AttributeError: module 'cv2.cv2' has no attribute 'ximgproc'

    今天用到了opencv的createSuperpixelSLIC接口,但是报以下错误:

AttributeError: module 'cv2.cv2' has no attribute 'ximgproc'

    尝试了升版本,降版本,都没有效果。

    最后想到该算法可能是有专利的,就像sift一样,需要第三方的支持。

    果断安装opencv-contrib

pip install opencv-contrib-python

    果然后面就不报错了

    注意,opencv-contrib-python需和opencv-python版本一致

你可能感兴趣的:(opencv,python)