Using OPENCV libraries in Qt Creator

Source: Internet
Author: User

Use OpenCV library in Qt creator (successful compilation under Windows 7 system)

Compiling OpenCV2.0

1 Download tdm-mingw-1.908.0-4.4.1-2 and install, install complete add bin to system path.

2 Installing Opencv2.0 Windows version

3 Installation CMake

4 Open CMake, configure source and target path, select MinGW makefiles, and generate target makefile

5 go to set target path, make until all libraries are generated

Configuring QT Creator

QT developed programs generally need to use Qmake to generate makefile files. Because Qmake does not recognize spaces when parsing paths, you need to ensure that OPENCV's installation path cannot contain spaces (C:\Program FILES\OPENCV is not possible).

When creating the project file (assumed to be hello.pro and suffix Pro), add the following statement to the project:

INCLUDEPATH +=  D:\Qt\OpenCV-2.0.0\include\opencv
LIBS +=  D:\Qt\OpenCV-2.0.0\lib\libcv200.dll.a\
         D:\Qt\OpenCV-2.0.0\lib\libcxcore200.dll.a\
         D:\Qt\OpenCV-2.0.0\lib\libml200.dll.a\
         D:\Qt\OpenCV-2.0.0\lib\libcvaux200.dll.a\
         D:\Qt\OpenCV-2.0.0\lib\libhighgui200.dll.a 

In this way, OPENCV 2.0 can be used in QT.

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.