Tessaract not able to output detected text

136 views
Skip to first unread message

payel roy

unread,
Apr 28, 2020, 2:26:15 PM4/28/20
to tesseract-ocr
Hi Team,

I am new to Tessaract. Following the code snippet. While running it, I can't get result back from Tesseract on the detect texts. Please help. 

#!/usr/bin/python

import cv2
import pytesseract
import sys
from PIL import Image

filename=sys.argv[1]

print(pytesseract.image_to_string(Image.open(filename)))


Both of the above images get detected by Amazon rekognition system with 80% confidence score. Would you please help how I can get this working on Tesseract? 

Thanks
output_2645.png
output_26.png

Zdenko Podobny

unread,
Apr 28, 2020, 2:27:39 PM4/28/20
to tesser...@googlegroups.com

ut 28. 4. 2020 o 20:26 payel roy <smith...@gmail.com> napísal(a):
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-oc...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/bc3386b8-0220-458b-bd5d-bef463747747%40googlegroups.com.

payel roy

unread,
Apr 28, 2020, 2:50:17 PM4/28/20
to tesser...@googlegroups.com
Hi  Zdenko

Thanks for your email. I already tried with multiple combination changing different parameters. However I am still not able to get text from the image. Attached my pre-processing code, which I am running before using tesseract. But however I am unable to get text still. Please help.

preprocess.py

Zdenko Podobny

unread,
Apr 29, 2020, 2:33:37 PM4/29/20
to tesser...@googlegroups.com
IMO you miss the point. Tesseract is OCR engine with very limited text detection capability (e.g. it works fine for book scans or simple documents with minimum graphics element.
Your pictures are very complex with a lot of graphics - so you need to remove them or first run text detection algorithm and pass only text area to tesseract.

Other option is to use complex solution like google vision[1] .



Zdenko


ut 28. 4. 2020 o 20:50 payel roy <smith...@gmail.com> napísal(a):
Reply all
Reply to author
Forward
0 new messages