Qt Creator 2.4.1 (Qt SDK 1.2) and OpenCV 2.3.1 on Windows with VS 2010

Today, I install Qt SDK 1.2 (Qt Creator 2.4.1 is included) to program with OpenCV 2.3.1 on my laptop, which runs VS 2010 Sp1. And I have some notes to share:
1) You do not need the whole SDK (about 1.2 Gb), so uncheck all the options related to Symbian, that save about 750 Mbs for your hard disk. My QtSDK directory is about 480 Mbs after installing Qt SDK.
2) Qt Creator 2.4.1 is included in Qt SDK, so you do not need to install.
3) You do not need CMake to build a progam created by Qt Creator
4) You do not need to rebuild OpenCV, using the libraries and dlls file in build folder of OpenCV package is OK.
5) There are three notes in order to build a OpenCV (C++) program with Qt Creator:
+ add your OpenCV’s dlls directory to your system’s PATH environment variable.
+ add include folder of OpenCV in your Qt Creator’s project file.
+ add libs file of OpenCV in your Qt Creator’s project file
Like this:
INCLUDEPATH += D:\opencv\build\include \
CONFIG(release,debug|release)
{
LIBS += D:\opencv\build\x86\vc10\lib\opencv_calib3d231.lib \
D:\opencv\build\x86\vc10\lib\opencv_contrib231.lib \
D:\opencv\build\x86\vc10\lib\opencv_core231.lib \
D:\opencv\build\x86\vc10\lib\opencv_features2d231.lib \
D:\opencv\build\x86\vc10\lib\opencv_flann231.lib \
D:\opencv\build\x86\vc10\lib\opencv_gpu231.lib \
D:\opencv\build\x86\vc10\lib\opencv_haartraining_engine.lib \
D:\opencv\build\x86\vc10\lib\opencv_highgui231.lib \
D:\opencv\build\x86\vc10\lib\opencv_imgproc231.lib \
D:\opencv\build\x86\vc10\lib\opencv_legacy231.lib \
D:\opencv\build\x86\vc10\lib\opencv_ml231.lib \
D:\opencv\build\x86\vc10\lib\opencv_objdetect231.lib \
D:\opencv\build\x86\vc10\lib\opencv_ts231.lib \
D:\opencv\build\x86\vc10\lib\opencv_video231.lib
}

CONFIG(debug,debug|release)
{
LIBS += D:\opencv\build\x86\vc10\lib\opencv_calib3d231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_contrib231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_core231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_features2d231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_flann231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_gpu231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_haartraining_engined.lib \
D:\opencv\build\x86\vc10\lib\opencv_highgui231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_imgproc231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_legacy231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_ml231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_objdetect231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_ts231d.lib \
D:\opencv\build\x86\vc10\lib\opencv_video231d.lib
}
6) OpenCV 2 Computer Vision Application Programming Cookbook is a good book for OpenCV and Qt programming and you can see some examples from the book at The author’s website.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: