此程序为优化后的分水岭算法,避免了图像过分割 I= imread('D:\Images\pic_loc\1870405130305041503.jpg'); imshow(I); h=fspecial('sobel'); %h = fspecial(type) creates a two-dimensional filter h of the specified type. fspecial returns h as %a correlation kernel, which is the app
temp=z(101:2200,101:2200) 根据图像属性可得此为2300*2300的tif图像,由于需要将其划分为9宫格,所以begin点设置为101,end点设置为2200,temp转化为可均分的2100*2100矩阵 for i=1:9 switch i case {1,2,3} G{i}=temp(1:700,1+(i-1)*700:i*700); case {4,5,6} G{i}=temp(701:1400,1+(i-4)*700:(i-3)*700); case {7,8,9
骨架提取与分水岭算法也属于形态学处理范畴,都放在morphology子模块内. 1.骨架提取 骨架提取,也叫二值图像细化.这种算法能将一个连通区域细化成一个像素的宽度,用于特征提取和目标拓扑表示. morphology子模块提供了两个函数用于骨架提取,分别是Skeletonize()函数和medial_axis()函数.我们先来看Skeletonize()函数. 格式为:skimage.morphology.skeletonize(image) 输入和输出都是一幅二值图像. 例1: from s