VideoCapture::retrieve

Decodes and returns the grabbed video frame.

C++:  bool  VideoCapture:: retrieve (Mat&  image, int  channel=0 ) ¶
Python:   cv2.VideoCapture. retrieve ( [image [, channel ] ] ) → retval, image
C:  IplImage*  cv RetrieveFrame (CvCapture*  capture, int  streamIdx=0  )
Python:   cv. RetrieveFrame (capture ) → image

The methods/functions decode and return the just grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more frames in video file), the methods return false and the functions return NULL pointer.

Note

 

OpenCV 1.x functions cvRetrieveFrame and cv.RetrieveFrame return image stored inside the video capturing structure. It is not allowed to modify or release the image! You can copy the frame using cvCloneImage() and then do whatever you want with the copy.

你可能感兴趣的:(VideoCapture::retrieve)