Page 1 of 1

Find Image to look a specific coordinate

Posted: 18 Feb 2019, 16:52
by SteelMassimo
Hello everyone!

Is there a way to make the Find Image action search a especific set of coordinates on the screen instead of the screen as a whole?

In the Edit Action menu, the only options I have are Screenshot, Window and Image.

If I use Screenshot, the search for the especified image begins at mouse coordinates 0;0 and ends at 1920;1080. Is there a way to change the targeted area for searching on the Screenshot? Maybe using the Code action, along with some Javascript?

Re: Find Image to look a specific coordinate

Posted: 18 Feb 2019, 18:31
by eureka
I am theorising here ..

If in Windows 10 could you leverage Magnifier to zoom your target window image?
https://support.microsoft.com/en-gb/hel ... -magnifier

I am not sure what is the equivalent tool in Ubuntu/Mac but I will explore.

...

Actually I now see that Magnifier will not work since the expanded area is not clickable.
My current thought is to resize the target window beyond the normal constraints of screensize
then you can move the expanded window around to hunt for images. Perhaps place it in a virtual workspace (in Ubuntu I can create a grid of workspaces and switch between them).

Re: Find Image to look a specific coordinate

Posted: 18 Feb 2019, 19:11
by SteelMassimo
Hello eureka!

My first idea was to use the Windows Capture Tool, in order to create an image file that the Find Image action would search into in order to determine if what I'm looking for is present or not in the especified area I'm targeting. I'm dealing with a lot of images, so the name of the file that the Windows Capture Tool would save (C:\Images\Img_n) would serve as the constant in which to find the variable images, with each Img_n being a crop of the area I'm targeting.

There are 5 diferent areas where I'm searching for a particular image (which is basically a square filled with an "X"), so Capture Tool would save Img_1 through Img_5 (crops of diferent areas of the screen) and then Find Image would search each of those for what I'm looking for. Depending on which one it finds, a certain procedure would then be performed by the bot.

This is obviouly very time consuming, which is why I asked about this possibility. I've had a lot o success using the Code Editor in order to do some crazy stuff with Actiona (amazing software by the way), so I though I'd ask you guys for ideas to manipulate the target of the Find Image scan.

I'm using a Windows 7, 64-bits, along with the latest version of Actiona, by the way.

Re: Find Image to look a specific coordinate

Posted: 18 Feb 2019, 20:15
by eureka
I am a keen user of Actiona for desktop automation but where image searching is required on occasions I draw on Sikulix which is java and python based.

Here is just one basic tutorial.

https://www.youtube.com/watch?v=I-UYoezac4Q

I'm sure that the two tools could work in concert.

There is a similar project fork named Sikuli Slides. Read the history.

====================================================

[Later edit] On reflection why is it necessary to break the screen image into multiple images to be scanned for the X icon?
If it is required for reasons I don't understand you can use imagemagick to crop a large image into a grid of images.
http://www.fmwconcepts.com/imagemagick/ ... .php#crop2

Re: Find Image to look a specific coordinate

Posted: 19 Feb 2019, 13:45
by francois
In the french forum, there is an example which is not far from your need :
https://forum.jmgr.net/viewtopic.php?f= ... opy#p14693

The main part :

Code: Select all

var screenShot = Image.takeScreenshot();
var screenShot_partie= screenShot.copy(new Rect(x0,y0,largeur,hauteur));

var img_a_trouver_ = new Image(img_a_trouver);
                                                
 Search_IMG_ = screenShot_partie.findSubImages( img_a_trouver_,{
confidenceMinimum: 90,
downPyramidCount: 1,
searchExpansion: 15,
maximumMatches: 30
 });

Re: Find Image to look a specific coordinate

Posted: 19 Feb 2019, 19:55
by Frank
Hello everybody,

I think the topic here just totally intresting and would like to insert a burning intressing question if I may.

I think that Sikuli Java is not a programmer, I would be interested to know if you can execute sikuli in Actinoa code.

Thanks for your answers in advance.

greetings
Frank