Sign in to follow this  
Followers 0
dainiusb

Count stuff on screen?

21 posts in this topic

Do you know any good way to count or track stuff on screen? For example, there are 3 little images on screen that are same. I want to get the number or position of each image. So what is the best way to do this?

Share this post


Link to post
Share on other sites



dainiusb,

There are a number of good image search UDFs available if you search - or you could even use PixelChecksum. :)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I know about ImageSearch and it's doing pretty well but I dont know how to count :) I'm going to check PixelChecksum again.

EDIT: No I don't think PixelChecksum will help here.

Edited by dainiusb

Share this post


Link to post
Share on other sites

Actually my goal is not to count. It's to get position of EVERY image or whatever object on screen. I'm just learning and I want to be able to do something more advanced rather than basic stuff.

Share this post


Link to post
Share on other sites

Yeah, sure. But it can be anything in the end.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Well you could try finding the upper-left pixel on your screen and check if the adjacent pixels have the correct colour then store the co-ords of the pixels for later use.

Edited by DatMCEyeBall

"Just be fred, all we gotta do, just be fred."  -Vocaliod

"That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha

@tabhooked

Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation

Share this post


Link to post
Share on other sites

Yeah, sure. But it can be anything in the end.

.

still the same "project" ? but different approach ?


[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Share this post


Link to post
Share on other sites

.

still the same "project" ? but different approach ?

What you mean?

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Well you could try finding the upper-left pixel on your screen and check if the adjacent pixels have the correct colour then store the co-ords of the pixels for later use.

upper-left pixel of that image? But whats the use of this? I don't think I'll be able to find more than 4 images. And it's pretty hard if images are randomly placed on screen.

Edited by dainiusb

Share this post


Link to post
Share on other sites

dainiusb, you're not getting a lot of help because you're being very vague about what you want to do. "Count stuff" or "But it can be anything in the end" - probably couldn't offer less of an explanation if you tried. How about a clear, concise explanation of what you're trying to do, with a step by step example. If you're having trouble, throw in a screenshot. Help us help you ;)


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

Share this post


Link to post
Share on other sites

Seeing how you are new and this request of yours can easily be used for a game, would you be so kind in showing a screenshot of what you are trying to count?

Please understand if this is for a game then the moderator will close this thread. We do not allow discussion of game automation here in the forum.

forum rules

Share this post


Link to post
Share on other sites

What you mean?

I'm guessing he's referring to these threads.

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Firstly, by anything I meant any image. Secondly I don't know yet what my project is going to be because I'm just learning for the future at the moment but here's an example: screenie.pngSo the goal is to count all those image icons and get their coords.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

Oh I see. But these are pretty old and I've solved them myself already and completed that project the next day without problems. I'm no longer interested in game automation after I saw how crappy it was haha ;)

Edited by dainiusb

Share this post


Link to post
Share on other sites

Firstly, by anything I meant any image. Secondly I don't know yet what my project is going to be because I'm just learning for the future at the moment but here's an example: So the goal is to count all those image icons and get their coords.

 A couple of questions, not because I am questioning your motives but because I truly don't understand what you're trying to accomplish.

"I don't know yet what my project is going to be because I'm just learning for the future" - If you don't know what you want to do, how is anyone supposed to help you?

"So the goal is to count all those image icons and get their coords" - These images are really just files. If you want to count them, use Melba's RecFileListToArray. You can create an array of the files, filter it as you want, then manipulate the files in any manner you wish. I can't fathom why you would want to open an Explorer file and "find the coords" of files. I'm not even sure why you would expect them not to be lined up in order, instead of splayed out all over the screen.


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

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

 A couple of questions, not because I am questioning your motives but because I truly don't understand what you're trying to accomplish.

"I don't know yet what my project is going to be because I'm just learning for the future" - If you don't know what you want to do, how is anyone supposed to help you?

"So the goal is to count all those image icons and get their coords" - These images are really just files. If you want to count them, use Melba's RecFileListToArray. You can create an array of the files, filter it as you want, then manipulate the files in any manner you wish. I can't fathom why you would want to open an Explorer file and "find the coords" of files. I'm not even sure why you would expect them not to be lined up in order, instead of splayed out all over the screen.

I've told already that I want to learn more(this is what I want to do), not just basic stuff and I'm asking this not to automate specific program but simply to learn more because I couldn't find anything like that on the forum and even google. If I wanted to find those files the way you told me(what if was controlling some computer remotely?), I could simply use any other programming language. And this is just an example...I don't expect them to be so but that's one of the examples that I could think of ;)

Edited by dainiusb

Share this post


Link to post
Share on other sites

If that is the case (and still pretending I don't believe this is still for a game), how about you expand on post #3. You state you know ImageSearch, and it is working, but you don't know how to count. Why don't you show some of your effort by posting what you've done so far.


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

Share this post


Link to post
Share on other sites

#20 ·  Posted (edited)

If that is the case (and still pretending I don't believe this is still for a game), how about you expand on post #3. You state you know ImageSearch, and it is working, but you don't know how to count. Why don't you show some of your effort by posting what you've done so far.

The thing is that I can't think of a way to do this. Well I have one idea. Like split screen or area in chunks and scan them one after another but that's quite dumb because like if just a half of that icon appears in chunk then it won't get detected...And if it was some advanced detection then same image could be detected up to 4 times...

Another crazy thought: let ImageSearch detect one of the images, then cover it somehow( :D ) and search for another bwahahaha ;D

Edited by dainiusb

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0