Jump to content
Macro Express Forums

can ME do image recognition?


Recommended Posts

I'm wondering if ME can do "image recognition", I know you can do pixel color searches and things of that nature, but what about actual image capture and search?

the reason I ask is because right now, I am using 2 macro applications and the other app is strictly being used for the image search function, nothing else. I would like to be able to have ME perform everything without the need for a second app but so far I don't see that happening being I see no options for an actual "image recognition" , "Image search" or "image capture" in ME and "pixel color" is pretty much useless for a lot of instances in my macro because the actual pixel colors have random color variations (very slight variations, but enough to make it not work right) but the image recognition in the other app works great because you can select the area of the screen to capture the image, compare it to the full screen capture, set a tolerance level for color range in the image you are looking for and it works nearly 100% of the time. basically the code for the other app looks like this but haven't figured out a way to get this effect in ME as of yet.


SetFocus>cellinarac Atruin
Wait>1.5
GetScreenRes>sx,sy
ScreenCapture>0,0,sx,sy,C:\Users\cellinarac\Documents\Test Macro\screen.bmp
FindImagePos>C:\Users\cellinarac\Documents\Test Macro\Image1.bmp,C:\Users\cellinarac\Documents\Test Macro\screen.bmp,30,1,XPos,YPos,imgs
If>imgs>0
MouseMove>XPos_0,YPos_0
Wait>1.0
LDown
Wait>0.2
LUp
Wait>1.5
Endif
Wait>2.5
Press CTRL
Wait>0.2
SendText>m
Wait>0.1
Release CTRL
Exit

Link to comment
Share on other sites

For me, part of the pleasure of using Macro Express is discovering how far I can push a script to perform tasks for which Macro Express is not ideally suited. In other words, working creatively within Macro Express's limitations can be very satisfying.

 

Although Macro Express does not support image recognition, might there be another way?

 

For example, can a script find the name of the image file?

 

Or if there are a finite number of static images that you want to differentiate, could your script gather information about key pixels, e.g., their colours and/or locations, and deduce the content from that information?

 

It is not easy to push Macro Express to its limits and achieve reliable results, but there is a tremendous sense of accomplishment when one succeeds.

 

Many years ago, a member of this forum posted an astonishing video of a playable Tetris game he had created using Macro Express. I never would have imagined it was possible!

 

 

Link to comment
Share on other sites

Yea, I really like the ease of ME for the most part. I may end up looking into the other app and rebuild my macros for it so I don't need 2 apps for one macro lol, I'm also considering looking into the pixel color option and having it do a repeat  search for a color, or range of colors with in an area of the screen, then when color found continue macro, have it repeat this search for a certain number of times, then if color not found jump to section of macro. a lot to learn lol. getting the pixel color at a pixel that constantly makes changes with in what appears to be a set variable, the same cycle of number codes seem to repeat, just in random orders and it might throw in a random color number that isn't there often or is swapped with another random number at various times. they change pretty quick as well, and hitting print screen over and over again a few dozen times, you may or may not get one you already got a screen shot of lol.... damn, just had an idea lol. I could use my screen capture to record the numbers as they change, then play the video frame by frame to get the cycle of numbers.... feel like an idiot for not thinking of that earlier lol.

Link to comment
Share on other sites

What do you mean by "image recognition?"  Do you really need it to look at a picture and say, that's a house.  That's a tree.  That's a face.  Or is it actually Optical Character Recognition (OCR) that you want?  Or do you actually want to compare multiple images against each other?  Of course ME can't directly do any of that directly, but maybe you could get it to talk to other apps that can.  If you want OCR, there's a pretty cool freebie http://capture2text.sourceforge.net/   I used to have an AutoHotkey script that called Cap2Text.  I'm not sure if you could programatically get information back from it though..  There are free image-comparison tools too.  I don't know if any are automatable though.  

Link to comment
Share on other sites

Hi Terry,

 

In the video, he says it took "almost" 1000 instructions to make the game work. I've created complex macros that are 100 and 200 lines long that perform hundreds (or thousands) of calculations. But it's hard to wrap my mind around the complexity of a Macro Express script that results in a playable Tetris game. It's an accomplishment!

Link to comment
Share on other sites

On 7/21/2019 at 8:20 PM, kunkel321 said:

What do you mean by "image recognition?"  Do you really need it to look at a picture and say, that's a house.  That's a tree.  That's a face.  Or is it actually Optical Character Recognition (OCR) that you want?  Or do you actually want to compare multiple images against each other?  Of course ME can't directly do any of that directly, but maybe you could get it to talk to other apps that can.  If you want OCR, there's a pretty cool freebie http://capture2text.sourceforge.net/   I used to have an AutoHotkey script that called Cap2Text.  I'm not sure if you could programatically get information back from it though..  There are free image-comparison tools too.  I don't know if any are automatable though.  

as in, scan screen for an image, if image found, click on image, if image not found, wait for image. I have a second app that does support this function and have the 2 apps working together. just thought it would be nice to have everything working in ME than having to install and use 2 programs for 1 macro lol

Link to comment
Share on other sites

If the application is Microsoft Word, you can search for images within a document. When entering the search term, use "^g"  -- I imagine "g" stands for "graphic").

 

Searching for ^g doesn't work for every kind of graphic that one might insert into a Word document, but you won't know until you try!

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...