Case Studies

Machine Vision OCR Software and Camera Team Up to Inspect Cereal and Snack Labels at High Speeds

In the past, optical character recognition (OCR) vision systems were not traditionally thought of as fast, flexible, or maintainable. However, today’s systems are different, so when a worldwide, top manufacturer of cereal and snack products tasked EPIC Machine Vision Systems (EPIC; St Louis, MO, USA; www.epicvisionsystems.com) with installing one, the vision systems integrator was confident in its approach.
 
At the manufacturer site, a system rejects packaged food products with incorrectly printed data codes from the conveyor. While the previous system worked reasonably well, it was old and unsupported by the original software developer. The manufacturer sought to upgrade its existing system to meet new quality standards and industry food-safety standards and to improve the overall OCR inspection process.
 
The design team began with a front-end engineering (F.E.E.) methodology that involved gathering tens of thousands of in-process online images from multiple stock-keeping units (SKU), printers, and printing formats for testing.
 
“We spend more time on the front end to ensure that the final, turnkey, vision system is not an object of the constant ‘tweaking’ that is all too common with many vision systems,” says EPIC’s Director of Engineering, Dan Nadolny.
 
To install an OCR system for the company—which has more than 50 manufacturing facilities worldwide—EPIC deployed the SureDotOCR tool in Matrox Imaging Library (MIL) software from Matrox Imaging which is specifically designed for reading dot-matrix text. With support from Matrox Imaging, EPIC used these image sets to optimize the algorithm parameters and establish a baseline for the necessary processing and imaging hardware. Test results included multiple printers and large amounts of print variation (e.g. contrast, aspect ratio, line positions, character spacing, and curved lines.)
 
For the camera portion of the vision system, EPIC selected a Genie Nano M1940 camera from Teledyne DALSA. The M1940 GigE Vision camera is a monochrome model with a 2.4 MPixel IMX174 CMOS image sensor from Sony which has a 5.86 µm pixel size and can achieve a standard frame rate of 51 fps. The camera was set up to provide a 5-pixel dot diameter and was interface to a Matrox Indio I/O and communication PCIe board, which offers a Gigabit Ethernet port with Power over Ethernet (PoE) support and 16 real-time, discrete digital I/Os . The application uses standard and industrial PCs, with a camera and dome “cloudy day” lighting provided even lighting across the product surface contrast.
 
The goal was to achieve a 99.97% read rate, or a failure rate of less than 300 parts/million.
 
“The SureDotOCR algorithm met a 99.90% read rate, with one dot diameter setting and 99.99% read rate with three read attempts at different dot diameter settings,” says EPIC Project Leader, Chris Walker . “The ‘Dot Diameter’ is defined as the average pixel diameter of the individual dots in the dot-matrix printed text string. Matrox recommends a 7-pixel dot diameter, but the design team settled at a 5-pixel dot diameter to reduce image storage and bandwidth requirements.”
 
Typical inspection times for a single read attempt—involving two lines of text and approximately 36 characters total—were around 40 ms, according to Walker.
 
“Foreign font files were created and tested with similar performance ability as standard English alphanumeric fonts,” he says. “The algorithm was capable of exceeding 1200 inspections/minute on two lines of text with about 36 printed characters total. Read rates as high as 2500 inspections/minute were seen at single-read attempts. MIL-supported multi-threading and multi-core processing helped achieve the required read rates.”
 
An inspection rate of 1200 parts/minute provides a consecutive inspection time of only 50 ms/part. The average inspection time for a single read attempt was just under this value at 40 ms. Three read attempts/inspection are recommended to increase system robustness. Inspection times periodically exceeded 100ms and even were as high as 286ms during early testing. The vision system had to rely on the multithreading architecture feature—a key feature supported by the MIL SDK—to overcome these times. Multithreading is synonymous with parallel processing and is the function by which a computer can concurrently perform multiple processes.
 
The vision system—through MIL—can also receive and buffer images for processing in a queue and have multiple threads process those images in parallel. While the multithreading architecture works well at meeting high processing rates, this requires the vision system to keep track of the parts under inspection to properly reject failed parts subject to potentially longer inspection times.
 
For example, if parts are traveling on a conveyor at high speeds and the vision system process starts to back up with a large queue of images to process, or if a read takes a significantly long time to process, the part waiting for an inspection result will be significantly further along the conveyor belt by the time the inspection is complete and the pass/fail result is ready. For this application, if a single read took as long as 500 ms to process the part, it would be nearly 1 m further along the conveyor.
 
Providing encoder feedback for the existing line conveyor to track part distances from the point of inspection to an ejector located 1.5 m away overcame this challenge, allowing the vision system to work with occasional issues of significantly long read times while guaranteeing that the inspection result would be communicated before the part reaches the ejector.
 
In the end, the OCR solution was flexible and robust enough to meet the application requirements, according to Walker.
 

For more information contact Media Relations.