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)