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