close

[Solved] AttributeError: ‘module’ object has no attribute ‘xfeatures2d’ [Python/OpenCV 2.4]

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error AttributeError: ‘module’ object has no attribute ‘xfeatures2d’ [Python/OpenCV 2.4] in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How AttributeError: ‘module’ object has no attribute ‘xfeatures2d’ [Python/OpenCV 2.4] Error Occurs?

Today I get the following error AttributeError: ‘module’ object has no attribute ‘xfeatures2d’ [Python/OpenCV 2.4] in python.

How To Solve AttributeError: ‘module’ object has no attribute ‘xfeatures2d’ [Python/OpenCV 2.4] Error ?

  1. How To Solve AttributeError: 'module' object has no attribute 'xfeatures2d' [Python/OpenCV 2.4] Error ?

    To Solve AttributeError: 'module' object has no attribute 'xfeatures2d' [Python/OpenCV 2.4] Error I think you should install opencv-contrib-python instead. The module you're using is not support in opencv-python.

  2. AttributeError: 'module' object has no attribute 'xfeatures2d' [Python/OpenCV 2.4]

    To Solve AttributeError: 'module' object has no attribute 'xfeatures2d' [Python/OpenCV 2.4] Error I think you should install opencv-contrib-python instead. The module you're using is not support in opencv-python.

Solution 1

I think you should install opencv-contrib-python instead. The module you’re using is not support in opencv-python.

To install:

pip install opencv-contrib-python

Solution 2

SIFT is a patented algorithm, hence not available in each open-cv version. What you can do is install opencv and its contrib part simultaneously, i.e,

pip install opencv-python==3.3.0.10 opencv-contrib-python==3.3.0.10

SIFT worked fine for me on above versions of opencv.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read