read(…)
read([, image]) -> retval, image
. @brief Grabs, decodes and returns the next video frame.
.
. @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty.
. @return false
if no frames has been grabbed
.
. The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the
. most convenient method for reading video files or capturing data from decode and returns the just
. grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more
. frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()).
.
. @note In @ref videoio_c “C API”, 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.
翻译:读取(…)
读取([,图像])->检索,图像
. @短暂的抓取,解码和返回下一个视频帧。
.
. @param[out]image返回视频帧。如果没有抓取帧,图像将为空。
. @如果没有抓取帧,则返回“false”
.
. 该方法/函数在一个调用中结合了VideoCapture::grab()和VideoCapture::retrieve()。这就是
. 读取视频文件或从解码中捕获数据的最方便方法
. 抓住镜框。如果没有抓取任何帧(相机已断开连接,或者没有更多帧)
. 方法返回false,函数返回空图像(使用%cv::Mat,使用Mat::empty()进行测试)。
.
. @注意在@ref videoio_c“c API”中,函数cvRetrieveFrame()和cv.RetrieveFrame()返回存储在视频中的图像
. 捕捉结构。不允许修改或发布图像!可以使用
. 复制克隆图像,然后对副本执行任何操作。
解释:cv2.VideoCapture.read函数返回两个值,一个是索引,一个是图像