counting a number of pixels together 'an object' with a certain color on screen
counting a number of pixels together 'an object' with a certain color on screen
Hello, I would like to count for example numbers of arrows on the screen of a certain color (not appearing anywhere else). Any quick way to fix such a counter? Preferrably bind the counting to a key.
Re: counting a number of pixels together 'an object' with a certain color on screen
That searches for images which is similar to my other thread which didn't work. Is there no easy way to just search for these same colored pixels that stick together occuring in different spots on the screen and count them? One would think ahk could handle that easy some waymikeyww wrote: ↑28 Jan 2023, 19:41Here are some ideas for you: viewtopic.php?p=391569#p391569
Good luck!
Re: counting a number of pixels together 'an object' with a certain color on screen
I know how to make pixelsearches and move mouse to the found color but not to look for several pixels together and to count them ..
Re: counting a number of pixels together 'an object' with a certain color on screen
You can find one pixel and then search the neighboring ones. I don't know why that is easier than searching for an image, but it may depend on the specific pixels.
Re: counting a number of pixels together 'an object' with a certain color on screen
You would probably write a detailed plain-language description, step by step, of exactly how you identify one of these images yourself when you look at it. You would then translate each step into AutoHotkey.
Re: counting a number of pixels together 'an object' with a certain color on screen
You gave up on your last thread without even following up on the initial feedback after stating you couldn’t make the ImageSearchAll function work. This is very likely easily solved, but you are just describing your group of pixels in words. An example image or two would really clear up what you’re trying to describe and allow the forum members to give specific feedback to fix it.
What is a group of pixels that stick together if not an image? Maybe the issue is you are thinking ImageSearch can only search for a rectangular reference image and aren’t aware that by applying ImageSearch’s *TransN option, you can search for any irregular and even non-contiguous shape. Basically, it can find any group of pixels in a known pattern.
Re: counting a number of pixels together 'an object' with a certain color on screen
You can play around with this:
viewtopic.php?f=6&t=111773
It's useful for debugging ImageSearch. You can use any ImageSearch function you'd like.
viewtopic.php?f=6&t=111773
It's useful for debugging ImageSearch. You can use any ImageSearch function you'd like.
Re: counting a number of pixels together 'an object' with a certain color on screen
if u cant do it, dont post vague descriptions of ur problem, implying that u can do it urself
do as boiler says and describe everything that it relevant. what game, what ure trying to match, with screenshots
it could be that imagesearch doesnt even work on that particular game(last i checked Path of exile comes to mind)
do as boiler says and describe everything that it relevant. what game, what ure trying to match, with screenshots
it could be that imagesearch doesnt even work on that particular game(last i checked Path of exile comes to mind)
Re: counting a number of pixels together 'an object' with a certain color on screen
maxkill, may be it is better for Your task to use opencv.
You can google examples of shape detection in python and then convert code to ahk.
viewtopic.php?t=96394
You can google examples of shape detection in python and then convert code to ahk.
viewtopic.php?t=96394
Re: counting a number of pixels together 'an object' with a certain color on screen
is your "arrows" all have the same size and shape?
may be we could say those look like "→"
if so, maybe you can split the screen to many smaller areas, depend on your need
then use pixelsearch these areas one by one, with x y offsets
once you got the matched coordinate on the most left of "→"
you can further check the pixel on most right whether or not "certain color"
in this case, the offset of x depend on the length of "→", right?
of cause this way is not 100 precent exact, thats why imagesearch is better...
i think this is what mikeyww try to tell you
may be we could say those look like "→"
if so, maybe you can split the screen to many smaller areas, depend on your need
then use pixelsearch these areas one by one, with x y offsets
once you got the matched coordinate on the most left of "→"
you can further check the pixel on most right whether or not "certain color"
in this case, the offset of x depend on the length of "→", right?
of cause this way is not 100 precent exact, thats why imagesearch is better...
i think this is what mikeyww try to tell you