sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #29473
Re: [Question #258394]: Preprocess Image before applying OCR .text() fn
Question #258394 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/258394
Status: Open => Answered
RaiMan proposed the following answer:
in version 1.1.0 you can try the following:
imgWithText = Image.create(capture(someRegionWithText)) # creates in memory image of the given region
imgWithText.resize(scaleFactor) # resizes the image with the given factor as decimal number
text = imgWithText.text()
In prior versions up to 1.0.1 you have to implement your own solution
for this.
According to the Tesseract docs, you get best results with grayscale images (already done internally) having 300 dpi.
This resizing seems not to be done currently internally.
A suitable resize factor would be 300/screenresolution in dpi
so for a 72dpi monitor this is about 4, for a 96dpi monitor it is about 3, ....
If you try it, I would appreciate to get some feedback.
A complete revision of the text feature is planned for version 1.2 based
on Tess4J
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.