Back to Adaptive Vision Studio website

You are here: Start » Filter Reference » Image Analysis » CompareGoldenTemplate_Edges

CompareGoldenTemplate_Edges


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

Name Type Range Description
inImage Image Input image
inGoldenImage Image Reference image containing no defects
inRoi Region* Range of pixels to be processed
inStaticModel Bool Flag indicating whether the model should be created only in the first iteration
inStdDevX Real 0.0 - Amount of horizontal smoothing used by the edge filter
inStdDevY Real* 0.0 - Amount of vertical smoothing used by the edge filter (Auto = inStdDevX)
inEdgeThreshold Real 0.0 - Sufficient edge strength; edges of that strength will always be detected
inEdgeHysteresis Real 0.0 - Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges
inMaxDistance Integer 0 - 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 Edges on the input image
outGoldenEdges Region Edges on the golden image
outMatchingEdges Region Golden edges present on the input image

Applications

Finding general object defects by analyzing missing or excessive edges.

Description

This filter compares edges found on two input images and 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 this same edge.

To compare only part of an image use the CropImageToRectangle filter. Golden Template image can be stored in Global Parameter.

More information about this technique can be found in Machine Vision Guide: Golden Template.

Hints

  • A golden template comparison filter should be preceded with filters finding the object and cropping it to an image where the location and the size of the object are fixed. Most typically we do this with LocateSingleObject_Edges and CropImageToRectangle filters.
  • Connect the inImage input with the image containing the object at fixed location and size. Make sure that this image is available (the program was previously run).
  • Select an image with a perfect object and copy it to the inGoldenImage input (usually we copy it from the output of the CropImageToRectangle filter). It is recommended to use a global parameter here.
  • Set inEdgeThreshold, inEdgeHysteresis, inStdDevX and inStdDevY as in DetectEdges_AsRegion filter. These will control detection of the edges used for object comparison.
  • Set inMaxDistance to specify the maximum spatial deviation between the edges on the input image and the edges on the template.
  • Set inStaticModel to False only if the value on the inGoldenImage input changes over time.

Remarks

Input inStaticModel allows to compute comparison model in the first iteration of the filter execution. This option may speedup computation in time-critical appliances.

Complexity Level

This filter is available on Basic Complexity Level.

Filter Group

This filters is member of CompareGoldenTemplate filter group.

See Also