Ask Your Question

Rocinante's profile - activity

2015-11-12 02:27:32 -0600 commented answer Image written to disk and retrieved are not the same

No, unfortunately. I ran your exact code again and this is the std output: Cleaned up camera. WARNING: Couldn't read movie file test_raw.avi Program ended with exit code: 0. The file "test_raw.avi" is 8kb large. Way too small. No other program can read this file. int codec=0; does not work on my machine. I have to change 2 things in your code to be able to write and read a movie: fourcc = "a code" and fps = 20;. cap.get(CV_CAP_PROP_FPS) returns 0. So I have no idea how to force the VideoWriter to write a uncompressed movie file. When I use fourcc = -1 It should give a popup menu. It does not! Should this work on a OSX? (A problem using the built in camera might be that on a MAC the build in camera the framerate is automatically control depending on the light situation.)

2015-11-11 07:31:38 -0600 commented answer Image written to disk and retrieved are not the same

Unfortunately fourcc=0 does not work, the movie generated is not readable (~440 kb). Apparently I do need a 4 char Fourcc code. I can not find a force code that is 100% uncompressed it seems. FPS? reading frames from a file, does not involve framerate right? The framerate is set by the movie read? You do not 'set' it in your code.

2015-11-10 08:02:56 -0600 commented answer Image written to disk and retrieved are not the same

Thanks for trying! I ran your code and the movie that is produced is 8kb small and can not be read by VLC eg. I had to set fps =1; and use fourcc notation: "raw ". then it works and this is the result: Different pixels count for frame 0: 917114 Different pixels count for frame 1: 918040 ... (almost all piles). What it wrong on my MAC OSX (xcode)?

2015-11-10 07:35:23 -0600 commented question Image written to disk and retrieved are not the same

I tried all available codecs on my MAC (~24). Including raw. the results differ e little bit, but none is perfect.

2015-11-10 03:30:28 -0600 asked a question Image written to disk and retrieved are not the same

When I write an image/frame to disk using write using cv::VideoWrite (creating a small movie) and read same image/frame from disk (cv::VideoRead) and compare them by subtraction: they are not exactly the same. It seems to happen in the 'red' channel with differences of around ~10-30 (split channels and subtract). Any Idea why this happens and what to do about it??

see for example testcode: link text