1

Due to some reasons I need to access directly to image buffer from a camera through OpenCV's VideoCapture but I cannot find a way. To make it more clear, I want to access to the data from cv::VideoCapture::grab() before retrieving it to a cv::Mat.

I check the OpenCV source code here and it seems OpenCV decodes it automatically before outputing the frame. Intuitionally I am thinking about "encoding" the frame to obtain the original data, however, cv::imencode requires a specific file extension.

Is there a way to access the camera buffer data without tweaking the source code?

Best,

Eric

Eric W
  • 11
  • 2
  • Have you seen [this answer from 2011](https://stackoverflow.com/a/8165836/4669135) that seems to say you cannot, and [this answer from 2015](https://stackoverflow.com/a/27914179/4669135) that seems related ? – Gabriel Devillers Aug 10 '17 at 08:33
  • Hi, thanks for replying. I already saw the answer from 2011 but I don't know if it's still not possible right now. I've tried the "VideoCapture.set()" method and it did not work for me. I am developing in Windows and V4L2 should be designed for Linux. The image data from the camera I use is actually a combination data of two cameras in YUY2. If I can access to the image buffer, it would be easy to seperate them. – Eric W Aug 10 '17 at 08:58

0 Answers0