FitCircleToEdges_Direct
Performs a series of 1D edge detections 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#
Python
def FitCircleToEdges_Direct( inImage: Image, inFittingField: CircleFittingField, /, *, inFittingFieldAlignment: CoordinateSystem2D | None = None, inScanCount: int = 10, inScanWidth: int = 5, inSamplingParams: SamplingParams = SamplingParams(InterpolationMethod.Bilinear, 1.0, None), inEdgeScanParams: EdgeScanParams = EdgeScanParams(ProfileInterpolationMethod.Quadratic4, 1.0, 5.0, EdgeTransition.BrightToDark), inEdgeSelection: Selection = Selection.Best, inLocalBlindness: LocalBlindness | None = None, inMaxIncompleteness: float = 0.1, inFittingMethod: CircleFittingMethod = CircleFittingMethod.AlgebraicTaubin, inOutlierSuppression: MEstimator | None = None, outAlignedFittingField: CircleFittingField | None = None ) -> ( outCircle: Circle2D | None, outEdges: list[Edge1D | None], outDeviationProfile: Profile | None, outInliers: list[Point2D], outBrightnessProfiles: list[Profile], outResponseProfiles: list[Profile], diagScanSegments: list[Segment2D], diagSamplingAreas: list[Rectangle2D] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Image to fit the circle to | ||
![]() |
inFittingField | CircleFittingField | Circle fitting field | ||
![]() |
inFittingFieldAlignment | CoordinateSystem2D | None | None | Adjusts the fitting field to the position of the inspected object | |
![]() |
inScanCount | int | 3 - ![]() |
10 | The number of points that will be searched to estimate the position of the circle |
![]() |
inScanWidth | int | 1 - ![]() |
5 | The width of each scan field (in pixels) |
![]() |
inSamplingParams | SamplingParams | SamplingParams(InterpolationMethod.Bilinear, 1.0, None) | Parameters controlling the sampling process | |
![]() |
inEdgeScanParams | EdgeScanParams | EdgeScanParams(ProfileInterpolationMethod.Quadratic4, 1.0, 5.0, EdgeTransition.BrightToDark) | Parameters controlling the edge extraction process | |
![]() |
inEdgeSelection | Selection | Selection.Best | Selection mode of edges | |
![]() |
inLocalBlindness | LocalBlindness | None | None | Defines conditions in which weaker edges can be detected in the vicinity of stronger edges | |
![]() |
inMaxIncompleteness | float | 0.0 - 0.999 | 0.1 | Maximal fraction of edge points not found |
![]() |
inFittingMethod | CircleFittingMethod | CircleFittingMethod.AlgebraicTaubin | Method used to fit a circle | |
![]() |
inOutlierSuppression | MEstimator | None | None | Selects a method for ignoring incorrectly detected points | |
![]() |
outCircle | Circle2D | None | Fitted circle or nothing if the fitting fails | ||
![]() |
outEdges | list[Edge1D | None] | Found edges | ||
![]() |
outDeviationProfile | Profile | None | Profile of distances between the actual circle points and the corresponding reference circle points | ||
![]() |
outAlignedFittingField | CircleFittingField | None | None | Fitting field used; in the image coordinate system | |
![]() |
outInliers | list[Point2D] | Points matching the fitting Circle | ||
![]() |
outBrightnessProfiles | list[Profile] | Extracted image profiles | ||
![]() |
outResponseProfiles | list[Profile] | Profiles of the edge (derivative) operator response | ||
![]() |
diagScanSegments | list[Segment2D] | Segments along which the scans were run | ||
![]() |
diagSamplingAreas | list[Rectangle2D] | Areas from which the input image is sampled |
Hardware Acceleration
This operation supports automatic parallelization for multicore and multiprocessor systems.




