Welcome to follow my public account [Jizhi Vision], reply 001 to get Google programming specification

O_o >_< O_o O_o ~_~ O_o

This tutorial details how to compile OpencV from source code on Windows.

Opencv for x86, AARCH64 and ARM32 environments For those who need to compile OpencV on Ubuntu x86, AARCH64, or ARM32 machines, please refer to the text and expand the source code for Compiling OpencV on Windows. In fact, OpencV official website provides a compiled library on Windows, so for users, directly use it, here we have to do something about it, I here is based on VS2017 using nmake to compile.

1. Download the source code package

Download opencV from opencv.org/releases/

Download the specified version of the source package source.

This section uses Opencv4.3.0 as an example.

2. Compile OpencV

Note use vs2017 terminal – X64 native tools for VS2017 command prompt.

#Enter the compile step
cd <opencv-source-dir>
mkdir build
cd build

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" amd64

cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=%cd%/install -DWITH_TBB=ON -DWITH_V4L=ON -DBUILD_TIFF=ON ..

nmake
nmake install
Copy the code

If the dynamic and static libraries are generated under /build/install/x64/vc15, the compilation is successful:

Opencv is a source code compiler for Windows. I hope it will help you a little.


Windows source code compiler OpencV