1

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

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

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

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

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

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

Steven Hsu
  • 183
  • 1
  • 3
  • 15

1 Answers1

1

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.

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

SeB
  • 1,159
  • 6
  • 17