当前位置:网站首页>Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem

Identifier CV is not defined in opencv4_ CAP_ PROP_ FPS; CV_ CAP_ PROP_ FRAME_ COUNT; CV_ CAP_ PROP_ POS_ Frames problem

2022-04-23 20:37:00 Zhongai0049

opencv4 Identifier not defined in CV_CAP_PROP_FPS;CV_CAP_PROP_FRAME_COUNT;CV_CAP_PROP_POS_FRAMES problem

The problem this time is to read a video , But in the process of writing code, there is a problem of undefined representation , The error results are as follows :、

 Report errors
After many inquiries , The discovery is due to opencv Version update too fast ,opencv4 Many identifiers have changed in , Make the following changes to the following three identifiers :

CV_CAP_PROP_FPS   ->    CAP_PROP_FPS
CV_CAP_PROP_FRAME_COUNT ->  CAP_PROP_FRAME_COUNT
CV_CAP_PROP_POS_FRAMES ->  CAP_PROP_POS_FRAMES

And if there's no Definition cv The namespace of Words (using namespace cv;) It is necessary to use cv::CAP_PROP_FRAME_COUNT, In this way, you won't make a mistake .

Record all the problems encountered here , Prevent yourself from forgetting , I hope it will be helpful to you

版权声明
本文为[Zhongai0049]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210547163178.html