|Download Help (Windows Only)|
This section provides additional information you may need for building successful searching applications.
The following is the basic concept of correlation: Consider a subimage w(x, y) of size K × L within an image f(x, y) of size M × N, where K ≤ M and L ≤ M. The correlation between w(x, y) and f(x, y) at a point (i, j) is given by
|C(i,j) =||L – 1
x = 0
|K – 1
y = 0
|w(x, y)f(x + i, y + j)|
|where||i = 0, 1, . . . M – 1,
i = 0, 1, . . . N – 1, and the summation is taken over the region in the image where w and f overlap.
The following figure illustrates the correlation procedure. Assume that the origin of the image f is at the top left corner. Correlation is the process of moving the template or subimage w around the image area and computing the value C in that area. This involves multiplying each pixel in the template by the image pixel that it overlaps and then summing the results over all the pixels of the template. The maximum value of C indicates the position where w best matches f. Correlation values are not accurate at the borders of the image.
Basic correlation is very sensitive to amplitude changes in the image, such as intensity, and in the template. For example, if the intensity of the image f is doubled, so are the values of c. You can overcome sensitivity by computing the normalized correlation coefficient, which is defined as
R(i, j) =
where w (calculated only once) is the average intensity value of the pixels in the template w. The variable f is the average value of f in the region coincident with the current location of w. The value of R lies in the range –1 to 1 and is independent of scale changes in the intensity values of f and w.