Image Processing Reference
In-Depth Information
the match using the squared error criterion, then you will be choosing the maximum
likelihood solution. This implies that the result achieved by template matching is optimal
for images corrupted by Gaussian noise. A more detailed examination of the method of
least squares is given in Appendix 2, Section 9.2. (Note that the central limit theorem
suggests that practically experienced noise can be assumed to be Gaussian distributed,
though many images appear to contradict this assumption.) Of course you can use other
error criteria such as the absolute difference rather than the squared difference or, if you
feel more adventurous, then you might consider robust measures such as M-estimators.
We can derive alternative forms of the squared error criterion by considering that Equation
5.7 can be written as
Σ W
min =
e
(
I
2
- 2
I
T
+
T
2
)
(5.8)
xiy j
+, +
x iy j
+, +
xy
,
xy
(,)
xy
The last term does not depend on the template position ( i , j ). As such, it is constant and
cannot be minimised. Thus, the optimum in this equation can be obtained by minimising
2
min =
e
I
- 2
I
T
(5.9)
xiy j
+, +
xy
,
xiy j
+, +
(,)
xy
W
(,)
xy
W
If the first term
Σ
(,)
2
I
(5.10)
xiy j
+, +
xy
W
is approximately constant, then the remaining term gives a measure of the similarity
between the image and the template. That is, we can maximise the cross-correlation
between the template and the image. Thus, the best position can be computed by
Σ W
max =
e
I
T
(5.11)
xiy j
+, +
xy
,
(,)
xy
However, the squared term in Equation 5.10 can vary with position, so the match defined
by Equation 5.11 can be poor. Additionally, the range of the cross-correlation function is
dependent on the size of the template and it is non-invariant to changes in image lighting
conditions. Thus, in an implementation it is more convenient to use either Equation 5.7 or
Equation 5.9 (in spite of being computationally more demanding than the cross-correlation
in Equation 5.11). Alternatively, the cross-correlation can be normalised as follows. We
can rewrite Equation 5.8 as
I
T
xiy j
+, +
xy
,
(,)
xy
W
(5.12)
min = 1 - 2
e
I
2
xiy+j
+,
(,)
xy
W
Here the first term is constant and thus the optimum value can be obtained by
I
T
xiy j
+, +
xy
,
(,)
xy
W
max =
e
(5.13)
2
I
xiy+j
+,
(,)
xy
W
In general, it is convenient to normalise the grey level of each image window under the
template. That is,
Search WWH ::




Custom Search