I just want to do the abs diff between two frames. Here is the code:
vidGrabber.grabFrame();
if (vidGrabber.isFrameNew()){
colorCurrentVideo.setFromPixels(vidGrabber.getPixels(), camWidth, camHeight);
greyCurrentVideo.setFromColorImage(colorCurrentVideo);
// update motion images
greyMotionVideo.absDiff(greyCurrentVideo, greyPreviousVideo);
greyMotionVideo.threshold(25);
// store previous frame
greyPreviousVideo = greyCurrentVideo;
}
However, the threshold (greyMotionVideo) is flickering between the image you should see at zero.
Its not just my code, when I run theos i get the same problem:
http://www.openframeworks.cc/files/moti-…-cb-win.zip
My feeling is that its looping quicker than the video can update, but isFramenew should solve this?
When I set the framerate of the app to 15 fps for example, it still flickers but at a much slower rate.
Any ideas? Thanks