;------------------------------------------------------------------ ; KOAMP : Amplituden-Koregistrierung ; (C)23.9.97 by Andreas Reigber ;------------------------------------------------------------------ ; Amplitude Koregistration using FFTs. Precision 1 Pixel ; ; Usage: ; res = koamp(s1,s2) ; s1, s2 : Two amplitude images (floating point) ; res[0] : x offset between the images ; res[1] : y offset between the images ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ ; function koamp,s1,s2 sizx = (size(s1))[1] sizy = (size(s1))[2] aux=max(abs(fft(fft(abs(s1),-1)*conj(fft(abs(s2),-1)),1)),pos) xoff = pos mod sizx yoff = pos / sizx if xoff gt sizx / 2 then xoff = xoff - sizx if yoff gt sizy / 2 then yoff = yoff - sizy return,[xoff,yoff] end