Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
aruco::Dictionary Class Reference

#include <dictionary.h>

Public Types

enum  DICT_TYPES : uint64_t {
  ALL_DICTS = 0, ARUCO_MIP_36h12 = 1, ARUCO = 2, ARUCO_MIP_25h7 = 3,
  ARUCO_MIP_16h3 = 4, ARTAG = 5, ARTOOLKITPLUS = 6, ARTOOLKITPLUSBCH = 7,
  TAG16h5 = 8, TAG25h7 = 9, TAG25h9 = 10, TAG36h11 = 11,
  TAG36h10 = 12, CHILITAGS = 13, CUSTOM = 14
}
 

Public Member Functions

int at (uint64_t code)
 
MarkerMap createMarkerMap (cv::Size gridSize, int MarkerSize, int MarkerDistance, const std::vector< int > &Ids, bool chess_board=false)
 
const std::map< uint64_t, uint16_t > & getMapCode () const
 
cv::Mat getMarkerImage_id (int id, int bit_size, bool addWaterMark=true, bool enclosed_corners=false, bool printExternalWhiteBorder=false, bool centralCircle=false)
 Dictionary::getMarkerImage_id. More...
 
std::string getName () const
 
DICT_TYPES getType () const
 
bool is (uint64_t code) const
 
uint32_t nbits () const
 
int operator[] (uint64_t code)
 
uint64_t size () const
 
uint32_t tau () const
 

Static Public Member Functions

static uint64_t computeDictionaryDistance (const Dictionary &d)
 Dictionary::computeDictionaryDistance. More...
 
static std::vector< std::string > getDicTypes ()
 
static DICT_TYPES getTypeFromString (std::string str)
 
static std::string getTypeString (DICT_TYPES t)
 
static bool isPredefinedDictinaryString (std::string str)
 
static Dictionary load (std::string info)
 
static Dictionary loadFromFile (std::string path)
 
static Dictionary loadPredefined (DICT_TYPES type)
 
static Dictionary loadPredefined (std::string type)
 

Private Member Functions

void insert (uint64_t code, int id)
 

Static Private Member Functions

static void fromVector (const std::vector< uint64_t > &codes, std::map< uint64_t, uint16_t > &code_id_map)
 

Private Attributes

std::map< uint64_t, uint16_t > _code_id
 
std::string _name
 
uint32_t _nbits
 
uint32_t _tau
 
DICT_TYPES _type
 

Detailed Description

Represents a set of valid marker ids with a maximum size of 8x8 = 64 bits. In our approach, markers are seen as a pair code-id. The code is the internal binary code printed on the marker. Maximum size is 8x8 bits. The id is a smaller number you can use to identify it. You will use only the id

See enum DICT_TYPES for the set of dicitionaries availables

Definition at line 41 of file dictionary.h.

Member Enumeration Documentation

◆ DICT_TYPES

Enumerator
ALL_DICTS 
ARUCO_MIP_36h12 
ARUCO 
ARUCO_MIP_25h7 
ARUCO_MIP_16h3 
ARTAG 
ARTOOLKITPLUS 
ARTOOLKITPLUSBCH 
TAG16h5 
TAG25h7 
TAG25h9 
TAG36h11 
TAG36h10 
CHILITAGS 
CUSTOM 

Definition at line 45 of file dictionary.h.

Member Function Documentation

◆ at()

int aruco::Dictionary::at ( uint64_t  code)
inline

Definition at line 106 of file dictionary.h.

◆ computeDictionaryDistance()

uint64_t aruco::Dictionary::computeDictionaryDistance ( const Dictionary dict)
static

Dictionary::computeDictionaryDistance.

Parameters
dict
Returns

Definition at line 3620 of file dictionary.cpp.

◆ createMarkerMap()

MarkerMap aruco::Dictionary::createMarkerMap ( cv::Size  gridSize,
int  MarkerSize,
int  MarkerDistance,
const std::vector< int > &  Ids,
bool  chess_board = false 
)
Todo:
use const auto &
Todo:
use const auto &

Definition at line 3544 of file dictionary.cpp.

◆ fromVector()

void aruco::Dictionary::fromVector ( const std::vector< uint64_t > &  codes,
std::map< uint64_t, uint16_t > &  code_id_map 
)
staticprivate

Definition at line 101 of file dictionary.cpp.

◆ getDicTypes()

vector< std::string > aruco::Dictionary::getDicTypes ( )
static

Definition at line 3536 of file dictionary.cpp.

◆ getMapCode()

const std::map<uint64_t, uint16_t>& aruco::Dictionary::getMapCode ( ) const
inline

Definition at line 96 of file dictionary.h.

◆ getMarkerImage_id()

cv::Mat aruco::Dictionary::getMarkerImage_id ( int  id,
int  bit_size,
bool  addWaterMark = true,
bool  enclosed_corners = false,
bool  externalWhiteBorder = false,
bool  centralCircle = false 
)

Dictionary::getMarkerImage_id.

Parameters
id
Returns

Definition at line 3348 of file dictionary.cpp.

◆ getName()

std::string aruco::Dictionary::getName ( ) const
inline

Definition at line 91 of file dictionary.h.

◆ getType()

DICT_TYPES aruco::Dictionary::getType ( ) const
inline

Definition at line 70 of file dictionary.h.

◆ getTypeFromString()

Dictionary::DICT_TYPES aruco::Dictionary::getTypeFromString ( std::string  str)
static

Definition at line 3494 of file dictionary.cpp.

◆ getTypeString()

std::string aruco::Dictionary::getTypeString ( DICT_TYPES  t)
static

Definition at line 3455 of file dictionary.cpp.

◆ insert()

void aruco::Dictionary::insert ( uint64_t  code,
int  id 
)
inlineprivate

Definition at line 172 of file dictionary.h.

◆ is()

bool aruco::Dictionary::is ( uint64_t  code) const
inline

Definition at line 65 of file dictionary.h.

◆ isPredefinedDictinaryString()

bool aruco::Dictionary::isPredefinedDictinaryString ( std::string  str)
static

Definition at line 3531 of file dictionary.cpp.

◆ load()

Dictionary aruco::Dictionary::load ( std::string  info)
static

Loads a dictioanary using the string passed. If it is a string of the predefined dictionaries, then returns it. Otherwise, tries to load from a file

Definition at line 32 of file dictionary.cpp.

◆ loadFromFile()

Dictionary aruco::Dictionary::loadFromFile ( std::string  path)
static

loads a dictionary defined in a file Please note that the parsing is very basic and you must be very strict.

Here is an example of a 3x3 dictionary of 3 markers 010 111 000 001 101 001 001 010 100

File: myown.dict

name MYOWN nbits 9 010001001 111101010 000001100

Definition at line 41 of file dictionary.cpp.

◆ loadPredefined() [1/2]

Dictionary aruco::Dictionary::loadPredefined ( DICT_TYPES  type)
static

Definition at line 113 of file dictionary.cpp.

◆ loadPredefined() [2/2]

Dictionary aruco::Dictionary::loadPredefined ( std::string  type)
static

Definition at line 108 of file dictionary.cpp.

◆ nbits()

uint32_t aruco::Dictionary::nbits ( ) const
inline

Definition at line 81 of file dictionary.h.

◆ operator[]()

int aruco::Dictionary::operator[] ( uint64_t  code)
inline

Definition at line 102 of file dictionary.h.

◆ size()

uint64_t aruco::Dictionary::size ( ) const
inline

Definition at line 76 of file dictionary.h.

◆ tau()

uint32_t aruco::Dictionary::tau ( ) const
inline

Definition at line 86 of file dictionary.h.

Member Data Documentation

◆ _code_id

std::map<uint64_t, uint16_t> aruco::Dictionary::_code_id
private

Definition at line 179 of file dictionary.h.

◆ _name

std::string aruco::Dictionary::_name
private

Definition at line 186 of file dictionary.h.

◆ _nbits

uint32_t aruco::Dictionary::_nbits
private

Definition at line 182 of file dictionary.h.

◆ _tau

uint32_t aruco::Dictionary::_tau
private

Definition at line 183 of file dictionary.h.

◆ _type

DICT_TYPES aruco::Dictionary::_type
private

Definition at line 185 of file dictionary.h.


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


aruco
Author(s): Rafael Muñoz Salinas , Bence Magyar
autogenerated on Sat Sep 23 2023 02:26:45