AdjustPathArrayToEdges
Translates, rotates and scales the given contour set to the edges of the input image with subpixel precision.
Applications:Fine-tune results of edge-based template matching.
Syntax
C++
C#
Python
def AdjustPathArrayToEdges( inImage: Image, inPaths: list[Path], /, *, inPointSpacing: float | None = None, inAlignment: 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[Path], outAlignment: CoordinateSystem2D, diagAttractionVectors: list[Segment2D] )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image. | ||
![]() |
inPaths | 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. |
![]() |
inAlignment | CoordinateSystem2D | None | None | Alignment to be corrected, usually connects to outObject.Alignment of LocateObjects 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[Path] | Adjusted output paths. | ||
![]() |
outAlignment | CoordinateSystem2D | Corrected alignment - the inAlignment input modified with estimated adjustment parameters. | ||
![]() |
diagAttractionVectors | 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.




