OCR Verification and Character Inspection

Explore the power of OCR verification and inspection in reading QR codes on metal parts, recognizing part numbers, and checking expiration dates on food containers.

Character Inspection/OCR

Character inspection is used to check, recognize or determine characters printed on parts or products. The technology is also called print inspection and is used in various tasks, such as:

  • Reading QR codes (2D codes) stamped on metal parts
  • Character inspection of part numbers or model numbers
  • Checking expiration dates on food containers

Parts and products are marked with expiration dates or product numbers. However, this is not useful when this information cannot be read, recognized, judged, stored, and managed accurately. Character inspection has become widespread in recent years for recognition or judgment based on characters extracted from captured image data. This page describes basic information about OCR (Optical Character Recognition) and OCV (Optical Character Verification) and the basic principle of character inspection.

Basic Principle of Character Inspection/OCR for Reading Characters Such as Expiration Dates From Images

Advantages of Introducing Image Processing

Character strings are indispensable for showing information such as expiration dates for food/medicine and part numbers of assembly parts in manufacturing. They are also essential for sales order management. These strings are vitally important for management; however, management of characters can be a lot of trouble.

For example, assume that you manage orders and inventory on paper in handwriting. Management through handwriting may cause mistakes or omissions. If the book is lost, there might be no way to retrieve the orders and inventory.

In addition to preventing human errors, image processing is increasingly used to make management more reliable and reduce labor and cost. Replacing the recognition, checking and management of characters performed by human hands with an image processing system brings the following advantages:

Preventing mistakes and omissions in books
In character inspection, the captured characters are compared with those in the registered dictionary (character font groups) and each is recognized as the character with the closest shape. The recognized characters are compared with the judgment string and the pass/fail output of the final inspection is produced. It is also possible to store the output judgment result on a server or other storage device. This type of reliable procedure prevents mistakes and omissions that may occur with management through handwriting.

Reliable information management
Character inspection using image processing technology allows operators to upload the recognized character information to a server or other device, so there are no worries about mistakes such as writing the wrong characters. Product numbers or other items that consist of many characters are often written incorrectly. Handling them as digital information can prevent problems.

Thorough management of product numbers and other information also allows tracking of parts or products and collecting them quickly in case of the outflow of defective products or a product recall. It is also possible to track problems upstream to identify a problematic process to improve operations. Reliable information management is also effective for ensuring traceability.

Simultaneous reading along with barcodes or 2D codes
In recent years, barcodes or 2D codes have been introduced for product management. To read barcodes or 2D codes only, you can use a barcode reader or a handheld mobile computer. In many cases, however, an expiration date is also marked on the label along with the barcode or 2D code. Character inspection can recognize both codes and characters simultaneously. This improves efficiency dramatically because you can read all data at once and manage them together instead of reading each type of data separately.

100% inspection with minimum labor
The most effective method for preventing the outflow of defective workpieces is 100% inspection. However, checking characters visually not only takes time and labor but also involves a risk of oversight. Using image processing enables reliable inline character inspection to achieve both quality assurance and reduced labor costs. It also improves the yield rate in the inspection process and is highly effective for increasing production efficiency.

Basics of Character Inspection

There are various types of character inspection: presence of marking, marking quality, optical character verification (OCV) and optical character recognition (OCR).

Presence of marking:
An inspection to detect the presence or absence of marking.
Marking quality:
An inspection to detect illegible characters.
OCV:
An inspection to compare marked characters and a judgment string and make pass/fail judgment.
OCR:
An inspection to read marked characters and output them for verification or control.

Although the purposes are different, the basic operation of character inspection is to extract characters one by one from a captured image, compare them with characters in the registered dictionary, and identify characters.

1. Character extraction
Extract characters one by one from the captured data.
2. Comparison against dictionary
Each of the extracted characters is compared with registered characters for identification.

Techniques for Improving Recognition Accuracy

In the past, there were complaints about the low accuracy of character recognition. Through various technological innovations, the accuracy of character recognition has improved significantly.

Sub-pattern registration
Registering several patterns for one character improves recognition stability. By registering various fonts as sub-patterns, you can prevent failed recognition due to different font types.

Automatic fitting
Automatic fitting is an automatic fine adjustment of characters to allow extraction in optimum conditions. Since slight variations in the status among characters are corrected individually before verification, the correlation level is increased.

Inspection of expiration dates on food containers

Image enhance filters
When the background of the marking has patterns or is made of metal or other reflective material, the accuracy of character inspection may decrease. Even when reading is difficult due to these or other reasons, applying image enhance filters enables stable character inspection.

Normal gray processing image - Character extraction is unstable due to the influence of the background.

Color to gray processing with the CV-X400 - The contrast between the characters and background is sufficient to make the inspection stable.

Practical Applications

This section introduces practical examples of using image processing for character inspection not only to prevent the outflow of defective workpieces but also for quality improvement by building a thorough management system and ensuring traceability.

Character inspection of expiration dates
Character inspection is used often in the food and pharmaceutical industries. The most typical application is character inspection of expiration dates. Machine vision reads expiration dates to check for incorrect dates or omission. 100% inspection can prevent mixing of expired products.

Checking the orientation and correctness of characters on parts in an embossed tape
Embossed tape is used as packing material for IC chips, connectors and LEDs. Character inspection of targets packed in embossed tape requires image capture through the cover tape. These inspections are affected by random halation generated by ambient lighting, resulting in incorrect recognition. Using an image enhance filter (shading correction filter) ensures reliable character detection without the negative effect of halation. This filter is also effective for targets such as containers, filters, and reflective metal parts.

Inspection screen: OK

Inspection screen: NG (wrong orientation)

Inspection screen: NG (omission of marking)

Preventing Manual Errors with OCR Inspections

Optical character recognition and optical character verification revolutionized quality control processes in manufacturing and packaging industries, as they provide an automated solution that prevents manual errors.

In the past, most OCR verification of printed labels, cartons, and a variety of other packaging was mostly done after the printing process was completed. That would prevent the products with poor-quality prints from reaching end consumers. However, correction of poor printing would incur additional costs that could have been avoided with adequate technical implementations.

That was obviously a flawed system, so operators switched to manual selection of printed products and labels during production that would undergo quality assurance checks and print inspections, reducing the risks of coding errors across the entire batch. Of course, checking each individual product isn’t financially viable or practical.

Fortunately, the advancements in machine vision and OCR verification made it possible for every single product to undergo inspection. With every single label and package checked, the margin for error is significantly lower compared to previous inspection methods.

Implementing OCR inspections helps detect printing issues as soon as they occur, allowing operators and technicians to address coding and printing errors before resuming production. This significantly minimizes financial loss associated with downtime, recalls, corrections, and human error.

How do OCR Systems Work?

In the context of date coding in manufacturing, OCR systems are specifically designed to recognize text entries on images captured by vision system sensors and compare them to predetermined values. Below is the breakdown of the working principle of OCR systems:

Image Acquisition

The first step in OCR verification involves capturing images of date coding printed on product packaging or labeling. This is usually done using high-resolution cameras and optical transducers integrated into the production line. These cameras are strategically placed to capture the images of the date coding regardless of product orientation.

Preprocessing

Once the camera captures the image, the data goes into preprocessing to enhance image quality and readability for the OCR verification software. This may involve contrast, brightness, and noise adjustments that could interfere with text recognition. After this, the image moves into the text detection phase.

Text Detection and Character Recognition

OCR verification systems rely on advanced algorithms to identify the regions containing text and distinguish date, lot, and batch codes from other printed elements. The system will isolate the text and break it down into individual characters using pattern recognition techniques for identification. Considering the system is used for date coding, the algorithms for pattern recognition are specifically tailored to recognize coding formats specific to the industry in which they operate.

Verification and Validation

After recognizing the characters, the OCR system will verify the information against the expected, previously set values and formats. This is an important step as it ensures the coding isn’t only legible but also accurate and compliant with regulations.

Feedback Loop

If the OCR verification detects discrepancies or printing errors, the system will trigger alerts for immediate corrections. Creating this feedback loop is crucial for quality control and quality assurance, as it enables the production team to address printing issues immediately and minimize their impact on the overall production.

KEYENCE offers comprehensive quality assurance and print inspection solutions for your business. If you’re thinking about upgrading, contact us, and we’ll gladly respond to all your inquiries regarding the integration of our products into your existing production line.

Related Downloads

IMAGE PROCESSING USEFUL TIPS Compilation

This guide is a compilation of trivia pertaining to vision systems. Figures are used to provide easy-to-understand explanations of principles and characteristics for items ranging from lenses, image capturing, lighting, and color to communication and preprocessing. This guide is a must-read for anyone wanting to learn all about vision systems.

Download