Sikulixlibrary Click Text not working

Windows based app with a numpad (numbers 0 to 9), I have a screen shot of 8 button on the numpad and Sikulixlibrary always find and clicks it, but when I try to us “SikuliLibrary.Click Text 8” it never finds the 8 button on the numpad.

What am I doing wrong?

I have also tried setting a region of interest wit this code

${appcoords}=    SikuliLibrary.Get Image Coordinates    ${IMAGE_DIR}app-image.png
SikuliLibrary.Set Roi    ${appcoords}    5
SikuliLibrary.Select region    ${appcoords}
SikuliLibrary.Click Text    8

I have also tried replacing Click Text with Region Click Text but still results in the 8 button not being found.

This a known problem in SikuliLibrary and I don’t know if works OK in the original Java Sikuli.

But did you called Set Ocr Text Read before trying to click on text?
Maybe you need this.

Hi James,

When I investigated this I found that in order to use OCR you need tessercat installed which is not installed by default when you install the library.

Even with that installed I still never got it working for what I needed.

Hope this helps,

Dave.

1 Like

I’ve done very small stuff with tesseract in the past and main obstacle i had was that it didn’t recognize all of the fonts used in the toy stuff i was working on. Maybe in this case, it needs to be trained with the fonts in the images OCR is trying to read into actual text ? Eg, stuff like this: Tesseract training 101: How to prepare the data - Pretius

PS. that linked article might be a bit outdated as tesseract now ships with tools to do the process. Google is friend in this - as said, ive only dealt with toy stuff with tesseract many years ago..

2 Likes

I added “Set Ocr Text Read true” to the test but it didn’t fix the issue.
Prior to opening this question I tired it in the original Java Sikuli app and it does work.

I’m using OCRLibrary for OCR so needed to install Tessercat and add it to the path

I’ll look into training of Tessercat and see if that fixes my issue, thanks for the sugestion