29 #ifndef HIGHLYRELIABLEMARKERS_H 30 #define HIGHLYRELIABLEMARKERS_H 36 #include <opencv2/core/core.hpp> 37 #include <opencv2/imgproc/imgproc.hpp> 64 unsigned int getId(
unsigned int rot = 0)
const {
return _ids[rot]; };
70 bool get(
unsigned int pos,
unsigned int rot = 0)
const {
return _bits[rot][pos]; }
75 const std::vector< bool > &
getRotation(
unsigned int rot)
const {
return _bits[rot]; };
85 void set(
unsigned int pos,
bool val,
bool updateIds=
true);
90 unsigned int size()
const {
return n() * n(); };
95 unsigned int n()
const {
return _n; };
101 unsigned int selfDistance(
unsigned int &minRot)
const;
109 return selfDistance(minRot);
124 return distance(m, minRot);
135 std::string toString()
const;
142 cv::Mat getImg(
unsigned int pixSize)
const;
145 unsigned int _ids[4];
146 std::vector< bool > _bits[4];
152 unsigned int hammingDistance(
const std::vector< bool > &m1,
const std::vector< bool > &m2)
const;
166 bool fromFile(std::string
filename);
171 bool toFile(std::string filename);
178 unsigned int distance(
const MarkerCode &m,
unsigned int &minMarker,
unsigned int &minRot);
185 unsigned int minMarker, minRot;
186 return distance(m, minMarker, minRot);
192 unsigned int minimunDistance();
198 template <
class T >
static std::string
toStr(T num) {
199 std::stringstream ss;
230 bool findId(
unsigned int id,
unsigned int &orgPos);
233 std::vector< std::pair< unsigned int, unsigned int > >
_orderD;
247 static bool loadDictionary(
Dictionary D,
float correctionDistance = 1);
248 static bool loadDictionary(std::string filename,
float correctionDistance = 1);
257 int detect(
const cv::Mat &in,
int &nRotations);
265 static unsigned int _n;
274 static bool checkBorders(cv::Mat grey);
279 static MarkerCode getMarkerCode(
const cv::Mat &grey);
285 #endif // HIGHLYRELIABLEMARKERS_H
unsigned int getId(unsigned int rot=0) const
static Dictionary & getDictionary()
const std::vector< bool > & getRotation(unsigned int rot) const
static unsigned int _correctionDistance
unsigned int distance(const MarkerCode &m) const
static unsigned int _ncellsBorder
TFSIMD_FORCE_INLINE tfScalar distance(const Vector3 &v) const
Base class of labelers. A labelers receive a square of the image and determines if it has a valid mar...
unsigned int distance(const MarkerCode &m)
std::vector< std::pair< int, int > > _binaryTree
unsigned int size() const
static BalancedBinaryTree _binaryTree
int getBestInputSize()
getBestInputSize if desired, you can set the desired input size to the detect function ...
static std::string toStr(T num)
unsigned int selfDistance() const
std::vector< std::pair< unsigned int, unsigned int > > _orderD
bitset< 64 > fromString(std::string str)