Public Member Functions | Private Member Functions | Private Attributes | List of all members
aruco::MarkerCode Class Reference

#include <highlyreliablemarkers.h>

Public Member Functions

unsigned int distance (const MarkerCode &m, unsigned int &minRot) const
 
unsigned int distance (const MarkerCode &m) const
 
void fromString (std::string s)
 
bool get (unsigned int pos, unsigned int rot=0) const
 
unsigned int getId (unsigned int rot=0) const
 
cv::Mat getImg (unsigned int pixSize) const
 
const std::vector< bool > & getRotation (unsigned int rot) const
 
 MarkerCode (unsigned int n=0)
 
 MarkerCode (const MarkerCode &MC)
 
unsigned int n () const
 
unsigned int selfDistance (unsigned int &minRot) const
 
unsigned int selfDistance () const
 
void set (unsigned int pos, bool val, bool updateIds=true)
 
unsigned int size () const
 
std::string toString () const
 

Private Member Functions

unsigned int hammingDistance (const std::vector< bool > &m1, const std::vector< bool > &m2) const
 

Private Attributes

std::vector< bool > _bits [4]
 
unsigned int _ids [4]
 
unsigned int _n
 

Detailed Description

This class represent the internal code of a marker It does not include marker borders

Definition at line 49 of file highlyreliablemarkers.h.

Constructor & Destructor Documentation

◆ MarkerCode() [1/2]

aruco::MarkerCode::MarkerCode ( unsigned int  n = 0)

Constructor, receive dimension of marker

Definition at line 44 of file highlyreliablemarkers.cpp.

◆ MarkerCode() [2/2]

aruco::MarkerCode::MarkerCode ( const MarkerCode MC)

Copy Constructor

Definition at line 58 of file highlyreliablemarkers.cpp.

Member Function Documentation

◆ distance() [1/2]

unsigned int aruco::MarkerCode::distance ( const MarkerCode m,
unsigned int &  minRot 
) const

Return the rotation invariant distance to another marker, D(m1, m2) (Equation 6) Assign to minRot the rotation of minimun hamming distance. The rotation refers to the marker passed as parameter, m

Definition at line 119 of file highlyreliablemarkers.cpp.

◆ distance() [2/2]

unsigned int aruco::MarkerCode::distance ( const MarkerCode m) const
inline

Return the rotation invariant distance to another marker, D(m1, m2) (Equation 6) Same method as distance(MarkerCode m, uint &minRot), except this doesnt return minRot value.

Definition at line 122 of file highlyreliablemarkers.h.

◆ fromString()

void aruco::MarkerCode::fromString ( std::string  s)

Read marker bits from a string of "0"s and "1"s

Definition at line 134 of file highlyreliablemarkers.cpp.

◆ get()

bool aruco::MarkerCode::get ( unsigned int  pos,
unsigned int  rot = 0 
) const
inline

Get a bit value in a specific rotation. The marker is refered as a unidimensional string of bits, i.e. pos=y*n+x

Definition at line 70 of file highlyreliablemarkers.h.

◆ getId()

unsigned int aruco::MarkerCode::getId ( unsigned int  rot = 0) const
inline

Get id of a specific rotation as the number obtaiend from the concatenation of all the bits

Definition at line 64 of file highlyreliablemarkers.h.

◆ getImg()

cv::Mat aruco::MarkerCode::getImg ( unsigned int  pixSize) const

Convert marker to a cv::Mat image of (pixSize x pixSize) pixels It adds a black border of one cell size

Definition at line 160 of file highlyreliablemarkers.cpp.

◆ getRotation()

const std::vector< bool >& aruco::MarkerCode::getRotation ( unsigned int  rot) const
inline

Get the string of bits for a specific rotation

Definition at line 75 of file highlyreliablemarkers.h.

◆ hammingDistance()

unsigned int aruco::MarkerCode::hammingDistance ( const std::vector< bool > &  m1,
const std::vector< bool > &  m2 
) const
private

Return hamming distance between two bit vectors

Definition at line 186 of file highlyreliablemarkers.cpp.

◆ n()

unsigned int aruco::MarkerCode::n ( ) const
inline

Return the value of marker dimension (n)

Definition at line 95 of file highlyreliablemarkers.h.

◆ selfDistance() [1/2]

unsigned int aruco::MarkerCode::selfDistance ( unsigned int &  minRot) const

Return the self distance S(m) of the marker (Equation 8) Assign to minRot the rotation of minimun hamming distance

Definition at line 104 of file highlyreliablemarkers.cpp.

◆ selfDistance() [2/2]

unsigned int aruco::MarkerCode::selfDistance ( ) const
inline

Return the self distance S(m) of the marker (Equation 8) Same method as selfDistance(uint &minRot), except this doesnt return minRot value.

Definition at line 107 of file highlyreliablemarkers.h.

◆ set()

void aruco::MarkerCode::set ( unsigned int  pos,
bool  val,
bool  updateIds = true 
)

Set the value of a bit in a specific rotation The marker is refered as a unidimensional string of bits, i.e. pos=y*n+x This method assure consistency of the marker code:

  • The rest of rotations are updated automatically when performing a modification
  • The id values in all rotations are automatically updated too This is the only method to modify a bit value

Definition at line 70 of file highlyreliablemarkers.cpp.

◆ size()

unsigned int aruco::MarkerCode::size ( ) const
inline

Return the full size of the marker (n*n)

Definition at line 90 of file highlyreliablemarkers.h.

◆ toString()

std::string aruco::MarkerCode::toString ( ) const

Convert marker to a string of "0"s and "1"s

Definition at line 145 of file highlyreliablemarkers.cpp.

Member Data Documentation

◆ _bits

std::vector< bool > aruco::MarkerCode::_bits[4]
private

Definition at line 146 of file highlyreliablemarkers.h.

◆ _ids

unsigned int aruco::MarkerCode::_ids[4]
private

Definition at line 145 of file highlyreliablemarkers.h.

◆ _n

unsigned int aruco::MarkerCode::_n
private

Definition at line 147 of file highlyreliablemarkers.h.


The documentation for this class was generated from the following files:


asr_aruco_marker_recognition
Author(s): Allgeyer Tobias, Meißner Pascal, Qattan Mohamad
autogenerated on Mon Feb 28 2022 21:41:30