You are here: Start » FIL.NET » FIL.ImageDifference
Measures dissimilarity between two images.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void ImageDifference ( FilNet.Image inImage, FilNet.Image inPatternImage, FilNet.DistanceMeasure inDistanceMeasure, out float outDifference )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inPatternImage | FilNet.Image | Pattern to be compared with input image. | ||
![]() | inDistanceMeasure | FilNet.DistanceMeasure | Measure of distance. | ||
![]() | outDifference | float | Value of difference between pattern and image. |
Description
The operation computes the approximate difference between two images using the selected distance measure.
- If the inDistanceMeasure is set to MeanError then the resulting outDifference is the average difference between corresponding pixel values of the images.
- If the inDistanceMeasure is set to MeanSquaredError then the resulting outDifference is the average squared difference between corresponding pixel values of the images.
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
![]() |
![]() |
Mean error between the sample images equals 16.034.
![]() |
![]() |
Mean squared error between the sample images equals 2754.164.
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 supports automatic parallelization for multicore and multiprocessor systems.
Hardware acceleration settings may be manipulated with Settings class.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Not supported distance measure in ImageDifference. |