You are here: Start » FIL.NET » Function Reference » Computer Vision » Image Analysis » FIL.CompareGoldenTemplate_Edges
Compares image edges with the edges of a perfect template. Significant differences are considered defects.
Namespace: | FilNet |
---|---|
Assembly: | FIL.NET.dll |
Syntax
public static void CompareGoldenTemplate_Edges ( FilNet.Image inImage, FilNet.EdgeGoldenTemplate inGoldenTemplate, FilNet.CoordinateSystem2D inGoldenTemplateAlignment, float inStdDevX, float inEdgeThreshold, float inEdgeHysteresis, int inMaxDistance, FilNet.Region outDefects, out bool outDefectsPresent, FilNet.Region outMissingEdges, FilNet.Region outExcessiveEdges )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() | inImage | FilNet.Image | Input image. | ||
![]() | inGoldenTemplate | FilNet.EdgeGoldenTemplate | Golden edge template containing image with no defects. | ||
![]() | inGoldenTemplateAlignment | FilNet.CoordinateSystem2D | Adjusts the golden template to the position of the inspected object. | ||
![]() | inStdDevX | float | <0.0f, INF> | 2.0f | Amount of horizontal smoothing used by the edge filter. Default value: 2.0f. |
![]() | inEdgeThreshold | float | <0.0f, INF> | 35.0f | Sufficient edge strength; edges of that strength will always be detected on the input image. Default value: 35.0f. |
![]() | inEdgeHysteresis | float | <0.0f, INF> | 15.0f | Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges. Default value: 15.0f. |
![]() | inMaxDistance | int | <0, INF> | 3 | Maximal allowed distance between corresponding edges on the input and golden image. Default value: 3. |
![]() | outDefects | FilNet.Region | Region of detected defects. | ||
![]() | outDefectsPresent | bool | Flag indicating whether any defects were detected. | ||
![]() | outMissingEdges | FilNet.Region | Edges present on the golden image that are missing on the input image. | ||
![]() | outExcessiveEdges | FilNet.Region | Edges that are not present on the golden image. |
Description
This filter compares edges given input image with an image stored in a golden template and then, as a result, creates a region containing only pixels where edges are different.
This method is especially useful for finding defects of the object shape. Due to invulnerability to color changes, it may be used in appliances with changing light conditions.
Parameter inMaxDistance defines the maximal distances of two edges that should be treated as the same edge.
To prepare image and area to be compared in it you can use CreateGoldenTemplate_Edges filter or property window.
Mostly the inEdgeThreshold and inEdgeHysteresis parameters should have the same value as in CreateGoldenTemplate_Edges filter. The values should be changed however if the brightness of the input image is significantly different from the brightness of the golden image used in CreateGoldenTemplate_Edges. The inEdgeThreshold can be also decreased slightly if one wants to concentrate on missing edges or increased to concentrate on excessive edges.
More information about this technique can be found in Machine Vision Guide: Golden Template.
Remarks
Due to performance, it is recommended to create a template using the CreateGoldenTemplate_Edges filter outside a main loop of a program. It will create a model only once, instead of each iteration.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | No valid golden template on input in CompareGoldenTemplate_Edges. |
Function Overrides
- CompareGoldenTemplate_Edges(Image, EdgeGoldenTemplate, CoordinateSystem2D, Single, Nullable<Single>, Single, Single, Int32, Region, Boolean, Region, Region)
- CompareGoldenTemplate_Edges(Image, EdgeGoldenTemplate, CoordinateSystem2D, Single, Nullable<Single>, Single, Single, Int32, Region, Boolean, Region, Region, Region, Region, Region, Rectangle2D)
- CompareGoldenTemplate_Edges(Image, EdgeGoldenTemplate, CoordinateSystem2D, Single, Nullable<Single>, Single, Single, Int32, Region, Boolean, Region, Region, NullableRef<Region>, NullableRef<Region>, NullableRef<Region>, NullableValue<Rectangle2D>)