Jump to content

compare a two predefined areas in active window


Recommended Posts

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...