Expanding boundary of an object identified by a few pixels

27 views (last 30 days)
I want to move boundaries of objects identified in an image by a few pixels within or without, so that I have uniformly expanded or shrunk object of almost the same shape. I was thinking of finding the neighbourhood of the pixels on the boundary and then take an appropriate union of them all - this might work for expanding the boundaries, but as of shrinking, I am not sure. Is there any other simpler way, which could work for both the things equally well?
  1 Comment
Shuppar
Shuppar on 13 Sep 2016
Actually, I want the annular region around the boundaries detected comprising at least the 9th immediate neighbour. So I have this mask obtained from nuclei segmentation and I want an annular region around each nuclei detected. Hope, I made it clearer.

Sign in to comment.

Accepted Answer

Shuppar
Shuppar on 13 Sep 2016
Okay, got it. so I do the following: Let's say, I have the mask of segmented nuclei L. I will expand it (dilate) by the disk of appropriate radius and store the resulting image in P:
P = imdilate(L, strel('disk', 20));
After which I will subtract the original image (L) from the one obtained (p):
Q = P - L;
And that's it - I dunno why didn't it strike me earlier!

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!