Back to Aurora Vision Library website

You are here: Start » Function Reference » Computer Vision » Shape Fitting 3D » FitSegmentToEdges3D_Direct

FitSegmentToEdges3D_Direct


Header: AVL.h
Namespace: avl
Module: Vision3DStandard

Performs a series of 1D edge detections in 3D and finds a segment that best matches the detected points.

Applications: Precise detection of a straight edge, whose rough location is known beforehand.

Syntax

C++
C#
 
void avl::FitSegmentToEdges3D_Direct
(
	const avl::Surface& inSurface,
	const avl::SegmentFittingField& inFittingField,
	atl::Optional<const avl::CoordinateSystem2D&> inFittingFieldAlignment,
	int inScanCount,
	atl::Optional<float> inSamplingStep,
	int inScanWidth,
	const avl::InterpolationMethod::Type inSurfaceInterpolation,
	const avl::EdgeScanParams3D& inEdgeScanParams,
	avl::Selection::Type inEdgeSelection,
	atl::Optional<const avl::LocalBlindness&> inLocalBlindness,
	atl::Optional<int> inMaxProfileGapWidth,
	float inMaxIncompleteness,
	atl::Optional<avl::MEstimator::Type> inOutlierSuppression,
	atl::Conditional<avl::Segment3D>& outSegment,
	atl::Optional<atl::Array<atl::Conditional<avl::SurfaceEdge1D>>&> outEdges = atl::NIL,
	atl::Optional<atl::Conditional<avl::Profile>&> outDeviationProfile = atl::NIL,
	atl::Optional<avl::SegmentFittingField&> outAlignedFittingField = atl::NIL,
	atl::Optional<atl::Array<avl::Point3D>&> outInliers = atl::NIL,
	atl::Optional<atl::Array<avl::Profile>&> outHeightProfiles = atl::NIL,
	atl::Optional<atl::Array<avl::Profile>&> outResponseProfiles = atl::NIL,
	atl::Array<avl::Segment2D>& diagScanSegments,
	atl::Array<avl::Rectangle2D>& diagSamplingAreas
)

Parameters

Name Type Range Default Description
Input value inSurface const Surface& Surface to fit segment to
Input value inFittingField const SegmentFittingField& Segment fitting field
Input value inFittingFieldAlignment Optional<const CoordinateSystem2D&> NIL Adjusts the fitting field to the position of the inspected object
Input value inScanCount int 3 - 10 The number of points that will be searched to estimate the position of the segment
Input value inSamplingStep Optional<float> 0.0 - NIL Desired distance between consecutive sampling points on the scan segments; if Nil, the bigger of surface X and Y scales is chosen
Input value inScanWidth int 1 - 5 The width of each scan field (in pixels)
Input value inSurfaceInterpolation const InterpolationMethod::Type Bilinear Interpolation method used for extraction of surface points
Input value inEdgeScanParams const EdgeScanParams3D& EdgeScanParams3D ( ProfileInterpolation: Quadratic4 SmoothingStdDev: 1.0f MinMagnitude: 5.0f EdgeTransition: LowToHigh ) Parameters controlling the edge extraction process
Input value inEdgeSelection Selection::Type Selection mode of edges
Input value inLocalBlindness Optional<const LocalBlindness&> NIL Defines conditions in which weaker edges can be detected in the vicinity of stronger edges
Input value inMaxProfileGapWidth Optional<int> 0 - 1 Maximal number of consecutive not existing profile points
Input value inMaxIncompleteness float 0.0 - 0.999 0.1f Maximal fraction of edge points not found
Input value inOutlierSuppression Optional<MEstimator::Type> NIL Selects a method for ignoring incorrectly detected points
Output value outSegment Conditional<Segment3D>& Fitted segment or nothing if the fitting fails
Output value outEdges Optional<Array<Conditional<SurfaceEdge1D>>&> NIL Found edges
Output value outDeviationProfile Optional<Conditional<Profile>&> NIL Profile of distances between the actual segment points and the corresponding reference segment points
Output value outAlignedFittingField Optional<SegmentFittingField&> NIL Fitting field used; in the image coordinate system
Output value outInliers Optional<Array<Point3D>&> NIL Points matching the fitting segment
Output value outHeightProfiles Optional<Array<Profile>&> NIL Extracted surface height profiles
Output value outResponseProfiles Optional<Array<Profile>&> NIL Profiles of the edge (derivative) operator response
Diagnostic input diagScanSegments Array<Segment2D>& Segments along which the scans were run
Diagnostic input diagSamplingAreas Array<Rectangle2D>& Areas from which the input image is sampled

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outEdges, outDeviationProfile, outAlignedFittingField, outInliers, outHeightProfiles, outResponseProfiles.

Read more about Optional Outputs.

Hardware Acceleration

This operation supports automatic parallelization for multicore and multiprocessor systems.

Errors

List of possible exceptions:

Error type Description
DomainError Sampling step set to zero in FitSegmentToEdges3D.