为什么我不能安装python opencv2?

时间:2020-12-26 21:01:10

I am trying to install opencv2 on my Mac Air (with Lion) via these instructions.

我试图通过这些指令在我的Mac Air(和Lion)上安装opencv2。

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

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

I have successfully made opencv2 with

我已经成功地完成了opencv2。

make j8

However, running sudo make install produces an odd error noting how numextisn't defined.

然而,运行sudo使安装产生一个奇怪的错误,注意到numextisn没有定义。

[ 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) ...
                               ^

What does this error mean? I feel that it has to do with the Eigen library. I tried remaking the Eigen library. In turn, this produced another error involving glew, glut, and OpenGL. It feels like going down a rabbit hole.

这个错误是什么意思?我觉得这与本处图书馆有关。我试着重新设计了这个图书馆。反过来,这又产生了另一个涉及glew、过剩和OpenGL的错误。感觉就像掉进了一个兔子洞。

Does anyone know where the error in the Eigen library comes from?

有谁知道本图书馆的错误是从哪里来的?

3 个解决方案

#1


2  

It seems you are mixing two different versions of Eigen. Moreover, let me recall again that Eigen does not has to be compiled.

似乎你在混合两种不同的特征。此外,让我再次回顾一下,本征不需要编译。

#2


2  

My actual solution was to create symbolic links to eigen3, such as:

我的实际解决方案是创建特征3的符号链接,例如:

$ ln -s /usr/local/include/eigen3/unsupported /usr/local/include/

#3


2  

This was driving me crazy... but in the end it was just a:

这让我快要发疯了……但最后,它只是一个:

brew install eigen

And opencv built correctly!

和opencv建立正确!

#1


2  

It seems you are mixing two different versions of Eigen. Moreover, let me recall again that Eigen does not has to be compiled.

似乎你在混合两种不同的特征。此外,让我再次回顾一下,本征不需要编译。

#2


2  

My actual solution was to create symbolic links to eigen3, such as:

我的实际解决方案是创建特征3的符号链接,例如:

$ ln -s /usr/local/include/eigen3/unsupported /usr/local/include/

#3


2  

This was driving me crazy... but in the end it was just a:

这让我快要发疯了……但最后,它只是一个:

brew install eigen

And opencv built correctly!

和opencv建立正确!