The OpenCV Tutorials, Release 2.3
While the later one may contain a couple of new and experimental algorithms, performance increases and interface
improvements, be aware, that it may also contain many-many bugs. Using the first one is recommended in most of the
cases. That is unless you are extending the OpenCV library itself or really need to most up to date version of it.
Building the OpenCV library from scratch requires a couple of tools installed beforehand:
• An Integrated Developer Enviroment (IDE) preferably, or just a CC++ compiler that will actually make the
binary files. Here I will use the Microsoft Visual Studio. Nevertheless, you can use any other IDE that has a
valid C\C++ compiler.
• Then CMake is a neat tool that will make the project files (for your choosen IDE) from the OpenCV source files.
It will also allow an easy configuration of the OpenCV build files, in order to make binary files that fits exactly
to your needs.
• A Subversion Control System (SVN) to acquire the OpenCV source files. A good tool for this is TortoiseSVN.
Alternatively, you can just download an archived version of the source files from the Sourceforge OpenCV page.
OpenCV may come in multiple flavors. There is a “core” section that will work on its own. Nevertheless, they are a
couple of tools, libraries made by other organizations (so called 3rd parties) that offer services of which the OpenCV
may take advantage. These will improve in many ways its capabilities. In order to use any of them, you need to
download and install them on your system.
• The Python libraries are required to build the Python interface of OpenCV. For now use the version 2.7.x. This
is also a must have if you want to build the OpenCV documentation.
• Numpy is a scientific computing package for Python. Required for the Python interface.
• Intel © Threading Building Blocks (TBB) is used inside OpenCV for parallel code snippets. Using this will
make sure that the OpenCV library will take advantage of all the cores you have in your systems CPU.
• Intel © Integrated Performance Primitives (IPP) may be used to improve the performance of color conversion,
Haar training and DFT functions of the OpenCV library. Watch out as this isn’t a free service.
• OpenCV offers a somewhat fancier and more useful graphical user interface, than the default one by using the
Qt framework. For a quick overview of what this has to offer look into the documentations highgui module,
under the Qt New Functions section. Version 4.6 or later of the framework is required.
• Eigen is a C++ template library for linear algebra.
• The latest CUDA Toolkit will allow you to use the power lying inside your GPU. This will drastically improve
performance for some of the algorithms, like the HOG descriptor. Getting to work more and more of our
algorithms on the GPUs is a constant effort of the OpenCV team.
• OpenEXR source files are required for the library to work with this high dynamic range (HDR) image file
format.
• The OpenNI Framework contains a set of open source APIs that provide support for natural interaction with
devices via methods such as voice command recognition, hand gestures and body motion tracking.
• Miktex is the best TEX implementation on the Windows OS. It is required to build the OpenCV documentation.
• Sphinx is a python documentation generator and is the tool that will actually create the OpenCV documentation.
This on its own requires a couple of tools installed, I will cover this in depth at the How to Install Sphinx section.
Now I will describe the steps to follow for a full build (using all the above frameworks, tools and libraries). If you do
not need the support for some of these you can just freely skip those parts.
Building the library
1. Make sure you have a working IDE with a valid compiler. In case of the Microsoft Visual Studio just install it
and make sure it starts up.
1.4. Installation in Windows 15