Pushing OCR Performance to New Levels with MVTec HALCON: Testing OCR Viability

Veröffentlicht am 14. Mai 2019

This post, Testing OCR Viability is the first in a series of 8 posts from Pushing OCR Performance to New Levels with MVTec HALCON.

Optical character recognition (OCR) is one of the standard tasks 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.

In this series, we would like to give a short overview of the different approaches possible when using optical character recognition in HDevelop. In this first post, we will begin by taking a look at the general settings of the OCR assistant.

Let's jump right in and use OCR to read the best-by dates from a butter wrapper (below, fig. 1). If you want to code along, you can find the original image in the download section at the bottom of this page.

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

Testing the OCR Viability for the Application

To quickly test the viability of OCR 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 quick setup for butter wrapper.</i> <b>Fig. 4 (bottom, right):</b> <i>Results of quick setup.</i>

In the next post, we will look at the parameters found in the OCR assistant's Segmentation tab.

Please click here to download image.

Teilen Sie diesen Post mit Ihren Freunden und Kollegen:

Beitrag veröffentlicht von TIS Marketing am 14. Mai 2019.

Über The Imaging Source

Seit der Gründung im Jahre 1990 gehört The Imaging Source zu den führenden Herstellern von Industriekameras, Frame Grabbern und Videokonvertern für die Automatisierungstechnik, Qualitätskontrolle, Logistik, Medizin, Wissenschaft und Sicherheitssysteme.

Unser umfassendes Kamerasortiment beinhaltet USB 3.1, USB 3.0, USB 2.0, GigE Schnittstellen sowie weitere Bildverarbeitungsprodukte, die weltweit für ihre hohe Qualität und Erfüllung der Leistungsanforderung anspruchsvoller Applikationen bekannt sind.

Automated Imaging Association ISO 9001:2015 zertifiziert

Kontaktieren Sie uns