Back to FabImage Library website

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

FitCircleToStripe3D_Direct


Header: FIL.h
Namespace: fil
Module: Vision3DStandard

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

Applications: Precise detection of a circular object or hole, whose rough location is known beforehand.

Syntax

C++
C#
 
void fil::FitCircleToStripe3D_Direct
(
	const fil::Surface& inSurface,
	const fil::CircleFittingField& inFittingField,
	ftl::Optional<const fil::CoordinateSystem2D&> inFittingFieldAlignment,
	int inScanCount,
	ftl::Optional<float> inSamplingStep,
	int inScanWidth,
	const fil::InterpolationMethod::Type inSurfaceInterpolation,
	const fil::StripeScanParams3D& inStripeScanParams,
	fil::Selection::Type inStripeSelection,
	ftl::Optional<const fil::LocalBlindness&> inLocalBlindness,
	ftl::Optional<int> inMaxProfileGapWidth,
	float inMaxIncompleteness,
	fil::CircleFittingMethod::Type inFittingMethod,
	ftl::Optional<fil::MEstimator::Type> inOutlierSuppression,
	ftl::Conditional<fil::Circle3D>& outCircle,
	ftl::Conditional<fil::Circle3D>& outInnerCircle,
	ftl::Conditional<fil::Circle3D>& outOuterCircle,
	ftl::Optional<ftl::Array<ftl::Conditional<fil::SurfaceStripe1D>>&> outStripes = ftl::NIL,
	ftl::Optional<ftl::Array<fil::Point3D>&> outStripePoints = ftl::NIL,
	ftl::Optional<ftl::Conditional<fil::Profile>&> outDeviationProfile = ftl::NIL,
	ftl::Optional<fil::CircleFittingField&> outAlignedFittingField = ftl::NIL,
	ftl::Optional<ftl::Array<fil::Profile>&> outHeightProfiles = ftl::NIL,
	ftl::Optional<ftl::Array<fil::Profile>&> outResponseProfiles = ftl::NIL,
	ftl::Array<fil::Segment2D>& diagScanSegments,
	ftl::Array<fil::Rectangle2D>& diagSamplingAreas
)

Parameters

Name Type Range Default Description
Input value inSurface const Surface& Surface to fit the circle to
Input value inFittingField const CircleFittingField& Circle 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 circle
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 inStripeScanParams const StripeScanParams3D& StripeScanParams3D ( ProfileInterpolation: Quadratic4 SmoothingStdDev: 1.0f MinMagnitude: 5.0f MaxInnerEdgeMagnitude: Nil MinStripeWidth: 0.0f MaxStripeWidth: Nil StripePolarity: High ) Parameters controlling the stripe extraction process
Input value inStripeSelection Selection::Type Selection mode of stripe
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 stripe points not found
Input value inFittingMethod CircleFittingMethod::Type AlgebraicTaubin Method used to fit a circle
Input value inOutlierSuppression Optional<MEstimator::Type> NIL Selects a method for ignoring incorrectly detected points
Output value outCircle Conditional<Circle3D>& Fitted circle in the middle of found stripe or nothing if the fitting fails
Output value outInnerCircle Conditional<Circle3D>& Fitted inner circle
Output value outOuterCircle Conditional<Circle3D>& Fitted outer circle
Output value outStripes Optional<Array<Conditional<SurfaceStripe1D>>&> NIL Found stripes
Output value outStripePoints Optional<Array<Point3D>&> NIL Extracted points of middle circle of a surface stripe
Output value outDeviationProfile Optional<Conditional<Profile>&> NIL Profile of distances between the actual circle points and the corresponding reference circle points
Output value outAlignedFittingField Optional<CircleFittingField&> NIL Fitting field used; in the image coordinate system
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 ftl::NIL to these parameters: outStripes, outStripePoints, outDeviationProfile, outAlignedFittingField, 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 FitCircleToStripe3D.