Image Component Library (ICL)
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
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

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...
 

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

◆ MarkerCodeICL1() [1/3]

icl::markers::MarkerCodeICL1::MarkerCodeICL1 ( )

create instance with optionally given root color

◆ MarkerCodeICL1() [2/3]

icl::markers::MarkerCodeICL1::MarkerCodeICL1 ( int  id)

create instance from given ID

◆ MarkerCodeICL1() [3/3]

icl::markers::MarkerCodeICL1::MarkerCodeICL1 ( const int  ns[4],
bool  rootRegionColorIsBlack = true 
)

create instance from given set of child-child regions counts

Member Function Documentation

◆ generate()

static const std::vector<MarkerCodeICL1>& icl::markers::MarkerCodeICL1::generate ( )
static

generates a set of 60 instances that have minimum hamming distance of 2

◆ operator-()

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

◆ operator<()

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

compares the internal id

◆ operator[]() [1/2]

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

get child-child region count of child-region idx

◆ operator[]() [2/2]

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

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

Member Data Documentation

◆ id

int icl::markers::MarkerCodeICL1::id

computed or given marker ID

◆ n

int icl::markers::MarkerCodeICL1::n[4]

computed or given set of child-child-regions

◆ P

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

maximum amount of child-child-regions

◆ P1

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: