so I have an image like this:
And I want to apply a mean threshold. However, I want it to only consider the grey values of the particles in the image, not all the 0 values of the background. If I apply the mean threshold regularly, it gives me this:
My idea was now, to use the binary image as a mask and thell the mean threshold to only build the mean from the white areas.
How would I do that?