;------------------------------------------------------------------ ; kosub.pro : Amplituden-Koregistrierung ; 12.1.98 by Andreas Reigber ;------------------------------------------------------------------ ; Coregistration with subpixel precision based on coherence ; optimization, for complex interferometric SAR data. ; Attention: Course coregistration required before!!! ; ; Usage: ; res = kosub(s1,s2) ; s1,s2 : Two small patches of complex SAR images ; res[0] : Measured offset in X ; res[1] : Measured offset in X ; res[2] : Quality parameter (bigger is better) ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ function kosub,sbild1,sbild2 koh = fltarr(17,17) fbild = fft(sbild2,-1) freq = shift((findgen(64)-32),32) zero_a = fltarr(64)+1 fbild2 = complexarr(64,64) for i=0,16 do begin phase_ran = (i-8)/10.0*2*!pi/64 for j=0,16 do begin phase_azi = (j-8)/10.0*2*!pi/64 shift_matrix = ((phase_ran*freq)#zero_a)+(zero_a#(phase_azi*freq)) fbild2 = fft(fbild*exp(complex(0,shift_matrix)),1) koh[i,j] = total(abs( smooth(sbild1*conj(fbild2),5))) endfor endfor aux=max(koh,auxpos) posx=(auxpos mod 17) posy=(auxpos / 17) xpos=(posx-8.0)/10.0 ypos=(posy-8.0)/10.0 kpos=aux/64/64 return,[xpos,ypos,kpos] end