赞
踩
分别表示提取纹理的窗口大小和提取纹理的参数距离和角度。
glcm0=double(imread('E:\GF6_hongze\GLCM\GLCM3_0_TF.tif'));%读取3*3窗口的四个角度的纹理数据
glcm1=double(imread('E:\GF6_hongze\GLCM\GLCM3_1_TF.tif'));
glcm2=double(imread('E:\GF6_hongze\GLCM\GLCM3_2_TF.tif'));
glcm3=double(imread('E:\GF6_hongze\GLCM\GLCM3_3_TF.tif'));
glcm00=reshape(glcm0,[],size(glcm0,3));
glcm11=reshape(glcm0,[],size(glcm1,3));
glcm22=reshape(glcm0,[],size(glcm2,3));
glcm33=reshape(glcm0,[],size(glcm3,3));
%glcm_zh=cat(3,glcm00,glcm11,glcm22,glcm33);
glcm=(glcm00+glcm11+glcm22+glcm33)/4;%四个角度的纹理求平均
roi=imread('samples3.tif');%读取样本数据
SIab=zeros(8,8,48);
mea_si=zeros(48,1);
for i=1:48
for j=1:7
ind1=find(roi==j);
a=glcm(ind1,i);
for k=j+1:8
ind2=find(roi==k);
b=glcm(ind2,i);
SIab(j,k,i)=abs(mean(a)-mean(b))/(std(a)+std(b));%计算SI,可分离性指数
end
end
mea_si(i,1)=sum(sum(SIab(:,:,i)))/28;%计算可分离性指数的平均值
disp(i);
disp(mea_si(i,1));
end
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。