You are here: Start » AVL.NET » AVL.HistogramDistance(AvlNet.Histogram, AvlNet.Histogram, AvlNet.DistanceMeasure, float)
AVL.HistogramDistance(AvlNet.Histogram, AvlNet.Histogram, AvlNet.DistanceMeasure, float)
Computes the numeric distance between two histograms.
| Namespace: | AvlNet |
|---|---|
| Assembly: | AVL.NET.dll |
Syntax
public static void HistogramDistance( AvlNet.Histogram inHistogram1, AvlNet.Histogram inHistogram2, AvlNet.DistanceMeasure inDistanceMeasure, out float outDistance )
Parameters
- inHistogram1
- Type: AvlNet.Histogram
First input histogram - inHistogram2
- Type: AvlNet.Histogram
Second input histogram - inDistanceMeasure
- Type: AvlNet.DistanceMeasure
Measure of distance - outDistance
- Type: System.Single
Output distance value
Description
The operation computes the approximate difference between two histograms using the selected distance measure.
- If the inDistanceMeasure is set to MeanError then the resulting outDistance is the average difference between corresponding bins of the histograms.
- If the inDistanceMeasure is set to MeanSquaredError then the resulting outDistance is the average squared difference between corresponding bins of the histograms.
Examples
![]() |
![]() |
Mean Squared Error between the sample histograms equals 68302.590.
![]() |
![]() |
Mean Squared Error between the sample histograms equals 3043686.
Remarks
- inHistogram1 and inHistogram2 must have the same BinSizes, otherwise an error with appropriate description occurs.
Errors
| Error type | Description |
|---|---|
| DomainError | Inconsistent histogram bin sizes / domains in HistogramDistance. |
| DomainError | Empty histograms on input in HistogramDistance. |
| DomainError | Not supported DistanceMeasure in HistogramDistance. |




