H/A/wishart分类

来源:互联网 发布:企业网站源码下载 编辑:程序博客网 时间:2024/04/29 20:06

以下是全极化SAR经典的H/A/Wishart分类方法,转载时请注明出处。

1.首先可以利用polSARpro_4.0对原始的SAR数据进行处理,利用软件可以得到极化特征:散射角,熵和反熵。

或者自己编写程序,求得这些特征。

2.根据已经得到的H/A(熵和散射角)编写程序,如下:

clear all;
clc
row=610;
col=1000;
fid = fopen( 'alpha.bin','rb'); 
alpha= fread(fid,[col,row],'float').'; fclose(fid);
fid = fopen('anisotropy.bin','rb');
anisotropy = fread(fid,[col,row],'float').'; fclose(fid);
fid = fopen('entropy.bin','rb');
h= fread(fid,[col,row],'float')'; fclose(fid);
clr(:,1)=[0;0.8;0.2];   %绿
clr(:,2)=[0;1;0]; 
clr(:,3)=[0.8;0;0];     %暗红
clr(:,4)=[0;1;0];  
clr(:,5)=[0;0.3;1];     %青蓝
clr(:,6)=[1;0;0];       %红
clr(:,7)=[0;0.6;1];     %天蓝 
clr(:,8)=[0;0;1];       %蓝

for m=1:row
    for n=1:col
        if h(m,n)>=0.9   %分类、着色
            if alpha(m,n)>=55 
               z(m,n)=1; 
            elseif alpha(m,n)<40 
                   z(m,n)=0; 
            else   z(m,n)=2; 
            end 
       elseif h(m,n)>=0.5 
            if alpha(m,n)>=50 
               z(m,n)=3; 
            elseif alpha(m,n)<40 
                   z(m,n)=5; 
            else   z(m,n)=4; 
            end     
       else 
            if alpha(m,n)>=47.5 
               z(m,n)=6; 
            elseif alpha(m,n)<42.5 
                  z(m,n)=8; 
            else  z(m,n)=7; 
            end 
       end 
       I(m,n,:)=clr(:,z(m,n));
    end
end

figure(1),imagesc(h)
figure(2),imagesc(alpha)
figure(3),image(I)
plot(reshape(h,1,size(h,1)*size(h,2)),reshape(alpha,1,size(alpha,1)*size(alpha,2)))


%==============================% 画H/alpha平面 颜色分割=================================
figure(4),axis([0,1,0,90]),hold on      
h=0:.01:0.5; al=42.5*ones(1,length(h));  plot(h,al)  %画区域直线
al=47.5*ones(1,length(h));  plot(h,al)
h=0.5:.01:0.9; al=40*ones(1,length(h));  plot(h,al)
al=50*ones(1,length(h));  plot(h,al)
h=0.9:.01:1; al=40*ones(1,length(h));  plot(h,al)
al=55*ones(1,length(h));  plot(h,al)
al=0:90; h=0.5*ones(1,length(al)); plot(h,al)
al=0:90; h=0.9*ones(1,length(al)); plot(h,al)


fill([0.9 1 1 0.9],[55 55 90 90],[0 0.8 0.2]),  fill([0.9 1 1 0.9],[40 40 55 55],[0 1 0])  %填充分割色
fill([0.5 0.9 0.9 0.5],[50 50 90 90],[0.8 0 0]),  fill([0.5 0.9 0.9 0.5],[40 40 50 50],[0 1 0])
fill([0.5 0.9 0.9 0.5],[0 0 40 40],[0 0.3 1]),  fill([0 0.5 0.5 0],[47.5 47.5 90 90],[1 0 0])
fill([0 0.5 0.5 0],[42.5 42.5 47.5 47.5],[0 0.6 1]),  fill([0 0.5 0.5 0],[0 0 42.5 42.5],[0 0 1])
fill([0.9 1 1 0.9],[0 0 40 40],[0 0 0])

figure
image(z)
 map1=hsv(8);
 map=[map1];
 colormap(map);
 colorbar;

3 0
原创粉丝点击