Python bindings for OpenCV with AttributeError: 'module' object has no attribute 'FeatureDetector_create'

11,349

It seemed that I need opencv-devel and opencv-debuginfo (rpm/deb) packages as well for the 2.4.X version.

Regarding the 3.1 version, these functions have been removed in favor of functions like

detector = cv2.TYPE_create()

where TYPE can be ORB or other detector of your choosing but not SURF and SIFT which have been moved to a nonfree package. For more info check this source.

Share:
11,349
pevogam
Author by

pevogam

Updated on June 04, 2022

Comments

  • pevogam
    pevogam almost 2 years

    I am using the python bindings for OpenCV 2.4.X and OpenCV 3.1 but with the following simple two-liner

    import cv2
    detector = cv2.FeatureDetector_create("SURF")
    

    I get the following output:

    Traceback (most recent call last):
       File "version_test.py", line 3, in <module>
        detector = cv2.FeatureDetector_create("SURF")
    AttributeError: 'module' object has no attribute 'FeatureDetector_create'
    

    What are the reasons for this error in each version?