I have a silhouette edge that is not connected and i need a way to make it connected so that i can sort it's pixels clockwise... any help about how to do so. this is an image of the disconnected border but the cuts in the edge will not be obvious it need to zoom in to see them.
Try the following:
I = double(imread('http://i.stack.imgur.com/2MYgL.png'));
BW = im2bw(I,0.5); %# binarize image
BW = imdilate(BW,strel('square',3)); %# dilation
BW = imfill(BW,'holes'); %# fill inside silhouette
BW = imerode(BW,strel('square',3)); %# erode
BW = bwperim(BW,8); %# get perimeter
imshow(BW)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With