Image Recognition Plugin

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Casweb
Newbie
Posts: 5
Joined: Thu Feb 16, 2006 9:40 am

Image Recognition Plugin

Post by Casweb » Thu Feb 16, 2006 9:51 am

Hi, I am using the Image Recognition Plugin to fill out flash forms.
My problem is the speed the script needs to make a screenshot, find and compare the images and then fill out the form.
Is it possible to use jpg images within the libary to compare?
Any other ideas to increase the speed?

Thanks

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 Feb 16, 2006 11:51 am

Instead of capturing the entire screen, capture only the window, or a portion of it. Making the haystack smaller will speed up the search. Just don't forget your mouse positions will need an offset - work out the window position as an offset from 0,0.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Casweb
Newbie
Posts: 5
Joined: Thu Feb 16, 2006 9:40 am

Post by Casweb » Fri Feb 17, 2006 12:57 pm

mtettmar wrote:Instead of capturing the entire screen, capture only the window, or a portion of it. Making the haystack smaller will speed up the search. Just don't forget your mouse positions will need an offset - work out the window position as an offset from 0,0.
Ok, thanks.. But how do I capture only the window? And what do you mean with "Making the haystack smaller"..? Sorry, but what is the haystack?

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

Post by Marcus Tettmar » Fri Feb 17, 2006 1:12 pm

When I say haystack I am speaking metaphorically. I am referring to the english phrase to find a needle in a haystack.

What I mean is if you make the thing you are searching within (in this case a screen image) smaller you will speed up the search.

You don't need to search the entire screen. You can at least narrow the searched area down to the area of the window. Take a look at the Google Button Example that comes with the image recognition library. You will notice that the script grabs only the part of the screen that holds the Internet Explorer window, rather than the entire screen:

//Get bounds of window
GetActiveWindow>title,X,Y,W,H
ScreenCapture>X,Y,W,H,d:\screen.bmp

So screen.bmp is just an image of the window - not the entire screen. This will speed up the search significantly as you are now searching a smaller area.

Just don't forget that the returned position is relative to the upper left of the image, so you will need to convert back to screen coordinates by adding the X and Y values returned by GetActiveWindow.

Take a look at the Google Button Example and you'll see what I mean.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

Casweb
Newbie
Posts: 5
Joined: Thu Feb 16, 2006 9:40 am

Post by Casweb » Fri Feb 17, 2006 2:28 pm

Ok, thank you! My english isn´t that good.. sorry.
But now the form entrys are very much faster.
Thanks a lot.

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