Success Story

Beverage industry: HALCON reliably checks bottle cap imprints

Machine vision offers enormous advantages for quality control applications. High accuracy and speed as well as high flexibility and availability are important for practical use. K&S Anlagenbau GmbH has implemented such an application for the beverage industry with the help of the consulting company Computer Vision Solutions. In this application the machine vision software MVTec HALCON is used.
HALCON
Food & Beverage
Blob Analysis
Calibration
Matching

The production of bottles and bottle caps in the beverage industry is highly automated, as large quantities must be produced quickly and reliably. "Our aim is to make automated processes as safe and reliable as possible. This is the lever for being able to operate a process at high speed in the long term. Thus, we rely on standardized tools that allow us to manufacture reproducible products reliably and quickly. Based on machine vision, we have developed a solution for inspecting porcelain bottle caps," says Thomas Kelz, responsible for quality technology at K&S Anlagenbau GmbH.

The company from Lengenwang in Bavaria is developing automation solutions for the electrical, automotive, medical, and consumer goods industries. Together with the consulting firm Computer Vision Solutions Consulting & Research, the company has developed an application for the quality inspection of beverage bottle caps.

Maximum flexibility with a minimum of machine stops for the beverage industrie

The challenge was to implement a quality control system that quickly and reliably detects faults in a fully automated process but is also low-maintenance. Low-maintenance means that the system can quickly and easily be switched to other product types. "Automation only brings decisive added value, if the customer has little effort in maintaining the system," says Dr. Heber. In the newly developed system, quality control is carried out inline. To do this, the camera takes a picture of the bottle cap to be checked. This is then checked using the algorithms of the machine vision software MVTec HALCON.

The challenge with print image control is the variability of the print images on the one hand and the requirement to create a clear operating concept for the system operator on the other hand. Possible print image errors could be, for example, incorrect or out-of-focus colors or imprints that are not completely visible. The central position of the print image on the bottle cap is also evaluated as a quality criterion. "One of the major challenges during implementation was that the number of different-looking print images is theoretically infinite. This applies to both the good, i.e., "OK" prints, and the faulty, i.e., "NOK" prints. Thus, we had to ensure that the software was trained in advance to make the right decision at all times," explains Dr. Heber. For training, the image of an OK print is saved in HALCON. This "good image" serves as a template against which each image is compared during the inspection process. Various parameters in HALCON can be used to set the degree to which deviations are still considered OK.

Graphical user interface and MVTec HALCON as core parts

An important component of the system is the graphical user interface (GUI). With this, the entire system can be overviewed, and changes and configurations of the process can be made.

The requirement for the GUI was that it can dynamically display several different apps, which can be controlled both via the GUI and the PLC. In the finished system, the operator can set various display options, configuration modes, and different user levels. This means that it is also possible to assign rights and thus determine which employees are allowed to carry out which activities. Troubleshooting or adjustments, e.g., if a different print needs to be tested, can also be made via the GUI.

Another core component is MVTec HALCON. HALCON is integrated into the K&S Control software using HDevEngine. "HALCON is the industry standard in the field of image processing software and is not limited to just a few algorithms," explains Dr. Heber. HDevEngine acts as an interpreter designed to dynamically load and execute the machine vision algorithms. It also enables changes to the machine vision processes "on the fly" without having to recompile or recertify the entire application. Furthermore, HDevEngine communicates with the GUI in the background. Operators of the system have little or no contact with it. This is because they operate the system via the GUI they are familiar with.

Machine vision software is perfect for automated processes

The machine vision software HALCON enables high and robust detection rates. It not only includes HDevEngine, but also many image processing methods that are used to check the print images. Matching technologies, classification, and blob analysis are used in the specific application.

The three technologies interact as follows: after the image has been captured by a camera, shape-based matching localizes the print in the image - sub-pixel accurately and in near real-time. To do this, the pre-trained print image is matched with the scanned image. This works even if the print is rotated, scaled, perspectively distorted, partially covered or outside the image, or subject to non-linear lighting fluctuations. Once the print has been found, the next task is classification. Here, too, it is important that the class features have been defined and trained beforehand. In the K&S Anlagenbau plant, classification is used for quality control. Possible errors include color deviations, missing edges, incorrect edges, or structures. Corresponding deviations are segmented and analyzed using blob analysis.

If the machine vision technologies described find an error, this is displayed in the GUI. The corresponding area is highlighted in color. This also allows users to recognize the nature of the defect.

If the imprint is "OK", the bottle cap is processed further.

Bottle cap imprint classified as OK in the machine vision user interface.
The GUI shows that the imprint is "OK".
Bottle cap imprint classified as NOK in the machine vision user interface.
The GUI shows that the imprint is not ok: "NOK".

"However, the scope of the machine vision software goes beyond this. To ensure that the process is as automated as possible, we have embedded the software in the entire system in such a way that it can communicate with other components. If a bottle cap is not printed correctly, HALCON informs the system accordingly and the component is automatically ejected," explains Dr. Heber. The communication protocols OPC-UA and PROFINET enable consistent data exchange between the various components within the system. In this way, full automation can be achieved.

System fulfills requirements for automated quality control

"The feedback we have received from the customer has been very positive. The system runs flawlessly and can be operated highly autonomously," says Dr. Heber. Specifically, the system can test 120 bottle caps per minute.

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
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 programmin…
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
MVTec Software