Image recognition and different desktop resolutions

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Scones
Junior Coder
Posts: 32
Joined: Fri Jul 05, 2019 11:21 am

Image recognition and different desktop resolutions

Post by Scones » Tue Feb 04, 2020 8:26 am

Hello.

Does anyone know if there could be a problem with capturing an image with the Image Recognition Wizard, and then running a compiled script searching for that image on another computer with a different desktop resolution, than the one it was captured with?

Thanks in advance!

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

Re: Image recognition and different desktop resolutions

Post by Dorian (MJT support) » Tue Feb 04, 2020 11:02 am

Yes, you usually have to resample the images when using Image Recognition on a different PC.
Yes, we have a Custom Scripting Service. Message me or go here

Scones
Junior Coder
Posts: 32
Joined: Fri Jul 05, 2019 11:21 am

Re: Image recognition and different desktop resolutions

Post by Scones » Tue Feb 04, 2020 1:17 pm

Oh well.. That might be a problem for me :lol:

I'm gonna have to be creative..

Thanks!

nodochau
Pro Scripter
Posts: 131
Joined: Wed Jan 16, 2019 12:59 pm

Re: Image recognition and different desktop resolutions

Post by nodochau » Tue Feb 04, 2020 8:29 pm

Is there any solution?
:)

lw.jordan
Newbie
Posts: 1
Joined: Fri Nov 13, 2020 5:19 am

Re: Image recognition and different desktop resolutions

Post by lw.jordan » Fri Nov 13, 2020 5:26 am

You could use pixel values instead of using the entire screen as the search area..
At the beginning of the script store the screen resolution into variables and set it to a ratio of the screen resolution the script was originally written for. Modify the needle image xy resolution values by this ratio.. might have to use COEFF and drop quality to make it work..

user5274
Junior Coder
Posts: 43
Joined: Tue Aug 04, 2020 9:35 am

Re: Image recognition and different desktop resolutions

Post by user5274 » Sun Nov 15, 2020 6:58 pm

All my compiled macros that are to be portable include code to "train" image on the target computer, meaning on first run the macro will record (screencapture) the needed needles. it is not much of a problem if the resolution is different but once the DPI changes as it does on laptops 110dpi to desktops 96dpi then thats when you have a problem, thats why i dont support laptop usage, 99% of desktops are 1920x? with a DPI of 96. If you have control of the target desktop you can set the color profile of that desktop to "none", then the colors and images will most likely be the same. keep in mind that my "training" code can be just as complex (1000s of lines of code) as the actual macro code because everything is unknown at the time. For example for one of my macros "training" takes 1-3 hours, but after this training it works just the same as it does on the development PC and worth it since the macros run 24/7. So if you have control of the target PC as in the case of a company, then first try to delete any monitor screen profiles first, in lieu of that youll need to write training code to make your code portable between unknown enviroments. just my input :)

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