public class Dictionary
extends java.lang.Object
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]
Constructor and Description |
---|
Dictionary() |
Dictionary(Mat bytesList,
int _markerSize)
Basic ArUco dictionary constructor
|
Dictionary(Mat bytesList,
int _markerSize,
int maxcorr)
Basic ArUco dictionary constructor
|
Modifier and Type | Method and Description |
---|---|
static Dictionary |
__fromPtr__(long addr) |
void |
generateImageMarker(int id,
int sidePixels,
Mat _img)
Generate a canonical marker image
|
void |
generateImageMarker(int id,
int sidePixels,
Mat _img,
int borderBits)
Generate a canonical marker image
|
Mat |
get_bytesList() |
int |
get_markerSize() |
int |
get_maxCorrectionBits() |
static Mat |
getBitsFromByteList(Mat byteList,
int markerSize)
Transform list of bytes to matrix of bits
|
static Mat |
getByteListFromBits(Mat bits)
Transform matrix of bits to list of bytes with 4 marker rotations
|
int |
getDistanceToId(Mat bits,
int id)
Returns Hamming distance of the input bits to the specific id.
|
int |
getDistanceToId(Mat bits,
int id,
boolean allRotations)
Returns Hamming distance of the input bits to the specific id.
|
long |
getNativeObjAddr() |
boolean |
identify(Mat onlyBits,
int[] idx,
int[] rotation,
double maxCorrectionRate)
Given a matrix of bits.
|
void |
set_bytesList(Mat bytesList) |
void |
set_markerSize(int markerSize) |
void |
set_maxCorrectionBits(int maxCorrectionBits) |
public Dictionary()
public Dictionary(Mat bytesList, int _markerSize)
bytesList
- bits for all ArUco markers in dictionary see memory layout in the class description_markerSize
- ArUco marker size in unitspublic Dictionary(Mat bytesList, int _markerSize, int maxcorr)
bytesList
- bits for all ArUco markers in dictionary see memory layout in the class description_markerSize
- ArUco marker size in unitsmaxcorr
- maximum number of bits that can be correctedpublic static Dictionary __fromPtr__(long addr)
public void generateImageMarker(int id, int sidePixels, Mat _img)
id
- automatically generatedsidePixels
- automatically generated_img
- automatically generatedpublic void generateImageMarker(int id, int sidePixels, Mat _img, int borderBits)
id
- automatically generatedsidePixels
- automatically generated_img
- automatically generatedborderBits
- automatically generatedpublic Mat get_bytesList()
public int get_markerSize()
public int get_maxCorrectionBits()
public static Mat getBitsFromByteList(Mat byteList, int markerSize)
byteList
- automatically generatedmarkerSize
- automatically generatedpublic static Mat getByteListFromBits(Mat bits)
bits
- automatically generatedpublic int getDistanceToId(Mat bits, int id)
allRotations
flag is set, the four posible marker rotations are consideredbits
- automatically generatedid
- automatically generatedpublic int getDistanceToId(Mat bits, int id, boolean allRotations)
allRotations
flag is set, the four posible marker rotations are consideredbits
- automatically generatedid
- automatically generatedallRotations
- automatically generatedpublic long getNativeObjAddr()
public boolean identify(Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate)
onlyBits
- automatically generatedidx
- automatically generatedrotation
- automatically generatedmaxCorrectionRate
- automatically generatedpublic void set_bytesList(Mat bytesList)
public void set_markerSize(int markerSize)
public void set_maxCorrectionBits(int maxCorrectionBits)
Generated on 2024-06-02 16:58:23 / OpenCV 4.10.0