Image Processing Toolbox    
normxcorr2

Normalized two-dimensional cross-correlation

Syntax

Description

C = normxcorr2(TEMPLATE,A) computes the normalized cross-correlation of the matrices TEMPLATE and A. The matrix A must be larger than the matrix TEMPLATE for the normalization to be meaningful. The values of TEMPLATE cannot all be the same. The resulting matrix, C, contains the correlation coefficients, which may range in value from -1.0 to 1.0.

Class Support

The input matrices can be of class uint8, uint16, or double.

Algorithm

normxcorr2 uses the following general procedure:

  1. Calculate cross-correlation in the spatial or the frequency domain, depending on size of images.
  2. Calculate local sums by precomputing running sums. [1]
  3. Use local sums to normalize the cross-correlation to get correlation coefficients. [2]

Example

See Also

corrcoef

References

[1]  J. P. Lewis, "Fast Normalized Cross-Correlation", Industrial Light & Magic. <http://www.idiom.com/~zilla/Papers/nvisionInterface/nip.html>

[2]  Robert M. Haralick and Linda G. Shapiro, Computer and Robot Vision, Volume II, Addison-Wesley, 1992, pp. 316-317.


  nlfilter ntsc2rgb