'module' 对象没有属性 'CreateStructuringElementEx'

'module' object has no attribute 'CreateStructuringElementEx'

es = cv.CreateStructuringElementEx(9,9, 4,4, cv.CV_SHAPE_ELLIPSE)

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

为什么?我在哪里可以看到版本之间的差异?

在 OpenCV 3 中你应该使用:

cv2.getStructuringElement(cv2.MORPH_ELLIPSE,(9,9))

看看OpenCV Python tutorials on morphological operations