How to segment all pores and its connecting paths seperately

Using a larger opening kernel should work well for cases where there is a thin connecting path between the large spheres. You just need a kernel larger than the connections, and the larger objects should be only minimally modified. Cases where the connections are really two spheres touching (rather than linked via a thin connector) might end up reconnected when the spheres are restored.

Because of that, Andras’s suggestion of eroding (Margin => Shrink), separating (Islands => Split), followed by Grow from seeds with a threshold applied may work better for you. If you are left with small connector paths that you don’t want, applying morphological opening (Smoothing => Opening) to your final objects should get rid of any small projections off the sphere surfaces that you don’t want.

This reference gives a quick overview of morphological image processing: https://www.cs.auckland.ac.nz/courses/compsci773s1c/lectures/ImageProcessing-html/topic4.htm. Erode and Dilate operations are available via the Margin tool, and Open and Close are available via the Smoothing tool.

2 Likes