Image Recognition not always finding a match

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
JRSowards
Newbie
Posts: 2
Joined: Wed May 07, 2008 6:42 pm

Image Recognition not always finding a match

Post by JRSowards » Wed May 07, 2008 7:28 pm

I have a script that tries to find results in a grid using image recognition. It seems to work very well, except for the fact that it will suddenly not be able to find a match. It won't find a match again unless I take another screen capture to search for. Then it will work fine again for some time. The script code hasn't changed at all either, the only difference seems to be that I need a new screen capture every so often.

I've compared the bitmap that wasn't found to the bitmap that was found, and they seem to be exactly the same, down to the last pixel. I've tried setting the tolerance as high as 100. I've tried comparing to a full screen capture and also just using the SCREEN variable. The bitmap i'm searching for is very small and specific. It may be just the word "DAILY" for instance. Black font, white background.

Does anyone have a suggestion?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu May 08, 2008 7:36 am

Possible reasons:

- You're not using the latest version. You omit to tell us which version of Macro Scheduler you are running and whether you've installed the latest update.

- The image actually does NOT match. I've seen bitmaps that people swear blind are the same but when inspected closely really aren't.

- You're trying to find the image too soon, or too late. It isn't there when you look for it. Try doing a ScreenCapture instead of SCREEN and running FindImagePos against the bitmap returned by ScreenCapture. The benefit of this is you can keep a copy of the screen image created by ScreenCapture and analyse it later.

- Are you sure it is finding ZERO matches? It could be finding LOTS of potential matches, but the first one isn't the one you want - Override the FIP_SCANPIXELS variable to make it scan more pixels to increase the accuracy.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

JRSowards
Newbie
Posts: 2
Joined: Wed May 07, 2008 6:42 pm

Post by JRSowards » Thu May 08, 2008 1:40 pm

- True, I am not using the latest version. I'm running 9.2.01.

- The images match perfectly. I zoomed them both in paintbrush. I thought perhaps that maybe because I am searching for a written font rather than a picture, the font may change slightly sometimes. However, that doesn't seem to be the case.

- The image is definitely there. I can see it. And I even wait an extra few seconds just in case.

- It's finding zero matches. I test it by having the mouse move to each match. I'll try adjusting the FIP_SCANPIXELS variable though.

It just seems odd to me that it will work one time, and not work the next, even though nothing has changed. Then if I capture a new bitmap to use to find on the screen, it will work again. For a while.

Thanks for the help though, I'll keep plugging away once I get the latest version!

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