Back to Adaptive Vision Studio website

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

CompareGoldenTemplate_Intensity


Compares an image with a template image considered to have no defects.

Name Type Range Description
inImage Image Input image
inGoldenImage Image Reference image containing no defects
inRoi Region* Range of pixels to be processed
inEdgeThreshold Real 0.0 - Minimum strength of edges on the golden image near which comparison is NOT performed
inEdgeDilation Integer 0 - Defines for how far from the detected edges comparison is NOT performed
inStaticModel Bool Flag indicating whether model should be created only in the first iteration
inMaxDifference Real 0.0 - Maximal allowed difference between corresponding pixels of the input and golden images
inMinDefectRadius Integer 0 - Minimal radius of a defect
outDefects Region Region of detected defects
outDifferenceRegion Region Region of pixels differing too much between the golden image and the input image
outDefectsPresent Bool Flag indicating whether any defects were detected
outRoi Region Region of pixels that were compared

Applications

Finding general object defects by analyzing brightness deviations from a template image.

Description

This filter compares pixels of two input images and as a result creates a region containing only pixels in which intensity difference is higher than inMaxDifference value. This method is especially useful for finding defects like: smudges, noises and dust particles. It can be used for finding missing holes or changes in complex shapes.

Filter finds edges on an image and removes nearby pixels to avoid comparing pixels near edges which may contains some distortions due to shadows or changes in lightning. Input inEdgeDilation defines the width of the quiet zone around the edges and the parameter inEdgeThreshold define how strong must be change of the color between pixels to treat them as an edge.

When the defected pixels are found only consistent regions are selected. Minimal radius of accepted region is set in inMinDefectRadius.

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 to a value that assures detection of all object edges, so that defects appearing near the edges can be ignored. Also set inEdgeDilation to specify the margin around the edges. Verify these two settings with the outRoi output – it should be empty near the edges.
  • Set inMaxDifference to a value that assures detection of all true defects and no false ones. Verify this with the outDefects output.
  • Dismiss very small defects by setting inMinDefectRadius.
  • Set inStaticModel to False only if the value on the inGoldenImage input changes over time.

Examples

Description of usage of this filter can be found in examples and tutorial: Comparing Golden Template.

CompareGoldenTemplate_Intensity performed on sample image. A part of the object is missing – it is marked in blue on the right.

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