任何人都知道如何使用圖像創建cvCreateStructuringElementEx
? 我正在嘗試使用opencv.cv.cvCreateStructuringElementEx()
, 我的結構是一個bmp 160x120,黑色,半橢圓形,白色。從圖像Python OpenCV cvCreateStructuringElementEx,形狀= CV_SHAPE_CUSTOM
im = Image.open("struture.jpeg", "r")
im = im.convert("1")
val = numpy.uint(im.getdata())
gim = opencv.cv.cvCreateStructuringElementEx(im.size[0], im.size[1], im.size[0]/2, im.size[1]/2, opencv.cv.CV_SHAPE_CUSTOM, val)
所以返回錯誤:
TypeError: in method 'cvCreateStructuringElementEx', argument 6 of type 'int *'