# Cross Correlation

Let us assume that **x ***= (x _{1}, x_{2},..., x_{d}*)

^{T}e R

^{d}, and let us assume that

*f (*

**x***)*and g(x) are real functions, R

^{d}! R. Cross correlation between the two functions,

*f (*

**x***)*and g(x), is used for measuring the similarity of their waveforms and is defined as

The cross correlation is linear because it satisfies Eqs. (2.2) and (2.3). Comparing with Eq. (2.4), it should be noted that the sign of *Si* in the arguments of *f ()* on the right side is different, obtaining *f (***x***) ** g(x) = *f (***x***) ? g'(***x***)* if g'(x) = *g*(—x).

Let an image be denoted by *I(x _{1}*,

*x*(1 <

_{2}, x_{3})*x*1,2,3) and let a filter be denoted by

_{i}< W_{i}, i =*G(x*where

_{1}, x_{2}, x_{3}),*G()*is a real function: Z

^{3}! R. Assuming that the value of the filter

*G(x*is equal to zero when

_{1}, x_{2}, x_{3})

**x***= (x*is outside of a bounded region, V={(x

_{1}, x_{2}, x_{3})_{1},

*x*|

_{2}, x_{3})^{T}*— V*1,2,3}. Then, the cross correlation of

_{s}< x_{s}< V_{s}, s =*I*() and

*G()*is defined as follows:

Let R* denote a local region around x* = (x*, x*, *x*) ^{T}* in the image domain where

*x* — V*1,2,3), and let the part of the image in R* be denoted by a

_{s}< x_{s}< x_{s}+ V_{s}(s =*V*x

_{1}*V*x

_{2}*V*-vector,

_{3}

**I****,*which is obtained by concatenating the voxel values,

*I(*

**x***),*where

**x***e R*.*Let

*G(*

**x***)*be denoted by a

*V*V

_{1}x V_{2}x_{3}-vector,

**G***,*which are obtained by concatenating the voxel values,

*G(*

**x***),*where

*—V*(

_{s}< x_{s}< V_{s }*s*=

*1, 2, 3*). Then the value of the cross correlation between

*I(*

**x***)*and

*G(*

**x***)*is nothing but the inner product between I* and

*G*

**:**

A normalized cross correlation, C_{norm}(x*), between I* and *G* is widely employed for matching a template *G* to the given image * I* and is typically defined as

where I* and *G* are the averages of I* and G, respectively, and *a**_{I}* and

*a*

*are the standard deviations of them, respectively. When the template and the local appearance are more similar, the larger value of the normalized cross correlation is obtained. It should be noted that the value of C*

_{G}_{norm}is invariant against a linear change of the brightness of the image:

**I***(x*

**)***—*

**aI***(x)*

*where*

**,***>0.*

**a**