• 大小: 2KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: Matlab
  • 标签: N-findr  

资源简介

matblab平台编写的N-FINDR算法提取遥感卫星影像的纯净像元(端元)。

资源截图

代码片段和文件信息

//读取影像为矩阵,188为波段数,47750为单波段像元数(长*宽)
x=rand(18847750);
[L N]=size(x);
%正交投影算法压缩数据
d=6;%压缩至6个波段
y_m = mean(x2);
Corr = x*x‘/N;
Cov  = Corr - y_m*y_m‘;
[US] = svds(Covd-1);         % computes the a (p-1)-orth basis
Y_o = x - repmat(y_m[1 N]);   % remove mean
Yp =  U‘ * Y_o;               % project the zero-mean data onto a 
                               % (p-1) subspace
%初始化端元矩阵
rand_index = randperm(N);
pp_indices = rand_index(1:d);
Yp = [ones(1N); Yp];
%开始提取
m=250;n=191;P=188;
orignreshape=x‘;
xresh=Yp‘;
XDouble= double(xresh);
tstart=cputime;
randpoints=rand(1d+1);
randpoints=randpoints*m*n;
randpointsindex= uint32(randpoints);
EndmemberInOrign=zeros(d+11);
membervalues=zeros(dd+1);%dBandsd+1 Endmembers
detAA=zeros(d+1d+1);
detAA(1:)=1;
% maxdet=0;
% maxdetindex=1;
index=m*n;
for i=1:d+1
    membervalues(:i)= XDouble( randpointsindex(i):);%初始化endmember矩阵,列向量
end
detAA(2:d+1:)=membervalues(1:d:);
for i=1:d+1
    maxdet=0;
    maxdetindex=0;
    for j=1:index %固定后d个点在点集中寻找一个最优值,
        use=1;
        for ii=1:i-1
            if j==EndmemberInOrign(ii)
                use=0;
      

评论

共有 条评论