|
"Michael" wrote in message <igkhfo$p76$1@fred.mathworks.com>...
> I have two regions in an image (labeled with 1 and 2 respectively), and I want to find out the length of the boundary between them. I thought of applying dilation to one of them and then looking for the intersection with the second. Something like:
>
> region1 = image == 1;
> region2 = image == 2;
> se = strel('disk',1,0);
> extended = imdilate( region1, se );
> boundry = length( find( extended && region2 )
>
> The problem is that I need to do this for a large set of images and this procedure is slow (I guess because of the imdilate).
>
> Does anyone has an idea on how to do this faster?
>
> Thanks in advance!
What about:
bwboundaries, bwperim, bwtraceboundary
Also, I would guess that your method with imdilate isn't producing the results you expect, since it would fill small concave areas.
|