OpenCV Installation Guide


About OpenCV

OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. Being a BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code.

Libraries Installation

You can simply start OpenCV programming once you have the following set up:

1. Download

Download OpenCV from their webpage http://opencv.org/.
Download CMake from the webpage http://www.cmake.org/cmake/resources/software.html.

2. Compile

Open CMake.

(1) Set the path of “Where is the source code” to the source folder in opencv

(2) Set the path of “Where to build the binaries” to the build folder in opencv.

Press “Configure”, choose the version of the visual studio on your computer, then “Finish”.
Press "Generate".
Open the “ALL_BUILD.vcxproj” ("ALL_BUILD.vcproj" if you're using VS2008) in the "opencv/build” folder, compile the project in both Debug and Release version.

Writing OpenCV Programs

1. Create an empty new project with the type of Win32 Console Application.

2. Project -> Properties -> Configuration Properties -> C/C++ -> General:

In the Additional Include Directories, set the path to the corresponding include folder. Those include folders are “modules\xxx\include” in opencv.

3. Project -> Properties -> Configuration Properties -> Linker -> General:

In the Additional Library Directories, set the path to the lib folder. The lib folders are in “build\lib” in opencv.

4. Project -> Properties -> Configuration Properties -> Linker -> Input:

In the Additional Dependencies: Add the corresponding lib file you need, for example, opencv_core248.lib

5. Copy the corresponding dll file in “build\bin” in OpenCV into the folder where the executable file of your program is. For example: if you add “opencv_core248.lib” then in step 3 then you need to copy “opencv_core248.dll” into that folder

5. Compile, Build, and Execute.


Some Useful Links:

Official OpenCV website
GLUI OpenCV Tutorials
OpenGL Basic Tutorial for OpenCV