ceiwei
2013-01-29, 10:38
利用boundaries提取出来的边界是断断续续的,并且还把后面的阴影也包含进来了,我想把这些边界连接起来怎么处理?我想把那个阴影的边界处理怎么办?还有,我利用了connectpoly,发现效果不佳,处理后的边界图和原边界图基本上没有区别。
源程序如下,
f12=graythresh(f2);%f2是灰度图
g=~im2bw(f2,f12);
b=boundaries(g);
b1=b{1};
g2=bound2im(b1,M,N);
imshow(g2);
cn=connectpoly(b1(:,1),b1(:,2));
g3=bound2im(cn,M,N,cn(:,1),cn(:,2));%加上cn(:,1),cn(:,2)和不加上cn(:,1),cn(:,2)我发现基本上没有区别,那么加上的意义是什么呢?
g2=bound2im(cn,M,N);
imshow(g2);
imshow(g2)
源程序如下,
f12=graythresh(f2);%f2是灰度图
g=~im2bw(f2,f12);
b=boundaries(g);
b1=b{1};
g2=bound2im(b1,M,N);
imshow(g2);
cn=connectpoly(b1(:,1),b1(:,2));
g3=bound2im(cn,M,N,cn(:,1),cn(:,2));%加上cn(:,1),cn(:,2)和不加上cn(:,1),cn(:,2)我发现基本上没有区别,那么加上的意义是什么呢?
g2=bound2im(cn,M,N);
imshow(g2);
imshow(g2)