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
Image Recognition Plugin
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
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?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.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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.
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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?