Anyone know how to create a cvCreateStructuringElementEx using a image?
I’m trying use opencv.cv.cvCreateStructuringElementEx(),
my struture is a bmp 160×120, black, with a half ellipse in white.
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)
So return the error:
TypeError: in method 'cvCreateStructuringElementEx', argument 6 of type 'int *'
This might solved your problems: