# Objeckt tracking - filter training (MOSSE)

For a project I'd like to set up an easy to implement tracker. I read several papers and chose to go for the mosse (minimum output of squared error) tracker from Bolme et al.

The formula to obtain the mosse filter is (equation 5 in the paper):


H* = sum(Gi x Fi*)/(sum(Fi x Fi*) +e)



Where Gi is the fourier transform of the desired output, a 2D gaussian shaped peak centered on the target in the training image.
Fi is the fourier transform of the training image.
x denotes elementwise multiplication.
the asterisk indicates that it is the conjugate of the fourier transform.
e = 0.1, is a regularisation parameter that induces noise for enhanced noise tolerance.

To generate training images I took the first frame and applied small affine transformations to it.

But somewhere I made a mistake. Since my filter looks nothing like the one in the paper.

mine looks like this.
on the left the input image and on the right the obtained filter.

I even checked if the transformation to the training images and the desire output are faulty. However, they look fine to me.

Unfortunately I have no background in signal processing or linear algebra. So I would be really grateful if you could help me.

Below I added the Matlab code for my failed filter.


% get variables to store the numerator and denominator
sum_numerator = zeros(size(filter));
sum_denominator = zeros(size(filter));

for a = 1:numberOfTrainingImages
Fi = fft2(image);
Gi = fft2(desiredOutput);

% sum_numerator is the correlation between input and desired output
sum_numerator = sum_numerator+ ( Gi .* conj(Fi));

% sum_denominator is the energy spectrum of the input
sum_denominator = sum_denominator + ( Fi .* conj(Fi));

% Generate a training image and a according desired output
[image, desiredOutput] = generateTrainingImage (OriginalImage);
end

% elementwise division to get the filter
H = sum_numerator ./ sum_denominator;


The solution to the problem was, to rearrange the quadrants of the filter. After rearranging the quadrants, my filter looks like this:

A lot more like the one in the paper. However, it still lacks in tracking precission. To tweak this I played arround with the 2D gaussian. And obtained the filter below. Still not optimal but it's an improvement.

This is the formula for the 2D gaussian $$g_{i}(x,y) = e^{-\frac{(x-x_{i})^2+(y-y_{i})^2}{\sigma ^{2}}}$$

In the paper I mentioned in the question, Bolme et al. used $\sigma = 2$. Instead of this I obtained $\sigma$ now dependent on the size of my template

$$\sigma = \sqrt{{imgSize_{x} \cdot {imgSize_{y}}}} \cdot \frac{1}{16}$$

like used by Galoogahi et al. (2015). Correlation Filters with Limited Boundaries

• Although it has been some time, can I please ask you to accept this answer? That would close the question and stop it from circulating on the board. – A_A Jun 30 '18 at 9:35