#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 |
This class represent the internal code of a marker It does not include marker borders
Definition at line 49 of file highlyreliablemarkers.h.
aruco::MarkerCode::MarkerCode | ( | unsigned int | n = 0 | ) |
Constructor, receive dimension of marker
Definition at line 44 of file highlyreliablemarkers.cpp.
aruco::MarkerCode::MarkerCode | ( | const MarkerCode & | MC | ) |
Copy Constructor
Definition at line 58 of file highlyreliablemarkers.cpp.
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.
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.
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.
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.
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.
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.
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.
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.
unsigned int aruco::MarkerCode::n | ( | ) | const [inline] |
Return the value of marker dimension (n)
Definition at line 95 of file highlyreliablemarkers.h.
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.
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.
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:
Definition at line 70 of file highlyreliablemarkers.cpp.
unsigned int aruco::MarkerCode::size | ( | ) | const [inline] |
Return the full size of the marker (n*n)
Definition at line 90 of file highlyreliablemarkers.h.
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.
std::vector< bool > aruco::MarkerCode::_bits[4] [private] |
Definition at line 146 of file highlyreliablemarkers.h.
unsigned int aruco::MarkerCode::_ids[4] [private] |
Definition at line 145 of file highlyreliablemarkers.h.
unsigned int aruco::MarkerCode::_n [private] |
Definition at line 147 of file highlyreliablemarkers.h.