Ask Your Question
0

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

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

what happen with cv2.xfeatures2d.SIFT_create() ?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
-2

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

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
importlib.reload(myModule)
edit flag offensive delete link more

Comments

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 -0600 )edit

Question Tools

1 follower

Stats

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

Seen: 2,639 times

Last updated: Sep 14 '20