Image Component Library (ICL)
|
Utility class for markers of type "icl1". More...
#include <MarkerCodeICL1.h>
Public Member Functions | |
MarkerCodeICL1 () | |
create instance with optionally given root color More... | |
MarkerCodeICL1 (int id) | |
create instance from given ID More... | |
MarkerCodeICL1 (const int ns[4], bool rootRegionColorIsBlack=true) | |
create instance from given set of child-child regions counts More... | |
int & | operator[] (int idx) |
get child-child region count of child-region idx More... | |
int | operator[] (int idx) const |
get child-child region count of child-region idx (const) More... | |
bool | operator< (const MarkerCodeICL1 &t) const |
compares the internal id More... | |
int | operator- (const MarkerCodeICL1 &p) const |
computes the hamming distance of two codes More... | |
Static Public Member Functions | |
static const std::vector< MarkerCodeICL1 > & | generate () |
generates a set of 60 instances that have minimum hamming distance of 2 More... | |
Public Attributes | |
int | id |
computed or given marker ID More... | |
int | n [4] |
computed or given set of child-child-regions More... | |
Static Public Attributes | |
static const int | P = 5 |
maximum amount of child-child-regions More... | |
static const int | P1 = P+1 |
related to maximum child-child-region count base for ID computation More... | |
Utility class for markers of type "icl1".
"icl1" markers have 4 section each containing 1 to 5 child-regions. Therefore, each marker is completely defined by the numbers of child regions. In order to avoid disambiguities, the sub-region counts are sorted in ascending order (e.g. . To avoid the degenerate case, that all become equal, an extra rule is evaluated. A list of all valid codes (60) is generated by the static MarkerCodeICL1::genrate function.
The extra property rootColor can be used to store the information about the root regions color. This can be used to create an extra set of makers of identical type (one with root color 0, and one with root color 255).
The marker ID is directly computed from the set of the . Since the maximum number of child child regions is 5, the base for ID computation is 6. We use negative marker ID's to indicate, that the marker structure is inverse: i.e. the markers root region is white
The inverse calculation is implemented iteratively (note: the operator "/" uses integer division here)
icl::markers::MarkerCodeICL1::MarkerCodeICL1 | ( | ) |
create instance with optionally given root color
icl::markers::MarkerCodeICL1::MarkerCodeICL1 | ( | int | id | ) |
create instance from given ID
icl::markers::MarkerCodeICL1::MarkerCodeICL1 | ( | const int | ns[4], |
bool | rootRegionColorIsBlack = true |
||
) |
create instance from given set of child-child regions counts
|
static |
generates a set of 60 instances that have minimum hamming distance of 2
int icl::markers::MarkerCodeICL1::operator- | ( | const MarkerCodeICL1 & | p | ) | const |
computes the hamming distance of two codes
Note if you only use the codes that are returned by the generate-function, the minimal hamming distance between any two markers is 2
|
inline |
compares the internal id
|
inline |
get child-child region count of child-region idx
|
inline |
get child-child region count of child-region idx (const)
int icl::markers::MarkerCodeICL1::id |
computed or given marker ID
int icl::markers::MarkerCodeICL1::n[4] |
computed or given set of child-child-regions
|
static |
maximum amount of child-child-regions
|
static |
related to maximum child-child-region count base for ID computation