This is an old revision of the document!
Tutorial Installing OpenCV 3.1 in Visual Studio 2015
1) Necessary Software
For the following tutorials was used OpenCV 3.1 in Visual Studio 2015. You will need to download the main OpenCV directory , and the opencv_contrib directory (it contains some advanced features that can be useful for us ). The Visual Studio 2015 and the CMAKE.
Download the OpenCV main file here (Select version 3.1.0 for your OS)
Download all the opencv_contrib directory here
Download the Visual Studio 2015 here(Visual Studio Community)
Download the CMAKE for your OS here.
Installation Instructions
- Install the CMAKE into your computer using the default installe that you downloaded.
C:\opencv\build\install\include
- Under Linker > General > Additional libraries directory add these two directories: C:\opencv\build\x64\vc14\lib (if you have windows 64 bits and are using Visual Studio 2015) and C:\opencv\build\install\include\opencv2
- Under Linker > INPUT> Additional Dependencies include the following libraries
<Code C++> opencv_calib3d310d.lib opencv_core310d.lib opencv_features2d310d.lib opencv_flann310d.lib opencv_highgui310d.lib opencv_imgcodecs310d.lib opencv_imgproc310d.lib opencv_ml310d.lib opencv_objdetect310d.lib opencv_photo310d.lib opencv_shape310d.lib opencv_stitching310d.lib opencv_superres310d.lib opencv_ts310d.lib opencv_video310d.lib opencv_videoio310d.lib opencv_videostab310d.lib opencv_xfeatures2d.lib </Code>
To test if you did everything right , on your source file try to type:
<Code C++> #include “opencv2/xfeatures2d/nonfree.hpp” #include <opencv/highgui.h> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> </Code>
If the Visual Studio does not underline this lines it is because you did everything right and the libraries are successfully linked to your Visual Studio and you are ready to go.
If you want other sources for installations you can check the official instructions or just google for Installation Instructions OpenCV for your operational system.