SikuliX1 icon indicating copy to clipboard operation
SikuliX1 copied to clipboard

OCR problems: grayed out text, special characters, text with spaces

Open sridattasp opened this issue 4 years ago • 2 comments

I tried Sikuli 2.0.4 with ocr for few of my testcases but the results were inconsistent as we have seen from Bug #1852613

I tried tesseract.js with good ability to read most of the texts from images.

So, is there a way to use tesseract.js with sikuli?

sridattasp avatar Feb 01 '21 11:02 sridattasp

The mentioned bug is no longer relevant.

With 2.0.4: Did you already try the available options?

What system? What Java? I am generally interested in samples, where you think it is not optimal.

Integration of tesseract.js with SikuliX is not possible, since SikuliX is based on Java and tesseract.js works on node.js - different worlds. There might be bridges, but that is outside of my experiences.

RaiMan avatar Feb 01 '21 16:02 RaiMan

The mentioned bug is no longer relevant.

With 2.0.4: Did you already try the available options?

What system? What Java? I am generally interested in samples, where you think it is not optimal.

Integration of tesseract.js with SikuliX is not possible, since SikuliX is based on Java and tesseract.js works on node.js - different worlds. There might be bridges, but that is outside of my experiences.

Pre-reqs: Java version "1.8.0_281" windows 10 Enterprise/Sikuli 2.0.4 python/Chrome 88

Yes, I did try with Sikuli 2.0.4. Below is my sample code.

Settings.OcrTextRead = True
Settings.OcrTextSearch = True
#define region
r.highlight(2)
r.findText("Open").highlight(2) #fails
r.findText("Open").click() #fails

Result:

If text I want to click is like below, it fails to identify and click. We encounter same issue in few textfields which have help text before type-in as shown below.

Fail:

  1. Grayed out labels: image

  2. Input textfields: Like username/password etc., image

  3. Text with special characters image

  4. Labels with space image image

Pass: I see it working only for labels which are not grayed-out.

Whereas, tesseract.js is able to read text from all of the above samples (I tested), so I thought if there is a way to incorporate tesseract.js with SikuliX. But I also agree with your comment on different platforms.

Are above initializations ok to enable ocr in sikulix python?

sridattasp avatar Feb 02 '21 04:02 sridattasp