%计算一个区域的骨骼
f=imread('chromo_binary.tif');
subplot(3,2,1),imshow(f),title('原图')
f = im2double(f);%double型
h = fspecial ('gaussian',25,15);%高斯空间掩模
g = imfilter(f, h, 'replicate');%平滑
subplot(3,2,2),imshow(g),title('使用25*25高斯空间掩模平滑图像f后的结果')
g = im2bw(g, 1.5*graythresh(g));%阈值处理
subplot(3,2,3),imshow(g),title('经阈值处理后的图像')
s = bwmorph(g, 'skel', Inf) ;%骨骼
subplot(3,2,4),imshow(s),title('骨骼')
s1 = bwmorph(s, 'spur', 8);%8次去除毛刺得到的骨骼
subplot(3,2,5),imshow(s1),title('应用8次去除毛刺的算法后的骨骼')
s2 = bwmorph(s1, 'spur', 7);%再应用7次去除毛刺得到的骨骼
subplot(3,2,6),imshow(s2),title('在应用七次去除刺算法后的骨骼')
计算一个区域的骨骼
最新推荐文章于 2024-01-03 09:23:58 发布