How to disable Buffer in OpenCV Camera?

前端 未结 3 1387
情话喂你
情话喂你 2021-01-04 19:07

I have this situation where I use OpenCV to detect faces in front of the camera and do some ML on those faces. The issue that I have is that once I do all the processing, an

3条回答
  •  北海茫月
    2021-01-04 19:34

    I have the same problem but in C++. I didn't find proper solution in OpenCV but I found a workaround. This buffer accumulates a constant number of images, say n frames. So You can read n frames without analysis and read frame once more. That last frame will be live image from camera. Something like:

    buffer_size = n;
    
    for n+1
    {
      // read frames to mat variable
    }
    // Do something on Mat with live image
    

提交回复
热议问题