;----------------------------------------------------------------- ; lee_pol.pro ; ; 06/2001 by Andreas Reigber ;------------------------------------------------------------------ ; Vectorial Lee filter of multiplicative image noise using local ; statistics. Used for complex polarimetric SAR images. See: ; J.S.Lee et al.: "Speckle Reduction in Multipolarization, ; Multifrequency SAR Imagery", Trans. on Geoscience and Remote ; Sensing, Vol. 29, No. 4, pp. 535-544, 1991 ; ; Usage: ; res = lee_pol(image,size) ; ; image = 3D complex array containing the polarimetric image ; the polarizations are interleaved over the third ; dimension, i.e. image has size (xdim,ydim,3). ; size = size of the filter window ; ; res = Resulting filtered covariance matrix (xdim,ydim,3,3) ; ; Keywords: ; ; looks = Number of looks (default = 1) ; ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ function lee_pol,arr,smm,LOOKS=looks if not keyword_set(looks) then looks=1 siz = size(arr) anz_rg = siz[1] anz_az = siz[2] delta = (smm-1)/2 sig2 = 1.0/looks sfak = 1.0+sig2 zfak = smm^2-1 out = complexarr(anz_rg,anz_az,3,3) fbox = mbox(smm,anz_rg) sbox = [[fbox],[fbox+anz_rg*anz_az],[fbox+2*anz_rg*anz_az]] pol = [0,anz_rg*anz_az,2*anz_rg*anz_az] for i=delta,anz_rg-delta-1 do begin for j=delta,anz_az-delta-1 do begin pos = i+j*anz_rg k3 = arr[pos+sbox] meanc = (conj(k3) ## transpose(k3))/smm/smm mean2 = (abs(meanc[0])+abs(meanc[4])+abs(meanc[8])) z = total((total(abs(k3),2)-sqrt(mean2))^2)/zfak z = ((z+mean2)/sfak)-mean2 > 0 fak = z/(mean2*sig2+z) k3 = arr[pos+pol] cov = adj(k3) ## k3 out[i,j,*,*] = meanc + (cov - meanc)*fak endfor endfor return,out end