AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' [Opencv 3.4.3]

后端 未结 3 1209
迷失自我
迷失自我 2020-12-19 13:32

I have opencv 3.4.3 installed (using pip3 install opencv-python and pip3 install opencv-python-contrib)

When I run a code containing this

3条回答
  •  旧时难觅i
    2020-12-19 14:23

    The error message you have is related to the fact that the module xfeatures2d does not exist. It is not directly related to SIFT algorithm nor any algorithm in xfeatures2d (all will send that error). I suggest you to either reinstall opencv-contrib-python(pip install opencv-contrib-python) or if you are using anaconda or equivalent to re-install the two opencv package from another source repository. A last option consist to compile the full OpenCV ("regular" + contrib) by yourself if you are comfortable with it.

    Hope it helps.

提交回复
热议问题