OpenCV development environment and environment Construction (WIN10+VS2015+OPENCV 3.0)

Source: Internet
Author: User

OpenCV 3.0 for Windows (: http://opencv.org/)

In this test, the OPENCV installation directory: D:\Program FILES\OPENCV

The steps are as follows:

1. First install the VS and Opencv,opencv installation is actually the official download EXE decompression of their own designated directory;

2. Configure OPENCV related environment variables, after installation, find "Path" in the system environment, edit and add your own OpenCV directory, such as: ";D: \program Files\opencv\opencv\build\x86\vc12\ Bin ";

3. Create a new C + + Win32 Console project;

4. Modify the relevant configuration of the project. Specifically: Project--Properties--Configuration properties

4.1 in the VC + + directory:

--include path (contains directory):

D:\Program Files\opencv\opencv\build\include;

D:\Program Files\opencv\opencv\build\include \opencv;

D:\Program Files\opencv\opencv\build\include\opencv2

--lib Path (library directory):

D:\Program Files\opencv\opencv\build\x86\vc12\lib;

D:\Program Files\opencv\opencv\build \x86\vc12\staticlib

4.2 In the linker--input--Additional dependencies:

Opencv_ts300.lib
Opencv_world300.lib

5. Complete the above steps, the environment is basically ready to use, then create a new CPP file to run our first demo. Because I am also a novice, so I find a project online:

1 //Displaying image files2#include <opencv2/opencv.hpp>3 using namespacestd; 4   5 #pragmaComment (linker, "/subsystem:\" windows\ "/entry:\" Maincrtstartup\ "")6   7 intMain ()8 {  9     Const Char*pstrimagename ="img_0897.jpg"; Ten     Const Char*pstrwindowstitle ="OpenCV First Program";  One    A     //reading an image from a file -Iplimage *pimage =cvloadimage (Pstrimagename, cv_load_image_unchanged);  -    the     //Create Window - Cvnamedwindow (Pstrwindowstitle, cv_window_autosize);  -    -     //display an image in the specified window + cvshowimage (Pstrwindowstitle, pimage);  -    +     //wait for key event A Cvwaitkey ();  at    - Cvdestroywindow (Pstrwindowstitle);  -Cvreleaseimage (&pimage);  -     return 0;  -}

OpenCV development environment and environment Construction (WIN10+VS2015+OPENCV 3.0)

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.