Skip to content

TemplateMatching

TemplateModel - Deserialize

De-serialize a TemplateModel buffer.

IN

Name Type Description
InBuffer Buffer Buffer containing the object.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateModel Model_NCC Deserialized object.
Error ErrorState Gets the execution error message

TemplateModel - IsEmpty

Checks if the model contains valid data.

IN

Name Type Description
InTemplateModel Model_NCC The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutBool Bool False if the model contains valid data, true otherwise.
Error ErrorState Gets the execution error message

TemplateModel - Serialize

Serialize TemplateModel object using flatbuffers.

IN

Name Type Description
InTemplateModel Model_NCC The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutByteBuffer Buffer Buffer where the object is stored.
Error ErrorState Gets the execution error message

TemplateMatching - CreateModel_NCC

Creates a template model for NCC-based template matching. Note: Uses the Normalized Cross Correlation-based image alignment algorithm.

IN

Name Type Description
InImage Image Image from which model will be extracted.
InModelParams ModelParams_NCC Parameters of the model.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateModel Model_NCC Created model that can be used in findObjects.
Error ErrorState Gets the execution error message

TemplateMatching - FindObjects_NCC

Finds all occurrences of a predefined template on an image using a model based on NCC.

IN

Name Type Description
InImage Image Image on which object occurrences will be searched.
InTemplateModel Model_NCC Model of objects to be searched.
InSearchParams SearchParams_NCC Parameters that defines how to search for the objects and how many ones to keep.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateObject TemplateObjectArray Found objects.
Error ErrorState Gets the execution error message

SearchParams - CreateSearchParams_CreateFromValues

Creates a new SearchParams object.

IN

Name Type Description
InMinScore Float Minimum score of object candidates accepted at the top level. Range: 〔0, 1〕.
InMinDistance Float Minimum distance between the centers of two found object frames. Range: 〔0, +inf).
InMaxOverlap Float Maximum overlap allowed between two found objects (considered only when minDistance is 0.0f). Range: 〔0, 1〕.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutSearchParams SearchParams_NCC The SearchParams instance.
Error ErrorState Gets the execution error message

TemplateModel - Deserialize

De-serialize a TemplateModel buffer.

IN

Name Type Description
InBuffer Buffer Buffer containing the object.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateModel Model_Edge Deserialized object.
Error ErrorState Gets the execution error message

TemplateModel - GetEdges

Returns the edges found when creating the template model.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutPoint2D Point2DArray Found edges.
Error ErrorState Gets the execution error message

TemplateModel - GetImage

Returns the image from which the model is created.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutImage Image Image.
Error ErrorState Gets the execution error message

TemplateModel - GetMaxPyramidLevel

Returns the maximum pyramid level considered when computing the model in which edges could still be found.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt Int Maximum pyramid level.
Error ErrorState Gets the execution error message

TemplateModel - GetMinPyramidLevel

Returns the minimum pyramid level considered when computing the model.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutInt Int Minimum pyramid level.
Error ErrorState Gets the execution error message

TemplateModel - GetObjectFrame

Returns the object frame specified by the user when creating the model or, if not set, the bounding rect on the found edges.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutRectangle2D Rectangle2D Object frame considered in findObjects.
Error ErrorState Gets the execution error message

TemplateModel - IsEmpty

Checks if the model contains valid data.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutBool Bool False if the model contains valid data, true otherwise.
Error ErrorState Gets the execution error message

TemplateModel - Serialize

Serialize TemplateModel object using flatbuffers.

IN

Name Type Description
InTemplateModel Model_Edge The input TemplateModel
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutByteBuffer Buffer Buffer where the object is stored.
Error ErrorState Gets the execution error message

TemplateMatching - CreateModel_Edge

Creates a template model for edge-based template matching.

IN

Name Type Description
InImage Image Image from which model will be extracted. Only UInt8 images are supported. If the image is RGB, it is first converted using Image::convertToGrayscale.
InModelParams ModelParams_Edge Parameters of the model.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateModel Model_EdgeNull Created model that can be used in findObjects.
Error ErrorState Gets the execution error message

TemplateMatching - FindObjects_Edge

Finds all occurrences of a predefined template on an image by comparing object edges.

IN

Name Type Description
InImage Image Image on which object occurrences will be searched. Only UInt8 images are supported. If the image is RGB, it is first converted using Image::convertToGrayscale.
InTemplateModel Model_Edge Model of objects to be searched.
InSearchParams SearchParams_Edge Parameters that defines how to search for the objects and how many ones to keep.
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutTemplateObject TemplateObjectArray Found objects.
Error ErrorState Gets the execution error message

SearchParams - CreateSearchParams_CreateFromValues

Creates a new SearchParams object using the provided values.

IN

Name Type Description
InGradientThreshold Float Minimum gradient value used. Range: 〔0.01, +inf).
InEdgePolarity Enum < EdgePolarity > How edges with reversed polarity will contribute to the object score.
InMinScore Float Minimum score of object candidates accepted at the top level. Range: 〔0, 1〕.
InMinDistance Float Minimum distance between the centers of two found object frames. Range: 〔0, +inf).
InMaxOverlap Float Maximum overlap allowed between two found objects (considered only when minDistance is 0.0f). Range: 〔0, 1〕.
InGreediness Float Minimum ratio between the score at the upper levels and the one at level 0 (used to detect whether the upper levels have to be examined). Range: 〔0, 1〕.
InMaxDeformation Int Maximum deformation allowed. Range: 〔0, +inf).
Name String Set the tool's name
Enable Bool Sets if current tool is enabled or not

OUT

Name Type Description
OutSearchParams SearchParams_Edge The SearchParams instance.
Error ErrorState Gets the execution error message