You are here: Start » User Interface » Auto-tuning Datacode Parameters

Auto-tuning Datacode Parameters

Introduction

Auto-tune Editor can assist you in determining the optimal parameters for the ReadDataCodes filter. By using one or more provided images, it attempts to read as many codes as possible by testing different parameter combinations. It also optimizes the reading score and execution time.

To open the Editor, double-click on the ReadDataCodes filter or click on Auto-tune... in the Properties panel. Note that inputs to be modified by Auto-tune cannot be connected.

Opening Auto-tune Editor

Basic Operation

Auto-tune Editor overview

Parameters for datacode reading from the inputs inCodeParams and inDetectionParams are loaded into the editor and can be seen on the right side. Additionally, the inTypeSelection input value is also loaded.

First, select an image from the program to be used (you may need to run the program first). After selecting an image, the editor tries to read the codes on the image using the current parameters. Codes that can be read are highlighted on the image.

After pressing the Auto-tune button, the optimization process begins. The algorithm initially attempts to read as many codes as possible (at least the minimum defined number). Then, the parameters are refined to improve the scores of the read codes until at least the minimum defined score is achieved. Finally, the parameters are optimized to achieve the smallest possible execution time while still reading the required number of codes and maintaining an acceptable score.

During optimization, the current best parameters are updated live and displayed on the right. Read codes are displayed on the image. The progress of optimization regarding score and execution time can be seen on the charts.

If the results are satisfactory, the user can accept them by clicking OK. The optimized parameters are then written to the filter inputs.

If something goes wrong during optimization, you can start from scratch by clicking the Reset button. The results are then cleared, and the parameters are returned to their default values.

Conservative Optimization

If the user clicks the Extend only button instead of Auto-tune, optimization is performed in conservative mode. This mode is designed to make modifications to the reading parameters that will not prevent the filter from reading codes that were previously readable. For example, the parameter MaxRowCount in regular auto-tune can be increased or decreased, but in conservative mode, it can only be increased.

This mode is intended for tweaking parameters that already work in most cases. For example, it can help read a new difficult code while continuing to read existing codes.

Single and Multiple Codes Mode

By default, the editor starts in single code mode, meaning it can read only one code per image. To read more codes, change the variant of the ReadDataCodes filter to Multiple and reopen the editor.

Note that in multiple codes mode, additional filter inputs are loaded into the editor (and written back when closing the editor). The input inMaxCodeCount determines how many codes can be present in one image at most. The input inAllowMultipleScales can be useful when there are codes of different sizes in one image.

Single and Multiple Images Mode

Similarly, the editor begins in single image mode. For simplicity, the user can select a single image from those used in the current program. To assist auto-tune in choosing better parameters, the user can switch to multiple images mode to provide more images. Use the menu in the top-right corner to switch.

Switching to multiple images mode

Before starting auto-tune you will need to load the images into the list on the left. All of them will be considered during optimization process.

Editor in multiple images mode

Multiple codes mode and multiple images mode can be used at the same time.

Auto-tune Parameters

Auto-tune requires some parameters to be set manually:

  • Minimum score: The algorithm will attempt to improve the score up to this value, and during execution time optimization, it will not allow the score to fall below this value.
  • Detection method: If set to a value other than Auto, the DetectionMethod parameter will consistently be set to this value. This can be used to prevent auto-tune from altering it.
  • Time budget: Specifies the time to spend on optimization (in seconds). Alternatively, you can set a large value and then click Stop to manually finish auto-tune.
  • Minimal number of codes to be read in all images: The algorithm will initially attempt to use parameters that allow reading at least this many codes in all images combined. Setting this value too high may cause optimization failure. Conversely, setting it lower than the actual number of codes may result in not all codes being read, but the score and execution time may improve.
  • *Maximal number of codes in one image: If set too low, the code reader may stop reading before finding all codes in one image, potentially preventing auto-tune from achieving the minimum required number of codes across all images.
  • *Allow multiple scales: If set to false, the code reader may fail to read two codes when their sizes differ significantly.
  • Read codes after parameters changed: After a relevant code reading parameter is changed, the editor will read codes again on the current image so the user can observe the effect. However, if the codes are difficult and reading takes too much time, you can disable this for a better user experience.
  • *Types of code: Limits which types of codes are read. If a code type is unchecked here, it will never be read.

Parameters marked with * are linked to filter inputs (they are loaded when opening the editor and written back when accepting changes). They are also passed to the code reader inside auto-tune (which is essentially another ReadDataCodes filter).

Previous: Creating Text Recognition Models Next: Analysing Filter Performance