OCRArea captures wrong text most of the time

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
uniadv
Junior Coder
Posts: 29
Joined: Tue Aug 04, 2020 2:16 am

OCRArea captures wrong text most of the time

Post by uniadv » Wed Aug 26, 2020 6:06 am

Hi,

I'm facing an issue since long time. Every time I run the script to get text from image, I usually get wrong text out of OCRArea function. I have checked the dimensions of the rectangle many times but it returns wrong text every time.

Any idea why this is happening?
Is this a bug of MS 15 which I'm unaware of?

Regards,
Ushahra

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: OCRArea captures wrong text most of the time

Post by Dorian (MJT support) » Wed Aug 26, 2020 12:33 pm

It's certainly not a bug we've had reported. I'm sure we'd have had a lot of reports if it was a bug.

Something somewhere must be changing. Does your monitor setup change at all?

Adding or removing a monitor will change screen coordinates.

For example if you add a 2nd screen as an extension above, it'll shift the coordinates of your original screen down - in my case, by 2160. Could this be it?

When you get the incorrect results, are the screen coordinates still matching the script coordinates? Are you hard coding the coordinates you use in OCRArea or are you getting them programatically somehow? If the latter, have you looked in the watch list to ensure they are as expected?
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts