Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
If you dont know yet, OpenCV is a free library for image processing and computer vision
applications. You can find more info from their web site.
So why QT ?
OpenCV can be used mainly in programs written in C and C++ (not only that, there are so many
wrappers which enables you to work with OpenCV in other languages too). So talking about C+
+ why not using Visual C++ ?? Of course you can easily design GUIs. But why QT ?
QT is an C++ IDE which can be used to create gui applications easily. Find more info here.
The main advantage in using QT is that we can easily integrate the GUIs of OpenCV inside the
GUIs created with QT.( Correct me if Im wrong) What it means is that, It is hard to insert a
video window inside a form created with C#. If you are using Visual Studio the window will
open seperately to display the video. Think you got the point. Do some research, youll find the
importance.
Step 1:
FIrst we need to download and install the complete QT SDK. Download it here and get it
installed. ( I have installed Qt SDK version 1.1.4 which includes the QT Creator IDE version
2.3 into the folder C:\QtSDK)
Step 2:
Step 3:
Step 4:
Now we need to comiple the OpenCV libraries. Run the CMake GUI.
CMake
Now give the source folder ( Mine is C:\OpenCV2.2) and create a folder for the binaries to be
build (my case it is C:\OpenCV2.2MinGw ) and give the path to the Where to build binaries
box.
Step 5:
Now press configure. Select the generator as MinGW Makefiles.
Step 6:
If you like you can check the box for BUILD_EXAMPLES, so you can play with the examples
Check WITH_QT.
Step 7:
Now youll see a similar window to the last one and it asks for the path of qmake.exe. You need
to puth the path to the qmake.exe here.
For me it is
1 C:\QtSDK\Desktop\Qt\4.7.4\mingw\bin\qmake.exe
Step 8:
Most probably youll get a message saying that missing libgmp-10.dll is missing. Solution is
simple just add the bin folder of MinGW to the System Path variable
( My Computer -> View System Information -> Advanced -> Environment Variables -> System
Variables -> Path -. Edit (or New) )
1 C:\QtSDK\mingw\bin
.Now you are ready to proceed. Press generate button of the CMake window again.
Step 9:
Now youll get the required files in the folder which you gave as build folder above. Now we
need to compile these files with MinGW.
Open Command Prompt and change your directory to the build folder
1 cd C:\OpenCV2.2MinGw
1 mingw32-make
Have a nap because it takes some time for this process to complete
Step 10:
1 mingw32-make install
Download this. Double Click and open the Sanj.pro file. It will be opened with QT Creator.
In the Sanj.pro file change the paths INCLUDEPATH and LIBS, if you used paths other than
the ones I used.