gpt4 book ai didi

c++ - cv 没有成员 CAP_PROP_POS_FRAMES

转载 作者:搜寻专家 更新时间:2023-10-31 01:42:30 27 4
gpt4 key购买 nike

我正在尝试运行一些代码以在某些视频上添加轨迹栏,它来自 Learning OpenCV Second Edition 一书,但我无法编译我的代码并给出错误“namespace cv has no member 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_FRAMES(注意S)应该是highgui.hpp带进来的。它是全局命名空间中的未命名枚举。

关于c++ - cv 没有成员 CAP_PROP_POS_FRAMES,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26744549/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com