In OpenCV, I can capture frames using VideoCapture in C ++, however, when I try to get data from a frame and calculate the length, it just returns me 0.
The following is sample code:
VideoCapture cap(0);
for(;;) {
Mat frame;
cap >> frame;
int length = strlen((char*) frame.data);
}
As I mentioned above, if I save the frame in a PNG file, I can really see the image, so I can not understand why the data length goes out to zero.
Any clue?
source
share