前言
源代码
PRO stripe_remove1
ENVI,/Restore_Base_Save_Files
ENVI_Batch_init
file = DIALOG_PICKFILE(/READ, FILTER = '*.img')
print,file
ENVI_OPEN_FILE,file,r_fid=fid
ENVI_FILE_QUERY, fid, dims=dims, ns=ns, nl=nl, nb=nb
print,fid,dims,ns,nl,nb
fdata = fltarr(ns,nl,nb)
data=fltarr(ns,nl,nb)
for i=0,nb-1 do begin
fdata[*,*,i] = ENVI_GET_DATA(fid=fid, dims=dims, pos=i)
stdv1=Stddev(fdata[*,*,i])
avage1=Mean(fdata[*,*,i])
;print,stdv1,avage1
for k=0,ns-1 do begin
stdv2=Stddev(fdata[k,*,i])
avage2=Mean(fdata[k,*,i])
if stdv2 eq 0 then begin
stdv2=1
endif
print,k,i
data[k,*,i]= (float(stdv1)/stdv2)*fdata[k,*,i]+avage1-(float(stdv1)/stdv2)*avage2
endfor
endfor
OutName = "F:\\HJ\\"+file_basename(file,'.img')+'_remove.img'
mape_info=envi_get_map_info(fid=fid)
ENVI_WRITE_ENVI_FILE,data[*,*,*], out_name=OutName,MAP_INFO= mape_info
END
xxin blog , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明环境小卫星高光谱影像条纹噪声去除程序IDL版!