FitPathToEdges_Direct
Performs a series of 1D edge detections and creates a path from the detected points.
Applications:Tracing of an object contour, whose rough location and shape is known beforehand.
Syntax
C++
C#
Python
def FitPathToEdges_Direct( inImage: Image, inFittingField: PathFittingField, /, *, inFittingFieldAlignment: CoordinateSystem2D | None = None, inScanStep: float | None = 5.0, inScanWidth: int = 5, inSamplingParams: SamplingParams = SamplingParams(InterpolationMethod.Bilinear, 1.0, None), inEdgeScanParams: EdgeScanParams = EdgeScanParams(ProfileInterpolationMethod.Quadratic4, 0.6, 5.0, EdgeTransition.BrightToDark), inEdgeSelection: Selection = Selection.Best, inLocalBlindness: LocalBlindness | None = None, inMaxInterpolationLength: int | None = 1, inMaxDeviationDelta: float | None = None, inMaxIncompleteness: float = 0.1, outAlignedFittingField: PathFittingField | None = None ) -> ( outPath: Path | None, outEdges: list[Edge1D | None], outDeviationProfile: Profile | None, outBrightnessProfiles: list[Profile], outResponseProfiles: list[Profile], diagScanSegments: list[Segment2D], diagSamplingAreas: list[Rectangle2D] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Image to fit the path to | ||
![]() |
inFittingField | PathFittingField | Path fitting field | ||
![]() |
inFittingFieldAlignment | CoordinateSystem2D | None | None | Adjusts the fitting field to the position of the inspected object | |
![]() |
inScanStep | float | None | 0.0 - ![]() |
5.0 | Optional implicit conversion of the input path to an equidistant one |
![]() |
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, 0.6, 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 | |
![]() |
inMaxInterpolationLength | int | None | 0 - ![]() |
1 | Maximal number of consecutive points not found |
![]() |
inMaxDeviationDelta | float | None | 0.0 - ![]() |
None | Maximal difference between deviations of consecutive path points |
![]() |
inMaxIncompleteness | float | 0.0 - 0.999 | 0.1 | Maximal fraction of edge points not found |
![]() |
outPath | Path | None | Fitted path or nothing if the fitting failed | ||
![]() |
outEdges | list[Edge1D | None] | Found edges | ||
![]() |
outDeviationProfile | Profile | None | Profile of distances between the actual path points and the corresponding reference path points | ||
![]() |
outAlignedFittingField | PathFittingField | None | None | Fitting field used; in the image coordinate system | |
![]() |
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.




