Package org.opencv.objdetect
Class Dictionary
- java.lang.Object
- 
- org.opencv.objdetect.Dictionary
 
- 
 public class Dictionary extends java.lang.ObjectDictionary is a set of unique ArUco markers of the same sizebytesListstoring 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 usingnbytes = ceil(markerSize*markerSize/8.)bytes - each row contains all 4 rotations of the marker, so its length is4*nbytes- the byte order in the bytesList[i] row://bytes without rotation/bytes with rotation 1/bytes with rotation 2/bytes with rotation 3//SobytesList.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 bytesListdictionary_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]
- 
- 
Field SummaryFields Modifier and Type Field Description protected longnativeObj
 - 
Constructor SummaryConstructors Modifier Constructor Description Dictionary()protectedDictionary(long addr)Dictionary(Mat bytesList, int _markerSize)Basic ArUco dictionary constructorDictionary(Mat bytesList, int _markerSize, int maxcorr)Basic ArUco dictionary constructor
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Dictionary__fromPtr__(long addr)protected voidfinalize()voidgenerateImageMarker(int id, int sidePixels, Mat _img)Generate a canonical marker imagevoidgenerateImageMarker(int id, int sidePixels, Mat _img, int borderBits)Generate a canonical marker imageMatget_bytesList()intget_markerSize()intget_maxCorrectionBits()static MatgetBitsFromByteList(Mat byteList, int markerSize)Transform list of bytes to matrix of bitsstatic MatgetByteListFromBits(Mat bits)Transform matrix of bits to list of bytes with 4 marker rotationsintgetDistanceToId(Mat bits, int id)Returns Hamming distance of the input bits to the specific id.intgetDistanceToId(Mat bits, int id, boolean allRotations)Returns Hamming distance of the input bits to the specific id.longgetNativeObjAddr()booleanidentify(Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate)Given a matrix of bits.voidset_bytesList(Mat bytesList)voidset_markerSize(int markerSize)voidset_maxCorrectionBits(int maxCorrectionBits)
 
- 
- 
- 
Constructor Detail- 
Dictionaryprotected Dictionary(long addr) 
 - 
Dictionarypublic Dictionary() 
 - 
Dictionarypublic Dictionary(Mat bytesList, int _markerSize, int maxcorr) 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
 
 - 
Dictionarypublic Dictionary(Mat bytesList, int _markerSize) 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
 
 
- 
 - 
Method Detail- 
getNativeObjAddrpublic long getNativeObjAddr() 
 - 
__fromPtr__public static Dictionary __fromPtr__(long addr) 
 - 
identifypublic boolean identify(Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate) 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.- Parameters:
- onlyBits- automatically generated
- idx- automatically generated
- rotation- automatically generated
- maxCorrectionRate- automatically generated
- Returns:
- automatically generated
 
 - 
getDistanceToIdpublic int getDistanceToId(Mat bits, int id, boolean allRotations) Returns Hamming distance of the input bits to the specific id. IfallRotationsflag is set, the four posible marker rotations are considered- Parameters:
- bits- automatically generated
- id- automatically generated
- allRotations- automatically generated
- Returns:
- automatically generated
 
 - 
getDistanceToIdpublic int getDistanceToId(Mat bits, int id) Returns Hamming distance of the input bits to the specific id. IfallRotationsflag is set, the four posible marker rotations are considered- Parameters:
- bits- automatically generated
- id- automatically generated
- Returns:
- automatically generated
 
 - 
generateImageMarkerpublic void generateImageMarker(int id, int sidePixels, Mat _img, int borderBits)Generate a canonical marker image- Parameters:
- id- automatically generated
- sidePixels- automatically generated
- _img- automatically generated
- borderBits- automatically generated
 
 - 
generateImageMarkerpublic void generateImageMarker(int id, int sidePixels, Mat _img)Generate a canonical marker image- Parameters:
- id- automatically generated
- sidePixels- automatically generated
- _img- automatically generated
 
 - 
getByteListFromBitspublic static Mat getByteListFromBits(Mat bits) Transform matrix of bits to list of bytes with 4 marker rotations- Parameters:
- bits- automatically generated
- Returns:
- automatically generated
 
 - 
getBitsFromByteListpublic static Mat getBitsFromByteList(Mat byteList, int markerSize) Transform list of bytes to matrix of bits- Parameters:
- byteList- automatically generated
- markerSize- automatically generated
- Returns:
- automatically generated
 
 - 
get_bytesListpublic Mat get_bytesList() 
 - 
set_bytesListpublic void set_bytesList(Mat bytesList) 
 - 
get_markerSizepublic int get_markerSize() 
 - 
set_markerSizepublic void set_markerSize(int markerSize) 
 - 
get_maxCorrectionBitspublic int get_maxCorrectionBits() 
 - 
set_maxCorrectionBitspublic void set_maxCorrectionBits(int maxCorrectionBits) 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-