I am capturing the onPreviewFrame in a byte[] and then saving this to compare with the next captured frame. Although the camera is pointed to an area with no change happening and I can see on the display that there is no change succesive frames element by elemnet are different. Any suggestion why this should be so? Also I only want the grayscale and I understand that the first height * width bytes are grayscale data, is this correct>
Asked
Active
Viewed 913 times
1 Answers
0
Statistically, there cannot be an exact match. Check out Image comparison - fast algorithm for a way of comparing images.
-
Rajath thanks. I have written code in Delphi (Object Pascal) which reads frames from my webcam stream and compares them pixel by pixel and unless there is movement the comparison is the same. Before getting into more complex code I tried to compare the grayscale info at the start of each frame and even though there was no movement there was a 90% failure. Does this mean the stream from the Android camera is very different to the stream from my webcam? – ron Apr 13 '11 at 07:32
-
It's possible that for a low-resolution camera (which is what I'm guessing a webcam would be compared to an Android camera), there is more likelihood that successive frames are similar. But this kind of data should still be used to compare statistical deviations. That's just my opinion though. – Rajath Apr 13 '11 at 07:39