Package boofcv.alg.fiducial.microqr
Class MicroQrCode
java.lang.Object
boofcv.alg.fiducial.microqr.MicroQrCode
- All Implemented Interfaces:
Cloneable
Information about a detected Micro QR Code.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Specifies information about the data in this markerstatic enum
Error correction levelstatic class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final QrCode.Mode[]
Specifies the subset of allowed mode for Micro QR Codes.boolean
True if the QR code was incorrectly encoded and the bits are transposed.Approximate bounding box for QR-Code.Which string encoding was used decoding aQrCode.Mode.BYTE
message.byte[]
Raw byte data after error correction has been applied to it.Specifies where the QR code parsing failedstatic final int
Mask that's applied to format information when encodingA homography transform from grid bit coordinates into image pixels.static final List<Point2D_I32>[]
Location of data bits in the code qr for each version.Which mask is appliedstatic final int
Maximum possible version of a Micro QR CodeIf applicable the message is decoded into a sequence of characters.Text encoding modeLocation of position pattern (pp) in the imagebyte[]
The raw byte data encoded into the QR Code.double
Locally computed threshold around the ppint
Number of bit errors detected when apply error correction to the messageint
Version of the marker.static final MicroQrCode.VersionInfo[]
Specifies characteristics of each version -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MicroQrCode.ErrorLevel[]
allowedErrorCorrection
(int version) Returns which error correction is allowed at a version.static QrCode.Mode[]
allowedModes
(int version) clone()
boolean
decodeFormatBits
(int bits) Decodes format bits and updates the QR Codeboolean
decodeVersionAndECC
(int code) Decodes the version of error levelint
Encoded format information with ECC.int
Computes the 3-bit format which encodes marker version and ECC levelint
Maximum number of data bits this marker can storeint
Returns number of data code wordsint
Returns number of error code wordsint
Returns number of modules in the marker, i.e.static int
maxDataBits
(int version, MicroQrCode.ErrorLevel level) Returns number of data bits which can be encodedstatic int
modeIndicatorBitCount
(int version) Number of bits used to indicate the modevoid
reset()
Resets class variables into their initial statesetTo
(MicroQrCode o) Sets 'this' so that it's equivalent to 'o'.int
Number of zero bits used to indicate end of messagestatic int
totalModules
(int version) Number of modules (squares) across the marker is based on its versionstatic QrCode.Mode
valueToMode
(int value) Looks up an allowed mode by value.
-
Field Details
-
FORMAT_MASK
public static final int FORMAT_MASKMask that's applied to format information when encoding- See Also:
-
MAX_VERSION
public static final int MAX_VERSIONMaximum possible version of a Micro QR Code- See Also:
-
VERSION_INFO
Specifies characteristics of each version -
LOCATION_BITS
Location of data bits in the code qr for each version. Precomputed for speed. -
version
public int versionVersion of the marker. This can be from 1 to 4. -
error
-
pp
Location of position pattern (pp) in the image -
thresholdPP
public double thresholdPPLocally computed threshold around the pp -
mode
Text encoding mode -
mask
Which mask is applied -
byteEncoding
Which string encoding was used decoding aQrCode.Mode.BYTE
message. If there is no BYTE encoding then this will be an empty string. If there are multiple independent BYTE segments then this will be the first one encountered. -
rawbits
public byte[] rawbitsThe raw byte data encoded into the QR Code. data + ecc -
corrected
public byte[] correctedRaw byte data after error correction has been applied to it. Only contains the data portion -
message
If applicable the message is decoded into a sequence of characters. -
bounds
Approximate bounding box for QR-Code. The bottom right corner is estimated by intersecting lines and should not be used in SFM applications. Order: top-left = 0. Top-right = 1, Bottom-Right = 2, Bottom-Left = 3. -
Hinv
A homography transform from grid bit coordinates into image pixels. -
bitsTransposed
public boolean bitsTransposedTrue if the QR code was incorrectly encoded and the bits are transposed. If this is true then the position patterns are stored in a transposed order. Bounds will not be affected. -
totalBitErrors
public int totalBitErrorsNumber of bit errors detected when apply error correction to the message -
failureCause
Specifies where the QR code parsing failed -
allowedModes
Specifies the subset of allowed mode for Micro QR Codes.
-
-
Constructor Details
-
MicroQrCode
public MicroQrCode()
-
-
Method Details
-
reset
public void reset()Resets class variables into their initial state -
setTo
Sets 'this' so that it's equivalent to 'o'.- Parameters:
o
- The target object
-
clone
-
terminatorBits
public int terminatorBits()Number of zero bits used to indicate end of message -
encodeFormatBits
public int encodeFormatBits()Encoded format information with ECC. Does NOT apply the mask. -
decodeFormatBits
public boolean decodeFormatBits(int bits) Decodes format bits and updates the QR Code- Parameters:
bits
- Format bits without mask- Returns:
- true if error correction didn't have a fault
-
encodeVersionAndEccLevel
public int encodeVersionAndEccLevel()Computes the 3-bit format which encodes marker version and ECC level -
decodeVersionAndECC
public boolean decodeVersionAndECC(int code) Decodes the version of error level- Returns:
- true if the code is valid
-
getNumberOfModules
public int getNumberOfModules()Returns number of modules in the marker, i.e. number of squares wide -
getMaxDataBits
public int getMaxDataBits()Maximum number of data bits this marker can store -
totalModules
public static int totalModules(int version) Number of modules (squares) across the marker is based on its version -
maxDataBits
Returns number of data bits which can be encoded -
allowedErrorCorrection
Returns which error correction is allowed at a version. -
modeIndicatorBitCount
public static int modeIndicatorBitCount(int version) Number of bits used to indicate the mode -
allowedModes
-
valueToMode
Looks up an allowed mode by value. Returns UNKNOWN if the value is out of range -
getNumberOfDataCodeWords
public int getNumberOfDataCodeWords()Returns number of data code words -
getNumberOfErrorCodeWords
public int getNumberOfErrorCodeWords()Returns number of error code words
-