The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template. More...
Public Member Functions | |
| None | __init__ (self) |
| Creates an eVision.EObjectTemplateMatcher object. | |
| None | __init__ (self, eVision.EObjectTemplateMatcher other) |
| Creates an eVision.EObjectTemplateMatcher object. | |
| None | Load (self, str path) |
| Load the eVision.EObjectTemplateMatcher configuration. | |
| None | Load (self, eVision.ESerializer|None serializer) |
| Load the eVision.EObjectTemplateMatcher configuration. | |
| None | Save (self, str path) |
| Save the eVision.EObjectTemplateMatcher configuration. | |
| None | Save (self, eVision.ESerializer|None serializer) |
| Save the eVision.EObjectTemplateMatcher configuration. | |
| None | BuildTemplate (self, 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. | |
| None | BuildTemplate (self, eVision.EObjectSelection selection) |
| Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions. | |
| None | BuildTemplate (self, 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. | |
| None | BuildTemplate (self, eVision.ECodedImage2 objects) |
| Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions. | |
| None | BuildTemplate (self, list[eVision._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. | |
| None | BuildTemplate (self, list[eVision._eVision.EPoint] positions) |
| Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions. | |
| None | SortSelection (self, eVision.EObjectSelection selection) |
| Align and match the given selection with the reference template. | |
| None | SortPositions (self, list[eVision._eVision.EPoint] positions) |
| Align and match the given position array with the reference template. | |
| bool | Match (self, list[eVision._eVision.EPoint] positions) |
| Align and match the given items with the reference template. | |
| bool | Match (self, list[eVision._eVision.EPoint] positions, eVision.EFrame frame) |
| Align and match the given items with the reference template. | |
| bool | Match (self, eVision.EObjectSelection selection, eVision.EFrame frame) |
| Align and match the given items with the reference template. | |
| bool | Match (self, eVision.EObjectSelection selection) |
| Align and match the given items with the reference template. | |
| eVision.EObjectSelection | GetMatched (self, eVision.EObjectSelection selection, bool fromSelection) |
| Returns the matched objects in the order in which they appear in the template. | |
| eVision.EObjectSelection | GetMatched (self, eVision.EObjectSelection selection) |
| Returns the matched objects in the order in which they appear in the template. | |
| list[eVision._eVision.EPoint] | GetMatched (self, list[eVision._eVision.EPoint] positions, bool fromSelection) |
| Returns the matched objects in the order in which they appear in the template. | |
| list[eVision._eVision.EPoint] | GetMatched (self, list[eVision._eVision.EPoint] positions) |
| Returns the matched objects in the order in which they appear in the template. | |
| eVision.EObjectSelection | GetExtra (self, 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. | |
| list[eVision._eVision.EPoint] | GetExtra (self, list[eVision._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. | |
| eVision.EObjectSelection | GetMissing (self, eVision.EObjectSelection templateSelection) |
| Returns the template objects that were not matched, in the order in which they appeared in the template. | |
| list[eVision._eVision.EPoint] | GetMissing (self, list[eVision._eVision.EPoint] templatePositions) |
| Returns the template objects that were not matched, in the order in which they appeared in the template. | |
| None | GetUnpairedObjects (self, list[int] onlyInTemplate, list[int] onlyInSelection) |
| Return lists of object indexes that appear only in template or only in selection. | |
| bool | EnableAlignment (self) |
| Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). | |
| EnableAlignment (self, bool value) | |
| Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). | |
| eVision.EObjectTemplateMatcherAlignment | Alignment (self) |
| Sets optional preliminary alignement (rigid transformation only: translation and rotation). | |
| Alignment (self, eVision.EObjectTemplateMatcherAlignment value) | |
| Sets optional preliminary alignement (rigid transformation only: translation and rotation). | |
| float | MaximumAngle (self) |
| When eVision.EObjectTemplateMatcher.Alignment is set to eVision.EObjectTemplateMatcherAlignment.Fast or eVision.EObjectTemplateMatcherAlignment.Robust, the alignment can be constrained to a given angle range. | |
| MaximumAngle (self, float value) | |
| When eVision.EObjectTemplateMatcher.Alignment is set to eVision.EObjectTemplateMatcherAlignment.Fast or eVision.EObjectTemplateMatcherAlignment.Robust, the alignment can be constrained to a given angle range. | |
| float | MaximumDistance (self) |
| Defines the absolute maximum distance (in pixels) for a match to be valid. | |
| MaximumDistance (self, float value) | |
| Defines the absolute maximum distance (in pixels) for a match to be valid. | |
| list[int] | TemplateIndexes (self) |
| For each object in the SELECTION return the paired index in the TEMPLATE. | |
| list[int] | SelectionIndexes (self) |
| For each object in the TEMPLATE return the paired index in the SELECTION. | |
| int | NumberOfPairedObjects (self) |
| Return the number of paired objects. | |
The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template.
Remarks:
License(s): EasyObject
| None eVision.EObjectTemplateMatcher.__init__ | ( | self | ) |
Creates an eVision.EObjectTemplateMatcher object.
| None eVision.EObjectTemplateMatcher.__init__ | ( | self, | |
| eVision.EObjectTemplateMatcher | other ) |
Creates an eVision.EObjectTemplateMatcher object.
| other | Reference to the eVision.EObjectTemplateMatcher used for the initialization. |
| eVision.EObjectTemplateMatcherAlignment eVision.EObjectTemplateMatcher.Alignment | ( | self | ) |
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 eVision.EObjectTemplateMatcherAlignment. The max rotation of the alignment can be set by eVision.EObjectTemplateMatcher.MaximumAngle. By default, no alignment is performed.
| eVision.EObjectTemplateMatcher.Alignment | ( | self, | |
| eVision.EObjectTemplateMatcherAlignment | value ) |
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 eVision.EObjectTemplateMatcherAlignment. The max rotation of the alignment can be set by eVision.EObjectTemplateMatcher.MaximumAngle. By default, no alignment is performed.
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| eVision.ECodedImage2 | objects ) |
Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
| objects | The coded image to be used as template. |
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| 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.
| objects | The coded image to be used as template. |
| frame | The frame in which the other arguments are expressed. |
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| eVision.EObjectSelection | selection ) |
Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
| selection | The object selection to be used as template. |
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| 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.
| selection | The object selection to be used as template. |
| frame | The frame in which the other arguments are expressed. |
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| list[eVision._eVision.EPoint] | positions ) |
Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions.
| positions | The list of positions to be used as template. |
| None eVision.EObjectTemplateMatcher.BuildTemplate | ( | self, | |
| list[eVision._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.
| positions | The list of positions to be used as template. |
| frame | The frame in which the other arguments are expressed. |
| bool eVision.EObjectTemplateMatcher.EnableAlignment | ( | self | ) |
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.EObjectTemplateMatcher.EnableAlignment | ( | self, | |
| bool | value ) |
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.EObjectSelection eVision.EObjectTemplateMatcher.GetExtra | ( | self, | |
| 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.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| selection | The object selection that was used in eVision.EObjectTemplateMatcher.Match. |
| list[eVision._eVision.EPoint] eVision.EObjectTemplateMatcher.GetExtra | ( | self, | |
| list[eVision._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.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| positions | The vector of positions that was used in eVision.EObjectTemplateMatcher.Match. |
| eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMatched | ( | self, | |
| eVision.EObjectSelection | selection ) |
Returns the matched objects in the order in which they appear in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| selection | The object selection that was used in eVision.EObjectTemplateMatcher.Match. |
| eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMatched | ( | self, | |
| eVision.EObjectSelection | selection, | ||
| bool | fromSelection ) |
Returns the matched objects in the order in which they appear in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| selection | The object selection that was used in eVision.EObjectTemplateMatcher.Match. |
| fromSelection | Wether the given objects are from the selection or the template. Default: selection |
| list[eVision._eVision.EPoint] eVision.EObjectTemplateMatcher.GetMatched | ( | self, | |
| list[eVision._eVision.EPoint] | positions ) |
Returns the matched objects in the order in which they appear in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| positions | The vector of positions that was used in eVision.EObjectTemplateMatcher.Match. |
| list[eVision._eVision.EPoint] eVision.EObjectTemplateMatcher.GetMatched | ( | self, | |
| list[eVision._eVision.EPoint] | positions, | ||
| bool | fromSelection ) |
Returns the matched objects in the order in which they appear in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| positions | The vector of positions that was used in eVision.EObjectTemplateMatcher.Match. |
| fromSelection | Wether the given objects are from the selection or the template. Default: selection |
| eVision.EObjectSelection eVision.EObjectTemplateMatcher.GetMissing | ( | self, | |
| eVision.EObjectSelection | templateSelection ) |
Returns the template objects that were not matched, in the order in which they appeared in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| templateSelection | The object selection that was used in eVision.EObjectTemplateMatcher.BuildTemplate. |
| list[eVision._eVision.EPoint] eVision.EObjectTemplateMatcher.GetMissing | ( | self, | |
| list[eVision._eVision.EPoint] | templatePositions ) |
Returns the template objects that were not matched, in the order in which they appeared in the template.
eVision.EObjectTemplateMatcher.Match must be called before this method.
| templatePositions | The vector of positions that was used in eVision.EObjectTemplateMatcher.BuildTemplate. |
| None eVision.EObjectTemplateMatcher.GetUnpairedObjects | ( | self, | |
| list[int] | onlyInTemplate, | ||
| list[int] | onlyInSelection ) |
Return lists of object indexes that appear only in template or only in selection.
| onlyInTemplate | The list of object indexes that appear only in the template. |
| onlyInSelection | The list of object indexes that appear only in the selection. |
| None eVision.EObjectTemplateMatcher.Load | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Load the eVision.EObjectTemplateMatcher configuration.
The given eVision.ESerializer must have been created for reading.
| serializer | The serializer. |
| None eVision.EObjectTemplateMatcher.Load | ( | self, | |
| str | path ) |
Load the eVision.EObjectTemplateMatcher configuration.
The given eVision.ESerializer must have been created for reading.
| path | The file path. |
| bool eVision.EObjectTemplateMatcher.Match | ( | self, | |
| 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 eVision.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.
| selection | The object selection to be compared with the template. |
| bool eVision.EObjectTemplateMatcher.Match | ( | self, | |
| 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 eVision.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.
| selection | The object selection to be compared with the template. |
| frame | The frame in which the other arguments are expressed. |
| bool eVision.EObjectTemplateMatcher.Match | ( | self, | |
| list[eVision._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 eVision.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.
| positions | The array of positions to be compared with the template. |
| bool eVision.EObjectTemplateMatcher.Match | ( | self, | |
| list[eVision._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 eVision.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.
| positions | The array of positions to be compared with the template. |
| frame | The frame in which the other arguments are expressed. |
| float eVision.EObjectTemplateMatcher.MaximumAngle | ( | self | ) |
When eVision.EObjectTemplateMatcher.Alignment is set to eVision.EObjectTemplateMatcherAlignment.Fast or eVision.EObjectTemplateMatcherAlignment.Robust, the alignment can be constrained to a given angle range.
This is useful to filter out symmetries and makes eVision.EObjectTemplateMatcherAlignment.Robust faster. Defaults to 180°.
| eVision.EObjectTemplateMatcher.MaximumAngle | ( | self, | |
| float | value ) |
When eVision.EObjectTemplateMatcher.Alignment is set to eVision.EObjectTemplateMatcherAlignment.Fast or eVision.EObjectTemplateMatcherAlignment.Robust, the alignment can be constrained to a given angle range.
This is useful to filter out symmetries and makes eVision.EObjectTemplateMatcherAlignment.Robust faster. Defaults to 180°.
| float eVision.EObjectTemplateMatcher.MaximumDistance | ( | self | ) |
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.
| eVision.EObjectTemplateMatcher.MaximumDistance | ( | self, | |
| float | value ) |
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 eVision.EObjectTemplateMatcher.NumberOfPairedObjects | ( | self | ) |
Return the number of paired objects.
| None eVision.EObjectTemplateMatcher.Save | ( | self, | |
| eVision.ESerializer | None | serializer ) |
Save the eVision.EObjectTemplateMatcher configuration.
The given eVision.ESerializer must have been created for writing.
| serializer | The eVision.ESerializer object that is written to. |
| None eVision.EObjectTemplateMatcher.Save | ( | self, | |
| str | path ) |
Save the eVision.EObjectTemplateMatcher configuration.
The given eVision.ESerializer must have been created for writing.
| path | The file path. |
| list[int] eVision.EObjectTemplateMatcher.SelectionIndexes | ( | self | ) |
For each object in the TEMPLATE return the paired index in the SELECTION.
if the object has no match, the value -1 is used.
| None eVision.EObjectTemplateMatcher.SortPositions | ( | self, | |
| list[eVision._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 eVision.EObjectTemplateMatcher.TemplateIndexes. The position indexes for template's positions are returned by method eVision.EObjectTemplateMatcher.SelectionIndexes. Indexes of positions that appears only in template or only in the given array are returned by method eVision.EObjectTemplateMatcher.GetUnpairedObjects. The complexity is O(n) where n is the number of elements in the given array.
Use eVision.EObjectTemplateMatcher.Match instead.
Deprecated in version 26.6. Scheduled to be removed in version 27.6.
| positions | The array of positions to be compared with the template. |
| None eVision.EObjectTemplateMatcher.SortSelection | ( | self, | |
| 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 eVision.EObjectTemplateMatcher.TemplateIndexes.
The selection indexes for template objects are returned by method eVision.EObjectTemplateMatcher.SelectionIndexes. Indexes of objects that appears only in template or only in selection are returned by method eVision.EObjectTemplateMatcher.GetUnpairedObjects. The complexity is O(n) where n is the number of objects in selection.
Use eVision.EObjectTemplateMatcher.Match instead.
Deprecated in version 26.6. Scheduled to be removed in version 27.6.
| selection | The object selection to be compared. The selection is unchanged. |
| list[int] eVision.EObjectTemplateMatcher.TemplateIndexes | ( | self | ) |
For each object in the SELECTION return the paired index in the TEMPLATE.
If the object has no match, the value -1 is used.