AdjustPathArraysToEdges
Translates, rotates and scales multiple contour sets (PathArray), each separately, to the edges of the input image with subpixel precision.
Applications:Fine-tune results of edge-based template matching.
Syntax
C++
C#
Python
def AdjustPathArraysToEdges( inImage: Image, inPaths: list[ list[Path] ], /, *, inPointSpacing: float | None = None, inAlignments: list[CoordinateSystem2D] | None = None, inAttractionRadius: float = 2.0, inAdjustmentMetric: AdjustmentMetric = AdjustmentMetric.SegmentDistance, inAdjustTranslation: bool = True, inAdjustRotation: bool = True, inAdjustScale: bool = False, inIterationCount: int = 6, inBaseGradient: float = 1.0 ) -> ( outAdjustedPaths: list[ list[Path] ], outAlignments: list[CoordinateSystem2D], diagAttractionVectors: list[ list[Segment2D] ] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image. | ||
![]() |
inPaths | list[ list[Path] ] | Paths to be adjusted. For sparse, synthetic paths the inPointSpacing needs to be specified. | ||
![]() |
inPointSpacing | float | None | 1.0 - ![]() |
None | If set, sampling points of the input path will be equidistant with specified spacing. Useful for increasing density of synthetic, sparse paths. |
![]() |
inAlignments | list[CoordinateSystem2D] | None | None | Alignments to be corrected, usually connect to outObjects.Alignment[] of LocateObjects:Multiple filter. | |
![]() |
inAttractionRadius | float | 0.1 - ![]() |
2.0 | Expected initial distance between inPaths and edges of the input image. |
![]() |
inAdjustmentMetric | AdjustmentMetric | AdjustmentMetric.SegmentDistance | Metric used for path attraction. The SegmentDistance minimizes distances along path normal vectors, and thus adjustment is more accurate. PointDistance_* minimize euclidean distance, adjustment tends to be more stable. | |
![]() |
inAdjustTranslation | bool | True | Compute the translation part of adjustment transform. Must be true when using AttractPathTangents estimation method. | |
![]() |
inAdjustRotation | bool | True | Compute the rotation part of adjustment transform. | |
![]() |
inAdjustScale | bool | False | Compute the scale part of adjustment transform. | |
![]() |
inIterationCount | int | 0 - 100 | 6 | Number of iterations of internal adjustment algorithm. |
![]() |
inBaseGradient | float | 0.1 - ![]() |
1.0 | Threshold for suppression of weak input image gradients. Increase for very noisy images. |
![]() |
outAdjustedPaths | list[ list[Path] ] | Adjusted output paths. | ||
![]() |
outAlignments | list[CoordinateSystem2D] | Corrected alignments - inAlignments input modified with estimated adjustment parameters. | ||
![]() |
diagAttractionVectors | list[ list[Segment2D] ] | Attraction vectors from first iteration. |
Hardware Acceleration
This operation is optimized for SSSE3 technology for pixels of type: UINT8.
This operation is optimized for AVX2 technology for pixels of type: UINT8.
This operation is optimized for NEON technology for pixels of type: UINT8.
This operation supports automatic parallelization for multicore and multiprocessor systems.




