function q = dummy(a,b) % motion from fft2 2-D version % fast conv; see how much image is shifted over % motion_estimation by fft methods: cross spectrum, CROSS SPECTRUM % % Example use: q=motion_fft2(a,b) % % See also est_trans_fft2 % (e.g. you probably want to use est_trans_fft2 and not this) A = fft2(a); B = fft2(b); %%%%B = fft2(rev(b)); % conj doesnt work quite right in 2D % the phase shift seems to have effect??? % but this should not be a problem % conj is like reversal in time domain % Q = conj(B).*A./sqrt(A.*conj(A).*B.*conj(B)); Q = conj(B).*A./(abs(A).*abs(B)); q = ifft2(Q); % q should be real (e.g. imag part should be nearly 0) %dispmatb(log(real(q+max2(q)/1000000))) % display as log image