cv::aruco::Dictionary Class ReferenceObject Detection » ArUco markers and boards detection for robust camera pose estimation
Dictionary is a set of unique ArUco markers of the same size. More...
#include <opencv2/objdetect/aruco_dictionary.hpp>
Dictionary is a set of unique ArUco markers of the same size. More...
#include <opencv2/objdetect/aruco_dictionary.hpp>
Public Member Functions | |
| Dictionary () | |
| Dictionary (const Mat &bytesList, int _markerSize, int maxcorr=0) | |
| Basic ArUco dictionary constructor. | |
| void | generateImageMarker (int id, int sidePixels, OutputArray _img, int borderBits=1) const |
| Generate a canonical marker image. | |
| int | getDistanceToId (InputArray bits, int id, bool allRotations=true) const |
| Returns Hamming distance of the input bits to the specific id. | |
| 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. | |
| bool | readDictionary (const cv::FileNode &fn) |
| Read a new dictionary from FileNode. | |
| void | writeDictionary (FileStorage &fs, const String &name=String()) |
| Write a dictionary to FileStorage, format is the same as in readDictionary(). | |
Static Public Member Functions | |
| static Mat | getBitsFromByteList (const Mat &byteList, int markerSize, int rotationId=0) |
| Transform list of bytes to matrix of bits. | |
| static Mat | getByteListFromBits (const Mat &bits) |
| Transform matrix of bits to list of bytes with 4 marker rotations. | |
Public Attributes | |
| Mat | bytesList |
| marker code information. See class description for more details | |
| int | markerSize |
| number of bits per dimension | |
| int | maxCorrectionBits |
| maximum number of bits that can be corrected | |
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:
nbytes = ceil(markerSize*markerSize/8.) bytes4*nbytes//bytes without rotation/bytes with rotation 1/bytes with rotation 2/bytes with rotation 3// So bytesList.ptr(i)[k*nbytes + j] is the j-th byte of i-th marker, in its k-th rotation.
| cv::aruco::Dictionary::Dictionary | ( | ) |
| Python: | ||||
|---|---|---|---|---|
| cv.aruco.Dictionary( | ) -> | <aruco_Dictionary object> | ||
| cv.aruco.Dictionary( | bytesList, _markerSize[, maxcorr] | ) -> | <aruco_Dictionary object> |
| cv::aruco::Dictionary::Dictionary | ( | const Mat & | bytesList, |
| int | _markerSize, | ||
| int | maxcorr = 0 ) |
| Python: | ||||
|---|---|---|---|---|
| cv.aruco.Dictionary( | ) -> | <aruco_Dictionary object> | ||
| cv.aruco.Dictionary( | bytesList, _markerSize[, maxcorr] | ) -> | <aruco_Dictionary object> |
Basic ArUco dictionary constructor.
| bytesList | bits for all ArUco markers in dictionary see memory layout in the class description |
| _markerSize | ArUco marker size in units |
| maxcorr | maximum number of bits that can be corrected |
| 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.
| static |
| Python: | ||||
|---|---|---|---|---|
| cv.aruco.Dictionary.getBitsFromByteList( | byteList, markerSize[, rotationId] | ) -> | retval | |
| cv.aruco.Dictionary_getBitsFromByteList( | byteList, markerSize[, rotationId] | ) -> | retval |
Transform list of bytes to matrix of bits.
| int cv::aruco::Dictionary::getDistanceToId | ( | InputArray | bits, |
| int | id, | ||
| bool | allRotations = true ) const |
| Python: | ||||
|---|---|---|---|---|
| cv.aruco.Dictionary.getDistanceToId( | bits, id[, allRotations] | ) -> | retval |
Returns Hamming distance of the input bits to the specific id.
If allRotations flag is set, the four posible marker rotations are considered
| 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.
Returns reference to the marker id in the dictionary (if any) and its rotation.
| bool cv::aruco::Dictionary::readDictionary | ( | const cv::FileNode & | fn | ) |
| Python: | ||||
|---|---|---|---|---|
| cv.aruco.Dictionary.readDictionary( | fn | ) -> | retval |
Read a new dictionary from FileNode.
Dictionary example in YAML format:
nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101"
| 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().
| Mat cv::aruco::Dictionary::bytesList |
marker code information. See class description for more details
| int cv::aruco::Dictionary::markerSize |
number of bits per dimension
| int cv::aruco::Dictionary::maxCorrectionBits |
maximum number of bits that can be corrected