PyCharm: Installation of non-free OpenCV modules for operations like SIFT, SURF

后端 未结 2 678
眼角桃花
眼角桃花 2021-01-21 05:23

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.

I can open Pycharm, create a p

2条回答
  •  借酒劲吻你
    2021-01-21 06:12

    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.

    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.

    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.

提交回复
热议问题