Technology Update: Machine vision can ensure reliable, repeatable bar code inspection

When applied for bar code reading (BCR), a vision system can ensure each product on a packaging line contains the proper bar code—which in turn contains the proper product identification and manufacturing location data. UPC symbols, for instance, include five digits of data about the product manufacturer and five digits about the specific product. Here’s how it works. October Control Engineering


As the standards for product and ingredient quality face ever more stringent agency regulations, bar code reading, verification, and grading are increasingly important in many inspection processes. Commonly used in pharmaceutical applications for traceability purposes, bar codes are now used for a similar purpose in food and beverage applications. They are also more frequently applied in industrial applications, enabling recalled product to be quickly identified and tracked back to its manufacturing origin, easing the recall process.

Machine vision is often used for bar code inspection in the above areas, as the proper combination of vision sensor hardware, software, and lighting can deliver efficient, effective analysis in these applications. When applied for bar code reading (BCR), a vision system can ensure each product on a packaging line contains the proper bar code—which in turn contains the proper product identification and manufacturing location data. UPC symbols, for instance, include five digits of data about the product manufacturer and five digits about the specific product. The ECC 200 Data Matrix, a two-dimensional bar code symbol type, can greatly increase the amount of data stored within a code: a single data matrix symbol can encode up to 2335 numbers of 1555 ASCII characters. In each of these cases, vision sensors capture an image of the bar code on the inspected product, and then analyze the captured image to “decode” the symbol—thus “reading” the code to verify its contents.

Vision sensors may additionally be applied to grade bar codes. Grading is used to ensure each product contains a clear, high-contrast, and complete code that can be successfully read throughout the manufacturing process. Bar codes also must be successfully read once the product reaches shipping, retailers, and finally consumers. Grading is performed on an A to F scale based upon a number of parameters, including “Symbol Contrast,” which involves how well the black and white portions of a bar code can be distinguished from one another. If the bar code does not exhibit sufficient contrast between these two elements, it may be illegible downstream. A successful vision inspection will not only grade a bar code but will reject a product if it fails the inspection, possibly indicating whether the device marking the bar codes is low on ink—thus preventing future rejected products.

Most vision sensors with BCR capabilities can identify a bar code placed at any orientation, so long as the entire code falls within the camera’s field-of-view. The overall size of the bar code symbol is often not a concern; some data matrix symbols can consist of cells as small as .001 in. on a side. Such small marks are readable by a vision sensor with the proper lens. However, the bar code must meet certain resolution requirements in order to be successfully read. For most applications, the narrowest bar in a linear code must be at least three pixels wide in order to be legible. The same is true of the cells within a data matrix.

Vision for bar code inspection

Just as contrast is a pivotal parameter in successful bar code grading, contrast between the bar code symbol and the material on which it is located is key to the success of a vision inspection. Often, ambient light within a factory environment does not illuminate a product’s bar code evenly enough for a vision sensor to always obtain a clear image of the code. Even if ambient lighting is plentiful, it is often inconsistent due to plant windows or skylights. Poor lighting affects the ability of the vision sensor to read a bar code in a consistent manner from product to product, leading to unreliable results. A dedicated vision lighting solution establishes the contrast required to attain accurate, repeatable results from a vision inspection.

Of the many varieties of vision lighting types and techniques that are available, ring lights are the most commonly used lighting for bar code inspection. Ring lights mount directly to the camera and surround the camera lens, aiming illumination toward the feature of interest—in this case, the bar code. This dedicated lighting technique ensures both sufficient and uniform lighting, allowing the vision sensor to consistently obtain an image with high accuracy. For long-lasting illumination, ring lights are available utilizing LEDs, which provide a usable life of 100,000 hours.

Lighting is one of several components that comprise vision sensor hardware, which also includes the camera, processor, and lens. For BCR applications, vision hardware should be selected based on the size of the bar code and how it is placed within the camera’s field of view. A bar code symbol can vary greatly in size, from a few inches to less than a millimeter wide. The lens chosen should provide a field of view that accommodates the bar code’s size, as well as the entire product region on which the bar code may be placed. For applications where bar codes are mechanically stamped or applied in precisely the same location each time, the field of view can generally be smaller, allowing the use of a standard resolution camera in many cases. If the bar code is hand-placed, the field of view must be expanded to include the entire product region on which it may appear. In these instances, a high-resolution camera should be used to ensure the narrowest bars or cells that comprise the code, when captured by the camera, are at least three pixels wide.

The key to how a vision sensor interprets a bar code is the sensor’s operation as, essentially, an electronic light meter. The vision sensor’s imager chip is comprised of photosites, light-sensitive elements that create an electronic signal proportional to the amount of light to which they are exposed. Each photosite on an imager chip is linked to a pixel, which portrays the obtained light value from dark to bright—ranging from 0 to 255—on an 8-bit grayscale. In these terms, when contrast is created, it yields a greater numeric difference between pixels in the dark and bright portions of the bar code, making these variations easier to detect.

Software for machine vision

The final element of a vision system, the vision software, includes all programming and image algorithms required to monitor, analyze, and control an inspection. This is the component that determines whether a bar code is present, if it contains the correct data, and if the physical bar code symbol is legible. The BCR tool allows the vision sensor to capture the full bar code as an image containing both light and dark patterns for analysis. The sensor is then able to compare these light and dark patterns to the bar code symbol standards stored in the software. If the light/dark line and space variations can be identified as a known bar code symbol type, the data can be decoded.

After this determination has been made, the vision sensor uses communication tools to send inspection data via serial or Ethernet communications to a PLC or PC. Sensors that offer configurable I/Os do more than share the collected inspection data—they apply it by sorting products according to the data that each bar code contains, as well as diverting any incorrect or illegible bar codes from the line.

While the results of a vision inspection are comprehensive, the selection, setup, and programming of the sensor can be complex. Taking a cue from the explosion in touch-screen-driven consumer electronic devices from recent years, some vision sensors now offer an all-in-one solution that provides the same comprehensive inspection capabilities within a self-contained design. This type of sensor features an integrated touch screen for onsite programming but also offers a USB port to upload and download inspection parameters and results to and from a PC. A simple-to-apply design speeds operator training and lessens the programming time required for setting up a bar code inspection, all while allowing users to monitor and control the inspection in real time on the plant floor, with no external PC or other components required. These innovations, paired with a wide range of hardware options and sophisticated BCR capabilities, ensure machine vision delivers a reliable, repeatable solution for bar code inspections.

More on Banner Engineering's bar code reading applications

- Also read from Control Engineering:

Machine Vision

Machine Vision Looks Well Beyond Inspection

Machine Vision Product Research: Positive Attitudes, Outlooks, New Products

- Brent Evanger is an applications engineer at Banner Engineering.


The Top Plant program honors outstanding manufacturing facilities in North America. View the 2015 Top Plant.
The Product of the Year program recognizes products newly released in the manufacturing industries.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
Pipe fabrication and IIoT; 2017 Product of the Year finalists
The future of electrical safety; Four keys to RPM success; Picking the right weld fume option
A new approach to the Skills Gap; Community colleges may hold the key for manufacturing; 2017 Engineering Leaders Under 40
Control room technology innovation; Practical approaches to corrosion protection; Pipeline regulator revises quality programs
The cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Power system design for high-performance buildings; mitigating arc flash hazards
VFDs improving motion control applications; Powering automation and IIoT wirelessly; Connecting the dots
Natural gas engines; New applications for fuel cells; Large engines become more efficient; Extending boiler life

Annual Salary Survey

Before the calendar turned, 2016 already had the makings of a pivotal year for manufacturing, and for the world.

There were the big events for the year, including the United States as Partner Country at Hannover Messe in April and the 2016 International Manufacturing Technology Show in Chicago in September. There's also the matter of the U.S. presidential elections in November, which promise to shape policy in manufacturing for years to come.

But the year started with global economic turmoil, as a slowdown in Chinese manufacturing triggered a worldwide stock hiccup that sent values plummeting. The continued plunge in world oil prices has resulted in a slowdown in exploration and, by extension, the manufacture of exploration equipment.

Read more: 2015 Salary Survey

Maintenance and reliability tips and best practices from the maintenance and reliability coaches at Allied Reliability Group.
The One Voice for Manufacturing blog reports on federal public policy issues impacting the manufacturing sector. One Voice is a joint effort by the National Tooling and Machining...
The Society for Maintenance and Reliability Professionals an organization devoted...
Join this ongoing discussion of machine guarding topics, including solutions assessments, regulatory compliance, gap analysis...
IMS Research, recently acquired by IHS Inc., is a leading independent supplier of market research and consultancy to the global electronics industry.
Maintenance is not optional in manufacturing. It’s a profit center, driving productivity and uptime while reducing overall repair costs.
The Lachance on CMMS blog is about current maintenance topics. Blogger Paul Lachance is president and chief technology officer for Smartware Group.
The maintenance journey has been a long, slow trek for most manufacturers and has gone from preventive maintenance to predictive maintenance.
This digital report explains how plant engineers and subject matter experts (SME) need support for time series data and its many challenges.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.
Maintenance Manager; California Oils Corp.
Associate, Electrical Engineering; Wood Harbinger
Control Systems Engineer; Robert Bosch Corp.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
click me