Barcode Scanner

Barcode Scanner

 

Introduction

Barcode Scanner is a Catalyst Zia AI-driven service that enables you to scan standard barcode formats and obtain the encoded information. You can implement Barcode Scanner in your Catalyst application that would allow the end-users to read barcode data from real world objects such as posters, flyers, packaged products, or digital devices, and process it into the application in a fast and effective manner.

A barcode is a visual representation of data in a machine-readable format. Barcodes enable you to pass encoded data from a physical platform into a digital platform in a secure way. The identified data can then be saved in a database or used for further processing.

Zia Barcode Scanner can read the following fourteen types of barcode formats, which can be classified into two primary categories:

  • Linear or 1D Barcode Formats: Code 39, Code 128, Code 93, EAN-8, EAN-13, Codabar, ITF, UPC-A, UPC-E, RSS
  • 2D Barcode Formats: QR code, Aztec, PDF417, Data Matrix

Catalyst provides Barcode Scanner in the Java and Node.js SDK packages, and you can integrate it in your Catalyst web or Android application. The Catalyst console provides easy access to code templates for these environments, which you can implement in your application's code. You can also test Barcode Scanner using sample images and generate responses in the console.

You can refer to the Java SDK documentation and Node.js SDK documentation for code samples of Barcode Scanner. Refer to the API documentation to learn about the API available for Barcode Scanner.

 

Key Concepts

Before you learn about the use cases and implementation of Barcode Scanner, it's important to understand its fundamental concepts in detail.

Encoding Data in a Barcode

A barcode carries a string of characters as the data, and both barcode and data are mapped together for a fast transfer from a real world object to a computing device. The mapping of the data with a barcode is called a symbology. Depending on the use case, a barcode might directly encode the data, or encode an item identifier that is linked to an entry in a database that contains the actual data.

Both linear and 2D primary barcodes supported by Zia Barcode Scanner contain distinct features, and each barcode type is used for a different purpose. Some characteristics of linear and 2D barcode formats are specified below:

  • Linear barcode formats:
    The linear barcode format is a first-generation one-dimensional format that represents data by varying the widths and spacings of multiple parallel lines. These hold restrictions on the type and number of characters that can be passed.

    Linear barcodes are therefore used to encode a limited number of alphanumeric characters, depending on the type. Types such as UPC, EAN, Code-39, and Code-128 are commonly used to label consumer goods and products across industries like retail, automotive, logistics, transportation, and healthcare. The specifications of the data format and usage varies from type to type.
  • 2D barcode formats:
    The 2D barcode format is an advanced form of barcode format that is visually represented in the form of rectangles, hexagons, dots, or other geometric patterns. The 2D barcode format can hold much more data in a unit area compared to the 1D format.

    They also don't contain many restrictions on the types of data supported, and can hold structured and binary data, such as photographs, fingerprints, signatures, geolocation, and more. The 2D types also have advantages like space efficiency, fault tolerance, error correction, and high density. The specifications of the data format and usage varies from type to type in the 2D format, as well.
 

Input Format

Zia Barcode Scanner scans barcodes from image files. Barcode Scanner supports the following input file formats:

  • .jpg/.jpeg
  • .png

You can code the Catalyst application to use the end user device's camera to capture a photo with a barcode, and process the image as the input file. You could also provide a space for the user to upload the image file from the device's memory to the Catalyst application.

The input provided using the API contains the source image file of the barcode, and the barcode type if the user is aware of it. Zia will automatically detect the barcode type if the user doesn't specify it.

You can check the request format from the API documentation.

The user must follow these guidelines while providing the input, for better results:

  • Avoid providing blurred, corrupted, or unrecognizable images of the barcode.
  • Ensure that barcode image is clear, visible, and distinct.
  • Ensure that the image does not have any borders.
  • Do not upload partial images. The entire barcode must be present in the image.
  • The image size must not be too small.
  • The file size must not exceed 10 MB.
  • The resolution of the image (width * height in pixels) must not exceed 36000000 pixels.
  • The barcode in the image can be oriented in any manner.
 

Response Format

Zia Barcode Scanner returns the response in the following ways:

  • In the console: When you upload a sample image with a barcode in the console, it will return the decoded data in two response formats:
    • Readable textual format: Displays the decoded data that is visually segregated into lines, based on the content
    • JSON format: Displays the decoded data in the JSON format
  • Using the SDKs: When you send an image file using an API request, you will receive a JSON response containing the decoded data.

You can check the JSON response format from the API documentation.

 

Benefits

  1. Automatic Type Detection

    Barcode Scanner can automatically detect the barcode type without requiring any input from the end user about the barcode type. However, the user can also specify the type while sending a request using the API, if they know it. When the barcode format is specified, the scanning and decoding processes happen faster, as it enables Zia to restrict its processing and analysis to the specified format alone.  
  2. Orientation-Free

    Barcode Scanner enables flexibility in detecting and scanning barcodes from any angle or orientation in the image. For example, the barcodes can be rotated sideways or upside-down. This provides convenience to the user, as they need not spend time in orienting the image in a particular way.
  3. Rapid Performance

    Barcode Scanner generates the decoded content of a barcode instantly when the image is uploaded. Catalyst ensures a high throughput of data transmission and a minimal latency in serving requests. The fast response time enhances your application's performance, and provides a satisfying experience for the end user.
  4. Seamless Integration

    You can easily implement Barcode Scanner in your application without having to worry about the underlying logic or the backend set-up. You can implement the ready-made code templates provided for the Java and Node.js platforms in any of your Catalyst applications that requires the use of a barcode scanner.
  5. Testing in the Console

    The testing feature in the console enables you to verify the efficiency of Barcode Scanner. You can upload sample images with barcodes, and view the response results. This allows you to get an idea about the format and accuracy of the response that will be generated when you implement it in your application.
 

Use Cases

Barcodes are widely used in various industrial, manufacturing, commercial, and service sectors for a variety of purposes. The following are some use cases for Zia Barcode Scanner:

  • An inventory management application implements Zia Barcode Scanner to label products in an electronics supplier company. The details and information of the products, such as their unique identification numbers, price, dates of manufacture, and brands, are entered and stored in the Catalyst Data Store. The information about a specific item can easily be obtained by scanning its barcode, as the item identifier refers to the database and fetches its details.
  • An digital wallet and payment application implements Zia Barcode Scanner to scan QR codes in retail outlets to obtain the payee information of the outlet easily. Customers can open the Catalyst application and scan the QR codes, which redirects them to the integrated payment platform. They can then quickly pay the bill amount through an online transaction.

Barcode Scanner can also be implemented in the following scenarios:

  • A ticketing application in a multiplex or a stadium that scans the customer's QR codes to verify the tickets that were booked online
  • A file sharing application that establishes connections with other devices by scanning the QR codes generated on them, which is then used to transfer files
  • An equipment or product rental service application that scans the barcodes on the products when the customers return them to verify their identification
  • An application that enables the users to obtain information about a consumer product available in a public cloud by scanning its barcode, and provides suggestions for similar products or services available in the vicinity
  • A generic scanner application that enables users to scan both linear and 2D barcodes from any source to obtain the decoded content, and performs other activities like translating the content, redirecting hyperlinks, and sharing the content with their contacts through other integrated platforms
 

Implementation

This section only covers working with Barcode Scanner in the Catalyst console. Refer to the SDK and API documentation sections for implementing Barcode Scanner in your application's code.

As mentioned earlier, you can access the code templates that will enable you to integrate Barcode Scanner in your Catalyst application from the console, and also test the feature by uploading images with barcodes and obtaining the decoded content.

Access Barcode Scanner

To access Barcode Scanner in your Catalyst console:

  1. Navigate to Zia Services under Discover, then click Access Now on the Barcode Scanner window.
  2. Click Try a Demo in the Barcode Scanner feature page.

    This will open the Barcode Scanner feature.
 

Test Barcode Scanner in the Catalyst Console

You can test Barcode Scanner by either selecting a sample image from Catalyst or by uploading your own image.

To scan a sample image with a barcode and decode its content:

  1. Click Select a Sample Image in the box.
  2. Select an image from the samples provided.

    Barcode Scanner will scan the barcode and display its content under Result.

    You can also click View Response to do so in the JSON format.

To upload your own image with a barcode and decode its content:

  1. Click Upload under the Result section.

    If you're opening Barcode Scanner after you have closed it, click Browse Files in this box.
  2. Upload a file from your local system.
    Notes:
    • The file must be in .jpg/.jpeg or .png format. The file size must not exceed 10 MB. The resolution of the image must not exceed 36000000 pixels.
    • You will not be able to specify the barcode type as an input while testing it in the Catalyst console, as it is detected automatically. If you know the barcode type, you can specify it in the API request that you send from your Catalyst application.
    The console will scan the barcode and display its content.

    You can copy the content using the copy icon for easier access, or check the JSON response by clicking View Response.
 

Access Code Templates for Barcode Scanner

You can implement Barcode Scanner in your Catalyst application using the code templates provided by Catalyst for Java and Node.js platforms.

You can access them from the section below the test window. Click either the Java SDK or NodeJS SDK tab, and copy the code using the copy icon. You can paste this code in your web or Android application's code wherever you require.

In Java, you can process the input file as a new File and select the format of the barcode using the ZCBarcodeOptions module. If you want Zia to scan the image for all formats, you can use ZCBarcodeFormat.ALL. If you are aware of the format, you can enter it as ZCBarcodeFormat.ean13, for example. Refer to the API documentation for the keys of all supported formats.

The Node.js code processes the barcode image as the object barcodePromise. You can provide the image file name and the format in a similar way here.

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocatalyst.com