【发布时间】:2011-08-09 02:17:05
【问题描述】:
有人知道如何使用图片创建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 *'
【问题讨论】: