Dictionary is a set of unique ArUco markers of the same size.
More...
#include <opencv2/objdetect/aruco_dictionary.hpp>
|
| | 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.
|
| int | getDistanceToId (InputArray onlyCellPixelRatio, int id, bool allRotations, float validBitIdThreshold) const |
| | Returns number of cells that differ from the specific id.
|
| Mat | getMarkerBits (int markerId, int rotationId=0) const |
| | Get ground truth bits float.
|
| 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 | identify (const Mat &onlyCellPixelRatio, int &idx, int &rotation, double maxCorrectionRate, float validBitIdThreshold) const |
| | Given a matrix of pixel ratio ranging from 0 to 1. Returns whether the 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().
|
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:
- bytesList.rows is the dictionary size
- each marker is encoded using nbytes = ceil(markerSize*markerSize/8.) bytes
- each row contains all 4 rotations of the marker, so its length is 4*nbytes
- the byte order in the bytesList[i] row: //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.
- Note
- Python bindings generate matrix with shape of bytesList dictionary_size x nbytes x 4, but it should be indexed like C++ version. Python example for j-th byte of i-th marker, in its k-th rotation: aruco_dict.bytesList[id].ravel()[k*nbytes + j]
◆ Dictionary() [1/2]
| cv::aruco::Dictionary::Dictionary |
( |
| ) |
|
| Python: |
|---|
| cv.aruco.Dictionary( | | ) -> | <aruco_Dictionary object> |
| cv.aruco.Dictionary( | bytesList, _markerSize[, maxcorr] | ) -> | <aruco_Dictionary object> |
◆ Dictionary() [2/2]
| 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.
- Parameters
-
| 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 |
◆ 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()
| Mat cv::aruco::Dictionary::getBitsFromByteList |
( |
const Mat & | byteList, |
|
|
int | markerSize, |
|
|
int | rotationId = 0 ) |
|
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.
◆ getByteListFromBits()
| 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 with 4 marker rotations.
◆ getDistanceToId() [1/2]
| int cv::aruco::Dictionary::getDistanceToId |
( |
InputArray | bits, |
|
|
int | id, |
|
|
bool | allRotations = true ) const |
| Python: |
|---|
| cv.aruco.Dictionary.getDistanceToId( | bits, id[, allRotations] | ) -> | retval |
| cv.aruco.Dictionary.getDistanceToId( | onlyCellPixelRatio, id, allRotations, validBitIdThreshold | ) -> | retval |
Returns Hamming distance of the input bits to the specific id.
If allRotations flag is set, the four possible marker rotations are considered
◆ getDistanceToId() [2/2]
| int cv::aruco::Dictionary::getDistanceToId |
( |
InputArray | onlyCellPixelRatio, |
|
|
int | id, |
|
|
bool | allRotations, |
|
|
float | validBitIdThreshold ) const |
| Python: |
|---|
| cv.aruco.Dictionary.getDistanceToId( | bits, id[, allRotations] | ) -> | retval |
| cv.aruco.Dictionary.getDistanceToId( | onlyCellPixelRatio, id, allRotations, validBitIdThreshold | ) -> | retval |
Returns number of cells that differ from the specific id.
For each cell, the distance is increased when the difference between the detected cell pixel ratio and the dictionary bit value is greater than validBitIdThreshold. If allRotations is set, the four possible marker rotations are considered.
- Parameters
-
| onlyCellPixelRatio | markerSize x markerSize matrix (CV_32FC1) holding, for each cell, the ratio of white pixels ranging from 0 to 1 |
| id | marker id in the dictionary to compute the distance to |
| allRotations | if set, the four possible marker rotations are considered and the smallest distance is returned |
| validBitIdThreshold | maximum allowed difference between a cell pixel ratio and the dictionary bit value; cells exceeding it are counted as differing |
◆ getMarkerBits()
| Mat cv::aruco::Dictionary::getMarkerBits |
( |
int | markerId, |
|
|
int | rotationId = 0 ) const |
| Python: |
|---|
| cv.aruco.Dictionary.getMarkerBits( | markerId[, rotationId] | ) -> | retval |
Get ground truth bits float.
◆ identify() [1/2]
| 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 |
| cv.aruco.Dictionary.identify( | onlyCellPixelRatio, maxCorrectionRate, validBitIdThreshold | ) -> | 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.
◆ identify() [2/2]
| bool cv::aruco::Dictionary::identify |
( |
const Mat & | onlyCellPixelRatio, |
|
|
int & | idx, |
|
|
int & | rotation, |
|
|
double | maxCorrectionRate, |
|
|
float | validBitIdThreshold ) const |
| Python: |
|---|
| cv.aruco.Dictionary.identify( | onlyBits, maxCorrectionRate | ) -> | retval, idx, rotation |
| cv.aruco.Dictionary.identify( | onlyCellPixelRatio, maxCorrectionRate, validBitIdThreshold | ) -> | retval, idx, rotation |
Given a matrix of pixel ratio ranging from 0 to 1. Returns whether the marker is identified or not.
Returns reference to the marker id in the dictionary (if any) and its 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 example in YAML format:
nmarkers: 35
markersize: 6
maxCorrectionBits: 5
marker_0: "101011111011111001001001101100000000"
...
marker_34: "011111010000111011111110110101100101"
◆ writeDictionary()
| Python: |
|---|
| cv.aruco.Dictionary.writeDictionary( | fs[, name] | ) -> | None |
◆ bytesList
| Mat cv::aruco::Dictionary::bytesList |
marker code information. See class description for more details
◆ markerSize
| int cv::aruco::Dictionary::markerSize |
number of bits per dimension
◆ maxCorrectionBits
| int cv::aruco::Dictionary::maxCorrectionBits |
maximum number of bits that can be corrected
The documentation for this class was generated from the following file: