#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.
|
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.
|
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.
|
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.
|
inline |
Get the string of bits for a specific rotation
Definition at line 75 of file highlyreliablemarkers.h.
|
private |
Return hamming distance between two bit vectors
Definition at line 186 of file highlyreliablemarkers.cpp.
|
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.
|
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.
|
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.
|
private |
Definition at line 146 of file highlyreliablemarkers.h.
|
private |
Definition at line 145 of file highlyreliablemarkers.h.
|
private |
Definition at line 147 of file highlyreliablemarkers.h.