How to enable tessedit_write_images on pytesseract ?

17 views
Skip to first unread message

Mars

unread,
Feb 4, 2023, 3:55:55 AM2/4/23
to tesseract-ocr
Hello,

I am in the process of figuring out how to make Tesseract more accurate, because I have some issues. In League of Legends' in-game chat the position is fixed, the text color will always be the same, but the background changes a lot.

So I read how to improve quality of the output : https://tesseract-ocr.github.io/tessdoc/ImproveQuality.html#page-segmentation-method

It says to set tessedit_write_images to true so it will generate the image tesseract sees, so we can detect if it pre-processed it properly.

So I tried to enable it : text = pytesseract.image_to_string(image, config='--psm 6 tessedit_write_images=1 ')

But it doesn't do anything, I don't see the file being generated in my folder. I also tried :
text = pytesseract.image_to_string(image, config='--psm 6 tessedit_write_images=true ')

Still nothing, also tried :
text = pytesseract.image_to_string(image, config='--psm 6 --tessedit_write_images=1 ')

Here it outputs an error :  pytesseract.pytesseract.TesseractError: (1, "Error, unknown command line argument '--tessedit_write_images=1'")

I have no idea what I'm doing wrong, if someone can help me.
Thank you

Zdenko Podobny

unread,
Feb 4, 2023, 4:11:35 AM2/4/23
to tesser...@googlegroups.com
py-tesseract is wrapped of tesseract executable, so I suggest to use dirrecty tesseeract if something goes wrong...
"tesseract --help-extra" is your friend.
tessedit_write_images should be use this way: "-c tessedit_write_images=1"

Zdenko


so 4. 2. 2023 o 9:55 Mars <hdcre...@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/0f7ff681-f5c1-4b75-8ef3-f82f96466019n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages