PyCharm:为 SIFT、SURF 等操作安装非免费 OpenCV 模块 [英] PyCharm: Installation of non-free OpenCV modules for operations like SIFT, SURF

查看:64
本文介绍了PyCharm:为 SIFT、SURF 等操作安装非免费 OpenCV 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 SIFT、SURF 等功能.我在具有 OpenCV 3.4.1 并使用 PyCharm 作为 IDE 的虚拟机上使用 Ubuntu 16.04.

I want to use functions like SIFT, SURF,etc. I am using Ubuntu 16.04 on a virtual machine with OpenCV 3.4.1 and using PyCharm as the IDE.

我可以打开Pycharm,创建一个项目,进入文件-设置-项目解释器并下载我需要的模块.我已经下载了opencv-python和opencv-contrib-python.

I can open Pycharm, create a project, go to file - settings - Project interpreter and download the modules I need.I have downloaded opencv-python and opencv-contrib-python.

但我仍然无法使用上述功能.

But I still am not able to use the above mentioned fucntions.

请帮忙.谢谢.

推荐答案

使用 OpenCV 3,non-free 模块,即 SIFT 和 SURF他们各自的创建者已从默认的 OpenCV 安装中移出并进入 opencv_contrib 包.opencv_contrib 中的实现默认不安装,您需要在编译和安装 OpenCV 时显式启用它们才能访问它们.

With OpenCV 3, the non-free modules, namely SIFT and SURF, which are patented by their respective creators, were moved out of the default OpenCV install and into the opencv_contrib package. The implementations in opencv_contrib are not installed by default and you need to explicitly enable them when compiling and installing OpenCV to obtain access to them.

要访问 OpenCV 2.4.X 中的原始 SIFT 和 SURF 实现(默认安装这些实现的版本),您需要下拉 both opencvopencv_contrib 从 GitHub 存储库,然后从源代码编译和安装 OpenCV3.

To get access to the original SIFT and SURF implementations found in OpenCV 2.4.X (versions with these implementations installed by default), you will need to pull down both the opencv and the opencv_contrib repositories from GitHub and then compile and install OpenCV3 from source.

尽管我想为您提供执行此操作的步骤,但我想感谢在线提供的一个教程来代替执行此操作.因此,请遵循此 甜蜜教程 - 在 Ubuntu 上安装 OpenCV 3.0 和 Python 3.4+,您应该能够使用这些实现.此外,我建议查看 ORB 更快,SIFT 和 SURF 的免费替代品,但不确定它是否能达到您的目的.

As much as I would like to provide you with the steps to do this, I want to give credit to one tutorial available online to do this instead. So, follow this sweet tutorial - Install OpenCV 3.0 and Python 3.4+ on Ubuntu and you should be able to work with these implementations. Additionally, I would suggest looking at ORB which is a faster, free alternative to SIFT and SURF, but not sure if it will serve your purpose.

如果你实在不想用终端,打开一个新项目,转到->

If you really don't want to work with the terminal, open a new project, Go to ->

设置 -> 项目 -> 项目解释器 -> +

Settings -> Project -> Project Interpreter -> +

通过搜索添加您想要的模块,您应该能够使用它们.

Add the modules that you want by searching for them and you should be able to use them.

这篇关于PyCharm:为 SIFT、SURF 等操作安装非免费 OpenCV 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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