You are here: Start » AVL.NET » AVL.ImageCorrelation(AvlNet.Image, AvlNet.Image, AvlNet.Region, AvlNet.CorrelationMeasure, float)

AVL.ImageCorrelation(AvlNet.Image, AvlNet.Image, AvlNet.Region, AvlNet.CorrelationMeasure, float)

Computes the correlation of pattern and image.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void ImageCorrelation(
	AvlNet.Image inImage,
	AvlNet.Image inPatternImage,
	AvlNet.Region inRoi,
	AvlNet.CorrelationMeasure inCorrelationMeasure,
	out float outCorrelation
)

Parameters

inImage
Type: AvlNet.Image
Input image
inPatternImage
Type: AvlNet.Image
Pattern to be compared with input image
inRoi
Type: AvlNet.Region
Range of pixels to be processed, or null.
inCorrelationMeasure
Type: AvlNet.CorrelationMeasure
Measure of correlation
outCorrelation
Type: System.Single
Value of correlation of pattern and image

Description

The operation computes the correlation between two images using the selected measure.

  • If the inCorrelationMeasure is set to CrossCorrelation then the resulting outCorrelation is the sum of products of corresponding pixel values of the images.
  • If the inCorrelationMeasure is set to NormalizedCrossCorrelation then the resulting outCorrelation is the normalized sum of products of corresponding pixel values of the images. This value always lies in closed interval \([-1,1]\), with \(1\) indicating the images ideal correlation.

The operation requires that the images being processed have equal format and dimensions, otherwise an error with appropriate description occurs. To obtain an image of desired dimensions one can use ResizeImage or CropImage filter. To alter the format of an image one can use filters contained in ImageConversions category.

Examples

Normalized cross correlation between the sample images equals 0.919.

Normalized cross correlation between the sample images equals 0.798.

Errors

Error type Description
DomainError Not supported correlation measure in ImageCorrelation.

See also