BarcodeRecognize

BarcodeRecognize[image]

recognizes a barcode in image and returns it as a string.

BarcodeRecognize[image,"prop"]

returns the specified property of the barcode.

BarcodeRecognize[image,"prop",format]

recognizes barcodes of the specified format only.

Details

  • BarcodeRecognize works with arbitrary grayscale and multichannel images, operating on the intensity value of each pixel.
  • If multiple barcodes exist in the image, a list of decoded barcodes is returned.
  • The following properties "prop" are supported:
  • "Data"recognized barcode data
    "Format"recognized format for the barcode
    "BoundingBox"approximate bounding box for the barcode as a Rectangle
    "Orientation"orientation used for recognizing the barcode
    {prop1,prop2,}a list of properties
  • With BarcodeRecognize[image,"prop",{format1,format2,}], a list of formats to include in barcode recognition can be specified.
  • BarcodeRecognize works with different types of one- and two-dimensional barcodes.
  • The following 1D barcode formats can be used for format:
  • "UPC"UPC-A12 numerical digits
    "UPCE"UPC-E6 numerical digits
    "EAN8"EAN-88 numerical digits
    "EAN13"EAN-1313 numerical digits
    "Code39"Code 39up to 43 characters of uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space
    "Code93"Code 93uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space
    "Code128"Code 128up to 80 ASCII characters
    "ITF"ITFup to 80 numerical digits of an even length
    "Codabar"Codabarnumerical digits and special characters :, /, +, .
    "GS1"GS1 DataBar (or RSS)14 numerical digits
    "ExpandedGS1"GS1 Expanded and Expanded Stacked74 digits or 41 alphanumeric characters in a single row or up to 11 stacked rows (GS1 DataBar Expanded Stacked)
  • The following 2D barcode formats can be used for format:
  • {"QR",lev}QR and error correction levelvariable-length ASCII characters
    {"PDF417",lev}PDF417 and error correction levelvariable-length ASCII characters
    "Aztec"Aztec codevariable-length ASCII characters
    "DataMatrix"Data Matrix codevariable-length ASCII characters
    "MaxiCode"MaxiCodeup to 93 ASCII characters
  • The error correction level lev may be "L", "M", "Q", or "H" for "QR" codes, and an integer value between 0 and 8 for "PDF417".

Examples

open allclose all

Basic Examples  (2)

Recognize a UPC-A barcode:

Recognize a QR barcode:

Scope  (19)

Formats  (16)

Recognize a UPC barcode:

Recognize a UPC-E barcode:

Recognize an EAN-8 barcode:

Recognize an EAN-13 barcode:

Recognize a Code 39 barcode:

Recognize a Code 93 barcode:

Recognize a Code 128 barcode:

Recognize an ITF barcode:

Recognize a Codabar barcode:

Generate a GS1 barcode:

Recognize a GS1 (Expanded) barcode:

Recognize a QR barcode:

Recognize a PDF417 barcode:

Recognize an Aztec barcode:

Recognize a Data Matrix barcode:

Recognize a MaxiCode barcode:

Properties  (3)

Return the decoded barcode:

Barcode format:

Compute and visualize the bounding box:

Recognize bounding box of multiple barcodes:

Highlight barcode bounding boxes:

Get the format with the error correction level:

Applications  (4)

Read an ISBN from a scan of a book:

ISBN is an EAN-13 barcode:

Use Hyperlink to get a link from a QR code:

Decode a QR code:

Highlight the bounding box of the QR code:

Recognize and annotate a recognized barcode:

Properties & Relations  (3)

Recognize a noisy PDF417 code:

Recognize a damaged UPC code:

Use BarcodeImage to generate a barcode image:

Possible Issues  (1)

False positive result:

Neat Examples  (2)

Recognize and speak the text stored in a barcode:

Recognize and evaluate an expression:

Introduced in 2014
 (10.0)
 |
Updated in 2018
 (11.3)