Inspection of Results in MVTec HALCON

Published on October 24, 2019 by TIS Marketing.

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.)

Fig. 1: Selection of classifier Fig. 2: 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.