opencv编译:opencv 3.4.1 编译 contrib模块,增加人脸识别

  1. start cmake-gui

  2. select the opencv source code folder and the folder where binaries will be built (the 2 upper forms of the interface)


  3. press the configure button. you will see all the opencv build parameters in the central interface

  4. browse the parameters and look for the form called OPENCV_EXTRA_MODULES_PATH (use the search form to focus rapidly on it)


  5. complete this OPENCV_EXTRA_MODULES_PATH by the proper pathname to the <opencv_contrib>/modules value using its browse button.

  6. press the configure button followed by the generate button (the first time, you will be asked which makefile style to use)

  7. build the opencv core with the method you chose (make and make install if you chose Unix makfile at step 6)



    Install to: C:/Users/dongufang/Downloads/opencv-3.4.1/build/install

    -----------------------------------------------------------------


    Configuring done

    Generating done

  8. to run, linker flags to contrib modules will need to be added to use them in your code/IDE. For example to use the aruco module, "-lopencv_aruco" flag will be added.

重新编译OpenCV工程


让我们怀着激动的心情打开OpenCV解决方案,哇,可以看到解决方案共包含了69个项目:




好啦 ,下面让我们马不停蹄的来编译解决方案吧,由于解决方案项目很多,需要静静等待几分钟后,,,,,


编译完成后,可以在工程目录的“./bin/Debug”文件夹里找到编译生成的链接库


最后插一句,生成的解决方案里的头文件和源代码都是OpenCV里sources里的文件,如进行修改,sources里的文件也将被修改。


原文地址:https://www.cnblogs.com/mrcharles/p/11879784.html