Back to Aurora Vision Library website

You are here: Start » Function Reference » Image » Image Metrics » ImageDifferenceImage

ImageDifferenceImage


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes an image of differences between a moving pattern and the input image.

Syntax

C++
C#
 
void avl::ImageDifferenceImage
(
	const avl::Image& inImage,
	const avl::Image& inPatternImage,
	atl::Optional<const avl::Region&> inRoi,
	atl::Optional<const avl::Region&> inPatternRoi,
	avl::DistanceMeasure::Type inDistanceMeasure,
	avl::Image& outImage
)

Parameters

Name Type Default Description
Input value inImage const Image& Input image
Input value inPatternImage const Image& Pattern to be compared with input image
Input value inRoi Optional<const Region&> NIL Range of pixels to be processed
Input value inPatternRoi Optional<const Region&> NIL Range of pixels in the pattern to be processed
Input value inDistanceMeasure DistanceMeasure::Type Measure of distance
Output value outImage Image& Output image

Description

The operation computes the difference between inImage and inPatternImage. The inPatternImage is aligned at each location of the inImage and the similarity between the inPatternImage and the corresponding part of the inImage is estimated using the inDifferenceMeasure as in ImageDifference filter. The result is stored in the pixel of the outImage that corresponds to the location at which the center of inPatternImage was aligned to the inImage.

Examples

A sample inImage.

A sample inPatternImage.

The resulting outImage.

The locations in the inImage corresponding to the darkest points of the outImage.

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: UINT8 (for inDistanceMeasure = MeanError).

This operation is optimized for SSE3 technology for pixels of types: UINT16 (for inDistanceMeasure = MeanError), UINT8 (for inDistanceMeasure = MeanSquaredError), REAL.

This operation is optimized for SSE4 technology for pixels of types: INT16, UINT16 (for inDistanceMeasure = MeanSquaredError).

This operation is optimized for AVX2 technology for pixels of types: UINT8, INT16, UINT16, REAL.

This operation is optimized for NEON technology for pixels of types: UINT8, UINT16 (for inDistanceMeasure = MeanError), INT16 (for inDistanceMeasure = MeanError), REAL.

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

List of possible exceptions:

Error type Description
DomainError Not supported distance measure in ImageDifferenceImage.

See Also

  • LocateMultipleObjects_SAD – Finds multiple occurrences of a predefined template on an image by analysing the Square Average Difference between pixel values.