eVision .NET API
Loading...
Searching...
No Matches
eVision.EObjectTemplateMatcher Class Reference

The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template. More...

Inheritance diagram for eVision.EObjectTemplateMatcher:
Collaboration diagram for eVision.EObjectTemplateMatcher:

Public Member Functions

 EObjectTemplateMatcher ()
 Creates an EObjectTemplateMatcher object.
 EObjectTemplateMatcher (eVision.EObjectTemplateMatcher other)
 Creates an EObjectTemplateMatcher object.
void Load (string path)
 Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.
void Load (eVision.ESerializer serializer)
 Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.
void Save (string path)
 Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.
void Save (eVision.ESerializer serializer)
 Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.
void BuildTemplate (eVision.EObjectSelection selection, eVision.EFrame frame)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void BuildTemplate (eVision.EObjectSelection selection)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void BuildTemplate (eVision.ECodedImage2 objects, eVision.EFrame frame)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void BuildTemplate (eVision.ECodedImage2 objects)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void BuildTemplate (eVision.EPoint[] positions, eVision.EFrame frame)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void BuildTemplate (eVision.EPoint[] positions)
 Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
void SortSelection (eVision.EObjectSelection selection)
 Align and match the given selection with the reference template.
void SortPositions (eVision.EPoint[] positions)
 Align and match the given position array with the reference template.
bool Match (eVision.EPoint[] positions)
 Align and match the given items with the reference template.
bool Match (eVision.EPoint[] positions, eVision.EFrame frame)
 Align and match the given items with the reference template.
bool Match (eVision.EObjectSelection selection, eVision.EFrame frame)
 Align and match the given items with the reference template.
bool Match (eVision.EObjectSelection selection)
 Align and match the given items with the reference template.
eVision.EObjectSelection GetMatched (eVision.EObjectSelection selection, bool fromSelection)
 Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.
eVision.EObjectSelection GetMatched (eVision.EObjectSelection selection)
 Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.
eVision.EPoint[] GetMatched (eVision.EPoint[] positions, bool fromSelection)
 Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.
eVision.EPoint[] GetMatched (eVision.EPoint[] positions)
 Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.
eVision.EObjectSelection GetExtra (eVision.EObjectSelection selection)
 Returns the objects in the selection that do not appear in the template, in the order in which they appear in the selection. EObjectTemplateMatcher.Match must be called before this method.
eVision.EPoint[] GetExtra (eVision.EPoint[] positions)
 Returns the objects in the selection that do not appear in the template, in the order in which they appear in the selection. EObjectTemplateMatcher.Match must be called before this method.
eVision.EObjectSelection GetMissing (eVision.EObjectSelection templateSelection)
 Returns the template objects that were not matched, in the order in which they appeared in the template. EObjectTemplateMatcher.Match must be called before this method.
eVision.EPoint[] GetMissing (eVision.EPoint[] templatePositions)
 Returns the template objects that were not matched, in the order in which they appeared in the template. EObjectTemplateMatcher.Match must be called before this method.
void GetUnpairedObjects (ref int[] onlyInTemplate, ref int[] onlyInSelection)
 Return lists of object indexes that appear only in template or only in selection.

Properties

bool EnableAlignment [get, set]
 Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). Enable alignment only if the selection is not aligned with the template.
eVision.EObjectTemplateMatcherAlignment Alignment [get, set]
 Sets optional preliminary alignement (rigid transformation only: translation and rotation). Choose to enable alignment only if the selection is not aligned with the template. Three types of alignment are possible. See EObjectTemplateMatcherAlignment. The max rotation of the alignment can be set by EObjectTemplateMatcher.MaximumAngle. By default, no alignment is performed.
float MaximumAngle [get, set]
 When EObjectTemplateMatcher.Alignment is set to EObjectTemplateMatcherAlignment.EObjectTemplateMatcherAlignment_Fast or EObjectTemplateMatcherAlignment.EObjectTemplateMatcherAlignment_Robust, the alignment can be constrained to a given angle range. This is useful to filter out symmetries and makes EObjectTemplateMatcherAlignment.EObjectTemplateMatcherAlignment_Robust faster. Defaults to 180°.
float MaximumDistance [get, set]
 Defines the absolute maximum distance (in pixels) for a match to be valid. That value is used during the closest object search. By default, infinite distance is used.
int[] TemplateIndexes [get]
 For each object in the SELECTION return the paired index in the TEMPLATE. If the object has no match, the value -1 is used.
int[] SelectionIndexes [get]
 For each object in the TEMPLATE return the paired index in the SELECTION. if the object has no match, the value -1 is used.
int NumberOfPairedObjects [get]
 Return the number of paired objects.

Detailed Description

The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template.

License(s): EasyObject

Constructor & Destructor Documentation

◆ EObjectTemplateMatcher() [1/2]

eVision.EObjectTemplateMatcher.EObjectTemplateMatcher ( )

Creates an EObjectTemplateMatcher object.

◆ EObjectTemplateMatcher() [2/2]

eVision.EObjectTemplateMatcher.EObjectTemplateMatcher ( eVision.EObjectTemplateMatcher other)

Creates an EObjectTemplateMatcher object.

Parameters
otherReference to the EObjectTemplateMatcher used for the initialization.

Member Function Documentation

◆ BuildTemplate() [1/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.ECodedImage2 objects)

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
objectsThe coded image to be used as template.

◆ BuildTemplate() [2/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.ECodedImage2 objects,
eVision.EFrame frame )

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
objectsThe coded image to be used as template.
frameThe frame in which the other arguments are expressed.

◆ BuildTemplate() [3/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.EObjectSelection selection)

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
selectionThe object selection to be used as template.

◆ BuildTemplate() [4/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.EObjectSelection selection,
eVision.EFrame frame )

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
selectionThe object selection to be used as template.
frameThe frame in which the other arguments are expressed.

◆ BuildTemplate() [5/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.EPoint[] positions)

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
positionsThe list of positions to be used as template.

◆ BuildTemplate() [6/6]

void eVision.EObjectTemplateMatcher.BuildTemplate ( eVision.EPoint[] positions,
eVision.EFrame frame )

Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.

Parameters
positionsThe list of positions to be used as template.
frameThe frame in which the other arguments are expressed.

◆ GetExtra() [1/2]

eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetExtra ( eVision.EObjectSelection selection)

Returns the objects in the selection that do not appear in the template, in the order in which they appear in the selection. EObjectTemplateMatcher.Match must be called before this method.

Parameters
selectionThe object selection that was used in EObjectTemplateMatcher.Match.

◆ GetExtra() [2/2]

eVision.EPoint[] eVision.EObjectTemplateMatcher.GetExtra ( eVision.EPoint[] positions)

Returns the objects in the selection that do not appear in the template, in the order in which they appear in the selection. EObjectTemplateMatcher.Match must be called before this method.

Parameters
positionsThe vector of positions that was used in EObjectTemplateMatcher.Match.

◆ GetMatched() [1/4]

eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMatched ( eVision.EObjectSelection selection)

Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
selectionThe object selection that was used in EObjectTemplateMatcher.Match.

◆ GetMatched() [2/4]

eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMatched ( eVision.EObjectSelection selection,
bool fromSelection )

Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
selectionThe object selection that was used in EObjectTemplateMatcher.Match.
fromSelectionWether the given objects are from the selection or the template. Default: selection

◆ GetMatched() [3/4]

eVision.EPoint[] eVision.EObjectTemplateMatcher.GetMatched ( eVision.EPoint[] positions)

Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
positionsThe vector of positions that was used in EObjectTemplateMatcher.Match.

◆ GetMatched() [4/4]

eVision.EPoint[] eVision.EObjectTemplateMatcher.GetMatched ( eVision.EPoint[] positions,
bool fromSelection )

Returns the matched objects in the order in which they appear in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
positionsThe vector of positions that was used in EObjectTemplateMatcher.Match.
fromSelectionWether the given objects are from the selection or the template. Default: selection

◆ GetMissing() [1/2]

eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMissing ( eVision.EObjectSelection templateSelection)

Returns the template objects that were not matched, in the order in which they appeared in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
templateSelectionThe object selection that was used in EObjectTemplateMatcher.BuildTemplate.

◆ GetMissing() [2/2]

eVision.EPoint[] eVision.EObjectTemplateMatcher.GetMissing ( eVision.EPoint[] templatePositions)

Returns the template objects that were not matched, in the order in which they appeared in the template. EObjectTemplateMatcher.Match must be called before this method.

Parameters
templatePositionsThe vector of positions that was used in EObjectTemplateMatcher.BuildTemplate.

◆ GetUnpairedObjects()

void eVision.EObjectTemplateMatcher.GetUnpairedObjects ( ref int[] onlyInTemplate,
ref int[] onlyInSelection )

Return lists of object indexes that appear only in template or only in selection.

Parameters
onlyInTemplateThe list of object indexes that appear only in the template.
onlyInSelectionThe list of object indexes that appear only in the selection.

◆ Load() [1/2]

void eVision.EObjectTemplateMatcher.Load ( eVision.ESerializer serializer)

Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.

Parameters
serializerThe serializer.

◆ Load() [2/2]

void eVision.EObjectTemplateMatcher.Load ( string path)

Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.

Parameters
pathThe file path.

◆ Match() [1/4]

bool eVision.EObjectTemplateMatcher.Match ( eVision.EObjectSelection selection)

Align and match the given items with the reference template.

The shortest distance between the positions is used to pair the given positions with the template's positions. In the case of EObjectSelection, only the centers of the objects are considered.

After the execution of this function:

Returns true if all given objects and all template objects are matched.

Parameters
selectionThe object selection to be compared with the template.

◆ Match() [2/4]

bool eVision.EObjectTemplateMatcher.Match ( eVision.EObjectSelection selection,
eVision.EFrame frame )

Align and match the given items with the reference template.

The shortest distance between the positions is used to pair the given positions with the template's positions. In the case of EObjectSelection, only the centers of the objects are considered.

After the execution of this function:

Returns true if all given objects and all template objects are matched.

Parameters
selectionThe object selection to be compared with the template.
frameThe frame in which the other arguments are expressed.

◆ Match() [3/4]

bool eVision.EObjectTemplateMatcher.Match ( eVision.EPoint[] positions)

Align and match the given items with the reference template.

The shortest distance between the positions is used to pair the given positions with the template's positions. In the case of EObjectSelection, only the centers of the objects are considered.

After the execution of this function:

Returns true if all given objects and all template objects are matched.

Parameters
positionsThe array of positions to be compared with the template.

◆ Match() [4/4]

bool eVision.EObjectTemplateMatcher.Match ( eVision.EPoint[] positions,
eVision.EFrame frame )

Align and match the given items with the reference template.

The shortest distance between the positions is used to pair the given positions with the template's positions. In the case of EObjectSelection, only the centers of the objects are considered.

After the execution of this function:

Returns true if all given objects and all template objects are matched.

Parameters
positionsThe array of positions to be compared with the template.
frameThe frame in which the other arguments are expressed.

◆ Save() [1/2]

void eVision.EObjectTemplateMatcher.Save ( eVision.ESerializer serializer)

Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.

Parameters
serializerThe ESerializer object that is written to.

◆ Save() [2/2]

void eVision.EObjectTemplateMatcher.Save ( string path)

Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.

Parameters
pathThe file path.

◆ SortPositions()

void eVision.EObjectTemplateMatcher.SortPositions ( eVision.EPoint[] positions)

Align and match the given position array with the reference template.

The shortest distance between the positions is used to pair the given positions with the template's positions. After the execution of this function, the template indexes corresponding to the position array are returned by method EObjectTemplateMatcher.TemplateIndexes. The position indexes for template's positions are returned by method EObjectTemplateMatcher.SelectionIndexes. Indexes of positions that appears only in template or only in the given array are returned by method EObjectTemplateMatcher.GetUnpairedObjects. The complexity is O(n) where n is the number of elements in the given array.

Parameters
positionsThe array of positions to be compared with the template.
Deprecated

Use EObjectTemplateMatcher.Match instead.

Deprecated in version 26.6. Scheduled to be removed in version 27.6.

◆ SortSelection()

void eVision.EObjectTemplateMatcher.SortSelection ( eVision.EObjectSelection selection)

Align and match the given selection with the reference template.

The shortest distance between object's centers is used to pair the objects in the selection with the objects in the template. After the execution of this function, the template indexes corresponding to selection objects are returned by method EObjectTemplateMatcher.TemplateIndexes.

The selection indexes for template objects are returned by method EObjectTemplateMatcher.SelectionIndexes. Indexes of objects that appears only in template or only in selection are returned by method EObjectTemplateMatcher.GetUnpairedObjects. The complexity is O(n) where n is the number of objects in selection.

Parameters
selectionThe object selection to be compared. The selection is unchanged.
Deprecated

Use EObjectTemplateMatcher.Match instead.

Deprecated in version 26.6. Scheduled to be removed in version 27.6.

Property Documentation

◆ Alignment

eVision.EObjectTemplateMatcherAlignment eVision.EObjectTemplateMatcher.Alignment
getset

Sets optional preliminary alignement (rigid transformation only: translation and rotation). Choose to enable alignment only if the selection is not aligned with the template. Three types of alignment are possible. See EObjectTemplateMatcherAlignment. The max rotation of the alignment can be set by EObjectTemplateMatcher.MaximumAngle. By default, no alignment is performed.

◆ EnableAlignment

bool eVision.EObjectTemplateMatcher.EnableAlignment
getset

Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). Enable alignment only if the selection is not aligned with the template.

◆ MaximumAngle

float eVision.EObjectTemplateMatcher.MaximumAngle
getset

◆ MaximumDistance

float eVision.EObjectTemplateMatcher.MaximumDistance
getset

Defines the absolute maximum distance (in pixels) for a match to be valid. That value is used during the closest object search. By default, infinite distance is used.

◆ NumberOfPairedObjects

int eVision.EObjectTemplateMatcher.NumberOfPairedObjects
get

Return the number of paired objects.

◆ SelectionIndexes

int [] eVision.EObjectTemplateMatcher.SelectionIndexes
get

For each object in the TEMPLATE return the paired index in the SELECTION. if the object has no match, the value -1 is used.

◆ TemplateIndexes

int [] eVision.EObjectTemplateMatcher.TemplateIndexes
get

For each object in the SELECTION return the paired index in the TEMPLATE. If the object has no match, the value -1 is used.