image-stack can be downloaded from https://www.dropbox.com/sh/nsszin69z5sfzs2/AABeN2IOV4CwheJkOWq0G34na?dl=0
I wish to divide the image into five morphological components (equal to the objects seen in the stack).
I follow the procedure:
morph = MorphologicalComponents[Binarize@img3d,CornerNeighbors -> True]; morph // Colorize
the image i get at the end is shown below (viewed from two angles):
the segmentation seems ok when viewed from the top, however, not too good when viewed from the bottom; one reason is because these tiny components (specks) can be merged with the nearest bigger components!
One scheme i can think of uses
Nearest (constructed from the centroids of the five bigger components) and
ReplacePart to re-label small components in
morph with the label of the nearest big component. The method proves to be very slow.
Is there an efficient way to merge the smaller components (specks) with bigger components?