Back to Adaptive Vision Library website
You are here: Start » Function Reference » Path Global Transforms » SegmentPath
SegmentPath
Splits a path into parts that can be approximated as segments or arcs.
Syntax
C++
C#
void avl::SegmentPath ( const avl::Path& inPath, float inSmoothingStdDev, float inMaxDeviation, avl::PathSegmentationMode::Type inSegmentationMode, atl::Optional<float> inMaxArcRadius, atl::Array<avl::Path>& outStraight, atl::Array<avl::Path>& outArciform, atl::Array<avl::Segment2D>& outSegments, atl::Array<avl::Arc2D>& outArcs )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inPath | const Path& | Path to be segmented | |||
inSmoothingStdDev | float | 0.0 - | Standard deviation used for initial gaussian smoothing of the segmented path | ||
inMaxDeviation | float | 0.0 - | 0.5f | Maximal distance between any point of a classified segment to the abstract shape | |
inSegmentationMode | PathSegmentationMode::Type | Whether to use arcs for segmentation | |||
inMaxArcRadius | Optional<float> | 0.0 - | 10.0f | Maximal radius of an arc fitted to segment | |
outStraight | Array<Path>& | Parts classified as straight segments | |||
outArciform | Array<Path>& | Parts classified as arciform segments | |||
outSegments | Array<Segment2D>& | Segments corresponding to sections of path from outStraight | |||
outArcs | Array<Arc2D>& | Arcs corresponding to sections of path from outArciform |
Description
The operation segments the inPath into parts of preferably simple shape. Each of the resulting parts is classified as one of the following:
- Straight section - in which case it is returned in outStraight output array
- Arciform section - in which case it is returned in outArciform output array
The operation guarantees that the maximal distance from any of the resulting path section to the corresponding abstract shape (line segment or circular arc) is less than inMaxDeviation.
Examples
Errors
Error type | Description |
---|---|
DomainError | Empty input path in SegmentPath |