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).
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.
The next post looks at the parameters found in the OCR assistant's Segmentation tab.
Please click here to download image.
Post published by TIS Marketing on October 16, 2019.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.