91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

高光譜圖像處理 混合像元分解中的豐度估計常用算法——FCLS

資源截圖

代碼片段和文件信息

???function?[alpha?rmse]?=?fcls(totalpixelendmember)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%??function:?use?FCLS?algorithm?to?unmix?the?image
%%??totalpixel?-?pixel?need?to?be?unmixed
%%??endmember?-?the?endmember?matrix
%%??alpha?-?the?abundance
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?clear?all
%?[imagept]=freadenvi(‘D:/data/Fractal1_noise_30‘);
%?numofend?=?9;
%?[U11P11]?=?OSP(imagenumofend);
%?totalpixel=image;endmember=U11;

[rowlineb]?=?size(totalpixel);
[band?class]?=?size(endmember);???????%?obtain?the?band?number?and?class?number
?
pp?=?zeros(band1);
aa?=?zeros(class1);
endm?=?endmember;

dita?=?100;
pixel?=?dita*ones(band+11);
alpha?=?zeros(rowlineclass);
M?=?dita*ones(band+1class);
M(1:b:)?=?endmember(1:b:);
endmember?=?M;
for?i=1:row
????for?j=1:line
????????m?=?endmember;
????????pixel(1:band)?=?totalpixel(ij1:band);
????????flag?=?1;
????????[l?p]=size(m);??????%l-波段數;p-端元光譜數
????????order?=?1:p;?????%紀錄求解出的系數的順序
????????counter?=?0;????????????%紀錄當前求出的系數
????????while?flag?~=?0
????????????[l?p]=size(m);??????%l-波段數;p-端元光譜數
????????????one?=?ones(p1);
????????????a?=?zeros(band1);
????????????invmm=pinv(m‘*m);????%inv(m*m‘)
????????????a_ls?=?invmm*m‘*pixel;??????%使用無約束最小二乘求得系數
%?????????????s?=?invmm*one;
%?????????????lamda?=?(1-one‘*a_ls)/(one‘*s);
%?????????????a_fcls?=?a_ls-lamda*s;
????????????a_fcls?=?a_ls;
????????????re?=?(a_fcls>=0);
????????????if?sum(re)==p
????????????????flag=0;
????????????else
%?????????????????a_temp?=?a_fcls./s;
????????????????a_temp?=?a_fcls;
????????????????temp_max?=?0;
????????????????flag_zero?=?0;
????????????????%%尋找最大負系數
????????????????for?k=1:p
????????????????????if?temp_max????????????????????????temp_max?=?abs(a_temp(k));
????????????????????????flag_zero?=?k;
????????????????????end
????????????????end
????????????????counter?=?counter+1;
????????????????order(flag_zero:p-1)?=?order(flag_zero+1:p);
????????????????%%刪除最大負系數對應的項
????????????????matrx_new?=?zeros(lp-1);
????????????????if?flag_zero==1
????????????????????matrx_new(:1:p-1)?=?m(:2:p);
????????????????else
????????????????????if?flag_zero==p
????????????????????????matrx_new(:1:p-1)?=?m(:1:p-1);
????????????????????else
????????????????????????matrx_new(:1:flag_zero-1)?=?m(:1:flag_zero-1);
????????????????????????matrx_new(:flag_zero:p-1)?=?m(:flag_zero+1:p);
????????????????????end
????????????????end
????????????????m?=?matrx_new;
????????????end
????????end
????????if?p==1
????????????invmm=inv(m‘*m);????
????????????a_ls?=?invmm*m‘*pixel;
????????????alpha(ijorder(1))?=?a_ls;
????????else
????????????for?k=1:p
????????????????alpha(ijorder(k))?=?a_fcls(k);???????%最終系數
????????????end
????????end????
????????
????????pp(1:band)?=?totalpixel(ij1:band);
????????aa(1:class)?=?alpha(ij1:class);
??

評論

共有 條評論