Sign in to follow this  
Followers 0
111222qaz

compare a two predefined areas in active window

8 posts in this topic

Hello and good day, I'm new autoit student.

Script i want to make is:

-Read two (might be pre)defined areas in active window

-compare them if they are the same images

-if yes then stop

      -if no then press LM button pos (X,Y)

      -Go back to start

Is it possible for app to read the areas of screen and compare them if they are same? I don't want to check data or strings but image parts

Thanks

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

Can you please tell us what you try to achieve with your script?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hello and good day, I'm new autoit student.

Script i want to make is:

-Read two (might be pre)defined areas in active window

-compare them if they are the same images

-if yes then stop

      -if no then press LM button pos (X,Y)

      -Go back to start

Is it possible for app to read the areas of screen and compare them if they are same? I don't want to check data or strings but image parts

Thanks

Comparing images is very difficult. If for example the image is slightly a different size you will get the wrong result. If a transparent image is laid on top of the image you want to examine then you also get a different result. Also in some cases position on the screen may cause an error.

If you could tell the the name of the application or website we may have a better solution for you.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thanks for answers. I want to get universal tool for comparing stored locally/on imageshack images for filtering unwanted ones.

(photos without specified similarity would be spread, camera was on stator so main plan is 100% repeatable and has no moving without specified elements)

Apps: firefox and image viewer for windows.

(like xnview or basic windows, idc here ease of implement decides)

That is why I would like to predefine areas,for example: I set square 100/100px with centre pix position x,y, and square 2 100/100px with centre x,y. Then I could easily make two versions of soft for each environment, just need to determine constant window positions and sizing for both apps. While being able to define them for both versions separately I would avoid each time areas defining and possible area mismatches with different images (hand input is probably impossible to define precisely two linked pixels on separated images).

Regards,

Marcin

Edited by 111222qaz

Share this post


Link to post
Share on other sites

One method is to use the PixelChecksum function on both areas and compare.

As Bert mentioned, if the images differ in size or transparency or anything else even by one pixel this method wont work.


Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html

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