Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Image Combinators » DifferenceImage_Shifted

DifferenceImage_Shifted


Computes the non-negative distances between corresponding pixel values.

Name Type Description
inImage1 Image First input image
inImage2 Image Second input image
inBox1 Box
inBox2 Box
outImage Image Output image

Applications

Useful for things like comparing an image against a template or for detecting differences between consecutive video frames.

Description

The operation computes the absolute difference between image pixels inside the input boxes. Each outImage pixel is equal to the absolute value of difference between corresponding pixels of the input images:

\[\forall_{i,j} \text{OutImage}_{i,j} = |\text{InImage1}_{i + box1.x,j + box1.y} - \text{InImage2}_{i + box2.x,j + box2.y}|\]

In multichannel (color) images each pixel channel is processed separately.

The operation requires that the images being processed have equal format and the input boxes have equal dimensions, otherwise an error with appropriate description occurs. To alter the pixel type of an image one can use ConvertPixelType filter. ConvertToMultichannel and AverageChannels filters allow to alter the number of image channels.

Examples

DifferenceImage_Shifted performed on the sample images.

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: UINT8, SINT8, UINT16, SINT16, REAL.

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

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError Image formats are not the same in DifferenceImage_Shifted.
DomainError Input boxes are not completely inside the input images in DifferenceImage_Shifted.
DomainError Not equal box dimensions in DifferenceImage_Shifted.

Complexity Level

This filter is available on Basic Complexity Level.

See Also

  • DifferenceImage – Computes the non-negative distances between corresponding pixel values.
  • DifferenceImage_Flex – Computes the non-negative distances between corresponding pixel values using tiles.
  • SubtractImages – Subtracts two images pixel by pixel. The result is signed.