ellinarac Posted July 21, 2019 Report Share Posted July 21, 2019 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted July 21, 2019 Report Share Posted July 21, 2019 No Quote Link to comment Share on other sites More sharing options...
ellinarac Posted July 21, 2019 Author Report Share Posted July 21, 2019 46 minutes ago, Cory said: No oh well, it was a thought lol Quote Link to comment Share on other sites More sharing options...
acantor Posted July 21, 2019 Report Share Posted July 21, 2019 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! Quote Link to comment Share on other sites More sharing options...
ellinarac Posted July 21, 2019 Author Report Share Posted July 21, 2019 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. Quote Link to comment Share on other sites More sharing options...
kunkel321 Posted July 22, 2019 Report Share Posted July 22, 2019 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. Quote Link to comment Share on other sites More sharing options...
terrypin Posted July 23, 2019 Report Share Posted July 23, 2019 Thanks for posting that inspiring video, Alan! Quote Link to comment Share on other sites More sharing options...
acantor Posted July 23, 2019 Report Share Posted July 23, 2019 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! Quote Link to comment Share on other sites More sharing options...
ellinarac Posted July 23, 2019 Author Report Share Posted July 23, 2019 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 Quote Link to comment Share on other sites More sharing options...
acantor Posted July 23, 2019 Report Share Posted July 23, 2019 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! Quote Link to comment Share on other sites More sharing options...
jsampsonyyyyy Posted December 7, 2021 Report Share Posted December 7, 2021 It would be useful where it is not possible to predict where a button to click on will appear on the screen. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.