Disclaimer: This article is reproduced from http://tech.soft6.com/665/16/78484.html
This article is mainly to teach you how to add OpenCV configuration to QT in the Linux environment, the author through the program code to explain to you, and attach screenshots to help you understand. I'm sure it will help you when you see it.
First has been successfully installed in the Linux environment Qt, my version of the UBUNTU10, and then I am talking about in this environment, if there are differences, please install according to the specific version.
First, open the Software Center for Ubuntu 10.10 as shown in the following illustration:
Click on the Ubuntu Software Center, the following window appears:
In the upper-right corner of the search box input OpenCV appear a lot of related installation software, except the first, for running the program has no effect.
After installation, enter the command at the command line:
sudo gedit/usr/share/qt4/mkspecs/default/qmake.conf
The following two sentences were added to the file:
Qmake_incdir =/usr/include/opencv Qmake_libs =-lcvaux-lcv-lcxcore-lhighgui-lml
Let's give an example to test the success or failure of the installation:
#include <cv.h> #include
First step: Qmake-project
Step Two: Qmake
The third step: Open the Xxx.pro file instruction is: VI Xxx.pro, add the following content
Includepath +/usr/include/opencvlibs + +/usr/lib/libcv.so \/usr/lib/libcvaux.so \/usr/lib/libcxcore.so \/usr/lib/ Libhighgui.so \/usr/lib/libml.so
Fourth step: Make
Step Fifth: Run the command:./xxx to see if the image I wanted was successfully exported.