opencv_tutorials_installation
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
opencv_tutorials_installation [2016/06/08 00:15] – joaomatos | opencv_tutorials_installation [2016/09/05 14:38] (current) – jadintredup | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Tutorial | + | ===== Installing OpenCV 3.1.0 with Visual Studio 2015 ===== |
- | **1) Necessary Software** | + | === Part 1: Download the necessary Files === |
- | 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 | + | * Visual Studio 2015 can be downloaded |
+ | * OpenCV 3.1.0 is the latest release of OpenCV and most currently supported for Visual Studio 2015. It can be cloned from its git repository at [[https:// | ||
+ | * Cmake is required to build the libraries from the source code provided by the git repository. Cmake can be downloaded from [[https:// | ||
- | [[http:// | ||
- | [[https:// | + | ---- |
- | [[https:// | + | ==== Part 2: Building |
- | [[https:// | + | - Open your OpenCV directory and create a new directory called " |
+ | - Start CMake and | ||
+ | 2.1) Install the OpenCV 2.4.13 that you downloaded into your PC. Choose an easy to find directory , like C:> | ||
+ | 2.2) Create a new folder called OpenCV-Build into an easy to find directory , like C: | ||
+ | 2.3) Open the CMAKE and on the box "Where the source code is " Select the folder OpenCV > Source (Generated by the OpenCV installation) . On the box "Where to build the binaries" | ||
- | ---- | + | 2.4) Click one time in Generate (it will ask for you to select your compiler , choose the Visual Studio version that you are using) , and after generating is complete click in Configure. You will get some errors but it is OK because we are only installing the OpenCV without any other 3rd party libraries. |
- | ===== Installation Instructions ===== | + | 2.5) Go to the OpenCV-Build folder and open the ALLBUILD visual studio solution. |
- | - Install the CMAKE into your computer using the default installe that you downloaded. | + | 2.6) On the top Taskbar |
- | - Install Visual Studio 2015 (try to create a new project , select C++ into the left , and select | + | |
- | - Execute the OpenCV 3.1 file and save in a directory that is easy to access ( Like C:/opencv ) | + | |
- | - Save the opencv_contrib directory in a place that you have easy access ( Like c:/ | + | |
- | - Open CMAKE , into the source directory choose c:/ | + | |
- | - click generate | + | |
- | - Look for OPENCV_EXTRA_MODULES_PATH into the list that will appear into the CMAKE | + | |
- | - click on the blank space and browse to the c:/ | + | |
- | - click generate again | + | |
- | - click configure | + | |
- | - Navigate into c:/ | + | |
- | - On the right side , click with the right button into the INSTALL under the CmakeTarget folder | + | |
- | - Close and open the Visual Studio again , click new project and under Visual C++ select Win32 COnsole application , save your project anywhere | + | |
- | - On the Right side , right click into the source folder > add > new item. | + | |
- | - Let the name as source and select C++ File.cpp as the type. | + | |
- | - on the upper task bar (right bellow the Debug|Team|Tools ) , select Debug and x64 (if you have windows 64 bits) | + | |
- | - Right click into the name of your project on the right side and click properties. | + | |
- | - Under C/C++ > GENERAL > Additional include directories add these two directories: | + | |
- | C: | + | |
- | - Under Linker > General > Additional | + | |
- | - Under Linker > INPUT> Additional Dependencies include the following libraries | + | |
- | < | + | 2.7) Repeat 2.7 using the Release instead of Debug. |
+ | |||
+ | 2.8) Close the visual studio and open again . Select new project > Visual | ||
+ | |||
+ | 2.9) Select Debug and x64(if you have windows 64 bits ) or x86 (if you have windows 32 bits). | ||
+ | |||
+ | 2.10) Right click on the source files folder on the solution explorer (right side of the window). Click in add > new item. Select Visual C++ in the left , click on c++ File (.cpp) and then OK. | ||
+ | |||
+ | 2.11) On the Solution explorer (right side ) , right click into your project name > properties. | ||
+ | |||
+ | 2.12) On the top , Configuration select Debug , and platform select all. | ||
+ | |||
+ | 2.13) On the left , select C/C++ > general. Into the additional include directory , add the directory : OpenCV-Build > install > include. | ||
+ | |||
+ | 2.14) On the left , select Linker> general. Into the additional library directory add the directory: OpenCV-Build > install > x64 (or x86 depending on your Windows bits) > vc14 > lib. | ||
+ | |||
+ | 2.15) On the left , select Linker > input. Into additional dependencies paste the following libraries: | ||
+ | <Code> | ||
opencv_calib3d310d.lib | opencv_calib3d310d.lib | ||
+ | opencv_flann310d.lib | ||
opencv_core310d.lib | opencv_core310d.lib | ||
opencv_features2d310d.lib | opencv_features2d310d.lib | ||
- | opencv_flann310d.lib | ||
opencv_highgui310d.lib | opencv_highgui310d.lib | ||
- | opencv_imgcodecs310d.lib | ||
- | opencv_imgproc310d.lib | ||
opencv_ml310d.lib | opencv_ml310d.lib | ||
opencv_objdetect310d.lib | opencv_objdetect310d.lib | ||
+ | opencv_imgproc310d.lib | ||
+ | opencv_video310d.lib | ||
+ | opencv_imgcodecs310d.lib | ||
opencv_photo310d.lib | opencv_photo310d.lib | ||
opencv_shape310d.lib | opencv_shape310d.lib | ||
- | opencv_stitching310d.lib | ||
opencv_superres310d.lib | opencv_superres310d.lib | ||
opencv_ts310d.lib | opencv_ts310d.lib | ||
- | opencv_video310d.lib | ||
opencv_videoio310d.lib | opencv_videoio310d.lib | ||
opencv_videostab310d.lib | opencv_videostab310d.lib | ||
- | opencv_xfeatures2d.lib | ||
</ | </ | ||
+ | 2.16) Repeat 2.12) 2.13) 2.14) using Release configuration. In the step 2.15) you must paste the libraries names without the " | ||
- | ---- | + | 2.17) Close the Visual Studio. |
- | + | ||
- | To test if you did everything right , on your source file try to type: | + | |
- | + | ||
- | <Code C++> | + | |
- | #include " | + | |
- | #include < | + | |
- | #include < | + | |
- | #include < | + | |
- | #include < | + | |
- | </ | + | |
- | + | ||
- | 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 | + | |
- | + | ||
- | + | ||
- | + | ||
- | ---- | + | |
- | If you want other sources for installations you can check the official instructions or just google for Installation Instructions OpenCV for your operational | + | 2.18) Go to your files explorer , right click into your PC icon > properties. Select advanced |
+ | 2.19) Restart your PC. | ||
- | [[http:// | + | 2.20) Open Visual Studio again , and open the project that you created following the previous steps. If you did everything OK you are good to go. |
+ | 2.21) Copy and paste any example on the Tutorials section and see if it is running OK. | ||
opencv_tutorials_installation.1465370135.txt.gz · Last modified: 2016/06/08 00:15 by joaomatos