Invert Image

Hello,
Could you please help me to find the way of how can i detect primary objects on images like the one below.
As i understand i should firstly run ColortoGray and Invert from ImageMath. but it actually does not work.
Could you give me any suggestions.
Thank you beforehand!

Hi,

See my attached pipeline, which works better than I had hoped!


A couple notes
(1) The image is Color, not grayscale. There are a few red pixels, but mousing over the image shows RGB… Set NamesAndTypes to account for this.
(2) EnhanceOrSuppress helps a lot, obviously. If the objects get much bigger or are even more clumped, then this hack will not work so well.
(3) IDPrimary is not optimized much. You can try and declump the objects further if you need to.

Hope that helps!
David
DL_inverted.cppipe (7.36 KB)

(1) The image is Color, not grayscale. There are a few red pixels, but mousing over the image shows RGB… Set NamesAndTypes to account for this.
(2) EnhanceOrSuppress helps a lot, obviously. If the objects get much bigger or are even more clumped, then this hack will not work so well.
(3) IDPrimary is not optimized much. You can try and declump the objects further if you need to.
Hope that helps!
David