Check if new is new
I am using OpenCV C++ and grabbing a camera from USB port with cap.read(frame) in my for loop.
However i only want to get a new frame, when its a new frame from the camera. How can i check if the frame is new provided by the camera?
what exactly would count as a "new" frame ?
My Camera has 30 FPS. So it produces 30 frames per second. So in my for Loop cap.read(frame) often read the identical frame multiple times because the for loop executes much faster than 30 times pro second. I need to know if the frame from cap.read(frame) is newly produced by the camera or not
If there's no frame in the buffer,
cap.read
should be returning None, not the old frameplease be explicit about opencv version, os, video backend used, results WILL differ unfortunately.
(e.g. grab() will block until there is a new frame on win/DSHOW, but maybe not with what you use)