WOLFRAM

ImageCorrelate[image,ker]

gives the correlation of image with kernel ker.

ImageCorrelate[image,ker,f]

computes a generalized correlation in which the function f is used in place of Dot.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Blur an image by correlating it with a Gaussian matrix:

Out[1]=1

Find occurrences of a template in an image:

Out[1]=1

Scope  (5)Survey of the scope of standard use cases

Data  (3)

Correlate a binary image with a disk-shaped kernel:

Out[18]=18

Correlate a grayscale image:

Out[1]=1

Correlate a 3D image:

Out[1]=1

Parameters  (2)

Use a Laplacian kernel:

Out[6]=6

Use a template:

Out[5]=5

The default correlation operator f is Dot:

Out[1]=1

Use a different correlation operator:

Out[2]=2

Generalizations & Extensions  (2)Generalized and extended use cases

Nonrectangular templates are better matched when used with a mask:

The correlation obtained using a mask is more robust to background changes:

Out[5]=5

Result of the template matching without using the mask:

Out[6]=6

Match rotated occurrences of a template by matching the template rotated using a range of angles:

Visualize the best matches:

Out[3]=3

Result of the template matching without taking into account multiple orientations:

Out[4]=4

Options  (3)Common values & functionality for each option

Padding  (3)

By default, a "Fixed" padding is used:

Out[2]=2

Specify a custom padding:

Out[1]=1

Padding->None normally returns an image smaller than the input image:

Out[1]=1

Applications  (2)Sample problems that can be solved with this function

Isolate regions of interest in an image:

Out[22]=22

A basic face detector that uses the normalized correlation with an image of a pair of eyes:

Out[3]=3

Properties & Relations  (1)Properties of the function, and connections to other functions

ImageCorrelate gives an image of a real type:

Out[3]=3
Out[5]=5
Wolfram Research (2008), ImageCorrelate, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCorrelate.html (updated 2012).
Wolfram Research (2008), ImageCorrelate, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCorrelate.html (updated 2012).

Text

Wolfram Research (2008), ImageCorrelate, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCorrelate.html (updated 2012).

Wolfram Research (2008), ImageCorrelate, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCorrelate.html (updated 2012).

CMS

Wolfram Language. 2008. "ImageCorrelate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageCorrelate.html.

Wolfram Language. 2008. "ImageCorrelate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageCorrelate.html.

APA

Wolfram Language. (2008). ImageCorrelate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCorrelate.html

Wolfram Language. (2008). ImageCorrelate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCorrelate.html

BibTeX

@misc{reference.wolfram_2025_imagecorrelate, author="Wolfram Research", title="{ImageCorrelate}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCorrelate.html}", note=[Accessed: 07-June-2025 ]}

@misc{reference.wolfram_2025_imagecorrelate, author="Wolfram Research", title="{ImageCorrelate}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCorrelate.html}", note=[Accessed: 07-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_imagecorrelate, organization={Wolfram Research}, title={ImageCorrelate}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageCorrelate.html}, note=[Accessed: 07-June-2025 ]}

@online{reference.wolfram_2025_imagecorrelate, organization={Wolfram Research}, title={ImageCorrelate}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageCorrelate.html}, note=[Accessed: 07-June-2025 ]}