Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
icl::markers::MarkerCodeICL1 Struct Reference

Utility class for markers of type "icl1". More...

#include <MarkerCodeICL1.h>

Inheritance diagram for icl::markers::MarkerCodeICL1:
icl::markers::MarkerMetricsICL1

List of all members.

Public Member Functions

 MarkerCodeICL1 ()
 create instance with optionally given root color
 MarkerCodeICL1 (int id)
 create instance from given ID
 MarkerCodeICL1 (const int ns[4], bool rootRegionColorIsBlack=true)
 create instance from given set of child-child regions counts
int & operator[] (int idx)
 get child-child region count of child-region idx
int operator[] (int idx) const
 get child-child region count of child-region idx (const)
bool operator< (const MarkerCodeICL1 &t) const
 compares the internal id
int operator- (const MarkerCodeICL1 &p) const
 computes the hamming distance of two codes

Static Public Member Functions

static const std::vector
< MarkerCodeICL1 > & 
generate ()
 generates a set of 60 instances that have minimum hamming distance of 2

Public Attributes

int id
 computed or given marker ID
int n [4]
 computed or given set of child-child-regions

Static Public Attributes

static const int P = 5
 maximum amount of child-child-regions
static const int P1 = P+1
 related to maximum child-child-region count base for ID computation

Detailed Description

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 $n_i$ of child regions. In order to avoid disambiguities, the sub-region counts are sorted in ascending order (e.g. $n_0 \leq n_1 \leq n2 \leq n_3 $. To avoid the degenerate case, that all $n_i$ become equal, an extra rule $ n_0 < n_3 $ 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).

ID computation

The marker ID is directly computed from the set of the $n_i$. 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

\[ id(n_1,n_2,n_3,n_4) = (+1 or -1)(n_1 + 6 n_2 + 36 n_3 + 216 n_4) \]

The inverse calculation is implemented iteratively (note: the operator "/" uses integer division here)

\[ compute\_ni(id) = \]

\[ id = abs(id) \]

\[ n_4 = min(5,id/216) \]

\[ id -= n_4*216 \]

\[ n_3 = min(5,id/36) \]

\[ id -= n_3*36; \]

\[ n_2 = min(5,id/6) \]

\[ id -= n_2*6 \]

\[ n_1 = id; \]


Constructor & Destructor Documentation

create instance with optionally given root color

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


Member Function Documentation

static const std::vector<MarkerCodeICL1>& icl::markers::MarkerCodeICL1::generate ( ) [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

bool icl::markers::MarkerCodeICL1::operator< ( const MarkerCodeICL1 t) const [inline]

compares the internal id

int& icl::markers::MarkerCodeICL1::operator[] ( int  idx) [inline]

get child-child region count of child-region idx

int icl::markers::MarkerCodeICL1::operator[] ( int  idx) const [inline]

get child-child region count of child-region idx (const)


Member Data Documentation

computed or given marker ID

computed or given set of child-child-regions

const int icl::markers::MarkerCodeICL1::P = 5 [static]

maximum amount of child-child-regions

const int icl::markers::MarkerCodeICL1::P1 = P+1 [static]

related to maximum child-child-region count base for ID computation


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines