CompareGoldenTemplate_Edges
Compares image edges with the edges of a perfect template. Significant differences are considered defects.
Applications:Finding general object defects by analyzing missing or excessive edges.
Syntax
C++
C#
Python
def CompareGoldenTemplate_Edges( inImage: Image, inGoldenTemplate: EdgeGoldenTemplate, inGoldenTemplateAlignment: CoordinateSystem2D, outDefects: Region, outMissingEdges: Region, outExcessiveEdges: Region, /, *, inStdDevX: float = 2.0, inStdDevY: float | None = None, inEdgeThreshold: float = 35.0, inEdgeHysteresis: float = 15.0, inMaxDistance: int = 3, outImageEdges: Region | None = None, outGoldenEdges: Region | None = None, outMatchingEdges: Region | None = None, outObjectPosition: Rectangle2D | None = None ) -> outDefectsPresent: bool
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inImage | Image | Input image | ||
![]() |
inGoldenTemplate | EdgeGoldenTemplate | Golden edge template containing image with no defects | ||
![]() |
inGoldenTemplateAlignment | CoordinateSystem2D | Adjusts the golden template to the position of the inspected object | ||
![]() |
inStdDevX | float | 0.0 - ![]() |
2.0 | Amount of horizontal smoothing used by the edge filter |
![]() |
inStdDevY | float | None | 0.0 - ![]() |
None | Amount of vertical smoothing used by the edge filter (Auto = inStdDevX) |
![]() |
inEdgeThreshold | float | 0.0 - ![]() |
35.0 | Sufficient edge strength; edges of that strength will always be detected on the input image |
![]() |
inEdgeHysteresis | float | 0.0 - ![]() |
15.0 | Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges |
![]() |
inMaxDistance | int | 0 - ![]() |
3 | Maximal allowed distance between corresponding edges on the input and golden image |
![]() |
outDefects | Region | Region of detected defects | ||
![]() |
outDefectsPresent | bool | Flag indicating whether any defects were detected | ||
![]() |
outMissingEdges | Region | Edges present on the golden image that are missing on the input image | ||
![]() |
outExcessiveEdges | Region | Edges that are not present on the golden image | ||
![]() |
outImageEdges | Region | None | None | Edges on the input image | |
![]() |
outGoldenEdges | Region | None | None | Edges on the golden image | |
![]() |
outMatchingEdges | Region | None | None | Golden edges present on the input image | |
![]() |
outObjectPosition | Rectangle2D | None | None | Position of the object being compared |



