验证码识别 图像降噪 算法 Python (二)

处理器图像:

 

处理后图像:

 

代码:

from PIL import Image
image = Image.open('4.jpg')
image = image.convert('L')
image.show()

import numpy as np
image = np.asarray(image)
image = (image > 135) * 255
image = Image.fromarray(image).convert('RGB')
image.show()
image.save('4.png')

 

posted @ 2018-07-05 17:48  淋哥  阅读(2079)  评论(0编辑  收藏  举报