Package org.opencv.objdetect
Class Dictionary
- java.lang.Object
-
- org.opencv.objdetect.Dictionary
-
public class Dictionary extends java.lang.ObjectDictionary/Set of markers, it contains the inner codification BytesList contains the marker codewords where: - bytesList.rows is the dictionary size - each marker is encoded usingnbytes = ceil(markerSize*markerSize/8.)- each row contains all 4 rotations of the marker, so its length is4*nbytesbytesList.ptr(i)[k*nbytes + j]is then the j-th byte of i-th marker, in its k-th rotation.
-
-
Field Summary
Fields Modifier and Type Field Description protected longnativeObj
-
Constructor Summary
Constructors Modifier Constructor Description Dictionary()protectedDictionary(long addr)Dictionary(Mat bytesList, int _markerSize)Dictionary(Mat bytesList, int _markerSize, int maxcorr)
-
Method Summary
All 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 in the 4 rotationsintgetDistanceToId(Mat bits, int id)Returns the distance of the input bits to the specific id.intgetDistanceToId(Mat bits, int id, boolean allRotations)Returns the 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)
-
-
-
Method Detail
-
getNativeObjAddr
public long getNativeObjAddr()
-
__fromPtr__
public static Dictionary __fromPtr__(long addr)
-
identify
public boolean identify(Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate)
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- Parameters:
onlyBits- automatically generatedidx- automatically generatedrotation- automatically generatedmaxCorrectionRate- automatically generated- Returns:
- automatically generated
-
getDistanceToId
public int getDistanceToId(Mat bits, int id, boolean allRotations)
Returns the distance of the input bits to the specific id. If allRotations is true, the four posible bits rotation are considered- Parameters:
bits- automatically generatedid- automatically generatedallRotations- automatically generated- Returns:
- automatically generated
-
getDistanceToId
public int getDistanceToId(Mat bits, int id)
Returns the distance of the input bits to the specific id. If allRotations is true, the four posible bits rotation are considered- Parameters:
bits- automatically generatedid- automatically generated- Returns:
- automatically generated
-
generateImageMarker
public void generateImageMarker(int id, int sidePixels, Mat _img, int borderBits)Generate a canonical marker image- Parameters:
id- automatically generatedsidePixels- automatically generated_img- automatically generatedborderBits- automatically generated
-
generateImageMarker
public void generateImageMarker(int id, int sidePixels, Mat _img)Generate a canonical marker image- Parameters:
id- automatically generatedsidePixels- automatically generated_img- automatically generated
-
getByteListFromBits
public static Mat getByteListFromBits(Mat bits)
Transform matrix of bits to list of bytes in the 4 rotations- Parameters:
bits- automatically generated- Returns:
- automatically generated
-
getBitsFromByteList
public static Mat getBitsFromByteList(Mat byteList, int markerSize)
Transform list of bytes to matrix of bits- Parameters:
byteList- automatically generatedmarkerSize- automatically generated- Returns:
- automatically generated
-
get_bytesList
public Mat get_bytesList()
-
set_bytesList
public void set_bytesList(Mat bytesList)
-
get_markerSize
public int get_markerSize()
-
set_markerSize
public void set_markerSize(int markerSize)
-
get_maxCorrectionBits
public int get_maxCorrectionBits()
-
set_maxCorrectionBits
public void set_maxCorrectionBits(int maxCorrectionBits)
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-