envi提取纹理信息并进行地物可分离性指数分析,选取最合适窗口的纹理特征
作者:互联网
分别表示提取纹理的窗口大小和提取纹理的参数距离和角度。
glcm0=double(imread('GLCM\GLCM3_0_TF.tif'));%读取3*3窗口的四个角度的纹理数据
glcm1=double(imread('\GLCM\GLCM3_1_TF.tif'));
glcm2=double(imread('\GLCM\GLCM3_2_TF.tif'));
glcm3=double(imread('\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=mean(glcm_zh,3);%四个角度的纹理求平均
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);
ind2=find(roi==j+1);
a=glcm(ind1,i);
b=glcm(ind2,i);
SIab(j,j+1,i)=abs(mean(a)-mean(b))/(std(a)+std(b));%计算SI,可分离性指数
end
ind3=find(SIab(:,:,i)~=0);
siab=SIab(ind3,i);
mea_si(i,1)=mean(siab);%计算可分离性指数的平均值
disp(i);
disp(mea_si(i,1));
end
标签:GLCM3,glcm0,可分离性,纹理,glcm,envi,imread,tif 来源: https://blog.csdn.net/weixin_44519417/article/details/122161986