开发者

connecting a disconnected silhouette edge

开发者 https://www.devze.com 2023-03-19 09:21 出处:网络
I have a silhouette edge that is not connect开发者_开发知识库ed 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.

I have a silhouette edge that is not connect开发者_开发知识库ed 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.

connecting a disconnected silhouette edge


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)

connecting a disconnected silhouette edge

0

精彩评论

暂无评论...
验证码 换一张
取 消