1

我的错误是:

错误:C2228:'.open' 左侧必须有类/结构/联合,我不知道如何解决。

#include "dialog.h"
#include "ui_dialog.h"
#include <QTimer>
#include <stdio.h>
#include <iostream>
#include <opencv2\video\video.hpp>
#include <opencv2\opencv.hpp>
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/flann/miniflann.hpp"

using namespace cv; <i> all the new API is put into "cv" namespace. Export its content</i>
using namespace std;

Dialog::Dialog(QWidget *parent) : QDialog(parent),ui(new Ui::Dialog){
    ui->setupUi(this);
    capture.open("E:\\Six Degree of Separation.avi");
    tmrTimer = new QTimer(this);
    connect(tmrTimer,SIGNAL(timeout()),this,SLOT(ProcessFrameAndUpdateGUI()));
    tmrTimer ->start(20);
}
4

1 回答 1

1

应该有一个实例cv::VideoCapture capture;。你可以检查它是否打开capture.isOpened()。如果文件已成功打开或相机已成功初始化,则返回 true。

于 2013-04-26T11:44:47.390 回答