Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Path Metrics »
PathToPathDistanceProfile
PathToPathDistanceProfile
Computes the profile of distances between two paths.
Syntax
C++
C#
void avl::PathToPathDistanceProfile
(
const avl::Path& inPath1,
const avl::Path& inPath2,
avl::PathDistanceMode::Type inPathDistanceMode,
float inResolution,
avl::Profile& outDistanceProfile,
atl::Optional<atl::Array<float>&> outDistances = atl::NIL,
atl::Optional<atl::Array<avl::Segment2D>&> outConnectingSegments = atl::NIL
)
void PathToPathDistanceProfile
(
Path inPath1,
Path inPath2,
PathDistanceMode inPathDistanceMode,
float inResolution,
out Profile outDistanceProfile,
out float[] outDistances,
out Segment2D[] outConnectingSegments
)
Parameters
|
Name |
Type |
Range |
Default |
Description |
|
inPath1 |
const Path& |
|
|
First input path |
|
inPath2 |
const Path& |
|
|
Second input path |
|
inPathDistanceMode |
PathDistanceMode::Type |
|
|
Distance measuring method |
|
inResolution |
float |
0.0 - |
1.0f |
|
|
outDistanceProfile |
Profile& |
|
|
Profile of distances between second path and consecutive points of first path |
|
outDistances |
Optional<Array<float>&> |
|
NIL |
Distances between second path and consecutive points of first path |
|
outConnectingSegments |
Optional<Array<Segment2D>&> |
|
NIL |
Segments connecting second path and consecutive points of first path having minimal length |
Description
The operation iterates over characteristic points of inPath1 and at each point computes the distance from this point to inPath2.
The distance is computed as follows, depending on the value of inPathDistanceMode:
- The distance to nearest characteristic point of inPath2, if inPathDistanceMode is set to PointToPoint.
- The minimal distance to inPath2 segments adjacent to the nearest characteristic point of inPath2 (which is much more precise), if inPathDistanceMode is set to PointToSegment.
The operation computes outDistanceProfile profile of consecutive distances and, additionally, outConnectingSegments array of corresponding line segments.
Examples
Sample paths |
|
|
The resulting outConnectingSegments drawn onto the input paths. |
The resulting outDistanceProfile. |
Errors
Error type |
Description |
DomainError |
Second input path is empty and first input path is not empty in PathToPathDistanceProfile. |
See Also