Picture Recognition problem im coming across

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
nick
Newbie
Posts: 6
Joined: Sun Apr 05, 2009 9:06 pm

Picture Recognition problem im coming across

Post by nick » Sun Apr 05, 2009 9:22 pm

Hey people,

I recently just bought macro scheduler pro to put together some awesome macros using picture recognition and then to compile them to exe to then use on my other computer.

I have just recently come across a problem my macro wont work on my other comp because it has a different screen res (smaller screen) so the images are therefor smaller than the ones i took so it doesn't now locate them.

the script i have usedto locate the images is..

Code: Select all

FindImagePos>**path**\image.bmp,SCREEN,40,0,Xpos,ypos,img
So overall is there a way to make my macro work on other screen resolutions (different size screens) am i doing something wrong or is it not possible?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Image recognition on second machine.

Post by gdyvig » Sun Apr 05, 2009 10:59 pm

The most reliable way is to use the same display options on both machines. Make sure ALL of the display settings are the same. They all change the appearance of the screen one way or another.

Even so, the script should work with different screen sizes provided you account for the differences.

When you say the image gets smaller, do you mean the sizes of objects scale to fit the size of the screen, that is they are smaller in terms of number of pixels? If so you would need two sets of images for the scripts to run on either machine. Or lower the resolution of the display on your larger monitor.

Or do you mean the spacing of objects on the screen adjusts to the screen size, the pixel sizes of the objects remaining the same. In that case, just make sure your images are small and do not include 2 objects whose spacing may vary. If the background is a gradient, try not to include it in your image files, the background for the same object may be different on the 2 machines.

The other thing that changes is color depth, but yours is set to 40. That should account for differences between 16 and 24/32 bit color. Some programs dither objects using a 24bit palette when run on a machine with 16 bit color. If you see dithering, you will need 2 versions of images for those objects. Or simply run both machines at the lower 16bit color depth.

Have you checked out the blogs on this site dealing with image recognition mistakes?


Good luck with your project!

Gale

P.S.
Try doing a screencapture just before or after you do the FindImgPos to make sure the expected objects are displayed, there could be a timing difference.

I see the **path** will not work. If you put the images in the same directory as the script, you can replace that with %SCRIPT_DIR%.

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