Inspection of Results in MVTec HALCON

Published on October 24, 2019

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

In addition to using one of the pre-trained classifiers, custom classifiers can be built by creating a training file and selecting suitable features. More often than not, however, it is enough to use one of the pretrained classifiers. (The creation of a training file deserves its own blog post, and so will be addressed as a separate post in this blog.)

<i><b>Fig. 1:</b></i> Selection of classifier <i><b>Fig. 2:</i></b> Inspection of results

After fine-tuning the segmentation and selecting a suitable classifier, the last two steps of setting up an OCR application are rather easy. To define which features should be displayed in the results table (Results tab, Fig. 2), select parameters and options in Display Parameters. Postprocessing of the classification results is also possible by enabling Word Processing. The classified sequence of characters is then compared to a regular expression or words in a lexicon file.

After prototyping the OCR reader via point-and-click, go to the Code Generation tab which takes care of the rest. Simply set Generation Mode to Text Reading and select no alignment. If the goal is only to read the text in the image, alignment will not be necessary. If OCR is being used in an application where the text position changes, automatic localization of the corresponding region of interest might be necessary. Apply segmentation and classification in this new region, so that code can be generated to align the region. Be aware, however, that alignment only functions when a transformation matrix has been defined which localizes the new region of interest.

At this point, the generated code can be additionally fine-tuned. The next blog post in the series covers craeting text model readers and additional parameters. (Please see navigation at the top of this page for additional posts.)

Please click here to the download image.

Please click here to download the generated code.

Share this post with your friends and coworkers:

Post published by TIS Marketing on October 24, 2019.

About The Imaging Source

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.

Automated Imaging Association ISO 9001:2015 certified

Contact us