伊谢尔伦2017-04-18 10:04:04
Do some basic image processing before recognition to improve the recognition rate:
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)
im = enhancer.enhance(20)
print pytesseract .image_to_string(im)