【问题标题】:OpenCV Contrib Module Installation on MacMac 上的 OpenCV Contrib 模块安装
【发布时间】:2015-08-05 02:11:48
【问题描述】:

我在 StackOverflow 和其他网站上进行了搜索,以了解如何安装 OpenCV 3.0 的 Contrib 模块。我已经下载了额外的模块并将 zip 文件解压缩到 /opt/local/include/opencv2/opencv_contrib/ 文件夹。我已经导航到 /opt/local/include/opencv2 文件夹并在终端中键入以下命令:

cmake -DOPENCV_EXTRA_MODULES_PATH=/opt/local/include/opencv2/opencv_contrib/modules/ /opt/local/include/opencv2

我明白了:

-bash: $: command not found

如果我只输入 cmake -D,我会得到:

CMake Error: -D must be followed with VAR=VALUE.
CMake Error: Problem processing arguments. Aborting.

所以我知道它可以识别带有 -D 标签的 cmake 命令。

有什么想法吗?

【问题讨论】:

    标签: c++ macos opencv


    【解决方案1】:

    没有人说安装 OpenCV 及其模块很容易。

    和你一样,我已经安装并运行了 Opencv 3.0.0,想添加 contrib 模块。

    步骤:

    1st- 把OpenCV3.0.0文件夹删掉再下载一次(没必要,折腾一下,我更喜欢下载一个新的)下载openccv_contrib,放在同一个文件夹里。

    2nd- 转到 OpenCV3.0.0 并创建构建文件夹。

    3rd- 打开 Cmake gui 并按照https://github.com/itseez/opencv_contrib 的步骤操作。

    3.1- Fill “Where is the source code” with the rotute of where is openCV3.0.0. (my case /Users/Rafearl/Program/ComputerVision/opencv-3.0.0)
    3.2- Fill “Where to build binaries” with the build route(/Users/Rafearl/Program/ComputerVision/opencv-3.0.0/build)
    3.3- Press configure
    3.4- In the search bar search for “OPENCV_EXTRA_MODULES_PATH” and fill with the Opencv_contrib modules(/Users/Rafearl/Program/ComputerVision/opencv_contrib-master/modules)
    3.5- Click configure again and then click generate. By default current generator: Unix makefiles
    

    4th- 在终端中转到您的构建文件夹

    5th-make -j4(4是处理器的核心数)

    6th- sudo make install

    现在您可以在 build 文件夹中查看添加了 contrib 库的 lib 如果您不想再次下载 OpenCV3.0.0,只需按照相同的步骤操作,无需下载或删除任何内容。

    如果您已经在 Xcode 中安装了 Opencv,那么一切都应该可以正常工作,但只是作为一个建议;许多 OpenCV2.4 示例在 3.0 版本中不起作用。

    【讨论】:

    猜你喜欢
    • 2018-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-10
    相关资源
    最近更新 更多