Ask Your Question

Revision history [back]

You have two solutions in my opinion:

  1. Grab frame each time and retrieve only when its needed (see Grab and Retrieve functions on HighGui doc) with a timer, or a counter, etc.
  2. Use a double buffer, like in OpenGL: grab and retrieve an image in the back buffer, create an accessor to the front buffer with synchronization. Copy the back buffer to the front (if no one is accessing to the buffer) and swap pointers (see Multiple buffering on wikipedia here). In this case each image is retrieved, but you can compared it in a smart "way", eg. check if the image as changed since last retrieve, etc.