Using EasyQRCode

This document details all the capabilities of EasyQRCode beyond calling EQRCodeReader::Read() .NET Python on an image.

Note

The method EQRCodeReader::Read .NET Python supports multithreading.

The multithreading splits the load between the detection methods (such as EQRDetectionMethod_AdaptiveThreshold .NET Python and EQRDetectionMethod_Gradient .NET Python) and decodes multiple candidates in parallel. This is useful when there are several codes in the image.

Contents of the EQRCode Object

QR Code Geometry

A QR code geometry .NET Python is a set of points:

EasyQRCode uses a float coordinate system and the origin (0.0, 0.0) is the top left corner of the top left pixel of the image.

../../../_images/qr-geometry.webp

QR code geometry

Retrieve and Interpret the Read Data

Retrieving the Decoded Data

To retrieve the decoded data, you can (in growing complexity order):

Method 1

Use the method EQRCode::GetDecodedString .NET Python of an object EQRCode .NET Python.

  1. Call this method to get an UTF-8 formatted string that contains the concatenated data of the QR code.

  2. Optionally, give an EByteInterpretationMode .NET Python as argument.

  3. For the GS1 QR codes:

Method 2

Use the method EQRCodeDecodedStreamPart::GetDecodedString .NET Python of the objects EQRCodeDecodedStreamPart .NET Python.

  1. Call this method on a part to get an UTF-8 formatted string that contains the data of this part.

  2. Optionally, give an EByteInterpretationMode .NET Python as argument.

  3. Concatenate the decoded string of each part.

Method 3

Use the method EQRCodeDecodedStreamPart::GetDecodedData .NET Python of the objects EQRCodeDecodedStreamPart .NET Python.

  1. Call this method on a part to get a vector of bytes that contains the data of this part.

  2. Interpret the data according to the coding mode .NET Python of the QR code and the encoding .NET Python of each part.

  3. Concatenate the interpreted data of each part.

Interpret the Read Data

The QR code data can be encoded in either alphanumeric, numeric or byte modes. If a QR code contains bytes, the interpretation mode of these bytes can be embedded in the QR code through the ECI protocol or you must specify or know it.

The Interpretation Mode

Use the dedicated EByteInterpretationMode .NET Python for this purpose:

The Decoded Data

The decoded string .NET Python returns the concatenated data of the QR code in UTF-8 format:

The decoded stream .NET Python class consists of:

  • A coding mode (basic, ECI, FNC1/GS1 or FNC1/AIM).

  • An application indicator (if the coding mode is FNC1/AIM, otherwise 0).

The decoded data .NET Python:

  • Is accessible from each part of the decoded stream.

  • Is interpreted according to its encoding (numeric, alphanumeric, byte or Kanji) and the ECI table indicator .NET Python (if the coding mode is ECI, otherwise -1).

  • Can be the raw bit stream (the bit data after unmasking and error correction, but before decoding as a vector of bytes).

  • Can be the corresponding decoded string .NET Python (specify a byte interpretation mode .NET Python if the encoding is byte without ECI coding mode or if the ECI table is not supported).

See also

See the code snippet Retrieving the Decoded Data (Advanced).

Compute the Code Print Quality

  • When EQRCodeReader::SetComputeGrading .NET Python is set to true:

    Note

    The print quality is not yet available for Micro QR code models.

  • Grade computing:

    • For more accurate results, the modules should be at least 10 pixels in width.

    • EasyQRCode requires a 1-module quiet zone for grading.

    • EasyQRCode evaluates the Fixed Pattern Damage .NET Python with a 4-module quiet zone around the finder patterns.

      • If this condition is not met, the Fixed Pattern Parameter Grade is returned as -1.

      • This result affects the overall symbol grade.

    • The Version Additional Parameter .NET Python is returned as -1 when it is not applicable.

      • In this case, this result is ignored in the overall symbol grade.

    • The implementation follows closely the standard but the grades also depend on the decoding algorithm.

      • The results may slightly differ according to the eVision version.

Note

Our implementation of ISO 29158, a complement to ISO 15415, includes only those parameters that are unique or redefined in ISO 29158.

For parameters common to both standards, please refer to the corresponding ISO 15415 struct fields.

See also

For more information on the code grading, see Code Grading.

Read QR Codes Placed on a Grid

../../../_images/grid2.webp

Reading Micro QR codes arranged in a grid

If the codes in the images are arranged in a regular grid-like fashion:

See also

For an example, see Reading a Grid of QR Codes.

Reading Parameters

Maximum Number of Expected Codes

Searched Models and Versions

Note

By default, EasyQRCode searches for QR codes of model 1 and 2 and all versions.

  • You can shorten the process by specifying the QR code model(s) and a range of versions (from 1 to 40) to search for.

  • By default, EasyQRCode does not search for Micro QR code symbols.

Compute Grading

Show Unreliable Codes

Timeout

If you have a defined time constraint:

Advanced Parameters

Detection Method

Minimum Isotropy

  • The isotropy of a QR code represents its rectangular deformation. It is the short side divided by the long side, whether the rectangle is vertical or horizontal.

    • A perfectly square QR code has an isotropy of 1.

    • EasyQRCode can detect rectangle QR codes with an isotropy down to 0.5.

    • You can adjust the minimum isotropy between 0 to 1 (the default is 0.75).

QR codes: isotropy = 1 (left), 0.5 horizontal (center) and 0.5 vertical (right)

Minimum Score

  • EasyQRCode searches for the QR code finder pattern:

    ../../../_images/illu_finder_pattern.webp

    The QR code finder pattern

    • A perfect match returns a pattern finder score of 1.

    • Less accurate matches return lower scores.

    • You can adjust the minimum score between 0 to 1 (the default is 0.7).

  • Use the parameter EQRCodeReader::SetMinimumScore .NET Python to set the minimum score for an instance to be accepted and returned.

Cell Polarity Confidence Threshold

  • The cell polarity confidence reflects the confidence in the cell digitization result, on a scale from 0 to 1. When the cell confidence is under the threshold, an additional processing is attempted to improve its polarity detection:

    • Increasing the threshold can improve the reading of overprinted or underprinted QR codes.

    • A high threshold can affect the speed and increase the probability of false positive changes.

    • You can adjust the threshold between 0 to 1 (the default is 0.2).

  • Use the parameter EQRCodeReader::SetCellPolarityConfidenceThreshold .NET Python to set the minimum cell polarity confidence threshold.

Scan Precision

  • Use the parameter EQRCodeReader::SetScanPrecision .NET Python to select the precision used to scan the search field:

    • Fine: recommended for small QR codes

    • Coarse: recommended for large images with medium to large QR codes

    • Automatic: the QR code reader determines the scan precision automatically

Foreground Detection Threshold

  • The foreground detection threshold is the minimum number of grayscale-values that a pixel should deviate from its local background to be considered as part of the foreground. A small threshold value may help to locate codes in low contrast images. (The default value is 10.)

  • Use the parameter EQRCodeReader::SetForegroundDetectionThreshold .NET Python to set the minimum foreground detection threshold.

  • The default parameter for this value usually works well. It is thus unlikely that you have to modify it.

Adaptive Threshold Half Kernel Size

Note

Before eVision 26.10, that parameter was computed from the image size. Set EQRCodeReader::SetComputeAdaptiveThresholdHalfKernelSizeFromImage .NET Python to true to get the previous behavior.