cv2.Videocapture.read函数的使用介绍

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函数返回两个值,一个是索引,一个是图像

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值