I. VS2015 installation
Refer to blog 73775519?locationnum=2&fps=1
Two. opencv3.3.0 version
http://opencv.org/, download it in SourceForge, or choose to download it in GitHub.
Unpack the installation package, install the path F:\OPENCV\OPENCV;
Three configuration environment variables
environment variable->path-> Editor, advanced system settings, System Properties, computer
Add the OpenCV bin file path in the back ( note that before you want to add a semicolon, be sure to match your own OPENCV installation path ),
Bo Master's path for F:\OPENCV\OPENCV\BUILD\X64\VC15; F:\OPENCV\OPENCV\BUILD\X86\VC15, then click OK.
Create a project in four vs2015 and configure
1. New project----->visual c++->win32 console application, Next, check Empty project, complete.
2. Add a C + + file, new item, add, source file
3. Change to 64-bit debugging
Four. Property configuration
Right-click the item that appears in the property column or Alt+enter enter the property
(1) Through the configuration Properties-"VC + + Directory-" General, select the Include directory to add the following path:
F:\opencv\opencv\build\include; F:\OPENCV\OPENCV\BUILD\INCLUDE\OPENCV; F:\opencv\opencv\build\include\opencv2;
That is, include the Include folder under the Build folder in the OpenCV folder, the include OpenCV, and the Opencv2.
(2). Select the Library directory to add the following path:
F:\opencv\opencv\build\x64\vc15\lib\opencv_world340.lib; F:\opencv\opencv\build\x64\vc15\lib\opencv_world340d.lib;
That is, the Poencv folder Build\x64\vc15\lib under the two. lib file; library directory;
Five. adding dependencies
SELECT linker-"Input-" Additional dependencies, click on Additional dependencies to add dependencies.
Opencv_world330.lib
Opencv_world330d.lib
Six. Test code
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace CV; int main () { //read in a picture (game original) Mat img = Imread ("pic.jpg"); //Create a window called "Game Namedwindow" ("original picture of the game"); //In the window to display the original picture of the game Imshow ("game original Painting", IMG); //Wait for 6000 MS after the window automatically closes Waitkey (6000);}
1#include <iostream>2#include <opencv2/core/core.hpp>3#include <opencv2/highgui/highgui.hpp>4 5 6 using namespaceCV;7 8 9 intMain ()Ten { One //read a picture (original picture of the game) AMat img = Imread ("pic.jpg"); - //Create a window named "Game Original picture" -Namedwindow ("Game original Painting"); the //display the game's original picture in the window -Imshow ("Game original Painting", IMG); - //wait for 6000 ms after the window automatically shuts down -Waitkey (6000); +}
(i) OpenCV3.3.0 installation configuration (vs2015+win7)