Ask Your Question

AttributeError: 'module' object has no attribute 'xfeatures2d'

asked 2015-06-06 19:48:09 -0500

what happen with cv2.xfeatures2d.SIFT_create() ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2020-09-14 01:16:33 -0500

This error happens because there is no attribute with the name you called, for that Object. This means that you got the error when the "module" does not contain the method you are calling. But it is evident that the method is there, which leads to believe that may be the method was added by you in the python source code after you had already imported the file (module). Or, some times packages get deprecated and they rename some functions. If that is true, then you may want to exit and reimport the module once again to be able to access the new method. You can do it in another way to reimport the module with changes without having to exit the interpreter is to do the following:

import importlib
edit flag offensive delete link more


please do not answer such outdated questions.

and the usual problem here is, that ppl do not have the code from opencv_contrib installed (e.g. pip opencv_contrib_python), so your answer is not really helpful, it would not mend anything.

berak gravatar imageberak ( 2020-09-14 01:46:19 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-06-06 19:48:09 -0500

Seen: 2,213 times

Last updated: Sep 14