Author Topic: Is it possible to count how many shapes that have matching greyscale value?  (Read 480 times)

Hi all,
I'm trying to find out whether it's possible to count all shapes that have matching greyscale values, and then assign those shapes with a greyscale value based on the amount of matching shapes found.

EXAMPLE: let's say that there are 50 shapes in total. Out of these 50 shapes:

15 have a luminance value of 0.75
25 have a luminance value of 0.65
10 have a luminance value of 0.5

The wished output would then be:
a luminance value of 0.15 for 15 / 50 shapes
a luminance value of 0.25 for 25 /50 shapes
a luminance value of 0.1 for 10/50 shapes.
Last Edit: April 16, 2021, 10:13:56 pm

Hey, you could use a threshold node to isolate the value you want, then apply a flood fill + flood to Index (don't forget to activate the advanced options of the floodfill)