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')

猜你喜欢

转载自www.cnblogs.com/xuchunlin/p/9269693.html