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

前端 未结 10 1252
我寻月下人不归
我寻月下人不归 2020-12-01 15:39

This line:

sift = cv2.xfeatures2d.SIFT_create()

return error:

Traceback (most recent call last):
  File \"C:/Python27/openC         


        
10条回答
  •  Happy的楠姐
    2020-12-01 16:20

    I used to have similar problem as @srihegde said you can try to uninstall opencv-contrib-python package and reinstall again. You can also try to uninstall opencv-python package if you have one, since it might mess with the packages too.

    This helped for me.

    Uninstall:

    pip3 uninstall opencv-contrib-python
    pip3 uninstall opencv-python
    

    And then install:

    pip3 install opencv-contrib-python
    pip3 install opencv-python
    

提交回复
热议问题