代码如下:
if name == '__main__':
im = array(Image.open('G:/graduation project/picture/车牌.jpg'))
ret, binary = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
img = cv2Thin(im, 3)
im2, cdf = histeq(im)
cv2.imshow('细化图像', img)
plt.imshow(im2, cmap=cm.gray)
show() # 定义在pylab中
报错:
C:\Python27\python.exe "G:/graduation project/Python-opencv/imtools.py"
Traceback (most recent call last):
File "G:/graduation project/Python-opencv/imtools.py", line 387, in
ret, binary = cv2.threshold(im, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
TypeError: src data type = 17 is not supported