FitSegmentToStripe3D_Direct
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#
Python
def FitSegmentToStripe3D_Direct( inSurface: Surface, inFittingField: SegmentFittingField, /, *, inFittingFieldAlignment: CoordinateSystem2D | None = None, inScanCount: int = 10, inSamplingStep: float | None = None, inScanWidth: int = 5, inSurfaceInterpolation: InterpolationMethod = InterpolationMethod.Bilinear, inStripeScanParams: StripeScanParams3D = StripeScanParams3D(ProfileInterpolationMethod.Quadratic4, 1.0, 5.0, None, SurfaceStripePolarity.High, 0.0, None), inStripeSelection: Selection = Selection.Best, inLocalBlindness: LocalBlindness | None = None, inMaxProfileGapWidth: int | None = 1, inMaxIncompleteness: float = 0.1, inOutlierSuppression: MEstimator | None = None, outAlignedFittingField: SegmentFittingField | None = None ) -> ( outSegment: Segment3D | None, outLeftSegment: Segment3D | None, outRightSegment: Segment3D | None, outStripes: list[SurfaceStripe1D | None], outStripePoints: list[Point3D], outDeviationProfile: Profile | None, outHeightProfiles: list[Profile], outResponseProfiles: list[Profile], diagScanSegments: list[Segment2D], diagSamplingAreas: list[Rectangle2D] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inSurface | Surface | Surface to fit segment to | ||
![]() |
inFittingField | SegmentFittingField | Segment 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 segment |
![]() |
inSamplingStep | float | None | 0.0 - ![]() |
None | Desired distance between consecutive sampling points on the scan segments; if Nil, the bigger of surface X and Y scales is chosen |
![]() |
inScanWidth | int | 1 - ![]() |
5 | The width of each scan field (in pixels) |
![]() |
inSurfaceInterpolation | InterpolationMethod | InterpolationMethod.Bilinear | Interpolation method used for extraction of surface points | |
![]() |
inStripeScanParams | StripeScanParams3D | StripeScanParams3D(ProfileInterpolationMethod.Quadratic4, 1.0, 5.0, None, SurfaceStripePolarity.High, 0.0, None) | Parameters controlling the stripe extraction process | |
![]() |
inStripeSelection | Selection | Selection.Best | Selection mode of stripe | |
![]() |
inLocalBlindness | LocalBlindness | None | None | Defines conditions in which weaker edges can be detected in the vicinity of stronger edges | |
![]() |
inMaxProfileGapWidth | int | None | 0 - ![]() |
1 | Maximal number of consecutive not existing profile points |
![]() |
inMaxIncompleteness | float | 0.0 - 0.999 | 0.1 | Maximal fraction of stripe points not found |
![]() |
inOutlierSuppression | MEstimator | None | None | Selects a method for ignoring incorrectly detected points | |
![]() |
outSegment | Segment3D | None | Fitted segment or nothing if the fitting fails | ||
![]() |
outLeftSegment | Segment3D | None | Fitted left segment | ||
![]() |
outRightSegment | Segment3D | None | Fitted right segment | ||
![]() |
outStripes | list[SurfaceStripe1D | None] | Found stripes | ||
![]() |
outStripePoints | list[Point3D] | Extracted points of middle segment of a surface stripe | ||
![]() |
outDeviationProfile | Profile | None | Profile of distances between the actual segment points and the corresponding reference segment points | ||
![]() |
outAlignedFittingField | SegmentFittingField | None | None | Fitting field used; in the image coordinate system | |
![]() |
outHeightProfiles | list[Profile] | Extracted surface height 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.




