Class Dictionary
- Namespace
- OpenCvSharp.Aruco
- Assembly
- OpenCvSharp.dll
Dictionary/Set of markers. It contains the inner codification
public class Dictionary : CvObject, IDisposable
- Inheritance
-
Dictionary
- Implements
- Inherited Members
Constructors
Dictionary()
Creates an empty dictionary.
public Dictionary()
Dictionary(Mat, int, int)
Basic ArUco dictionary constructor
public Dictionary(Mat bytesList, int markerSize, int maxCorrectionBits = 0)
Parameters
bytesListMatbits for all ArUco markers in dictionary. See class description for the memory layout.
markerSizeintArUco marker size in units
maxCorrectionBitsintmaximum number of bits that can be corrected
Properties
BytesList
Marker code information
public Mat BytesList { get; }
Property Value
MarkerSize
Number of bits per dimension.
public int MarkerSize { get; set; }
Property Value
MaxCorrectionBits
Maximum number of bits that can be corrected.
public int MaxCorrectionBits { get; set; }
Property Value
Methods
GenerateImageMarker(int, int, OutputArray, int)
Generate a canonical marker image
public void GenerateImageMarker(int id, int sidePixels, OutputArray img, int borderBits = 1)
Parameters
idintsidePixelsintimgOutputArrayborderBitsint
GetBitsFromByteList(Mat, int, int)
Transform list of bytes to matrix of bits
public static Mat GetBitsFromByteList(Mat byteList, int markerSize, int rotationId = 0)
Parameters
Returns
GetByteListFromBits(Mat)
Transform matrix of bits to list of bytes in the 4 rotations
public static Mat GetByteListFromBits(Mat bits)
Parameters
bitsMat
Returns
GetDistanceToId(InputArray, int, bool)
Returns the distance of the input bits to the specific id. If allRotations is true, the four possible bits rotation are considered
public int GetDistanceToId(InputArray bits, int id, bool allRotations = true)
Parameters
bitsInputArrayidintallRotationsbool
Returns
GetMarkerBits(int, int)
Get ground truth bits float
public Mat GetMarkerBits(int markerId, int rotationId = 0)
Parameters
Returns
Identify(Mat, out int, out int, double)
Given a matrix of bits. Returns whether if marker is identified or not. It returns by reference the correct id (if any) and the correct rotation
public bool Identify(Mat onlyBits, out int idx, out int rotation, double maxCorrectionRate)
Parameters
Returns
Identify(Mat, out int, out int, double, float)
Given a matrix of pixel ratio ranging from 0 to 1. Returns whether if marker is identified or not. It returns by reference the correct id (if any) and the correct rotation
public bool Identify(Mat onlyCellPixelRatio, out int idx, out int rotation, double maxCorrectionRate, float validBitIdThreshold)
Parameters
onlyCellPixelRatioMatidxintrotationintmaxCorrectionRatedoublevalidBitIdThresholdfloatacceptable threshold when comparing the detected marker to the dictionary during marker identification.
Returns
ReadDictionary(FileNode)
Read a new dictionary from FileNode.
public bool ReadDictionary(FileNode fn)
Parameters
fnFileNodethe FileNode to read the dictionary from.
Returns
WriteDictionary(FileStorage, string)
Write a dictionary to FileStorage, format is the same as in ReadDictionary().
public void WriteDictionary(FileStorage fs, string name = "")
Parameters
fsFileStoragethe FileStorage to write the dictionary to.
namestringname of the node to write.