Solution for addressing the issue of OpenCV reading cached images from previous operations

机器视觉 Jul 3, 2024

In Past of times, to Read the image from the ‘cap’ class and not real-time read will cause read the past image.

To solve this, all you need to do is change the size of imgae buffer.

  1. cap = cv2.VideoCapture(device)
  2. # set the size of buffer area
  3. cap.set(cv2.CAP_PROP_BUFFERSIZE,1)

Tags