Class MicroQrCode

java.lang.Object
boofcv.alg.fiducial.microqr.MicroQrCode
All Implemented Interfaces:
Cloneable

public class MicroQrCode
extends Object
implements Cloneable
Information about a detected Micro QR Code.
  • Field Details

    • FORMAT_MASK

      public static final int FORMAT_MASK
      Mask that's applied to format information when encoding
      See Also:
      Constant Field Values
    • MAX_VERSION

      public static final int MAX_VERSION
      Maximum possible version of a Micro QR Code
      See Also:
      Constant Field Values
    • VERSION_INFO

      public static final MicroQrCode.VersionInfo[] VERSION_INFO
      Specifies characteristics of each version
    • LOCATION_BITS

      public static final List<Point2D_I32>[] LOCATION_BITS
      Location of data bits in the code qr for each version. Precomputed for speed.
    • version

      public int version
      Version of the marker. This can be from 1 to 4.
    • error

      public MicroQrCode.ErrorLevel error
    • pp

      public Polygon2D_F64 pp
      Location of position pattern (pp) in the image
    • thresholdPP

      public double thresholdPP
      Locally computed threshold around the pp
    • mode

      public QrCode.Mode mode
      Text encoding mode
    • mask

      Which mask is applied
    • rawbits

      public byte[] rawbits
      The raw byte data encoded into the QR Code. data + ecc
    • corrected

      public byte[] corrected
      Raw byte data after error correction has been applied to it. Only contains the data portion
    • message

      public String message
      If applicable the message is decoded into a sequence of characters.
    • bounds

      public Polygon2D_F64 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

      public Homography2D_F64 Hinv
      A homography transform from grid bit coordinates into image pixels.
    • bitsTransposed

      public boolean bitsTransposed
      True 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 totalBitErrors
      Number of bit errors detected when apply error correction to the message
    • failureCause

      public QrCode.Failure failureCause
      Specifies where the QR code parsing failed
    • allowedModes

      public static final QrCode.Mode[] 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

      public MicroQrCode setTo​(MicroQrCode o)
      Sets 'this' so that it's equivalent to 'o'.
      Parameters:
      o - The target object
    • clone

      public MicroQrCode clone()
      Overrides:
      clone in class Object
    • 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

      public static int maxDataBits​(int version, MicroQrCode.ErrorLevel level)
      Returns number of data bits which can be encoded
    • allowedErrorCorrection

      public static MicroQrCode.ErrorLevel[] allowedErrorCorrection​(int version)
      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

      public static QrCode.Mode[] allowedModes​(int version)
    • valueToMode

      public static QrCode.Mode valueToMode​(int value)
      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