Image Recognition help please

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
bob9021
Newbie
Posts: 2
Joined: Sun Jul 29, 2007 5:46 pm

Image Recognition help please

Post by bob9021 » Wed Aug 01, 2007 6:56 am

Hi, I am using the Image Recognition Plug in and
Macro Scheduler
Version 9.1 - With Macro Script
for this project and after looking at this demo http://www.mjtnet.com/demos/irdemo.html
i can see that this is just what i need for what i want to do but dose not cover all i need
to know for my project .iv look at some other post here and they came close but did not give
enough details so as i could do this on my own .

OK so what i need to know is this ill have a folder with 12 imgs 6 and 6 in it

img.1 img.2 img.3 etc... and img.a img.b img.c etc...

the thing is any 1 of images 1 2 or 3 can appear at first so the script will need to look for all 6
based on that lets say that img .2 was the first' it will then wate to see witch 1 of imgs
a b or c comes and then trigger an action mouse click , checked box Wave sound etc..

i know i can do this i just need someone to help me find the right path
the 1 thing I'm most confused about is how 2 get the script 2 look for all 6 imgs not just 1 img



bob


my system info;
win home
667 mhz
128 ram
1024 by 728 high (24 pix)
also I'm using for image edit; IrfanView 3.75 http://www.irfanview.com/

User avatar
xurf4xs
Newbie
Posts: 19
Joined: Wed Jul 04, 2007 9:03 pm
Location: The Netherlands
Contact:

Post by xurf4xs » Sun Aug 05, 2007 1:10 pm

Maybe you can use the command 'WaitScreenImage'. This command will compare your image to your screen.

If this is not the solution you need, you can use 'GetScreenCapture' in combination with the 'FindImagePos'. You will make a loop function, where only one 'GetScreenCapture' is done, and 6 'FindImagePos' are done. If there is any result, you can do your thing.

I think it schould be like this:

...
...
GetScreenRes>x,y
Repeat>ImageFound
Wait>1
ScreenCapture>0,0,x,y,c:\myscreencapture.bmp
FindImagePos>c:\img1.bmp,c:\myscreencapture.bmp,0,0,ximg1,yimg1,count1
FindImagePos>c:\img2.bmp,c:\myscreencapture.bmp,0,0,ximg2,yimg2,count2
FindImagePos>c:\img3.bmp,c:\myscreencapture.bmp,0,0,ximg3,yimg3,count3
FindImagePos>c:\img4.bmp,c:\myscreencapture.bmp,0,0,ximg4,yimg4,count4
FindImagePos>c:\img5.bmp,c:\myscreencapture.bmp,0,0,ximg5,yimg5,count5
FindImagePos>c:\img6.bmp,c:\myscreencapture.bmp,0,0,ximg6,yimg6,count6
ImageFound=count1+count2+count3+count4+count5+count6
Until>ImageFound>0
...
...

If this script comes out the loop, one of the images is recognized. With the variables countn you can proof which image is recognized and add your script for it.

I did not proof this script, but I hope I helped you with your script.

bob9021
Newbie
Posts: 2
Joined: Sun Jul 29, 2007 5:46 pm

thank you

Post by bob9021 » Sun Aug 05, 2007 5:43 pm

im thinking this will work will test soon
thank you for taking the time to help me

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