Produkty
Servis a podpora
Odvetvia a Riešenia
Spoločnosť
Verzia 1.0
·
Naposledy upravené dňa 2025-08-13

OCR Tool Vision/Identsensor function and expert settings

1. Introduction

This article takes a closer look at the "Read Characters" tool (also known as OCR) for vision and identification sensors, which was released with firmware 2.1, and describes how it works. An example is used to explain the limits of the tool and how more difficult applications can be solved with the expert settings, as well as a few tricks and tips on what to look out for with OCR.

OCR was and is a challenging task for a camera system and modern OCR tools are now mainly AI-based to achieve the best reading results. Unfortunately, our current hardware does not support Deep OCR from Halcon and we use the traditional OCR tool. The underlying tool is therefore the same as the OCR tool from the previous SmartCamera and the BVS Cockpit.

Compared to our previous OCR tool from the BVS Cockpit, the setup of the tool has been simplified by adding an automatic training process. The automatic training takes over all settings such as character height, character width, contrast, polarity, etc. It is no longer possible to set these values manually.

2. Delimitation of OCR functionality in the vision/ident sensor

Important!

Only the vision sensor has free OCR configurability. The identification sensor only has limited OCR capability. The identification sensor does not have a "Read Characters" tool!

The OCR functionality is integrated in the "Read Code" tool. The OCR function must be explicitly activated in the tool. The AOI for character reading is always tracked with the position of the code found.

3. Read Characters Setup / Train character string

In order to use the "Read Characters" tool correctly, a character string must be trained. Only then can the automatic training of the "Read Characters" tool be started and the tool attempts to determine the optimum internal parameters for robust reading.

In addition to the internal tool settings such as character height, character width etc., the font with the best match is also selected. The fonts pre-trained by Halcon are used here.

Important!

The characters used for training are not added to the tool as a font or as character "examples".

The pre-trained fonts include a wide range of OCR A and B, Universal, DotPrint, Pharma, etc. Fonts that deviate completely from these fonts may be difficult or impossible to read.

Successful training is no guarantee for reliable reading at runtime!

The training process is based on a single camera image. During training, artificial variations are created and tested internally with different brightness, contrast, rotation, etc. . However, this can hardly realistically cover the variation at runtime.

Ideally, training must take place under real conditions (lighting, distance, etc.). The training object must be as representative as possible, i.e. not a "perfect" object. After training, test the robustness with other test objects in monitor mode.

If training is not successful, a corresponding error message appears.

In the BVS_Configuration Guide there is a table in chapter" 2.4.5 Optimizations" with all possible error messages after training with information on the possible cause and measures.

3.1. Application examples

The following examples were used to set up and optimize the automatic training.

Good examples:

Non-critical font, good contrast and character spacing

Difficult examples (must be tested):

The strokes of the code can possibly interfere and be recognized as characters

Uneven print image

Strong line interference that divides the letters and thus disturbs the separation of the individual characters

Smudged print image

Reflections in the characters, uneven brightness

Unusual font

Lasered metal, uneven reflections/brightness

What does not work well:

No writing arranged in a circle can be read. It is not possible to unwind the circle.

Engraved lettering or lettering embossed on metal often does not work reliably. External lighting, e.g. dark field, side lighting, must often be used here. Bad examples:

3.1.1. Dot-print font

DotPrint on paper/plastic often works well. Ideally, the distances between the dots of different characters or lines are greater than the distances between the dots within a character.

Good examples:

Difficult examples:

Spacing between characters is tight.

DotPrint pinned in metal only works with "good" image and print quality. It should also be borne in mind that the marking quality can be expected to deteriorate over time due to a blunt needle or marking tool. As a rule, external lighting is required. Examples:

4. Expert settings: Character class/ Character pattern

Basically, the more information is known and provided to the tool, the better the desired characters will be recognized.

The character class is used in the default setting. After training, only the character classes that were used in the trained character string are used. Special characters such as "." ":" "," in particular are hard to read and should be avoided if possible. It is recommended that only the character classes that are actually to be read are activated. If possible, omit unnecessary special characters.

If the length and sequence of the character string is known, you can switch from "Character classes" to "Character patterns". In this mode, only the set class is searched for each character.

Advantage: In borderline cases, the "correct" character is read much more frequently Disadvantage: If a misprint actually occurs, the "wrong" character is recognized

Example:

Only digits are printed and an "N" (number) is defined as the character string. If an "S" is erroneously printed at this point, the tool will most likely read the "S" as "5".

This mode therefore reduces the rate of incorrect readings, but can be exploited to the point of self-deception.

5. Tips and tricks for stable reading

  • Minimum character size: For better separation of the individual characters and readability, a minimum character size of 35px is required. If this is not adhered to, a corresponding message/error is displayed during training.
  • Locator: It is recommended to use a locator to track the region. With the ident sensor variant, a code must always be read in order to use the OCR tool. Reading a text without a code is not intended for the ident sensor; the vision sensor must be used for this.
  • The size of the search area should be set so that it is ensured that the character string is completely and generously visible within the search area, even with small shifts in position. Other objects at the edge of the search area are ignored during training and at runtime. This may require some fine-tuning and trial and error.

Narrow line spacing, AOI slightly too small

Narrow line spacing, best possible AOI. Rotations are still problematic.

AOI too large

Energy consumption labeling
Energy consumption labeling

EPREL - European Product Database for Energy Labeling

Máte nejaké otázky alebo návrhy? Radi vám pomôžeme.

Môžete nás kontaktovať niekoľkými spôsobmi. Tešíme sa, že vám môžeme pomôcť.

Kontaktujte nás priamo telefonicky: +421 2 672 000 61


Balluff Slovakia s.r.o.

Balluff Slovakia s.r.o.
Mlynské nivy 73,
Bratislava - mestská časť
Ružinov 821 05

Spojte sa s nami:
[email protected]

Bezplatná vzorka produktu

Aby sme mohli do košíka pridať bezplatnú vzorku produktu, musíme z košíka odstrániť všetky bežné produkty. Ste si istí, že chcete pokračovať