Introduction To Industrial Barcode Reading - Cognex
Introduction To Industrial Barcode Reading - Cognex
Introduction To Industrial Barcode Reading - Cognex
Types of barcodes........................................................................................................ 5
1D barcodes..................................................................................................... 5
2D codes........................................................................................................... 7
Laser scanners................................................................................................. 11
Image-based readers........................................................................................ 13
Glossary....................................................................................................................... 20
Although barcode technology was originally patented in 1952, it wasn’t until 1974 that
the first product—a package of Wrigley’s gum—was scanned at a Marsh® supermarket
in Ohio. Today, barcodes come in dozens of different formats, from a row of simple
lines called a 1D (one-dimensional) barcode to dots and squares that form a 2D
(two-dimensional) code; QR (Quick Response) and Data Matrix codes are among
the most popular 2D codes. The more advanced 2D code allows users to store and
retrieve significantly more data than they could with a 1D code. This is because 1D codes
only contain data in the horizontal direction whereas 2D codes contain information both
vertically and horizontally.
Safety and liability are also drivers behind industry adoption of barcodes. In recent years,
governments around the world have started to require medical devices and pharmaceutical
manufacturers to apply machine-readable codes on every package down to individual
medicine containers. Should a defective product reach a store shelf, automated tracking of
every package will accelerate safety recalls while making quality-control data available to
the entire supply chain.
In most cases, 1D barcodes are read from left to right. The widths of the spaces and
bars relate to a specific character in the barcode. A quiet zone or margin is the white
space to the left and the right of the barcode; this helps the reader to locate the barcode.
As a general rule, the margins should be at least seven to ten times the narrowest bar
width in the barcode.
5 0 6 0 0 3 4 4 8 1 4 6 1
Quiet zone
Figure 3: Structure of a 1D code
All the other bars in the code are based off a ratio of the narrow bar width. For example,
2:1, 3:1 and 2.5:1 are common ratios that describe the width of white spaces and black
bars based on the starting point of the narrowest black bar. Some barcodes also have a
guard pattern. The guard pattern is at the beginning and end of the barcode; this pattern
tells the reader where the barcode starts and ends.
Other 1D codes, such as Code 39 (widely used by the military), POSTNET (used by the
United States Postal Service®), Codabar, and Interleaved 2 of 5 offer optional check
digits. Pharmacode, which is used for the pharmaceutical industry, can be read both
forward and backward. The drawback of this code is that it must be positioned the same
way each time it is read.
EAN-13 Code 39
Typical usage: Typical usage:
Retail & Supermarkets Military & Automotive
in Europe
Code 93 Codabar
Typical usage: Typical usage:
Military, Automotive U.S. Blood Banks,
& Healthcare Photo Labs, FedEx®
Airbills and Libraries
Interleaved 2 of 5 MSI/Plessy
Typical usage: Typical usage:
Distribution & Supermarkets
Warehousing
POSTNET
Typical usage:
United States Postal Service (USPS®)
Unlike 1D barcodes, all 2D codes have built-in error correction, similar to the check digits
in some 1D codes, which effectively eliminates misreads. Within a single 2D Data
Matrix code, the data is typically encoded three times, which significantly increases the
chances the code will be read correctly.
While 1D codes have quiet zones and guard patterns to identify where the code starts
and stops, a 2D code has a quiet zone, a finder pattern, and a clocking pattern. The
finder pattern is the L-shaped pattern located around the outside edge of two sides of the
2D code. This is used to ensure proper orientation during decoding. Opposite the finder
pattern is the clocking pattern, a series of alternating black and white modules (or
cells) that defines how big a single cell is and the size of the code (number of rows and
columns) for decoding. The quiet zone is similar to that of 1D barcodes; for 2D codes,
however, it must surround the entire code.
Clocking pattern
Module or cell
Data region
QR Aztec
Typical Usage: Typical Usage:
Automotive Parts Travel Tickets & Car
& Commercial Registration Documents
Marketing
DotCode
Typical Usage:
Packaging, Logistics &
Anti-theft Initiatives
Depending on the material being marked, each method has its own strengths and
weaknesses. For metal parts, laser-marking systems offer high-throughput permanent
marks but are costly to install. Dot peen marking heads are less expensive but they wear
down, which can compromise the mark.
Sensor
Oscillating
Mirror
Barcode
Laser
Despite being an older technology, laser scanners still offer some operational benefits. Laser
scanners do not require an image processor. They are also fast, capable of conducting up
to 1,300 scans per second. Finally, because they use lasers—collimated beams of light that
essentially do not diverge no matter how far the light travels from the source—they can read
1D barcodes from relatively long distances with the use of special optics.
Damage
Noise
Low contrast
Figure 12: Codes that can be hard to read with a laser scanner
Code position is also critical to laser scanners because, with few exceptions, 1D codes
must be scanned from left to right. This can require additional fixturing or mechanical
systems to make sure an object’s barcode is consistently oriented in a single
direction. Laser scanners also have an oscillating mirror, and moving parts can break,
resulting in additional costs and time required to repair or replace. Finally, due to eye
safety concerns, laser scanners must be shielded to protect nearby workers.
Image resolution
One of the biggest differentiators for choosing an image sensor, or camera, is resolution.
Image resolution refers to how many individual pixels make up each image.
Sensor
Lens
Working Distance
2D code size:
12 mm x 12 mm
22 x 22 modules
Field of View
(FOV)
Figure 13: Pixel grid showing PPM on a Data Matrix code using an image-based reader
Symbologies
Data requirements for your inventory or track and trace application may be only a few
kilobytes today, which may make a 1D barcode seem the most logical choice. But data
requirements are likely to grow along with the size and complexity of your operation. It
is worthwhile to anticipate future requirements that would benefit from a 2D code or the
ability to read compromised barcodes. You may own your distribution channels today, but
growth or new clients in remote locations may necessitate a third-party logistics company,
leaving you no longer in control of the code-marking quality. Investing in better technology
today may minimize future equipment upgrades.
This problem isn’t limited to paper and plastic packages. Even codes etched into metal can
be distorted or damaged. So if supply chain accuracy is important to your business, make
sure your reader can read noisy codes—such as those that are printed on cardboard or
are scratched, deformed or low contrast—not just perfect codes fresh off the printer.
If the reader is the final inventory check for dock workers loading incoming materials or
outgoing product, a handheld barcode reader will be ideal. Handheld barcode readers
are held in the hand of an operator and can be corded or wireless.
If it’s a courier or technician working in the field, a mobile barcode reader with built-in code
reading capability will help quickly scan packages or check equipment specifications. Mobile
barcode readers are also held in the hand of an operator and can be purpose-built for a
particular application or smartphone-based with a rugged mobile terminal enclosure.
Ethernet USB
Cost of ownership
With the additional power and flexibility of image-based barcode readers, you might expect
the cost to be considerably more than laser scanners. While that was true in the past, the
latest image-based readers cost about the same as industrial laser scanners that have far
less functionality. New microprocessors and CMOS digital sensor chips also mean image-
based systems can be nearly as fast as the fastest laser scanner. And these developments
come in addition to the traditional benefits of image-based readers: no moving parts,
resulting in a longer life than laser scanners; ability to read 2D codes as well as damaged
and omnidirectional codes; and the ability to store images for audits and tracking.
2D barcode A machine-readable code that stores data both horizontally and vertically.
Examples include: Data Matrix, MaxiCode, and QR code.
Barcode scanner An electronic device that decodes and captures the information in a barcode.
Check digits A form of redundancy check used for error detection on identification
numbers that is analogous to a binary parity bit used to check for errors
in computer-generated data. Consists of a single digit (sometimes more
than one) computed by an algorithm from the other digits (or letters) in the
sequence input.
Chemical etching A form of direct part marking; the subtractive manufacturing process of
using baths of temperature-regulated etching chemicals to remove material
to create an object with the desired shape.
Clocking pattern Provides a count of the number of rows and columns in a 2D barcode.
Code 128 The most robust 1D barcode type. The number 128 refers to the ability
to hold any character of the ASCII 128 character set. Includes all digits,
characters, and punctuation marks, making it compact and powerful as it
enables diverse storage of data.
Dark field Illumination of the field of view from the side so that the object is viewed
against a dark background.
Data Matrix A 2D code that can encode large amounts of data (up to 2,335
alphanumeric or 3,116 numerical characters) and use an error-correction
system to read codes that are as much as 40% damaged. It is made up
of black and white cells in a square or rectangular pattern, and includes a
finder and clocking pattern.
Diffuse dome A lighting arrangement where the light is directed into a hemispherical,
lighting usually white, enclosure that reflects the light backwards on an object
without bright spots, or hot spots, common to direct bright field lighting.
Direct part A process to permanently mark parts with product information including
marking (DPM) serial numbers, part numbers, date codes, and barcodes. This is done to
allow the tracking of parts through their full life cycle. Examples include:
chemical etching, dot peen, and laser marking.
Discrete I/O Refers to a wiring method where the conductor directly connects a
transmitter to a receiver without encoding, protocols, or other common
methods used to create digital networks.
EAN Standing for International Article Number (EAN), EAN-8 is the European
counterpart of the UPC-A symbol. The main difference between them is
that the EAN-13 encodes an extra digit of data to make a total of 13. The
first two digits of the barcode identify a specific country, and the check digit
is the last number of the second group of six digits. This is primarily used
on small packaging where space is limited.
Finder pattern Also called a locator or L pattern, it lies along two sides of a 2D code and
helps the reader to locate and determine the orientation of the machine-
readable code.
GS1 Global Standards One (GS1) develops the global standards for business
communication, most notably the barcode.
Guard pattern Usually a pair of bars in a 1D barcode that indicate the beginning and end
of specific data strings.
Handheld Scans codes from the hand of an operator and can be corded or wireless.
barcode reader
Hotspot A bloom or section of an image where all pixels in that area have maximum
intensity values, hiding any image data that may have otherwise been
found in that area of the image; usually caused by lights reflecting off shiny
surfaces during imaging.
Image-based Uses an area array sensor similar to those found in digital cameras to read
barcode reader both 1D and 2D barcodes.
Inkjet printer A computer peripheral that sprays ink onto paper, labels, boxes, and
other media.
Laser marking A direct part-marking method that labels materials with a laser beam by
engraving, removing, staining, annealing, and foaming an object’s surface.
Laser scanner 1D barcode reader that directs a laser point source across the code by
passing the beam through a rotating prism or mirror.
Liquid lens Allows the reader to adapt to changes in working distances. Liquid lenses
technology do not move or use motors and therefore are much more robust than
mechanical or spinning optics.
Margin The margin is a blank space around a barcode that separates the barcode
from neighboring graphics, shapes and textures. Also see quiet zone.
Microprocessor An integrated circuit that contains all the functions of a central processing
unit of a computer.
Pixels per module Determines how many pixels are in one cell or module of the code.
(PPM)
Postal Numeric Barcode used by the United States Postal Service to automatically sort mail.
Encoding Technique Unlike most other barcodes in which data is encoded in the width of the bars
(POSTNET) and spaces, this 1D barcode encodes data in the height of the bars.
Quick Response Codes containing square blocks of black cells on a white background
(QR) code with finder patterns in the top left, top right, and bottom left corners. It was
developed to track parts during vehicle assembly but is now commonly
used in printed marketing materials.
Quiet zone A blank space around a barcode that separates the barcode from
neighboring graphics, shapes, and textures. See also margin.
Read rate Number of successfully read barcodes divided by the number of attempts.
S-mount lens A standard lens mount that uses a male metric M12 thread with 0.5 mm
pitch on the lens and a corresponding female thread on the lens mount;
thus an S-mount lens is sometimes called an M12 lens.
Universal Product A variety of 1D barcodes widely used in the United States for tracking
Code (UPC) trade items.
Universal Serial A common interface that enables communication between devices and a
Bus (USB) host controller, such as a personal computer (PC).
www.cognex.com/machine-vision
3D VISION SYSTEMS
Cognex In-Sight® laser profilers and 3D vision systems provide ultimate
ease of use, power and flexibility to achieve reliable and accurate
measurement results for the most challenging 3D applications.
www.cognex.com/3D-vision-systems
VISION SOFTWARE
Cognex vision software provides industry leading vision technologies,
from traditional machine vision to deep learning-based image analysis,
to meet any development needs.
www.cognex.com/vision-software
BARCODE READERS
Cognex industrial barcode readers and mobile terminals with patented
algorithms provide the highest read rates for 1D, 2D and DPM codes
regardless of the barcode symbology, size, quality, printing method or surface.
www.cognex.com/barcodereaders
Companies around the world rely on Cognex vision and barcode reading
solutions to optimize quality, drive down costs and control traceability.