Package org.opencv.objdetect
Class Dictionary
java.lang.Object
org.opencv.objdetect.Dictionary
public class Dictionary extends Object
Dictionary/Set of markers, it contains the inner codification
BytesList contains the marker codewords where:
- bytesList.rows is the dictionary size
- each marker is encoded using
nbytes = ceil(markerSize*markerSize/8.)
- each row contains all 4 rotations of the marker, so its length is 4*nbytes
bytesList.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 long
nativeObj
-
Constructor Summary
Constructors Modifier Constructor Description Dictionary()
protected
Dictionary(long addr)
Dictionary(Mat bytesList, int _markerSize)
Dictionary(Mat bytesList, int _markerSize, int maxcorr)
-
Method Summary
Modifier and Type Method Description static Dictionary
__fromPtr__(long addr)
protected void
finalize()
void
generateImageMarker(int id, int sidePixels, Mat _img)
Generate a canonical marker imagevoid
generateImageMarker(int id, int sidePixels, Mat _img, int borderBits)
Generate a canonical marker imageMat
get_bytesList()
int
get_markerSize()
int
get_maxCorrectionBits()
static Mat
getBitsFromByteList(Mat byteList, int markerSize)
Transform list of bytes to matrix of bitsstatic Mat
getByteListFromBits(Mat bits)
Transform matrix of bits to list of bytes in the 4 rotationsint
getDistanceToId(Mat bits, int id)
Returns the distance of the input bits to the specific id.int
getDistanceToId(Mat bits, int id, boolean allRotations)
Returns the distance of the input bits to the specific id.long
getNativeObjAddr()
boolean
identify(Mat onlyBits, int[] idx, int[] rotation, double maxCorrectionRate)
Given a matrix of bits.void
set_bytesList(Mat bytesList)
void
set_markerSize(int markerSize)
void
set_maxCorrectionBits(int maxCorrectionBits)
-
Field Details
-
Constructor Details
-
Dictionary
-
Dictionary
public Dictionary() -
Dictionary
-
Dictionary
-
-
Method Details
-
getNativeObjAddr
-
__fromPtr__
-
identify
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
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
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
Generate a canonical marker image- Parameters:
id
- automatically generatedsidePixels
- automatically generated_img
- automatically generatedborderBits
- automatically generated
-
generateImageMarker
Generate a canonical marker image- Parameters:
id
- automatically generatedsidePixels
- automatically generated_img
- automatically generated
-
getByteListFromBits
Transform matrix of bits to list of bytes in the 4 rotations- Parameters:
bits
- automatically generated- Returns:
- automatically generated
-
getBitsFromByteList
Transform list of bytes to matrix of bits- Parameters:
byteList
- automatically generatedmarkerSize
- automatically generated- Returns:
- automatically generated
-
get_bytesList
-
set_bytesList
-
get_markerSize
-
set_markerSize
-
get_maxCorrectionBits
-
set_maxCorrectionBits
-
finalize
-