摘要
记录OpenCV踩过的坑
记录
OpenCV-3.3.0 cmake时勾选BUILD_opencv_cvv会出错:提示error C2079: 'cvv::view::DualFilterView::rawImages_' uses undefined class 'std::array<cv::Mat,2>',该错误在3.4.1版本中解决。参考:https://github.com/Microsoft/vcpkg/issues/3024OpenCV3默认不包含sift、surf等特征提取器。解决办法:下载载对应的OpenCV_contrib,在cmake时勾选OPENCV_ENABLE_NONFREE并且在OPENCV_EXTRA_MODULES_PATH填入OpenCV_contrib中modules的路径。具体操作参考:https://blog.csdn.net/a435262767/article/details/83989399OpenCV默认不包含viz(vtk),需要额外编译好vtk,在cmake时勾选WITH_VTK并填写正确的VTK_DIR。具体操作参考:https://blog.csdn.net/a435262767/article/details/83989399OpenCV+QT编译时会出错,提示:error C2001: 常量中有换行符,解决办法时修改错误文件的编码,改为"Uncode (UTF-8 带签名) - 代码页65001",再重新编译。具体操作参考:https://blog.csdn.net/a435262767/article/details/90443309cmake时勾选WITH_CUDA后,编译会非常久,可以在CUDA_ARCH_BIN去掉一些不需要的GPU架构减少编译时间。OpenCV-4.1.0编译opencv_test_tracking.vcxproj会出错,解决办法:在ALL_BUILD->引用中去掉opencv_test_tracking.vcxproj的勾选
备忘
OpenCV parallel_for_ 的使用,opencv的 parallel_for_ 可以采用多种框架实现。 详情见这里
相关/参考链接