当前位置: 首页 > 工具软件 > VideoCapture > 使用案例 >

VideoCapture::retrieve

万俟玉书
2023-12-01

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*  cvRetrieveFrame (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.

 类似资料: