-1

我正在尝试通过这些说明在我的 Mac Air(使用 Lion)上安装 opencv2。

http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support

我已经成功地制作了opencv2

make 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、glut 和 OpenGL 的错误。感觉就像掉进了兔子洞。

有谁知道 Eigen 库中的错误来自哪里?

4

3 回答 3

2

看来您正在混合两种不同版本的 Eigen。此外,让我再次回忆一下,Eigen 不必编译。

于 2013-12-08T14:56:12.513 回答
2

我的实际解决方案是创建到 eigen3 的符号链接,例如:

$ ln -s /usr/local/include/eigen3/unsupported /usr/local/include/
于 2014-01-07T07:53:07.310 回答
2

这让我发疯......但最终它只是一个:

brew install eigen

并且正确构建了opencv!

于 2014-03-02T22:41:04.313 回答