2
$\begingroup$

I want to search for a patch in a region of image, and I will use the normalized sum of squared differences.

I know that the sum of the squared differences is:

$SSD = \sum {\left(F - I\right)^2}$

Where: $F$: is the reference patch and $I$ is the patch from the image to match with $F$

My question is: what does it means normalized? is it the same as normalized correlation?

$\endgroup$
  • $\begingroup$ What's $F$, what's $I$? $\endgroup$ – Marcus Müller Aug 6 '17 at 10:03
  • $\begingroup$ $F$ is the reference patch, and the $I$ is the patch from the image to match with $F$ $\endgroup$ – Slh47 Aug 6 '17 at 10:09
  • $\begingroup$ ah well; edit your question to include that info. $\endgroup$ – Marcus Müller Aug 6 '17 at 10:35
0
$\begingroup$

In an attempt to solve the question on why to normalize, and implicitly how to normalize:

$F$ is your reference patch, $I$ is the patch under inspection.

So make $I$ only consist of the maximum possible value in your image format. Then, your $SSD$ becomes very large, although $I$ isn't "similar" to $F$ at all.

Now, for comparison, set $I=F$. In theory, this should give a large (if making any sense at all, the largest) $SSD$ possible, right?

So, obviously, your $SSD$ formula as is isn't useful at all for comparing things, because an $I$ with a high average amplitude will just come out as a "winner", always. So, you need to get the energy of the $I$ out of your formula first. That's easy: Just divide $I$ by the sum of the squares of all its values.

$\endgroup$
  • $\begingroup$ Thanks a lot, must I do the same thing to $F$ (dividing by the sum of squares)? $\endgroup$ – Slh47 Aug 6 '17 at 13:04
  • $\begingroup$ That can be easily solved by you actually writing down what happens when you do (hint: sum is a linear operation)! So, I'm going to leave that up to you, as it depends on what you do with things after you compared patches. $\endgroup$ – Marcus Müller Aug 6 '17 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.