Use opencv library in QT creator

Source: Internet
Author: User

Use the opencv library in QT creator (compiled successfully in Windows 7)

Compile opencv2.0

1. download and install the tdm-mingw-1.908.0-4.4.1-2. After installation, add the bin to the system path.

2. Install opencv2.0 for Windows

3. Install cmake

4. Open cmake, configure the source code and target path, and select mingw makefiles to generate the target makefile.

5. Go to the set target path and make until all libraries are generated.

Configure QT creator

Developed by QTProgramGenerally, you need to use qmake to generate the MAKEFILE file. Since qmake cannot identify spaces when parsing paths, it is necessary to ensure that the installation path of opencv cannot contain spaces (c: \ Program Files \ opencv is not acceptable ).

Add the following statement to the project when creating the project file (hello. Pro, Suffix: Pro:

Includepath + = D: \ QT \ OpenCV-2.0.0 \ include \ opencv

Libs + = D: \ QT \ OpenCV-2.0.0 \ Lib \ libcv200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libcxcore200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libml200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libcvaux200.dll. \
D: \ QT \ OpenCV-2.0.0 \ Lib \ libhighgui200.dll.

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.