Matlab Template Matching Using FFT
I am struggling with template matching in the Fourier domain in Matlab. Here are my images (the artist is RamalamaCreatures on DeviantArt): My aim is to place a bounding box around the ear of the possum, like this example (where I performed template matching using normxcorr2): Here is the Matlab code I am using: clear all; close all; template = rgb2gray(imread('possum_ear.jpg')); background = rgb2gray(imread('possum.jpg')); %% calculate padding bx = size(background, 2); by = size(background, 1); tx = size(template, 2); % used for bbox placement ty = size(template, 1); %% fft c = real(ifft2