1

My error is:

error: C2228: left of '.open' must have class/struct/union and i dont know to fix that.

#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);
}
İsmet Alkan
  • 5,361
  • 3
  • 41
  • 64

1 Answers1

1

There should be an instance of cv::VideoCapture capture;. You can check whether it is open with capture.isOpened(). It returns true if the file was open successfully or if the camera has been initialized successfully.

Eric
  • 2,301
  • 3
  • 23
  • 30