Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCR(region.text()) is detecting wrong text, when text is underlined #606

Open
avishekhece opened this issue Nov 2, 2023 · 7 comments
Open
Assignees
Labels
aText/OCR problems with text/ocr feature

Comments

@avishekhece
Copy link

Hi @RaiMan ,

I tried to get the region of a certain text on the screen using
Screen screen = new Screen();
ScreenImage image = screen.capture();
region = image.getRegion();
LoggerUtil.debug("Searching for text on screen. ");

    LoggerUtil.debug("region.text() = " + region.text());
    region=region.findText(strText);

In this case, findText getting failed & I debug the issue and realise that "relocate(wait("\t" + text + "\t", timeout))" the wait method is getting failed, even I tried with image, like Find the text on that image & return the region of the text but still did not worked & on console it is printing empty page !!

Also want to inform you that wherever we use "wait("\t" + text + "\t", timeout)" this, it fails.
Please look into this issue.
If you have any workaround then please inform me

Please find the image below
image

I have been getting stuck into this issue over 1month & due to this tool is almost stop.

@RaiMan
Copy link
Owner

RaiMan commented Nov 2, 2023

What SX version, what system, what Java?

@avishekhece
Copy link
Author

Hi @RaiMan ,

SX version : 'com.sikulix', name: 'sikulixapi', version: '2.0.5'
system : Windows 10, 64-bit operating system , I5 processo , 16gb RAM.
JAVA : jdk1.8.0_251

Can you please provide me a workaround?

@RaiMan
Copy link
Owner

RaiMan commented Nov 3, 2023

Tried this:

Screen screen = new Screen();
Match match = screen.findText("Product");
match.highlight(2);

while the text Product was visible in the upper left of the screen and it correctly highlighted the text.

@avishekhece
Copy link
Author

Hi @RaiMan ,

This does not work properly, as the string gets by region.text() is completely different than the existing text in UI.
What do I need to do as region.text() is not working properly ???

@thinhnguyenhcm
Copy link

Hi @avishekhece, I think it very hard to find completely when the text has underscore . You can use VietOCR to find text first and apply config to sikuli
image

@RaiMan
Copy link
Owner

RaiMan commented Jan 14, 2024

Apparently there are problems with underscored text in Tesseract, which is used in SikuliX under the hood.

Solutions mentioned in the net are too complex, to be used with SikuliX IDE.

So sorry - no easy solution currently.

@RaiMan RaiMan self-assigned this Jan 14, 2024
@RaiMan RaiMan added the aText/OCR problems with text/ocr feature label Jan 14, 2024
@RaiMan RaiMan changed the title The wait method in Region class did not worked in some cases & also OCR(region.text()) is detecting wrong text OCR(region.text()) is detecting wrong text, when text is underlined Jan 14, 2024
@avishekhece
Copy link
Author

avishekhece commented Jun 10, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aText/OCR problems with text/ocr feature
Projects
None yet
Development

No branches or pull requests

3 participants