The configuration of QT add OpenCV in Linux environment __linux

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.