|
wilson :
From what I can tell, they are doing a cross correlation of the two
images where Target is much bigger than Template. It also appears
that they are expecting some spurious fluctuation in the illumination
of the Target image (say the scene is shadowed by a variable cloud
pattern. So to compensate for that they are subtracting the mean of
the moving window. This is done inside the loop so that it will adapt
for different means in different areas of the image. The template is
a "perfect" image or so small that there are not expected to be any
illumination fluctuations over it. But because they subtracted the
mean (which is the "DC" component) from the Target, they also did it
with the Template just to be consistent.
You should put a comment in the comment section of that submission
saying that they need to improve it by giving a good overall
description of what the thing does plus give better line-by-line
comments, and more descriptive variable names (image22 and Nimage -
those are pathetic).
And, like Matt Fig says, asking the author should always be the first
thing you should try. They know their code better than anyone here.
|