Detailed process for configuring Opencv3.1.0 in vs2015 in win10, vs2015opencv3.1.0
It was found that Opencv3.1.0 has been released, and the computer just re-installs the system and configures it. It is easier to configure than Opencv2 and has been adapted to vs2015.
Download and install Opencv3.1.0
1. Download Opencv3.1.0 and go to the official website. Click opencv for windows to download it.
Click Run the downloaded file. In fact, the installation program of opencv is to decompress the file. Personally, because only drive C is available, a folder Opencv3.1.0 is directly created on drive C.
Select the path and click Extract.
OpenCV3.1.0 environment variable configuration
Right-click the computer, choose Properties> advanced system Settings> environment variables> system variables> Find Path> Add the corresponding Path to the variable value, my path is C: \ Opencv3.1.0 \ opencv \ build \ x64 \ vc14 \ bin. Note that the semicolon should be input using the English input method. This update finds that the existing x86 folder has been deleted, that is, it does not support x86 compilation in vs2015. This issue will be highlighted later. In addition, if you are using vs2013, select the vc12 folder. If you are using another older version of vs, we recommend that you use another version of opencv.
Create a Win32 console Project
1. First open VS2015
File-> New-> Project-> Visual C ++ create a Win32 console Project
2. Click Next, click Next, select an empty project, and click Finish.
VS2015 contains directory and library directory Configuration
1. Configure the directory now
Create a. cpp source file under the source file.
Name it main. cpp.
2. Click View, find other windows in the view, find the property manager in other windows, and click Open
3. then there will be a window for the property manager. Next, open the project file test, and there will be a Debug | x64 folder under it. Click it and the name is Microsoft. cpp. x64.user file, right-click Properties
4. Select the VC ++ directory under the common attributes.Include directoryAndLibrary directoryClick "include directory" and add the following three paths. In fact, these are the directories where the extracted files of OpenCV are located.
C: \ Opencv3.1.0 \ opencv \ build \ include
C: \ Opencv3.1.0 \ opencv \ build \ include \ opencv
C: \ Opencv3.1.0 \ opencv \ build \ include \ opencv2
These three paths must be modified based on the OpenCV3.1 path that you decompress.
5. Click the library directory to add the following path.
C: \ Opencv3.1.0 \ opencv \ build \ x64 \ vc14 \ lib
6. The property page
Click the linker and select input. An additional dependency item is displayed on the right side, and the following file is added.
Opencv_world310d.lib
Note: here we add the Debug mode in small series. We will see d at the end of the file. If you want to add the Release mode, remove d.
Opencv_world310.lib
Show Image
1. The configuration has ended in the above process. Let's display an image to verify whether the configuration is successful! Switch to Solution Explorer, click the source file main. cpp, and add the following code:
# Include <opencv2 \ opencv. hpp> using namespace cv; int main () {Mat picture = imread ("wallpaper.jpg"); // The image must be added to the project directory // and test. put the cpp file in a folder !!! Imshow ("test program", picture); waitKey (20150901 );}
Click the local Windows debugger, or press F5 to run the program-
An error is reported...
Select
In this way, the image is too large... Just cut a part.
Summary
The above completes the configuration of Opencv3.1.0 in vs2015 in win10, and finds that with the change of Opencv version, the configuration process becomes easier and easier. I hope to learn image-related knowledge with everyone in the future study, progress together. Next, I plan to take a look at the official Tutorials in combination with @ Mao yunxing's introduction to Opencv3 Programming
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.