Class QrCode

java.lang.Object
boofcv.alg.fiducial.qrcode.QrCode
All Implemented Interfaces:
Cloneable

public class QrCode
extends Object
implements Cloneable
Information for a detected QR Code.

Position Patterns (PP) have their vertices CCW order. The polygons are oriented such that the following sides are paired: ppCorner[1,2] paired ppRight[3,0] and ppCorner[2,3] paired ppDown[0,1].

  • 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 QR Code
      See Also:
      Constant Field Values
    • VERSION_ENCODED_AT

      public static final int VERSION_ENCODED_AT
      The QR code version after which and including version information is encoded into the QR code
      See Also:
      Constant Field Values
    • VERSION_INFO

      public static final QrCode.VersionInfo[] VERSION_INFO
    • LOCATION_BITS

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

      public Polygon2D_F64 ppRight
      The finder pattern that is composed of the 3 position patterns. Orientation of corners in each position pattern goes in clockwise direction (when viewed in an image, CCW mathematically) 0 = top left, 1 = top right, 2 = bottom right, 3 = bottom left.
    • ppCorner

      public Polygon2D_F64 ppCorner
    • ppDown

      public Polygon2D_F64 ppDown
    • threshRight

      public double threshRight
      locally computed binary threshold at each position pattern
    • threshCorner

      public double threshCorner
      locally computed binary threshold at each position pattern
    • threshDown

      public double threshDown
      locally computed binary threshold at each position pattern
    • threshDownRight

      public double threshDownRight
      local threshold from bottom-right corner of QR code. Computed from local neighborhood
    • version

      public int version
      which version of QR code was found. 1 to 40
    • error

      public QrCode.ErrorLevel error
      Level of error correction
    • mask

      public QrCodeMaskPattern mask
      Which masking pattern is applied
    • alignment

      public DogArray<QrCode.Alignment> alignment
      Alignment pattern information
    • mode

      public QrCode.Mode mode
      Text encoding mode
    • 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.
    • failureCause

      public QrCode.Failure failureCause
      Specifies where the QR code parsing failed
    • 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.
    • totalBitErrors

      public int totalBitErrors
      Number of bit errors detected when apply error correction to the message
    • 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.
  • Constructor Details

    • QrCode

      public QrCode()
  • Method Details

    • getNumberOfModules

      public int getNumberOfModules()
    • getNumberOfDataBytes

      public int getNumberOfDataBytes()
    • totalModules

      public static int totalModules​(int version)
    • reset

      public void reset()
      Resets the QR-Code so that it's in its initial state.
    • clone

      public QrCode clone()
      Overrides:
      clone in class Object
    • setTo

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