7

我正在尝试在 2013 年末的 Macbook Pro 上安装 opencv 和小牛。我没有找到任何二进制文件,所以我正在尝试构建它。
我试过http://www.guidefreitas.com/installing-opencv-2-4-2-on-mac-osx-mountain-lion-with-python-support
http://forums.udacity.com/questions/ 100021223/installing-opencv-on-os-x-mountain-lion
调用 make 时产生错误 2
(cuda_compile_generated_matrix_operations.cu.o.cmake:208 处的 CMake 错误)

在这个网站上搜索时,我发现opencv for python on mavericks(我也试过自制软件,它也产生了错误 2,但没有任何进一步的信息)

我用谷歌搜索了很多,但没有一个找到的解决方案对我有用。有谁知道在 Mavericks 上安装 opencv 吗?

谢谢

使用 brew 给出以下输出:

    brew install homebrew/science/opencv
    Warning: It appears you have MacPorts or Fink installed.
    Software installed with other package managers causes known problems for
    Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.
    ==> Downloading http://downloads.sourceforge.net/project/opencvlibrary/opencv-un
    Already downloaded: /Library/Caches/Homebrew/opencv-2.4.6.1.tar.gz
    ==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.6.1 -DCMAKE_BUILD_
    ==> make
    cd /tmp/opencv-QBoi/opencv-2.4.6.1/macbuild/modules/stitching && /usr/local/Cellar/cmake/2.8.12/bin/cmake -E cmake_symlink_library ../../lib/libopencv_stitching.2.4.6.dylib ../../lib/libopencv_stitching.2.4.dylib ../../lib/libopencv_stitching.dylib
    /usr/local/Cellar/cmake/2.8.12/bin/cmake -E cmake_progress_report /tmp/opencv-QBoi/opencv-2.4.6.1/macbuild/CMakeFiles  90 91
    [100%] Built target opencv_stitching
    make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
    make: *** [all] Error 2

    READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
    If reporting this please do so at the homebrew/science tap (not mxcl/homebrew).

我使用对学生免费的Canopy ( https://www.enthought.com/products/canopy/ )为我解决了这个问题

4

2 回答 2

5

您可以正常使用 brew 安装它。

brew install homebrew/science/opencv

或者

brew tap homebrew/science
brew install opencv

这就是我在我的小牛上安装它的方式,它运行良好。

于 2013-11-10T16:14:48.717 回答
1
$ brew search opencv
        homebrew/science/opencv
$ brew install homebrew/science/opencv

安装后,有注意事项:

==> 注意事项 如果您需要 Python 来查找已安装的站点包:

mkdir -p ~/Library/Python/2.7/lib/python/site-packages

echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth

所以,就做

  mkdir -p ~/Library/Python/2.7/lib/python/site-packages
  echo '/usr/local/lib/python2.7/site-packages' > ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
于 2014-07-29T17:49:27.757 回答