Back to Aurora Vision Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Fitting » DetectPointSegments

DetectPointSegments


Header: AVL.h
Namespace: avl
Module: FoundationPro

Detect points that lie along multiple segments.

Syntax

C++
C#
 
void avl::DetectPointSegments
(
	const atl::Array<avl::Point2D>& inPoints,
	const float inMaxDistance,
	const int inMaxRank,
	atl::Optional<float> inMaxRelativeDistance,
	const float inMaxTurnAngle,
	const int inMinPointCount,
	atl::Array<avl::Segment2D>& outPointSegments,
	atl::Array<avl::Path>& outPaths
)

Parameters

Name Type Range Default Description
Input value inPoints const Array<Point2D>& Points to connect
Input value inMaxDistance const float 0.0 - 10.0f Maximum distance between connected points
Input value inMaxRank const int 1 - 4 Maximum number of neighbour candidates considered when joining points
Input value inMaxRelativeDistance Optional<float> 1.0 - 2.0f Maximum distance in relation to the shortest distance for a point
Input value inMaxTurnAngle const float 0.0 - 90.0 5.0f Maximum angle between consecutive path segments
Input value inMinPointCount const int 2 - 3 Minimum number of points in one path
Output value outPointSegments Array<Segment2D>& Segments connecting first and last point of each path
Output value outPaths Array<Path>& Paths of connected points

Description

Use this filter to detect multiple segments or paths at the same time.

Set inMaxDistance to smaller value to avoid connecting distant points.
Set inMaxRank to larger value to allow detecting paths that lie close to each other.
Set inMaxTurnAngle to larger value when points do not lie precisely on a segment.
Set inMinPointCount to filter out too short paths (useful when some of the input points are noise).

Filter returns array of paths as well as segments connecting first and last point of each path.

Examples

Results for input parameters: inMaxDistance = 30, inMaxRank = 4, inMaxTurnAngle = 20, inMinPointCount = 4.

The resulting outPointSegments drawn with the input points.

The resulting outPaths drawn with the input points.

See Also

  • FitSegmentToPoints – Approximates points with a segment using selected outliers suppression method.