OpenCV  4.5.5
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cv::aruco::Dictionary Class Reference

Dictionary/Set of markers. It contains the inner codification. More...

#include <opencv2/aruco/dictionary.hpp>

Public Member Functions

 Dictionary (const Mat &_bytesList=Mat(), int _markerSize=0, int _maxcorr=0)
 
 Dictionary (const Ptr< Dictionary > &_dictionary)
 
void drawMarker (int id, int sidePixels, OutputArray _img, int borderBits=1) const
 Draw a canonical marker image. More...
 
int getDistanceToId (InputArray bits, int id, bool allRotations=true) const
 Returns the distance of the input bits to the specific id. If allRotations is true, the four posible bits rotation are considered. More...
 
bool identify (const Mat &onlyBits, int &idx, int &rotation, double maxCorrectionRate) const
 Given a matrix of bits. Returns whether if marker is identified or not. It returns by reference the correct id (if any) and the correct rotation. More...
 

Static Public Member Functions

static Ptr< Dictionarycreate (int nMarkers, int markerSize, int randomSeed=0)
 
static Ptr< Dictionarycreate (int nMarkers, int markerSize, const Ptr< Dictionary > &baseDictionary, int randomSeed=0)
 
static Ptr< Dictionaryget (int dict)
 
static Mat getBitsFromByteList (const Mat &byteList, int markerSize)
 Transform list of bytes to matrix of bits. More...
 
static Mat getByteListFromBits (const Mat &bits)
 Transform matrix of bits to list of bytes in the 4 rotations. More...
 
static bool readDictionary (const cv::FileNode &fn, cv::Ptr< cv::aruco::Dictionary > &dictionary)
 Read a new dictionary from FileNode. Format: nmarkers: 35 markersize: 6 marker_0: "101011111011111001001001101100000000" ... marker_34: "011111010000111011111110110101100101". More...
 

Public Attributes

Mat bytesList
 
int markerSize
 
int maxCorrectionBits
 

Detailed Description

Dictionary/Set of markers. It contains the inner codification.

bytesList contains the marker codewords where

bytesList.ptr(i)[k*nbytes + j] is then the j-th byte of i-th marker, in its k-th rotation.

Constructor & Destructor Documentation

◆ Dictionary() [1/2]

cv::aruco::Dictionary::Dictionary ( const Mat _bytesList = Mat(),
int  _markerSize = 0,
int  _maxcorr = 0 
)

◆ Dictionary() [2/2]

cv::aruco::Dictionary::Dictionary ( const Ptr< Dictionary > &  _dictionary)

Dictionary(const Dictionary &_dictionary);

Member Function Documentation

◆ create() [1/2]

static Ptr<Dictionary> cv::aruco::Dictionary::create ( int  nMarkers,
int  markerSize,
int  randomSeed = 0 
)
static
Python:
cv.aruco.Dictionary_create(nMarkers, markerSize[, randomSeed]) -> retval
cv.aruco.Dictionary_create_from(nMarkers, markerSize, baseDictionary[, randomSeed]) -> retval

◆ create() [2/2]

static Ptr<Dictionary> cv::aruco::Dictionary::create ( int  nMarkers,
int  markerSize,
const Ptr< Dictionary > &  baseDictionary,
int  randomSeed = 0 
)
static
Python:
cv.aruco.Dictionary_create(nMarkers, markerSize[, randomSeed]) -> retval
cv.aruco.Dictionary_create_from(nMarkers, markerSize, baseDictionary[, randomSeed]) -> retval

◆ drawMarker()

void cv::aruco::Dictionary::drawMarker ( int  id,
int  sidePixels,
OutputArray  _img,
int  borderBits = 1 
) const
Python:
cv.aruco_Dictionary.drawMarker(id, sidePixels[, _img[, borderBits]]) -> _img

Draw a canonical marker image.

◆ get()

static Ptr<Dictionary> cv::aruco::Dictionary::get ( int  dict)
static
Python:
cv.aruco.Dictionary_get(dict) -> retval

◆ getBitsFromByteList()

static Mat cv::aruco::Dictionary::getBitsFromByteList ( const Mat byteList,
int  markerSize 
)
static
Python:
cv.aruco.Dictionary_getBitsFromByteList(byteList, markerSize) -> retval

Transform list of bytes to matrix of bits.

◆ getByteListFromBits()

static Mat cv::aruco::Dictionary::getByteListFromBits ( const Mat bits)
static
Python:
cv.aruco.Dictionary_getByteListFromBits(bits) -> retval

Transform matrix of bits to list of bytes in the 4 rotations.

◆ getDistanceToId()

int cv::aruco::Dictionary::getDistanceToId ( InputArray  bits,
int  id,
bool  allRotations = true 
) const

Returns the distance of the input bits to the specific id. If allRotations is true, the four posible bits rotation are considered.

◆ identify()

bool cv::aruco::Dictionary::identify ( const Mat onlyBits,
int &  idx,
int &  rotation,
double  maxCorrectionRate 
) const

Given a matrix of bits. Returns whether if marker is identified or not. It returns by reference the correct id (if any) and the correct rotation.

◆ readDictionary()

static bool cv::aruco::Dictionary::readDictionary ( const cv::FileNode fn,
cv::Ptr< cv::aruco::Dictionary > &  dictionary 
)
static
Python:
cv.aruco.Dictionary_readDictionary(fn, dictionary) -> retval

Read a new dictionary from FileNode. Format: nmarkers: 35 markersize: 6 marker_0: "101011111011111001001001101100000000" ... marker_34: "011111010000111011111110110101100101".

Member Data Documentation

◆ bytesList

Mat cv::aruco::Dictionary::bytesList

◆ markerSize

int cv::aruco::Dictionary::markerSize

◆ maxCorrectionBits

int cv::aruco::Dictionary::maxCorrectionBits

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