Picture recognition
Moderators: Dorian (MJT support), JRL
Picture recognition
Hi!
I want to program a macro and I need your help in order to do that.
The macro that I want to do will open the Windows Picture and Fax viewer and lclick on "next image" random number of times (until here I know how to do that).
all the pictures in the folder will be at the same size and color but every image has a different name of a football team, like these images:
http://img149.imageshack.us/img149/3785 ... ed13tj.png
http://img135.imageshack.us/img135/1420/untitled5bp.png
The macro needs to recognize the team and print (message>) the name of the team.
I don't want to do that with letters or words recognition. I thought about something like scaning all the pixels in the image and then compare it to a known sample of pixels, for example:
images that their size is 5X1 pixels. In this example I want to "catch" the five pixels and then "ask" the program if their colors are green, blue and whatever..
Thank you.
I want to program a macro and I need your help in order to do that.
The macro that I want to do will open the Windows Picture and Fax viewer and lclick on "next image" random number of times (until here I know how to do that).
all the pictures in the folder will be at the same size and color but every image has a different name of a football team, like these images:
http://img149.imageshack.us/img149/3785 ... ed13tj.png
http://img135.imageshack.us/img135/1420/untitled5bp.png
The macro needs to recognize the team and print (message>) the name of the team.
I don't want to do that with letters or words recognition. I thought about something like scaning all the pixels in the image and then compare it to a known sample of pixels, for example:
images that their size is 5X1 pixels. In this example I want to "catch" the five pixels and then "ask" the program if their colors are green, blue and whatever..
Thank you.
If these images are "known", that is to say, they can be stored in a bitmap file on your system before you search them, then you should use the Image Recognition Library that you can download free here at MJTNET. Quite simple to use. You would simply store the images (.bmp) you wish to find, then write a script (which I can send, if you like) to:
1. take a screen shot of the current image
2. call the DLL to see if the StoredImage.bmp exists within the Screen.bmp
then have your script do whatever you like based on the result.
If the images are unknown, then you are probably better off taking a sampling of pixels with GetPixelColor> and taking your best guess as to the specific image being viewed.
What type application are you attempting to create? What is the end result?
1. take a screen shot of the current image
2. call the DLL to see if the StoredImage.bmp exists within the Screen.bmp
then have your script do whatever you like based on the result.
If the images are unknown, then you are probably better off taking a sampling of pixels with GetPixelColor> and taking your best guess as to the specific image being viewed.
What type application are you attempting to create? What is the end result?
ok..
Hi!
Thank you for answering
I found another way to do that- I scan the picture in order to find how many pixels are in the black color.. and than I contact that, for example: "Maccabi Haifa" contains 900 black pixels and "Barcelona" conatains 500 black pixels.
The macro that I am writing nowadays should at the end to recognize sentences and to sort them according to their length.
Thank you for answering
I found another way to do that- I scan the picture in order to find how many pixels are in the black color.. and than I contact that, for example: "Maccabi Haifa" contains 900 black pixels and "Barcelona" conatains 500 black pixels.
The macro that I am writing nowadays should at the end to recognize sentences and to sort them according to their length.
you're right
youe'r right.. if I have two images with the same number of black pixels my macro will fail... but I've checked that and I don't have this.
If I have I can "ask" if there is a black pixel in a specific location, which one image has a black pixel there and the other one doesn't have...
If I have I can "ask" if there is a black pixel in a specific location, which one image has a black pixel there and the other one doesn't have...
thank you
thank you for your kindness.
I in the meantime cope with that program because it's a simple one, but maybe in the future, when I program more complicated scripts I will have to use the picture recognition from the website.
But now I have another question (unrelated to the privious questions)- How do I press the spacebar? I saw that the key code for that is 32 but I don't know how to press that (like I "press enter", "press g" or whatever).
Thank you very very much
I in the meantime cope with that program because it's a simple one, but maybe in the future, when I program more complicated scripts I will have to use the picture recognition from the website.
But now I have another question (unrelated to the privious questions)- How do I press the spacebar? I saw that the key code for that is 32 but I don't know how to press that (like I "press enter", "press g" or whatever).
Thank you very very much
thank you
thank you but it works just when I want to write space ( )...
If I have a video game that I need to press there the spacebar in order to do somthing in the game, it doesn't press the space bar... the "send>" command is just to write space ( ).
What can I do?
Thank you.
If I have a video game that I need to press there the spacebar in order to do somthing in the game, it doesn't press the space bar... the "send>" command is just to write space ( ).
What can I do?
Thank you.
- Marcus Tettmar
- Site Admin
- Posts: 7391
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
It's the same thing. Space is a character. The space key sends a space character. Just like the A key sends an A character. So Send>%space% is the same as Press Space would be if such a command existed. Same as Send>A would be the same as Press A if such a command existed.
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?
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
thank you
thank you but it still doesn't work.
For example, look at this flash game:
http://www.miniclip.com/spaceinvaders.htm
When I press on the spacebar the spaceship shots but when I do that with macro scheduler and write "send> " nothing happens.
For example, look at this flash game:
http://www.miniclip.com/spaceinvaders.htm
When I press on the spacebar the spaceship shots but when I do that with macro scheduler and write "send> " nothing happens.
picture recognition
Thanks to mtettmar I succedded in pressing the spacebar.
Now I need help with the picture recognition. I decided not to recognize a picture by its number of black pixels. I decided to use the Image Recognition Library plugin. I don't know hot to use it.
I have some pictures that are saved in my hard disk. This pictures (exactly these pictures) are in a website in a known location.
I want to program a script which take the picture in this known and defined location and than compare it to the other picture and tell me what is the number of the picture in the hard disk.
Thank you.
Now I need help with the picture recognition. I decided not to recognize a picture by its number of black pixels. I decided to use the Image Recognition Library plugin. I don't know hot to use it.
I have some pictures that are saved in my hard disk. This pictures (exactly these pictures) are in a website in a known location.
I want to program a script which take the picture in this known and defined location and than compare it to the other picture and tell me what is the number of the picture in the hard disk.
Thank you.
- Marcus Tettmar
- Site Admin
- Posts: 7391
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Have you read the help file and looked at the examples that come with the library?I decided to use the Image Recognition Library plugin. I don't know hot to use it.
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?
Yes...
Yes I read that and I still don't understand how to do that.. because the examples show the method of comparison with precens and I didn't understand this example... As I told the images are exactly the same and I don't need precents in order to compare them.