Home  >  Q&A  >  body text

python - pillow pytesseract 数字图片识别问题?????

迷茫迷茫2763 days ago542

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦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)

    reply
    0
  • Cancelreply