![](/img/trans.png)
[英]OpenCV VideoCapture::get(CV_CAP_PROP_POS_MSEC) returns 0
[英]cv has no member CAP_PROP_POS_FRAMES
我正在嘗試運行一些代碼以將軌跡欄添加到一些視頻中,這是《 Learning OpenCV Second Edition》一書中的內容,但是我無法編譯我的代碼,並出現錯誤“命名空間cv沒有成員CAP_PROP_POS_FRAMES”
這是代碼的第一位
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <iostream>
#include <fstream>
using namespace std;
int g_slider_position = 0;
int g_run = 1, g_dontset = 0; //start out in a single step mode
cv::VideoCapture g_cap;
void onTrackbarSlide(int pos, void *) {
g_cap.set(cv::CAP_PROP_POS_FRAMES, pos);
if(!g_dontset)
g_run = 1;
g_dontset = 0;
}
它是CV_CAP_PROP_POS_FRAME S (請注意S),應該由highgui.hpp引入。 這是全局命名空間中的未命名枚舉。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.