Image Processing Reference
In-Depth Information
(
I
-
I
)(
T
-
T
)
xiy j
+, +
ij
,
xy
,
(,)
xy
W
max =
e
(5.14)
2
(
I
-
I
)
xiy+j
+,
ij
,
(,)
xy
W
wher e I i , is the mean of the pixels I x + i , y + j for points within the window (i.e. ( x , y ) ∈ W )
and T is the mean of the pixels of the template. An alternative form to Equation 5.14 is
given by normalising the cross-correlation. This does not change the position of the optimum
and gives an interpretation as the normalisation of the cross-correlation vector. That is, the
cross-correlation is divided by its modulus. Thus,
(
I
-
I
)(
T
-
T
)
xiy j
+, +
ij
,
xy
,
(,)
xy
W
max =
e
(5.15)
2
2
(
I
-
I
) (
T
-
T
)
xiy+j
+,
ij
,
xy
,
(,)
xy
W
However, this equation has a similar computational complexity to the original formulation
in Equation 5.7.
A particular implementation of template matching is when the image and the template
are binary. In this case, the binary image can represent regions in the image or it can
contain the edges. These two cases are illustrated in the example in Figure 5.3. The
advantage of using binary images is that the amount of computation can be reduced . That
is, each term in Equation 5.7 will take only two values: it will be one when I x + i , y + j = T x , y ,
and zero otherwise. Thus, Equation 5.7 can be implemented as
Σ
max =
e
I
T
(5.16)
xiy j
+, +
xy
,
(,)
xy
W
(a) Binary image
(b) Edge image
(c) Binary template
(d) Edge template
Figure 5.3
Example of binary and edge template matching
Search WWH ::




Custom Search