You are here: Start » AVL.NET » AVL.CreateGoldenTemplate_Intensity Method

AVL.CreateGoldenTemplate_Intensity Method

Creates golden template for application in CompareGoldenTemplate_Intensity filter.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

public static void CreateGoldenTemplate_Intensity(
	AvlNet.Image inTemplateImage,
	AvlNet.Rectangle2D? inTemplateArea,
	AvlNet.Region inMask,
	AvlNet.CoordinateSystem2D? inTemplateAreaAlignment,
	float inEdgeThreshold,
	int inEdgeDilation,
	out AvlNet.GrayGoldenTemplate outGoldenTemplate,
	out AvlNet.Image diagCroppedImage,
	out AvlNet.Region diagCroppedEdgeRegion,
	out AvlNet.Region diagEdgeRegion
)

Parameters

Name Type Range Default Description
inTemplateImageAvlNet.ImageTemplate image containing an object with no defects.
inTemplateAreaAvlNet.Rectangle2D?Desired area to compare. Default value: atl::NIL, or null.
inMaskAvlNet.RegionRange of pixels to compare. Default value: atl::NIL, or null.
inTemplateAreaAlignmentAvlNet.CoordinateSystem2D?Alignment of template bounded by inTemplateArea. Default value: atl::NIL, or null.
inEdgeThresholdfloat<0.0f, INF>10.0fMinimum strength of edges on the golden image near which comparison is NOT performed. Default value: 10.0f.
inEdgeDilationint<0, 1000000>1Defines for how far from the detected edges comparison is NOT performed. Default value: 1.
outGoldenTemplateAvlNet.GrayGoldenTemplateThe output golden template structure.
diagCroppedImageAvlNet.ImageCropped image to be analyzed.
diagCroppedEdgeRegionAvlNet.RegionRegion of pixels that will not be compared.
diagEdgeRegionAvlNet.RegionEdges projected onto the input image.

Description

This filter creates a template structure that can be later used in CompareGoldenTemplate_Intensity filter. This golden template 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.

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 outside a main loop of a program. It will create a model only once, instead of each iteration.

See also