我必须实现用于图像拼接的SURF算法。我在库中遇到了问题,如here
所列在尝试了我能找到的解决方案之后,我删除了opencv并开始从头开始构建。我试图在安装过程中包含'opencv_contrib'库,但它没有用。
所以我安装了opencv,然后尝试将软件包整合到软件包的github repository中。在期间 make -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
提前致谢
答案 0 :(得分:3)
/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
(特别是cv::_InputArray
)不同的界面,而不是您的库存提供的界面。
您的选择是:
opencv-contrib
cv
代码库版本
cv
对应的较新opencv-contrib