using the ulterode function on multiple points

I am working with an image with a few small regions and i need to erode each region down to a single pixel.
When i use the ulterode function it erodes my image down to a single point,(from whichever of the original regions was the biggest).
I was just wondering if there is a modified version of this function that would allow it to output an image with multiple center pixels.
Thank you for any help
-Eric

1 Comment

Hi Eric,
If you make some matrix with two regions
>> I = false(7,6); I(2:3,2) = true; I(4:6,4) = true; I(5,3:5)= true
I =
0 0 0 0 0 0
0 1 0 0 0 0
0 1 0 0 0 0
0 0 0 1 0 0
0 0 1 1 1 0
0 0 0 1 0 0
0 0 0 0 0 0
Then you run bwulterode()...
>> bwulterode(I)
ans =
0 0 0 0 0 0
0 1 0 0 0 0
0 1 0 0 0 0
0 0 0 0 0 0
0 0 0 1 0 0
0 0 0 0 0 0
0 0 0 0 0 0
You end up with separate small regions as above. This seems to be working exactly as it's meant to. Can you produce an example that shows the phenomena you're talking about? And finally where you want to minimize it to a single pixel per separate region, what would you like to do with the small 2-pixel region at the top-left?

Sign in to comment.

Answers (0)

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 31 Jul 2013

Community Treasure Hunt

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

Start Hunting!