Compile OpenCV4.5.5 with Win10+CMake+VS2017

Step 1: Preparations

1 Download opencv4.5.5

Download OpenCV4.5.5 and unzip it to your new folder opencv.

2 Download opencv_contrib4.5.5

Download opencv_contrib4.5.5 , extract it to the opencv folder above, and create a build folder in the opencv folder to store the compiled VS project.

3 Download VS2017

4 Download CMake

This article uses CMake3.12.2

Step 2: CMake generates VS project

  1. Open CMake, configure the source code path of opencv and the path to generate the vs project, and click "Configure".

  1. Click "finish" to start the first configuration work.

  1. After the first configuration is complete, check BUILD_opencv_world.

  1. Add the modules module path in opencv_contrib in OPENCV_EXTRA_MODULES_PATH.

  1. Click Configure to start the second configuration.

  1. After the second configuration is complete, click Generate to start generating the project project.

Part 3: Regenerate Debug and Release Compilation Projects with VS

  1. Right-click ALL_BUILD and select Regenerate.

2. Continue to right-click INSTALL and select Regenerate.

Step 4: Call the compiled OpenCV library

  1. After the third step is compiled, there is an install folder in the build folder. When configuring the opencv environment of vs later, it is to call include in install and bin and lib in x64.

Guess you like

Origin blog.csdn.net/Kigha/article/details/128704863