You are here: Start » AVL.NET » Function Reference » Computer Vision » Image Analysis » AVL.CompareGoldenTemplate_Edges

AVL.CompareGoldenTemplate_Edges

Compares image edges with the edges of a perfect template. Significant differences are considered defects.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void CompareGoldenTemplate_Edges
(
	AvlNet.Image inImage,
	AvlNet.EdgeGoldenTemplate inGoldenTemplate,
	AvlNet.CoordinateSystem2D inGoldenTemplateAlignment,
	float inStdDevX,
	float inEdgeThreshold,
	float inEdgeHysteresis,
	int inMaxDistance,
	AvlNet.Region outDefects,
	out bool outDefectsPresent,
	AvlNet.Region outMissingEdges,
	AvlNet.Region outExcessiveEdges
)

Parameters

Name Type Range Default Description
inImageAvlNet.ImageInput image.
inGoldenTemplateAvlNet.EdgeGoldenTemplateGolden edge template containing image with no defects.
inGoldenTemplateAlignmentAvlNet.CoordinateSystem2DAdjusts the golden template to the position of the inspected object.
inStdDevXfloat<0.0f, INF>2.0fAmount of horizontal smoothing used by the edge filter. Default value: 2.0f.
inEdgeThresholdfloat<0.0f, INF>35.0fSufficient edge strength; edges of that strength will always be detected on the input image. Default value: 35.0f.
inEdgeHysteresisfloat<0.0f, INF>15.0fValue by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges. Default value: 15.0f.
inMaxDistanceint<0, INF>3Maximal allowed distance between corresponding edges on the input and golden image. Default value: 3.
outDefectsAvlNet.RegionRegion of detected defects.
outDefectsPresentboolFlag indicating whether any defects were detected.
outMissingEdgesAvlNet.RegionEdges present on the golden image that are missing on the input image.
outExcessiveEdgesAvlNet.RegionEdges 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

See also