You are here: Start » Function Reference » Computer Vision » Image Analysis » CreateGoldenTemplate_Edges

CreateGoldenTemplate_Edges
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Creates golden template for application in CompareGoldenTemplate_Edges filter.
Syntax
void fil::CreateGoldenTemplate_Edges ( const fil::Image& inTemplateImage, ftl::Optional<const fil::Rectangle2D&> inTemplateArea, ftl::Optional<const fil::Region&> inMask, ftl::Optional<const fil::CoordinateSystem2D&> inTemplateAreaAlignment, float inStdDevX, ftl::Optional<float> inStdDevY, float inEdgeThreshold, float inEdgeHysteresis, fil::EdgeGoldenTemplate& outGoldenTemplate, fil::Image& diagCroppedImage, fil::Region& diagCroppedEdges, fil::Region& diagEdges )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inTemplateImage | const Image& | Template image containing an object with no defects | ||
![]() |
inTemplateArea | Optional<const Rectangle2D&> | NIL | Desired area to compare | |
![]() |
inMask | Optional<const Region&> | NIL | Range of pixels to compare | |
![]() |
inTemplateAreaAlignment | Optional<const CoordinateSystem2D&> | NIL | Alignment of template bounded by inTemplateArea | |
![]() |
inStdDevX | float | 0.0 - ![]() |
2.0f | Amount of horizontal smoothing used by the edge filter |
![]() |
inStdDevY | Optional<float> | 0.0 - ![]() |
NIL | Amount of vertical smoothing used by the edge filter (Auto = inStdDevX) |
![]() |
inEdgeThreshold | float | 0.0 - ![]() |
35.0f | Sufficient edge strength; edges of that strength will always be detected on the template image |
![]() |
inEdgeHysteresis | float | 0.0 - ![]() |
15.0f | Value by which the edge threshold is decreased for edge points neighboring with sufficiently strong edges |
![]() |
outGoldenTemplate | EdgeGoldenTemplate& | The output golden template structure | ||
![]() |
diagCroppedImage | Image& | Cropped image to be analyzed | ||
![]() |
diagCroppedEdges | Region& | Edges found on the cropped image | ||
![]() |
diagEdges | Region& | Edges projected onto the input image |
Description
This filter creates a template structure that can be later used in CompareGoldenTemplate_Edges filter.
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.
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 in certain location. Most typically we do this with LocateSingleObject_Edges1 filter.
- Connect the inTemplateImage input with the image containing the perfect object.
- Set inEdgeThreshold, inEdgeHysteresis, inStdDevX and inStdDevY as in DetectEdges_AsRegion filter. These will control detection of the edges used for object comparison.
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
- CompareGoldenTemplate_Edges – Compares image edges with the edges of a perfect template. Significant differences are considered defects.
- CreateGoldenTemplate_Intensity – Creates golden template for application in CompareGoldenTemplate_Intensity filter.