EstervQrCode 1.1.1
Library for qr code manipulation
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members

Dictionary is a set of unique ArUco markers of the same size. More...

#include <aruco_dictionary.hpp>

Public Member Functions

CV_WRAP Dictionary ()
 
CV_WRAP Dictionary (const Mat &bytesList, int _markerSize, int maxcorr=0)
 Basic ArUco dictionary constructor. More...
 
CV_WRAP bool readDictionary (const cv::FileNode &fn)
 Read a new dictionary from FileNode. More...
 
CV_WRAP void writeDictionary (FileStorage &fs, const String &name=String())
 Write a dictionary to FileStorage, format is the same as in readDictionary(). More...
 
CV_WRAP bool identify (const Mat &onlyBits, CV_OUT int &idx, CV_OUT int &rotation, double maxCorrectionRate) const
 Given a matrix of bits. Returns whether if marker is identified or not. More...
 
CV_WRAP int getDistanceToId (InputArray bits, int id, bool allRotations=true) const
 Returns Hamming distance of the input bits to the specific id. More...
 
CV_WRAP void generateImageMarker (int id, int sidePixels, OutputArray _img, int borderBits=1) const
 Generate a canonical marker image. More...
 

Static Public Member Functions

static CV_WRAP Mat getByteListFromBits (const Mat &bits)
 Transform matrix of bits to list of bytes with 4 marker rotations. More...
 
static CV_WRAP Mat getBitsFromByteList (const Mat &byteList, int markerSize)
 Transform list of bytes to matrix of bits. More...
 

Public Attributes

CV_PROP_RW Mat bytesList
 marker code information. See class description for more details More...
 
CV_PROP_RW int markerSize
 number of bits per dimension More...
 
CV_PROP_RW int maxCorrectionBits
 maximum number of bits that can be corrected More...
 

Detailed Description

Dictionary is a set of unique ArUco markers of the same size.

bytesList storing as 2-dimensions Mat with 4-th channels (CV_8UC4 type was used) and contains the marker codewords where:

Constructor & Destructor Documentation

◆ Dictionary() [1/2]

CV_WRAP cv::aruco::Dictionary::Dictionary ( )

◆ Dictionary() [2/2]

CV_WRAP cv::aruco::Dictionary::Dictionary ( const Mat bytesList,
int  _markerSize,
int  maxcorr = 0 
)

Basic ArUco dictionary constructor.

Parameters
bytesListbits for all ArUco markers in dictionary see memory layout in the class description
_markerSizeArUco marker size in units
maxcorrmaximum number of bits that can be corrected

Member Function Documentation

◆ generateImageMarker()

CV_WRAP void cv::aruco::Dictionary::generateImageMarker ( int  id,
int  sidePixels,
OutputArray  _img,
int  borderBits = 1 
) const

Generate a canonical marker image.

◆ getBitsFromByteList()

static CV_WRAP Mat cv::aruco::Dictionary::getBitsFromByteList ( const Mat byteList,
int  markerSize 
)
static

Transform list of bytes to matrix of bits.

◆ getByteListFromBits()

static CV_WRAP Mat cv::aruco::Dictionary::getByteListFromBits ( const Mat bits)
static

Transform matrix of bits to list of bytes with 4 marker rotations.

◆ getDistanceToId()

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

Returns Hamming distance of the input bits to the specific id.

If allRotations flag is set, the four posible marker rotations are considered

◆ identify()

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

Given a matrix of bits. Returns whether if marker is identified or not.

Returns reference to the marker id in the dictionary (if any) and its rotation.

◆ readDictionary()

CV_WRAP bool cv::aruco::Dictionary::readDictionary ( const cv::FileNode fn)

Read a new dictionary from FileNode.

Dictionary example in YAML format:
nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101"

◆ writeDictionary()

CV_WRAP void cv::aruco::Dictionary::writeDictionary ( FileStorage fs,
const String name = String() 
)

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

Member Data Documentation

◆ bytesList

CV_PROP_RW Mat cv::aruco::Dictionary::bytesList

marker code information. See class description for more details

◆ markerSize

CV_PROP_RW int cv::aruco::Dictionary::markerSize

number of bits per dimension

◆ maxCorrectionBits

CV_PROP_RW int cv::aruco::Dictionary::maxCorrectionBits

maximum number of bits that can be corrected


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