Building OpenCV from source

If you want support for depth cameras, you should also install OpenNI 2, which is available as a set of precompiled binaries with an installation wizard. Then, we must build OpenCV from source using CMake and Visual Studio.

To obtain OpenNI 2, go to https://structure.io/openni and download the latest ZIP for Windows and for your system's architecture (x64 or x86). Unzip it to get an installer file, such as OpenNI-Windows-x64-2.2.msi. Run the installer.

Now, let's set up Visual Studio. To build OpenCV 4, we need Visual Studio 2015 or a later version. If you do not already have a suitable version, go to https://visualstudio.microsoft.com/downloads/ and download and run one of the installers for one of the following: ...

Get Learning OpenCV 4 Computer Vision with Python 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.