Added a file parameter to read data from file instead of a camera