关键词不能为空

当前您在: 主页 > 英语 >

VideoCapture类

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-03-02 19:48
tags:

-

2021年3月2日发(作者:subbranch)


我的


OpenCV


学习笔记(

< br>12


):


VideoCapture



分类:



opencv


2012-05-03 09:51 23139


人阅读



评论


(27)


收藏



举报



delayfilterfloat


网络


c



这次通过一个读取视频的综合例子来介绍


VideoCapture


类的一些基本操作:



[cpp]



view plaincopy



1.



#include




2.



#include




3.



#include




4.



#include




5.





6.



using



namespace


std;



7.



using



namespace


cv;



8.





9.



int


main()



10.



{



11.



//


打开视频文件:其实就是建立一个


VideoCapt ure


结构




12.



VideoCapture capture(



);



13.




//


检测是否正常打开


:


成功打开时,


isOpened


返回


ture




14.




if


(!ed())



15.



cout<<



<



16.




//


获取整个帧数




17.




long


totalFrameNumber = (CV_CAP_PROP_FRAME_COUNT);



18.



cout<<



整个视频共



<





<



19.





20.





21.



//


设置开始帧


()




22.




long


frameToStart = 300;



23.



( CV_CAP_PROP_POS_FRAMES,frameToStart);



24.



cout<<



从第


<



帧开始读



<



25.





26.





27.




//


设置结束帧




28.




int


frameToStop = 400;



29.





30.




if


(frameToStop < frameToStart)



31.



{



32.



cout<<



结束帧小于开始帧,程序错误,即将退出!



<



33.




return


-1;


-


-


-


-


-


-


-


-



本文更新与2021-03-02 19:48,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/692466.html

VideoCapture类的相关文章