有人知道如何使用图像创建cvCreateStructuringElementEx
吗?
我正在尝试使用opencv.cv.cvCreateStructuringElementEx()
,
我的结构是bmp 160x120,黑色,白色的椭圆形。
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 *'
最佳答案
这可能解决了您的问题:
int val[9]={0,1,0,1,1,1,0,1,0};
关于python - 来自Image的Python OpenCV cvCreateStructuringElementEx,形状为CV_SHAPE_CUSTOM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6990740/