Factors to consider for high-speed character reading

Oct. 18, 2017
Developers should consider factors such as print quality and line speed when specifying hardware and software components for optical character recognition.

Developers should consider factors such as print quality and line speed when specifying hardware and software components for optical character recognition.

Chris Walker

Optical character recognition (OCR) vision systems help manufacturers improve brand reputation, achieve traceability and package compliance, as well as minimize the risk of recalls. Many product labels have common issues that can be prevented with an automated machine vision system, such as: wrinkles, typographical errors, incorrect date codes, misprints and general flaws.

An experienced vision system engineer will integrate the correctly specified camera, optics, lighting and processor into an automated machine vision system that minimizes or eliminates failed quality checks and product returns. OCR vision systems are used on high speed packaging lines across a variety of products and industries, including medical, pharmaceutical, automotive and consumer packaged goods.

Depending on the product being inspected, manufacturers commonly depoly or use this type of inspection application for one or more of the following purposes: ensuring product quality; reducing repetitive labor tasks; eliminating or reducing risk; FDA compliance with Title 21 (i.e. pharmaceuticals); and finally, complying with export/import regulations.

Vision Systems utilizing OCR algorithms read and verify label date and expiration codes on packaging. A traditional OCR vision system scans alphanumeric characters on a package and compares it to a trained database of characters to determine if it recognizes the characters in view. If the characters are recognized and verified, it passes inspection; if it is not recognized, then the product is sent to a reject bin.

Processing time

OCR inspection is typically a three-step process. First, the vision system finds the alphanumeric code and determines its orientation, character-to-character spacing, size and scale based on pre-defined limits and then parses each character, including spaces, from the code.

Next, each character is compared to a trained set of characters and the highest match is returned. Lastly, the highest match percent is compared to a threshold value set by the user. If all returned characters are verified to be accurate to the known code and if the percent match is greater than the user-defined threshold, the vision system will pass the product under inspection.

High speed OCR vision systems can take as little as 30ms and as much as 1000ms to process an image with two lines and about 30 characters. However, multi-core processing capabilities mean that a PC-based solution can handle multiple inspections at the same time in parallel.

Parallel processing increases the overall throughput of the system. For such systems, it is ideal to place the reject mechanism at a distance from the camera that allows for the maximum allowable inspection time.

For instance, a max inspection time of 1000ms means that the rejector should be placed far enough from the camera to allow the product inspection to take at least 1000ms before being rejected if the product failed the inspection. This means that several products could end up between the camera and the rejector. When this problem occurs, part-tracking becomes essential.

The power of this type of setup allows the vision solution to handle highly variable inspection times while still being able to meet high speed production rates. EPIC Systems has utilized such solutions at rates >1000 parts per minute. These solutions often require other hardware features. High-speed strobed lighting can reduce image blur (Figure 1), an encoder can be used for part tracking and a programmable logic controller (PLC) can be integrated for a myriad of automation requirements.

Figure 1: At high-speeds of 600-1000 parts per minute, OCR solutions often require other hardware features such as high-speed strobed lighting to reduce image blur.

False-fail challenges

There are primary challenges to high speed applications in OCR: limited inspection time, increased variability in code printing (i.e. quality), and overall throughput capabilities of the vision system hardware. These challenges can sometimes cause higher false-fail rates.

Printer capability and OCR vision system capability are not the same. Highly regulated products, such as pharmaceuticals, strive for >90% thresholds that match characters to a trained "perfect" database. These systems must be integrated with a vision system equipped with a very high printing accuracy rate. However, this can be difficult for many printers on the market to achieve, especially at high speeds. Consequently, OCR vision systems typically average 70%-85% accuracy thresholds to reduce false fail rates.

Hardware platforms

To help increase the accuracy rate, printers should be specified to meet legibility requirements for OCR and tested thoroughly at actual part rates. An example specification is as follows:

  • The angle of the straight lines can vary +/- 8 degrees off horizontal position in the camera image
  • The spacing between the lines of text shall be no less than 30% of the character height
  • The relative angle between straight lines of text shall remain within +/- 8 degrees from each other
  • The system assumes the entire code shall fit within a fixed rectangle region 1" high and 2" wide
  • Print skew shall not exceed +/- 10 degrees from vertical
  • Print scale and aspect ratio can change up to +/-15% within a production run
  • The product shall be centered on the moving conveyor within +/- 1/2"

Along with choosing the correct printer, a smart camera (Figure 2) solution or a PC-based solution is needed to inspect the product. Smart camera solutions utilize on-board processing but typically have limitations in inspection speed and throughput. Typical smart camera inspection speeds on a set of 20 characters may range from 40 to 200 milliseconds of time and may be ideal for part rates <600 parts per minute.

Figure 2: Smart-camera based OCR systems inspecting a set of 20 characters typically range between 40 and 200 milliseconds. As a result, such hardware platforms are most suitable for part rates of <600 parts per minute.

Note that inspection rate can change drastically from one smart camera manufacturer to another, and that print quality and additional specifications can be a major factor in determining whether a smart camera solution is feasible.

Most smart cameras do not have parallel processing capabilities and inspection throughput can be limited. To reach part rates >600ppm, high speed PC-based solutions are typically required. PC-based solutions offer both, faster processors and parallel processing capabilities via multi-core processors.

Software solutions

EPIC Systems has utilized the Flexible Optical Character Verification (FlexOCV) image processing software from Cognex (Natick, MA, USA: www.cognex.com) for several high-speed OCR applications. The program is "flexible" because the algorithm begins with a trained set of characters, but modifies the trained set during production to "learn" how the code is being printed (Figure 3).

Figure 3: FlexOCV image processing software begins with a trained set of characters, but modifies the trained set during production based on printing variables such as character-to-character spacing, scale, aspect ratio, and multi-line distances to decrease inspection time.

Printing variables such as character-to-character spacing, scale, aspect ratio, and multi-line distances are learned and accounted for during a training phase of the algorithm. While this sometimes means a slight increase in false-failed product at the start of production during the training process, the flexibility of the algorithm to account for these printing variables allows the system to decrease inspection time significantly over time.

Other innovative software solutions include Matrox SureDotOCR algorithm which is part of the Matrox Imaging Library (MIL) from Matrox Imaging (Dorval, QC, Canada; www.matrox.com). Dot-matrix character printing poses many challenges. The SureDotOCR algorithm can handle deformed, skewed, and touching characters. In addition, the algorithm has a built-in method for finding and parsing the code, requiring minimal to no pre-processing of the camera image. The SureDotOCR algorithm compares the characters to a pre-defined or user-defined font.

Integrator assistance

Implementing an OCR vision system onto your packaging line requires help from a systems integrator specializing in machine vision. An integrator will evaluate your line set up and productivity requirements to determine if a PC-based or smart camera system is best. An integrator will also provide programming, lighting setup and design, and part tracking design for high speed applications.

Author:

The content for this article was provided by EPIC Systems, Inc. If you have additional questions or comments, please visit https://www.epicvisionsystems.com/ or email Chris Walker: [email protected]

Disclaimer: Although the information and recommendations set forth herein are presented in good faith, EPIC Systems, Inc. and its subsidiaries make no representations or warranties as to the completeness or accuracy thereof. No representations or warranties, either express or implied, or merchantability, fitness for a particular purpose or of any other nature are made hereunder, and nothing herein waives any of the seller's conditions of sale.

Chris Walker, Senior Project Manager for Vision Systems, EPIC Systems, Inc. St. Louis, MO, USA (www.epicvisionsystems.com)

Companies mentioned

Cognex
Natick, MA, USA
www.cognex.com

Matrox
Dorval, QC, Canada
www. matrox.com

Voice Your Opinion

To join the conversation, and become an exclusive member of Vision Systems Design, create an account today!