% template.matching.m
% Matching in the template using correlation
% Dr. W.David Pan for EE 604, UAH

I = imread('Fig1209(a)(Hurricane Andrew).tif');
w = imread('Fig1209(b)(eye template).tif');
[M,N] = size(I);
f = fft2(I);
w_dft = conj(fft2(w, M, N));
g = real(ifft2(w_dft.*f));
imagesc(g);
colorbar;
[I, J] = find(g == max(g(:)))

