伊谢尔伦2017-04-18 10:04:04
在識別之前做一些基本的圖片處理,可以提高識別率:
im = Image.open(img_name)
enhancer = ImageEnhance.Color(im)
enhancer = enhancer.enhance(0)
enhancer = ImageEnhance.Brightness( enhancer)
enhancer = enhancer.enhance(2)
enhancer = ImageEnhance.Contrast(enhancer)
enhancer = enhancer.enhance(8)
enhancer = ImageEnhance.Sharpness(enhancer). .image_to_string(im)