Sign in to follow this  
Followers 0
XJoeyV

Comparing a Image to a image from mouse?

5 posts in this topic

#1 ·  Posted

Hi,

I want to know if this is possible to make with AutoIT to get a picture from my computre and compare that to a certain area around the mouse.

Sor for example I get a bitmap with a picutre and when the mouse moves I check if the mouse position and like around it for 20px looks like the picture and if so I do action X

Share this post


Link to post
Share on other sites



#2 ·  Posted

Moved to the appropriate forum, as the Dev Forum very clearly states:

Quote

Do not create AutoIt-related topics here, use the AutoIt General Help and Support

Also, a short answer would be yes. A slightly longer answer would be "How about a detailed description regarding what you are trying to accomplish"?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

On 2017-5-22 at 10:32 PM, JLogan3o13 said:

Moved to the appropriate forum, as the Dev Forum very clearly states:

Also, a short answer would be yes. A slightly longer answer would be "How about a detailed description regarding what you are trying to accomplish"?

Sorry I lost my account and there where some things going on. But to be more detailed.

 

When I move the mouse I want to get a area around the mouse for example this: http://prntscr.com/fdyy5v

*Red Dot ( Between the text ) = The mouse pointer

* Red Marked Area = The area around the mouse I want to get ( in fact it would be smaller )

 

That area is the area I want to compare to a image for example this: http://prntscr.com/fdyysr

And then see how similar they are, if they are similar for like 80% then we go with Code X if not nothing will happen.

 

This is a bit of the idea how it see it.

FUNCTION onmousemove
    image i IS area around pointer
    iamge pc IS the image on the machine
    IF i is equal to pc OR i is 80% equal to pc THEN
        LOG "Hellow Image"
    ELSE
        ...
ENDFUNCTION

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You should be able to use the ImageSearch library here

I would think the best way to go about it is to get the position of your mouse, and then search in a predefined area around it. For example:

$mouseX = MouseGetPos(0)
$mouseY = MouseGetPos(1)
Local $search = _ImageSearchArea('image.bmp', 1, $mouseX, $mouseY, 50, 50, $x, $y, 0)
If($search) Then
    ;do stuff you want
Else
    ;we didnt find it
EndIf

I haven't tested this because I don't have the dlls set up for ImageSearch anymore, but some playing around with the area parameters of ImageSearch should work.

Edited by anthonyjr2

UHJvZmVzc2lvbmFsIENvbXB1dGVyZXI=

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0