Ask Your Question

Revision history [back]

After many hours of research now I think it is a OpenCV bug. The behaviour happens with OpenCV 2.4.6.1 and OpenCV 2.4.8 usando MinGW32. In order to compile OpenCV 2.4.8 with MinGW is necessary to patch the source code as is described here:

http://stackoverflow.com/questions/21103042/error-while-building-opencv-monitorfromrect-was-not-declared-in-this-scope

After that, if you want to obtain the behaviour, the only thing to do is to create a Qt project and in the main class add the following rows:

include "mainwindow.h"

include "ui_mainwindow.h"

include "opencv2/objdetect/objdetect.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); CascadeClassifier face_cascade; }

MainWindow::~MainWindow() { delete ui; }

Now which is the fastest way to obtain a good OpenCV release for MinGW?