Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Profile Metrics »
ProfileDistance
Computes the [mean] square error between two profiles.
Syntax
C++
C#
void avl::ProfileDistance
(
const avl::Profile& inProfile1,
const avl::Profile& inProfile2,
avl::DistanceMeasure::Type inDistanceMeasure,
float& outDistance
)
void ProfileDistance
(
Profile inProfile1,
Profile inProfile2,
DistanceMeasure inDistanceMeasure,
out float outDistance
)
Parameters
|
Name |
Type |
Default |
Description |
|
inProfile1 |
const Profile& |
|
First input profile |
|
inProfile2 |
const Profile& |
|
Second input profile |
|
inDistanceMeasure |
DistanceMeasure::Type |
|
Measure of distance |
|
outDistance |
float& |
|
Output distance value |
Description
The operation computes the approximate difference between two profiles using the selected distance measure.
- If the inDistanceMeasure is set to MeanError then the resulting outDistance is the average difference between corresponding values of the profiles.
- If the inDistanceMeasure is set to MeanSquaredError then the resulting outDistance is the average squared difference between corresponding values of the profiles.
The operation requires that the profiles being compared have equal sizes, otherwise an error with appropriate description occurs.
Examples
Mean Squared Error between the sample profiles equals 25245.070.
Mean Error between the sample profiles equals 0.803.
Errors
Error type |
Description |
DomainError |
Sizes of input profiles differ in ProfileDistance. |
DomainError |
Input profiles have different X coordinates in ProfileDistance. |
DomainError |
Empty profiles on input in ProfileDistance. |
DomainError |
DistanceMeasure type not supported in ProfileDistance. |