Reputation: 244
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;
}
Upvotes: 2
Views: 3113
Reputation: 30579
It's CV_CAP_PROP_POS_FRAMES (note the S) and it should be brought in by highgui.hpp. It's an unnamed enum in the global namespace.
Upvotes: 3