我正在尝试通过这些说明在我的Mac Air(与Lion)上安装opencv2。
http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support
我已成功使用
制作opencv2make j8
但是,运行sudo make install
会产生一个奇怪的错误,指出未定义numext
的方式。
[ 63%] Building CXX object modules/contrib/CMakeFiles/opencv_contrib.dir/src/rgbdodometry.cpp.o
In file included from /Users/davidfaux/Downloads/opencv-2.4.7/modules/contrib/src/rgbdodometry.cpp:65:
In file included from /usr/local/include/unsupported/Eigen/MatrixFunctions:61:
/usr/local/include/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h:119:41: error:
use of undeclared identifier 'numext'
result(0,1) = A(0,1) * (Scalar(2) * numext::atanh2(y,x) + ...
^
In file included from /Users/davidfaux/Downloads/opencv-2.4.7/modules/contrib/src/rgbdodometry.cpp:65:
In file included from /usr/local/include/unsupported/Eigen/MatrixFunctions:62:
/usr/local/include/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h:242:36: error:
use of undeclared identifier 'numext'
int unwindingNumber = std::ceil((numext::imag(logCurr - logPrev) - M_PI) ...
^
这个错误是什么意思?我觉得它与Eigen库有关。我尝试重塑Eigen库。反过来,这产生了另一个涉及glew,过剩和OpenGL的错误。感觉就像走了一个兔子洞。
有谁知道Eigen库中的错误来自哪里?
答案 0 :(得分:2)
看来你正在混合两种不同版本的Eigen。此外,让我再次回忆一下,不必编译Eigen。
答案 1 :(得分:2)
我的实际解决方案是创建到eigen3的符号链接,例如:
$ ln -s /usr/local/include/eigen3/unsupported /usr/local/include/
答案 2 :(得分:2)
这让我发疯了......但最后它只是一个:
brew install eigen
opencv构建正确!