Back to Aurora Vision Studio website

You are here: Start » Filter Reference » Image » Image Metrics » ColorDistance

ColorDistance


Module: FoundationPro

Compares two pixels using chromatic and non-chromatic information. Assumes RGB color space.

Applications

Color comparison insensitive to changes of illumination.
Name Type Range Description
Input value inPixelA Pixel
Input value inPixelB Pixel
Input value inChromaAmount Real 0.0 - 1.0 Proportion of chromatic information in distance computation
Output value outDistance Real

Description

The operation computes the distance between two pixels.

The distance between pixels is computed using two measures:

  • Value distance - the difference between average channel values
  • Chromatic distance - euclidean distance between pixels normalized to the same value level

The resulting distance is computed as a weighted average of these two values, parameter inChromaAmount ( 0.0 - 1.0 ) being the weight of the chromatic distance, and 1 - inChromaAmount being the weight of the value distance.

Examples

Description of usage of this filter can be found in examples and tutorial: HMI Handling Events.

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
RuntimeError Each pixel component must be nonnegative in ColorDistance.

Complexity Level

This filter is available on Advanced Complexity Level.

Filter Group

This filter is member of ColorDistance filter group.

See Also

  • ColorDistanceImage – Compares each pixel with the specified color using chromatic and non-chromatic information.