简体   繁体   中英

cv has no member CAP_PROP_POS_FRAMES

I'm trying to run a bit of code to add trackbars onto some video, it's from the Learning OpenCV Second Edition book, but I can't compile my code and gives the error "namespace cv has no member CAP_PROP_POS_FRAMES"

Here's the first bit of the code

#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;
}

It's CV_CAP_PROP_POS_FRAME (note the S) and it should be brought in by highgui.hpp. (请注意S),应该由highgui.hpp引入。 It's an unnamed enum in the global namespace.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM