The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template. More...
#include <eVision/EasyObject/EasyObject2/EObjectTemplateMatcher.h>
Public Member Functions | |
| EObjectTemplateMatcher () | |
| Creates an EObjectTemplateMatcher object. | |
| EObjectTemplateMatcher (const eVision::EObjectTemplateMatcher &other) | |
| Creates an EObjectTemplateMatcher object. | |
| virtual | ~EObjectTemplateMatcher () throw () |
| eVision::EObjectTemplateMatcher & | operator= (const eVision::EObjectTemplateMatcher &other) |
| Assignment operator. | |
| void | Load (const std::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 (const std::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, const 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, const 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 (const std::vector< eVision::EPoint > &positions, const eVision::EFrame &frame) |
| Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions. | |
| void | BuildTemplate (const std::vector< eVision::EPoint > &positions) |
| Set the reference template from a previous EasyObject coded image, an object selection or a list of known positions. | |
| void | SortSelection (const eVision::EObjectSelection &selection) |
| Align and match the given selection with the reference template. | |
| void | SortPositions (const std::vector< eVision::EPoint > &positions) |
| Align and match the given position array with the reference template. | |
| bool | Match (const std::vector< eVision::EPoint > &positions) |
| Align and match the given items with the reference template. | |
| bool | Match (const std::vector< eVision::EPoint > &positions, const eVision::EFrame &frame) |
| Align and match the given items with the reference template. | |
| bool | Match (const eVision::EObjectSelection &selection, const eVision::EFrame &frame) |
| Align and match the given items with the reference template. | |
| bool | Match (const eVision::EObjectSelection &selection) |
| Align and match the given items with the reference template. | |
| void | SetEnableAlignment (bool align) |
| Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). Enable alignment only if the selection is not aligned with the template. | |
| bool | GetEnableAlignment () const |
| Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). Enable alignment only if the selection is not aligned with the template. | |
| void | SetAlignment (eVision::EObjectTemplateMatcherAlignment alignment) |
| 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::SetMaximumAngle. By default, no alignment is performed. | |
| eVision::EObjectTemplateMatcherAlignment | GetAlignment () const |
| 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::SetMaximumAngle. By default, no alignment is performed. | |
| void | SetMaximumAngle (float maxAngle) |
| When EObjectTemplateMatcher::SetAlignment 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 | GetMaximumAngle () const |
| When EObjectTemplateMatcher::SetAlignment 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°. | |
| void | SetMaximumDistance (float distance) |
| 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. | |
| float | GetMaximumDistance () const |
| 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::EObjectSelection | GetMatched (const 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 (const 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. | |
| std::vector< eVision::EPoint > | GetMatched (const std::vector< 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. | |
| std::vector< eVision::EPoint > | GetMatched (const std::vector< 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 (const 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. | |
| std::vector< eVision::EPoint > | GetExtra (const std::vector< 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 (const 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. | |
| std::vector< eVision::EPoint > | GetMissing (const std::vector< 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. | |
| std::vector< int32_t > | GetTemplateIndexes () const |
| For each object in the SELECTION return the paired index in the TEMPLATE. If the object has no match, the value -1 is used. | |
| std::vector< int32_t > | GetSelectionIndexes () const |
| For each object in the TEMPLATE return the paired index in the SELECTION. if the object has no match, the value -1 is used. | |
| int32_t | GetNumberOfPairedObjects () const |
| Return the number of paired objects. | |
| void | GetUnpairedObjects (std::vector< int32_t > &onlyInTemplate, std::vector< int32_t > &onlyInSelection) const |
| Return lists of object indexes that appear only in template or only in selection. | |
| EObjectTemplateMatcher (CppWrapperInternal::InternalConstructor) | |
Public Attributes | |
| CppWrapperInternal::WrappedClass | wrappedClass_ |
The EObjectTemplateMatcher class is a tool designed to align and match the output of EasyObject to a reference template.
License(s): EasyObject
| eVision::EObjectTemplateMatcher::EObjectTemplateMatcher | ( | ) |
Creates an EObjectTemplateMatcher object.
| eVision::EObjectTemplateMatcher::EObjectTemplateMatcher | ( | const eVision::EObjectTemplateMatcher & | other | ) |
Creates an EObjectTemplateMatcher object.
| other | Reference to the EObjectTemplateMatcher used for the initialization. |
|
virtual | ||||||||||||
| eVision::EObjectTemplateMatcher::EObjectTemplateMatcher | ( | CppWrapperInternal::InternalConstructor | ) |
| void eVision::EObjectTemplateMatcher::BuildTemplate | ( | const std::vector< 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. |
| void eVision::EObjectTemplateMatcher::BuildTemplate | ( | const std::vector< eVision::EPoint > & | positions, |
| const 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. |
| 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.
| objects | The coded image to be used as template. |
| void eVision::EObjectTemplateMatcher::BuildTemplate | ( | eVision::ECodedImage2 & | objects, |
| const 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. |
| 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.
| selection | The object selection to be used as template. |
| void eVision::EObjectTemplateMatcher::BuildTemplate | ( | eVision::EObjectSelection & | selection, |
| const 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. |
| eVision::EObjectTemplateMatcherAlignment eVision::EObjectTemplateMatcher::GetAlignment | ( | ) | const |
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::SetMaximumAngle. By default, no alignment is performed.
| bool eVision::EObjectTemplateMatcher::GetEnableAlignment | ( | ) | const |
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 | ( | const 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.
| selection | The object selection that was used in EObjectTemplateMatcher::Match. |
| std::vector< eVision::EPoint > eVision::EObjectTemplateMatcher::GetExtra | ( | const std::vector< 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.
| positions | The vector of positions that was used in EObjectTemplateMatcher::Match. |
| eVision::EObjectSelection eVision::EObjectTemplateMatcher::GetMatched | ( | const 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.
| selection | The object selection that was used in EObjectTemplateMatcher::Match. |
| eVision::EObjectSelection eVision::EObjectTemplateMatcher::GetMatched | ( | const 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.
| selection | The object selection that was used in EObjectTemplateMatcher::Match. |
| fromSelection | Wether the given objects are from the selection or the template. Default: selection |
| std::vector< eVision::EPoint > eVision::EObjectTemplateMatcher::GetMatched | ( | const std::vector< 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.
| positions | The vector of positions that was used in EObjectTemplateMatcher::Match. |
| std::vector< eVision::EPoint > eVision::EObjectTemplateMatcher::GetMatched | ( | const std::vector< 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.
| positions | The vector of positions that was used in EObjectTemplateMatcher::Match. |
| fromSelection | Wether the given objects are from the selection or the template. Default: selection |
| float eVision::EObjectTemplateMatcher::GetMaximumAngle | ( | ) | const |
When EObjectTemplateMatcher::SetAlignment 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 eVision::EObjectTemplateMatcher::GetMaximumDistance | ( | ) | const |
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::EObjectSelection eVision::EObjectTemplateMatcher::GetMissing | ( | const 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.
| templateSelection | The object selection that was used in EObjectTemplateMatcher::BuildTemplate. |
| std::vector< eVision::EPoint > eVision::EObjectTemplateMatcher::GetMissing | ( | const std::vector< 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.
| templatePositions | The vector of positions that was used in EObjectTemplateMatcher::BuildTemplate. |
| int32_t eVision::EObjectTemplateMatcher::GetNumberOfPairedObjects | ( | ) | const |
Return the number of paired objects.
| std::vector< int32_t > eVision::EObjectTemplateMatcher::GetSelectionIndexes | ( | ) | const |
For each object in the TEMPLATE return the paired index in the SELECTION. if the object has no match, the value -1 is used.
| std::vector< int32_t > eVision::EObjectTemplateMatcher::GetTemplateIndexes | ( | ) | const |
For each object in the SELECTION return the paired index in the TEMPLATE. If the object has no match, the value -1 is used.
| void eVision::EObjectTemplateMatcher::GetUnpairedObjects | ( | std::vector< int32_t > & | onlyInTemplate, |
| std::vector< int32_t > & | onlyInSelection ) const |
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. |
| void eVision::EObjectTemplateMatcher::Load | ( | const std::string & | path | ) |
Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.
| path | The file path. |
| void eVision::EObjectTemplateMatcher::Load | ( | eVision::ESerializer * | serializer | ) |
Load the EObjectTemplateMatcher configuration. The given ESerializer must have been created for reading.
| serializer | The serializer. |
| bool eVision::EObjectTemplateMatcher::Match | ( | const 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.
| selection | The object selection to be compared with the template. |
| bool eVision::EObjectTemplateMatcher::Match | ( | const eVision::EObjectSelection & | selection, |
| const 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.
| selection | The object selection to be compared with the template. |
| frame | The frame in which the other arguments are expressed. |
| bool eVision::EObjectTemplateMatcher::Match | ( | const std::vector< 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.
| positions | The array of positions to be compared with the template. |
| bool eVision::EObjectTemplateMatcher::Match | ( | const std::vector< eVision::EPoint > & | positions, |
| const 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.
| positions | The array of positions to be compared with the template. |
| frame | The frame in which the other arguments are expressed. |
| eVision::EObjectTemplateMatcher & eVision::EObjectTemplateMatcher::operator= | ( | const eVision::EObjectTemplateMatcher & | other | ) |
Assignment operator.
| other | The EObjectTemplateMatcher object that should be copied. |
| void eVision::EObjectTemplateMatcher::Save | ( | const std::string & | path | ) |
Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.
| path | The file path. |
| void eVision::EObjectTemplateMatcher::Save | ( | eVision::ESerializer * | serializer | ) |
Save the EObjectTemplateMatcher configuration. The given ESerializer must have been created for writing.
| serializer | The ESerializer object that is written to. |
| void eVision::EObjectTemplateMatcher::SetAlignment | ( | eVision::EObjectTemplateMatcherAlignment | alignment | ) |
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::SetMaximumAngle. By default, no alignment is performed.
| alignment | The type of alignment to apply. |
| void eVision::EObjectTemplateMatcher::SetEnableAlignment | ( | bool | align | ) |
Enable an optional preliminary global alignement (rigid transformation only: translation and rotation). Enable alignment only if the selection is not aligned with the template.
| align | A boolean value to enable or disable the global alignment. |
Use EObjectTemplateMatcher::SetAlignment instead. This sets the alignment to EObjectTemplateMatcherAlignment::EObjectTemplateMatcherAlignment_Fast.
Deprecated in version 26.6. Scheduled to be removed in version 27.6.
| void eVision::EObjectTemplateMatcher::SetMaximumAngle | ( | float | maxAngle | ) |
When EObjectTemplateMatcher::SetAlignment 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°.
| maxAngle | The maximal alignment angle allowed. Allowed values are [0, 180°]. |
| void eVision::EObjectTemplateMatcher::SetMaximumDistance | ( | float | distance | ) |
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.
| distance | The Euclidean distance. |
| void eVision::EObjectTemplateMatcher::SortPositions | ( | const std::vector< 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::GetTemplateIndexes. The position indexes for template's positions are returned by method EObjectTemplateMatcher::GetSelectionIndexes. 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.
| positions | The array of positions to be compared with the template. |
Use EObjectTemplateMatcher::Match instead.
Deprecated in version 26.6. Scheduled to be removed in version 27.6.
| void eVision::EObjectTemplateMatcher::SortSelection | ( | const 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::GetTemplateIndexes.
The selection indexes for template objects are returned by method EObjectTemplateMatcher::GetSelectionIndexes. 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.
| selection | The object selection to be compared. The selection is unchanged. |
Use EObjectTemplateMatcher::Match instead.
Deprecated in version 26.6. Scheduled to be removed in version 27.6.
| CppWrapperInternal::WrappedClass eVision::EObjectTemplateMatcher::wrappedClass_ |