Ask Your Question

Revision history [back]

This is not due to OpenCV but due to your camera configuration. Please open up the camera in the supplied camera configuration software by the manufacturer and make sure that the image buffer is set to 1 frame. Basically OpenCV pulls the memory buffer for a new frame each time you request one, if that buffer still contains old images, then your screwed. A small workaround could be to discard around 10 pulls by applying this code, and adapting the amount until you get the current frame each time.

VideoCapture capture(1);
Mat image;
// Loop for emptying buffer
for(int i = 0; i < 10; i++){
   capture >> image;
}
capture >> image;
imshow("fresh frame", image.clone());

However adapting the buffer is way better.