gpt4 book ai didi

c++ - opencv_contrib 编译错误 : class has no member

转载 作者:太空狗 更新时间:2023-10-29 21:17:08 25 4
gpt4 key购买 nike

我必须实现用于图像拼接的 SURF 算法。我在使用库时遇到了问题,如所列 here

在尝试了我能找到的解决方案后,我删除了 opencv 并开始从头开始构建。我试图在安装过程中包含“opencv_contrib”库,但没有成功。

所以我安装了opencv,然后按照int he github repository的指示尝试集成包包的。在
制作-j2行,我不断收到以下错误。

[ 77%] Building CXX object modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/src/sparse_match_interpolators.cpp.o
In file included from /home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core.hpp:54:0,
from /home/akshat/OpenCV/opencv-3.0.0/build/modules/ximgproc/precomp.hpp:40:
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp: In member function ‘virtual void cv::ximgproc::EdgeAwareInterpolatorImpl::interpolate(cv::InputArray, cv::InputArray, cv::InputArray, cv::InputArray, cv::OutputArray)’:
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:171:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’
CV_Assert( !from_points.empty() && from_points.isVector() &&
^
/home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core/base.hpp:389:33: note: in definition of macro ‘CV_Assert’
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
^
/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:172:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’
!to_points .empty() && to_points .isVector() &&
^
/home/akshat/OpenCV/opencv-3.0.0/modules/core/include/opencv2/core/base.hpp:389:33: note: in definition of macro ‘CV_Assert’
#define CV_Assert( expr ) if(!!(expr)) ; else cv::error( cv::Error::StsAssert, #expr, CV_Func, __FILE__, __LINE__ )
^
make[2]: *** [modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/src/sparse_match_interpolators.cpp.o] Error 1
make[1]: *** [modules/ximgproc/CMakeFiles/opencv_ximgproc.dir/all] Error 2
make: *** [all] Error 2

提前致谢

最佳答案

/home/akshat/opencv_contrib/modules/ximgproc/src/sparse_match_interpolators.cpp:171:52: error: ‘const class cv::_InputArray’ has no member named ‘isVector’

证明这是版本不兼容。 ximgproc 中的代码需要来自 cv 的接口(interface)(特别是 cv::_InputArray),而不是您的现有接口(interface)提供的接口(interface)。

您的选择是:

  • 尝试与您安装的 cv 版本相对应的 opencv-contrib 代码库版本
  • 再次尝试构建与您当前的 opencv-contrib 相对应的更新的 cv

关于c++ - opencv_contrib 编译错误 : class has no member,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33602898/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com