使用 contrib 模块安装 openCV [英] Installing openCV with contrib modules

查看:143
本文介绍了使用 contrib 模块安装 openCV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 opencv3.3.1 运行 python3.6(32 位).

I was running python3.6 (32 bit) with opencv3.3.1.

我看到了这个教程,所以我正在尝试与 SIFT 描述符进行蛮力匹配:http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_matcher/py_matcher.html

I saw this tutorial so I was trying out the brute force matching with SIFT descriptors: http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_matcher/py_matcher.html

我读到包括 SIFT 在内的一些模块不再包含在默认安装中,需要单独安装.我在 python 官方网站上找到了带有 contrib 模块的 opencv3 下载(我假设它包含 SIFT).具体来说,我从这里下载了 opencv_contrib_python-3.3.0.10-cp36-cp36m-win32.whl (md5):https://pypi.python.org/pypi/opencv-contrib-python#downloads

I read that some modules including SIFT were no longer included in the default installation and needed to be installed separately. I found on the official python website a download for opencv3 with the contrib modules (which I assumed contains SIFT). Specifically I downloaded opencv_contrib_python-3.3.0.10-cp36-cp36m-win32.whl (md5) from here: https://pypi.python.org/pypi/opencv-contrib-python#downloads

我已经卸载了我以前的 opencv 并安装并导入了这个新版本的 opencv 并验证我正在运行新版本.

I have uninstalled my previous opencv and installed and imported this new version of opencv and verified that I am running the new version.

然而,当我尝试使用 cv2.SIFT() 时,我仍然收到模块 cv2.cv2 没有属性SIFT"的错误.

However, still when I try to use cv2.SIFT() I am still getting the error that module cv2.cv2 has no attribute 'SIFT'.

我是否下载了正确的软件包?包括 SIFT 在内的所有 opencv 模块都应该包含在我安装的包中吗?

Did I download the correct package? Are all opencv modules including SIFT supposed to be included in the package I installed?

推荐答案

要启用 opencv-contrib 模块,您必须从源代码重建 opencv 库.在 CMake 配置中,您必须启用它,指定变量 OPENCV_EXTRA_MODULES_PATH 和 opencv_contrib 模块所在的路径,例如 ...wherever_you_downloaded_it/opencv_contrib/opencv_contrib-master/modules.

For enabling opencv-contrib modules, you have to rebuild your opencv lib from source. In CMake config, you have to enable it, specifying variable OPENCV_EXTRA_MODULES_PATH with path where you have opencv_contrib modules such as ...wherever_you_downloaded_it/opencv_contrib/opencv_contrib-master/modules.

然后,使用 make 构建 opencv 将构建模块,而 make install 将使用其他 opencv 库安装这些库.

Then, building opencv with make will build modules, and make install will install these libs with other opencv libs.

这篇关于使用 contrib 模块安装 openCV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆