OpenCV for Unity 2.6.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.ObjdetectModule.Dictionary Class Reference

Dictionary is a set of unique ArUco markers of the same size. More...

Public Member Functions

 Dictionary ()
 
 Dictionary (Mat bytesList, int _markerSize)
 Basic ArUco dictionary constructor.
 
 Dictionary (Mat bytesList, int _markerSize, int maxcorr)
 Basic ArUco dictionary constructor.
 
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 ()
 
int getDistanceToId (Mat bits, int id)
 Returns Hamming distance of the input bits to the specific id.
 
int getDistanceToId (Mat bits, int id, bool allRotations)
 Returns Hamming distance of the input bits to the specific id.
 
IntPtr getNativeObjAddr ()
 
bool identify (Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate)
 Given a matrix of bits. Returns whether if marker is identified or not.
 
void set_bytesList (Mat bytesList)
 
void set_markerSize (int markerSize)
 
void set_maxCorrectionBits (int maxCorrectionBits)
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static Dictionary __fromPtr__ (IntPtr addr)
 
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.
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

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]

Constructor & Destructor Documentation

◆ Dictionary() [1/3]

OpenCVForUnity.ObjdetectModule.Dictionary.Dictionary ( )

◆ Dictionary() [2/3]

OpenCVForUnity.ObjdetectModule.Dictionary.Dictionary ( Mat bytesList,
int _markerSize,
int maxcorr )

Basic ArUco dictionary constructor.

Parameters
bytesListbits for all ArUco markers in dictionary see memory layout in the class description
_markerSizeArUco marker size in units
maxcorrmaximum number of bits that can be corrected

◆ Dictionary() [3/3]

OpenCVForUnity.ObjdetectModule.Dictionary.Dictionary ( Mat bytesList,
int _markerSize )

Basic ArUco dictionary constructor.

Parameters
bytesListbits for all ArUco markers in dictionary see memory layout in the class description
_markerSizeArUco marker size in units
maxcorrmaximum number of bits that can be corrected

Member Function Documentation

◆ __fromPtr__()

static Dictionary OpenCVForUnity.ObjdetectModule.Dictionary.__fromPtr__ ( IntPtr addr)
static

◆ Dispose()

override void OpenCVForUnity.ObjdetectModule.Dictionary.Dispose ( bool disposing)
protectedvirtual

Reimplemented from OpenCVForUnity.DisposableObject.

◆ generateImageMarker() [1/2]

void OpenCVForUnity.ObjdetectModule.Dictionary.generateImageMarker ( int id,
int sidePixels,
Mat _img )

Generate a canonical marker image.

◆ generateImageMarker() [2/2]

void OpenCVForUnity.ObjdetectModule.Dictionary.generateImageMarker ( int id,
int sidePixels,
Mat _img,
int borderBits )

Generate a canonical marker image.

◆ get_bytesList()

Mat OpenCVForUnity.ObjdetectModule.Dictionary.get_bytesList ( )

◆ get_markerSize()

int OpenCVForUnity.ObjdetectModule.Dictionary.get_markerSize ( )

◆ get_maxCorrectionBits()

int OpenCVForUnity.ObjdetectModule.Dictionary.get_maxCorrectionBits ( )

◆ getBitsFromByteList()

static Mat OpenCVForUnity.ObjdetectModule.Dictionary.getBitsFromByteList ( Mat byteList,
int markerSize )
static

Transform list of bytes to matrix of bits.

◆ getByteListFromBits()

static Mat OpenCVForUnity.ObjdetectModule.Dictionary.getByteListFromBits ( Mat bits)
static

Transform matrix of bits to list of bytes with 4 marker rotations.

◆ getDistanceToId() [1/2]

int OpenCVForUnity.ObjdetectModule.Dictionary.getDistanceToId ( Mat bits,
int id )

Returns Hamming distance of the input bits to the specific id.

If allRotations flag is set, the four posible marker rotations are considered

◆ getDistanceToId() [2/2]

int OpenCVForUnity.ObjdetectModule.Dictionary.getDistanceToId ( Mat bits,
int id,
bool allRotations )

Returns Hamming distance of the input bits to the specific id.

If allRotations flag is set, the four posible marker rotations are considered

◆ getNativeObjAddr()

IntPtr OpenCVForUnity.ObjdetectModule.Dictionary.getNativeObjAddr ( )

◆ identify()

bool OpenCVForUnity.ObjdetectModule.Dictionary.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.

◆ set_bytesList()

void OpenCVForUnity.ObjdetectModule.Dictionary.set_bytesList ( Mat bytesList)

◆ set_markerSize()

void OpenCVForUnity.ObjdetectModule.Dictionary.set_markerSize ( int markerSize)

◆ set_maxCorrectionBits()

void OpenCVForUnity.ObjdetectModule.Dictionary.set_maxCorrectionBits ( int maxCorrectionBits)

The documentation for this class was generated from the following file: