OpenCV  3.4.18
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...
 
bool readDictionary (const cv::FileNode &fn)
 Read a new dictionary from FileNode. Format:
nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101". More...
 
void writeDictionary (Ptr< FileStorage > &fs)
 Write a dictionary to FileStorage. Format is the same as in readDictionary(). 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...
 

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
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
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
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
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
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()

bool cv::aruco::Dictionary::readDictionary ( const cv::FileNode fn)
Python:
cv.aruco.Dictionary.readDictionary(fn) -> retval

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

◆ writeDictionary()

void cv::aruco::Dictionary::writeDictionary ( Ptr< FileStorage > &  fs)
Python:
cv.aruco.Dictionary.writeDictionary(fs) -> None

Write a dictionary to FileStorage. Format is the same as in readDictionary().

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: