Jump to content

_imagesearch How to count the amount of same images found?


Recommended Posts

Hello all.

 

I was wondering if its possible to count how many of the same picture is on the screen.

Like if i have 4 of the same icons on my desktop, i want the script to see how many of these icons are there. I want the script to have the output number 4.

So far i only managed to get it to see if the image was there or not, now i am wondering if i am able to count how many of the same images are on my screen.

Is it possible?

 

Thanks for your time, Armanistar.

Link to comment
Share on other sites

  • Moderators

armanistar,

Welcome to the AutoIt forum.

But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions.  I have moved it for you, but would ask you to be more careful in future.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Would they have the same name, or are they all different and the only thing that is the same between them is the picture?

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Would they have the same name, or are they all different and the only thing that is the same between them is the picture?

​Well it doesnt really matter, as i can copy and paste the picture 4 times so i have 4 times the same picture under a different name, but i can also make it just 1 picture under 4 names? Oh i guess i know how i could make such a system. 

Like setting up the range on where to look for the picture will always differ! :D

 

Thanks, you helped me already :D

Edited by armanistar
Link to comment
Share on other sites

No problem. They obviously can't be the same name in the same directory, but if it was just copies it would be very easy to to for the same name, with a small difference in the naming convention. 

Whatever helps you along the way. ^_^

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

Damn i was too quick with thinking i got it, i cannot get the search area function to work properly.

 

$pumpkin = _ImageSearchArea('pumpkin.jpg',1,$x14,$y14,0,0,$x15,$y15,200)

$y15 = 800 

&x15 = 800

 

Why isnt it still not finding the picture ? (tried it with tolorance of 10 - 200)

Link to comment
Share on other sites

Please, post your full code. 

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Link to comment
Share on other sites

  • Moderators

armanistar,

You have been reported for sending PMs asking for help. Please read the Forum rules when you log back into the forum - you will see that we do not permit that here. Asking for help via PM is discouraged because the forum is here to help everyone - if you get private help then no-one else can benefit.

So please do not do it again.

M23

 

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...