OPENCV configuration process (CMAKE,VS2013,QT 5.4)

Source: Internet
Author: User

Platform and Software:

Windows 7 X86

Visual Studio 2013

OpenCV3.0.0

Cmake3.3

1, download the installation files under Windows Opencv-3.0.0.exe, unzip, select the required installation directory. (This document is F:\OPENCV)

Note the corresponding directory cannot contain Chinese.

2. CMake Compilation

Execute CMake, which is used to generate the corresponding VS project for OPENCV source code.

1) Set the OPENCV installation file path (where is the source code) and the file path you want to generate (where to build the binaries)

The installation file path must include the Cmakelists file and any file path that you want to generate.

2) Click on the lower left configure, select Visual Studio (VS2013 available) in the popup window, other default

Note: You need to configure the environment variables before configure, add Qt D:\Qt\Qt5.4.1\5.4\msvc2013_opengl\bin, otherwise you will not cmake

Click Finish to start the configuration, configuration complete, the original settings do not move, and then select (tick) need to join the file with_qt and With_opengl, again configure

After the configuration is complete, the red disappears if no errors are made.

3) Press Generate. when the generate is complete, there will be a completion prompt.

3. VS Compiled version Library

After the above operation is completed, you can find the corresponding project file in the generated directory, open it, and do the following.

1) Under Debug, open the solution "OpenCV.sln" and rebuild the solution;

2) After the successful generation, select the Install Project, right-click to run the build;

3) in the release under the 1-2-step operation;

4) When the above operation is completed, the OpenCV library for the current system is generated.

4. Include directory

when compiling a OpenCV with Qt creator , after creating a new project, you will also need to add the following statements inside the project file. Pro file for the works:

Includepath+ = F:\OpenCV\install\include

F:\OpenCV\install\include\opencv

F:\OpenCV\install\include\opencv2

Add related libraries that you need to use

CONFIG (Debug, Debug|release):

{

LIBS +=f:\opencv\cmake\install\x86\vc12\lib\opencv_core300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_calib3d300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_highgui300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_imgproc300d.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_objdetect300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_photo300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_video300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_videoio300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_flann300d.dll \

F:\opencv\cmake\install\x86\vc12\lib\opencv_features2d300d.dll

}

CONFIG (Release, debug|release):

{

LIBS +=f:\opencv\cmake\install\x86\vc12\lib\opencv_core300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_calib3d300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_highgui300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_imgproc300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_objdetect300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_photo300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_video300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_videoio300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_flann300.dll\

F:\opencv\cmake\install\x86\vc12\lib\opencv_features2d300.dll

}

New OpenCV Configuration method

The new OPENCV integrates previous libraries into 2 library files F:\opencv\build\x86\vc12\lib\opencv_ts300.lib,F:\opencv\build\x86\vc12\lib\ In Opencv_ts300.lib , only the two library files are loaded into the QT. Pro file, and no more CMake compilation is generated Qt/vs the available libraries. Most of the library files used in the past can be found in F:\opencv\build\x86\vc12\staticlib, or the corresponding library files in this folder can be added to the. Pro file. With OpenCV's own library, the operation does not appear to be problematic.

Includepath + = F:/opencv/build/include\

F:/OPENCV/BUILD/INCLUDE/OPENCV \

F:/opencv/build/include/opencv2

CONFIG (Debug, Debug|release):

{

LIBS + = F:\opencv\build\x86\vc12\lib\opencv_ts300d.lib\

F:\opencv\build\x86\vc12\lib\opencv_world300d.lib

}

CONFIG (Release, debug|release):

{

LIBS +=f:\opencv\build\x86\vc12\lib\opencv_ts300.lib \

F:\opencv\build\x86\vc12\lib\opencv_world300.lib

}


Reference: http://blog.sina.com.cn/s/blog_8b6c17eb0101l7zd.html

Http://wenku.baidu.com/link?url=y28kjOhDWMYpj0aMW79hOkbGIXbiKOfUG68cAC-Ji4g-X-_NulMYMoUhly6kApcD_ 0kwhlgisj0uhi5khje575uir6ay7fw36svmiewkmgm

OPENCV configuration process (CMAKE,VS2013,QT 5.4)

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.