cannot convert 'cv::VideoCapture' to 'CvCapture*'

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sinat_33621733/article/details/78287022


参考博客http://blog.csdn.net/u011480040/article/details/17321583

http://www.cnblogs.com/annt/p/ant003.html


别人代码,实现进度条拖动相关。

private:

 CvCapture *capture;   

.cpp

int totalFrames =  (int)cvGetCaptureProperty(capture,CV_CAP_PROP_FRAME_COUNT);  

 cvSetCaptureProperty(capture,CV_CAP_PROP_POS_FRAMES,ui.slider->value ());  

但是最开始我用的代码播放视频的是

private:

 cv::VideoCapture capture;
 等直接用上边的代码完善播放功能的时候。会出现这样的错误cannot convert 'cv::VideoCapture' to 'CvCapture*',原因,'cv::VideoCapture' 和 'CvCapture*'功能类似。写法不一样, 
 

作如下更改:

.cpp

 int totalFrames = (int)capture.get(CV_CAP_PROP_FRAME_COUNT);

(int)capture.set(CV_CAP_PROP_POS_FRAMES, ui->slider->value());
其他函数类似。便可

猜你喜欢

转载自blog.csdn.net/sinat_33621733/article/details/78287022