Build opencv4.0.1 & opencv_contrib on Windows

Nhan Cao
2 min readApr 5, 2019

— Download opencv source: https://github.com/opencv/opencv/releases

— Download opencv_contrib source: https://github.com/opencv/opencv_contrib/releases

  • Extract both to the same folder
  • Run Cmake-GUI
  • Click Configure
  • Click Finish
  • Update config as below and click “Configure” again
  • Uncheck BUILD_opencv_python2 and BUILD_opencv_python3
  • Add Entry OpenCV_RUNTIME — STRING = vc15
  • Click “Configure” and “Generate” and wait to get “Generating done” message
  • Build debug (cd to build folder)
cmake.exe --build . --config Debug --target INSTALL# Build Release mode (optional)cmake.exe --build . --config Release --target INSTALL
  • Remember set OpenCV bin to system PATH

DONE

Related post: https://medium.com/@nhancv/windows-10-set-up-environment-for-opencv4-0-1-c-development-78efaabb4141

--

--