OpenCV  4.7.0
Open Source Computer Vision
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members

Dictionary/Set of markers, it contains the inner codification. More...

#include <opencv2/objdetect/aruco_dictionary.hpp>

Public Member Functions

 Dictionary ()
 
 Dictionary (const Mat &bytesList, int _markerSize, int maxcorr=0)
 
void generateImageMarker (int id, int sidePixels, OutputArray _img, int borderBits=1) const
 Generate 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. 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. More...
 
bool readDictionary (const cv::FileNode &fn)
 Read a new dictionary from FileNode. More...
 
void writeDictionary (FileStorage &fs, const String &name=String())
 Write a dictionary to FileStorage, format is the same as in readDictionary(). More...
 

Static Public Member Functions

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

◆ Dictionary() [2/2]

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

Member Function Documentation

◆ generateImageMarker()

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

Generate a canonical marker image.

◆ 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
Python:
cv.aruco.Dictionary.getDistanceToId(bits, id[, allRotations]) -> retval

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
Python:
cv.aruco.Dictionary.identify(onlyBits, maxCorrectionRate) -> retval, idx, rotation

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.

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

◆ writeDictionary()

void cv::aruco::Dictionary::writeDictionary ( FileStorage fs,
const String name = String() 
)
Python:
cv.aruco.Dictionary.writeDictionary(fs[, name]) -> 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: