OPENCV4.4.0和opencv_contrib-4.4.0的编译

OPENCV4.4.0和opencv_contrib-4.4.0的编译

最近两天进行了windows7系统下OPENCV4.4.0+opencv_contrib-4.4.0的编译+vs2017的编译。
编译过程中遇到了一系列问题,最终编译成功,此处记录一下,也为了给需要的同仁做个参考。
去年至今前前后后编译了几次---------,参考了诸多前辈的博客,在此表示感谢。
只要思想不滑坡,办法总比困难多。

一、编译的整个流程,大家可以参见
链接: [link].https://blog.csdn.net/gefeng3/article/details/101380001
二、注意事项:在设置opencv_contrib-4.4.0的module的目录路径的时候,还需要将opencv-enable-nonfree勾选(见上面链接中的提示)。
三、问题解决方案
缺少boostdesc_bgm.i文件的问题解决方案
https://blog.csdn.net/AlexWang30/article/details/99612188 提供了缺少文件百度云链接

https://blog.csdn.net/HanShu6/article/details/106269831/ 提供了缺少文件百度云链接同时提供了下述问题的解决方案
test_detectors_regression.impl.hpp无法打开文件或头文件错误
test_detectors_regression.impl.hpp 无法打开文件或头文件错误
解决方法:
将下述文件
test_descriptors_invariance.impl.hpp
test_descriptors_regression.impl.hpp
test_detectors_invariance.impl.hpp
test_detectors_regression.impl.hpp
test_invariance_utils.hpp
拷贝至opencv_contrib-4.4.0/modules/xfeatures2d/test/文件下
同时将下述头文件
#include “features2d/test/test_detectors_regression.impl.hpp”
#include “features2d/test/test_descriptors_regression.impl.hpp”
修改为
#include “test_detectors_regression.impl.hpp”
#include “test_descriptors_regression.impl.hpp”
#include “features2d/test/test_detectors_regression.impl.hpp” 文件头的修改方法
将下述头文件
#include “features2d/test/test_detectors_invariance.impl.hpp”
#include “features2d/test/test_descriptors_invariance.impl.hpp”
修改为
#include “test_detectors_invariance.impl.hpp”
#include “test_descriptors_invariance.impl.hpp”

对于无法打开python36-d.lib,请参考
https://blog.csdn.net/xihuaxi/article/details/62217011 进行修改

OPENCV4.4.0和opencv_contrib-4.4.0的编译_第1张图片
编译成功的截图如上
右键点击CMakeTargets下的INSTALL—>仅用于此项目—>仅生成INSTALL,最终在install目录下生成编译好的Debug库。
四、重新配置环境
步骤参见https://blog.csdn.net/liu798675179/article/details/51259505

建议生成一个总的*.lib,方便此处添加附加依赖项

五、程序运行验证
参照https://blog.csdn.net/gefeng3/article/details/101380001给出的代码进行验证

需要注意修改程序中图像的位置,与自己实际图片的位置一致即可。

你可能感兴趣的:(openc编译,opencv)