Pushing OCR Performance with MVTec HALCON: Testing OCR Viability

Published on October 16, 2019

This post, Testing OCR Viability is the first in a series of 7 posts from Pushing OCR Performance with MVTec HALCON: 1, 2, 3, 4, 5, 6, 7.

Optical character recognition (OCR) is a standard task in machine vision and image processing. Many different applications (e.g. automatic object recognition, quality control, packaging) rely on the power of OCR to read characters or symbols during processing. HALCON uses a classification-based system for OCR which requires the segmentation of characters from their background. After segmentation, the characters are read using a pre-trained classifier. HALCON's integrated development environment, HDevelop, offers wide-ranging OCR functionality from the easy-to-use assistant to the training of custom classifiers for specific fonts.

This series offers a short overview of possible approaches when using optical character recognition in HDevelop, beginning with a look at the general settings of the OCR assistant.

A common scenario would be to to use OCR to read the best-by dates on butter packaging (below, fig. 1). (The original image can be downloaded at the bottom of this page).

<b>Fig. 1:</b> <i>Butter packaging: Image of dot-matrix characters in best-by date.</i>

Testing OCR Viability for the Application

To quickly test OCR viability for the application at hand, HDevelop's OCR assistant provides a good starting point. First, load a sample image. Then, draw a bounding box to create a region of interest and define the expected text to be read in this region by entering it into the third field (see Fig. 3). After clicking on Apply Quick Setup, the assistant automatically tries to determine suitable parameters for segmentation and classification of the characters; the resulting regions and classes will be directly displayed in the image. If the assistant fails to find suitable parameters using Quick Setup, there are ways to fine-tune the parameters so that functional segmentation and classification can be achieved. Quick Setup tries to find good starting parameters and will not perform a long optimization process for finding them. Fig. 2 (below, right) shows the region of interest on the packaging and Fig. 3 the corresponding setup in the OCR assistant. Fig. 4 shows the results of the quick setup: segmentation and classification of characters with estimated parameters.

<b>Fig. 2 (top, right):</b> <i>Region of interest for OCR on butter packaging.</i> <b>Fig. 3 (left):</b> <i>OCR assistant</i> Quick Setup <i>for butter wrapper.</i> <b>Fig. 4 (bottom, right):</b> <i>Results of</i> Quick Setup.

The next post looks at the parameters found in the OCR assistant's Segmentation tab.

Please click here to download image.

Share this post with your friends and coworkers:

Post published by TIS Marketing on October 16, 2019.

About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, video converters and embedded vision components for factory automation, quality assurance, medicine, science, security and a variety of other markets.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE, MIPI interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

ISO 9001:2015 certified MVTEC | Edge AI + Vision Alliance | EMVA

Contact us