Developers Corner

Easy text and code reading with MERLIC standard tools

If you want to build an MVApp that reads for example QR codes or bar codes you can do so with just a few clicks. You can even combine the tools to get all available information printed on a product in different formats without the need for programming skills.

MERLIC offers six standard tools for reading common data codes as well as texts and numbers printed in any font type:

  • Read Aztec Code
  • Read Bar Code
  • Read Data Matrix ECC 200
  • Read PDF417
  • Read QR Code
  • Read Text and Numbers

If you want to build an MVApp that reads for example QR codes or bar codes you can do so with just a few clicks. You can even combine the tools to get all available information printed on a product in different formats without the need for programming skills.

MERLIC Vision App example

MERLIC is installed with useful example MVApps for common machine vision tasks, complete with all necessary images and a ready to use Frontend for a user friendly presentation of the results. In the example ‘read_lot_number_and_ECC200.mvapp’ the tools ‘Read Text and Numbers’ and ‘Read Data Matrix ECC 200’ are used to acquire and display the ‘best before’ date on a package and its ID number.

MERLIC is able to adapt to various features of print for reliable text and code reading regardless of the circumstances. Precautions for the handling of many characteristics like dot print, poor focus, and slant are included in the reading tools so in most cases there is no need for additional calibration or preprocessing. The screenshot shows the application of easyTouch. When hovering over an area with your mouse pointer, MERLIC determines suitable parameters and previews the result. If the results suit your needs, confirm the preselection with a click.

The images in the example MVApp are not perfectly aligned and some are out of focus. Nonetheless, all texts can be read because the region of interest (ROI) is big enough and the parameters are set right. ROIs can be adapted by simply dragging the edges or corners. They also can be rotated to fit the given requirements.

The second tool in the example, ‘Read Data Matrix ECC 200’, uses a training mode to determine parameter values suitable to detect and read codes inside an ROI. In case the tool does not recognize the code right from the start, simply add a training image, draw an ROI around the code you want to read and apply the training data. If you want to optimize every detail of the code processing there are over 20 additional parameters available. For example, you can define the minimum contrast, the finder pattern tolerance, and if the code appears dark on a light background or vice versa.

A quick way from codes to appealing results

To speed up the search, a so-called pyramid of contracted images is used. Instead of starting to look for codes on the full size image, a stack of contracted images is created, that looks like a pyramid. Starting from the smallest image on the top, MERLIC analyzes the image content and uses the first Data Matrix ECC 200 code it can find. To speed up the processing even more and make sure that only the desired code is found, you can specify a processing region for the images.

MERLIC provides the decoded data as a string in a result connector that can be connected to subsequent tools like ‘Write to File’. For the example MVApp the result is used in a label widget that displays the string in the Frontend. The MERLIC Frontend is a separate run time environment for the representation of results and easy user interaction. Therefore, it can be executed on a different computer or device than the one the MERLIC Backend is running on.

More than just reading

Most reading tools include a training and all follow the same simple work structure:

  1. Acquire the desired images.
  2. Insert the appropriate tool for reading text, numbers or codes to the Tool Flow.
  3. If the tool does not process the content automatically, optimize the parameters.

In addition to the basic parameters and results each tool offers a wide range of additional possibilities for your machine vision tasks. You can use this information as input for subsequent tools and data evaluation.

For a clean user experience additional parameters and results are hidden by default but can be displayed at any time if needed.

easyTouch determines suitable parameters for the task of the tool with a simple click.
The frontend combines images, results and interactive elements for a target-oriented presentation.
Each reading tool contains various additional parameters and results that are hidden by default.

Further articles

Visualize Object Model 3D
Improve your surface-based matching with two helpful features
Do you sometimes have objects, which have rather small symmetry-breaking elements (such as small boreholes on an object)? Does your surface-based 3D matching not find the correct orientation?
Read more
Developers Corner
Deep OCR Interface
Deep OCR recognition training – the next level
HALCON’s Deep OCR is very powerful and can detect and recognize text in various industrial scenes. However, what if you have a special font, or want to read foreign characters? With HALCON 22.05 it is possible to train the recognition model to read s…
Read more
Developers Corner
Fitted primitives distance threshold
Metrology Model – Quality of Fit
"For most applications, the standard parameter values are sufficient." This sentence is often read in the HALCON Solution Guide. But what if the results do not meet your expectations? The Metrology Model allows lightning-fast measurement of geometric…
Read more
Developers Corner
Review of Acquisition Modes
This article gives an overview of HALCON’s image acquisition modes, explaining how continuous, triggered, and synchronous acquisition work, and clarifying common misconceptions for practical applications.
Read more
Developers Corner
Deep OCR – Tips and Tricks
Have you already experienced the performance boost by using Deep OCR compared to the classical rule‑based approaches? In this article, we’ll show you practical tips and tricks to further improve your Deep OCR results.
Read more
Developers Corner
About MVTec's Heatmap
Imagine you intend to deliver a HALCON deep-learning-based classification application. And you are about to evaluate a trained model. You are therefore looking for feedback about this model, i.e. about its performances, biases, and other possible def…
Read more
Developers Corner
Gabor filter: What is it for?
Gabor filters, which are well known in the realm of time series analyses, can also be used in HALCON for 2D image analysis. They are particularly useful for detecting textures, patterns, and orientations in complex images.
Read more
Developers Corner
Introduction to new sub-pixel feature of bar code reader
Do you have small resolution bar codes to read but don't get any good results? Then please try our new feature – the subpixel bar code reader.
Read more
Developers Corner
Introduction to XYZ-Mappings (part 2)
This technical article continues our introduction to XYZ-mappings. In the last article, we answered the question "What are XYZ-mappings?" and gave a short preview towards "Why is using XYZ-mappings beneficial for many 3D applications?". Today, we wil…
Read more
Developers Corner
Introduction to XYZ-Mappings (part 1)
This technical article explores the benefits of XYZ-mappings in HALCON, showing how they increase speed, flexibility, and ease of use for many 3D applications.
Read more
Developers Corner
Deep learning: Why is the dataset key for a success result?
Deep learning success starts with the dataset: Learn why acquiring high-quality, well-labeled training data is crucial for reliable classification, detection, segmentation, and anomaly detection in your machine vision applications.
Read more
Developers Corner
How to prepare 3D height images for further processing with MERLIC’s standard tools
Learn how to prepare 3D height images in MERLIC for further processing: convert non-byte images to byte images to enable alignment, embossed text reading, and defect detection with standard easyTouch tools.
Read more
Developers Corner
Deflectrometry demo HALCON
Inspection of specular surfaces with deflectometry in HALCON
Inspect flat and curved reflective surfaces quickly and reliably with HALCON deflectometry: detect scratches, dents, and other defects with synchronized image acquisition and flexible image processing.
Read more
Developers Corner
Deep Learning classifier HALCON
Training a deep learning classifier with HALCON on the embedded board Jetson TX2
Learn how to train a deep learning classifier with HALCON on both a PC and an embedded Jetson TX2 board, from image acquisition to model training and inference, for efficient machine vision applications.
Read more
Developers Corner
Add touch input to the HSmartWindowControlWPF
Learn how to easily add touch input, including pinch-to-zoom, to the HSmartWindowControlWPF in HALCON, leveraging WPF’s built-in multi-touch events for intuitive image control.
Read more
Developers Corner
Increasing Speed in Deflectometry Set-ups
Discover three approaches to increase speed in deflectometry setups, from simple software-based synchronization to hardware triggers and FPGA-based real-time control, enabling faster and more precise inspection of reflective surfaces.
Read more
Developers Corner
HDevelop matching assistant speedup greediness
Speeding up shape-based matching with "Greediness"
Learn how the 'Greediness' parameter in shape-based matching balances speed and detection completeness, enabling faster searches while maintaining robust results in HALCON.
Read more
Developers Corner
Best practice for classification and OCR
Discover best practices for setting up classification and OCR in HALCON using the HDevelop OCR Training File Browser – quickly review, correct, and optimize your training data to improve segmentation and classification results.
Read more
Developers Corner
Rejection all classes 1.5
How to use rejection classes in MVTec HALCON
Learn how to handle outlier samples in MVTec HALCON by using rejection classes in MLP classifiers – automatically generate samples outside the training classes to improve classification reliability.
Read more
Developers Corner
Using regularization Weight prior 0.1 large
Using Regularization in MLP Classification
Learn how to use regularization in HALCON to prevent overfitting in MLP classifiers, smooth decision boundaries, and achieve better generalization for new and unseen data.
Read more
Developers Corner
MVTec Software