@Namespace(value="cv::aruco") @NoOffset @Properties(inherit=opencv_objdetect.class) public class Dictionary extends Pointer
/** \brief 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]
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
Dictionary() |
Dictionary(long size)
Native array allocator.
|
Dictionary(Mat bytesList,
int _markerSize) |
Dictionary(Mat bytesList,
int _markerSize,
int maxcorr)
\brief Basic ArUco dictionary constructor
|
Dictionary(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Mat |
bytesList()
marker code information.
|
Dictionary |
bytesList(Mat setter) |
void |
generateImageMarker(int id,
int sidePixels,
GpuMat _img) |
void |
generateImageMarker(int id,
int sidePixels,
GpuMat _img,
int borderBits) |
void |
generateImageMarker(int id,
int sidePixels,
Mat _img) |
void |
generateImageMarker(int id,
int sidePixels,
Mat _img,
int borderBits)
\brief Generate a canonical marker image
|
void |
generateImageMarker(int id,
int sidePixels,
UMat _img) |
void |
generateImageMarker(int id,
int sidePixels,
UMat _img,
int borderBits) |
static Mat |
getBitsFromByteList(Mat byteList,
int markerSize)
\brief Transform list of bytes to matrix of bits
|
static Mat |
getByteListFromBits(Mat bits)
\brief Transform matrix of bits to list of bytes with 4 marker rotations
|
int |
getDistanceToId(GpuMat bits,
int id) |
int |
getDistanceToId(GpuMat bits,
int id,
boolean allRotations) |
int |
getDistanceToId(Mat bits,
int id) |
int |
getDistanceToId(Mat bits,
int id,
boolean allRotations)
\brief Returns Hamming distance of the input bits to the specific id.
|
int |
getDistanceToId(UMat bits,
int id) |
int |
getDistanceToId(UMat bits,
int id,
boolean allRotations) |
Dictionary |
getPointer(long i) |
boolean |
identify(Mat onlyBits,
int[] idx,
int[] rotation,
double maxCorrectionRate) |
boolean |
identify(Mat onlyBits,
IntBuffer idx,
IntBuffer rotation,
double maxCorrectionRate) |
boolean |
identify(Mat onlyBits,
IntPointer idx,
IntPointer rotation,
double maxCorrectionRate)
\brief Given a matrix of bits.
|
int |
markerSize()
number of bits per dimension
|
Dictionary |
markerSize(int setter) |
int |
maxCorrectionBits()
maximum number of bits that can be corrected
|
Dictionary |
maxCorrectionBits(int setter) |
Dictionary |
position(long position) |
boolean |
readDictionary(FileNode fn)
\brief Read a new dictionary from FileNode.
|
void |
writeDictionary(FileStorage fs) |
void |
writeDictionary(FileStorage fs,
BytePointer name)
\brief Write a dictionary to FileStorage, format is the same as in readDictionary().
|
void |
writeDictionary(FileStorage fs,
String name) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public Dictionary(Pointer p)
Pointer(Pointer)
.public Dictionary(long size)
Pointer.position(long)
.public Dictionary()
public Dictionary(@Const @ByRef 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 Dictionary position(long position)
public Dictionary getPointer(long i)
getPointer
in class Pointer
@ByRef public Mat bytesList()
public Dictionary bytesList(Mat setter)
public int markerSize()
public Dictionary markerSize(int setter)
public int maxCorrectionBits()
public Dictionary maxCorrectionBits(int setter)
@Cast(value="bool") public boolean readDictionary(@Const @ByRef FileNode fn)
public void writeDictionary(@ByRef FileStorage fs, @opencv_core.Str BytePointer name)
public void writeDictionary(@ByRef FileStorage fs)
public void writeDictionary(@ByRef FileStorage fs, @opencv_core.Str String name)
@Cast(value="bool") public boolean identify(@Const @ByRef Mat onlyBits, @ByRef IntPointer idx, @ByRef IntPointer rotation, double maxCorrectionRate)
@Cast(value="bool") public boolean identify(@Const @ByRef Mat onlyBits, @ByRef IntBuffer idx, @ByRef IntBuffer rotation, double maxCorrectionRate)
@Cast(value="bool") public boolean identify(@Const @ByRef Mat onlyBits, @ByRef int[] idx, @ByRef int[] rotation, double maxCorrectionRate)
public int getDistanceToId(@ByVal Mat bits, int id, @Cast(value="bool") boolean allRotations)
allRotations
flag is set, the four posible marker rotations are consideredpublic int getDistanceToId(@ByVal UMat bits, int id, @Cast(value="bool") boolean allRotations)
public int getDistanceToId(@ByVal GpuMat bits, int id, @Cast(value="bool") boolean allRotations)
public void generateImageMarker(int id, int sidePixels, @ByVal Mat _img, int borderBits)
public void generateImageMarker(int id, int sidePixels, @ByVal UMat _img, int borderBits)
public void generateImageMarker(int id, int sidePixels, @ByVal GpuMat _img, int borderBits)
@ByVal public static Mat getByteListFromBits(@Const @ByRef Mat bits)
Copyright © 2024. All rights reserved.