Training and Tuning

An OCVMax tool must be trained in order to reliably locate the characters in the strings you want to verify. CVL uses PatMax technology to train the OCVMax tool based upon an actual image of the string(s).

You use the tool’s train() function to train the tool.

Before you can tune an OCVMax tool, you must acquire an image of a character string showing the characteristics you expect the tool to encounter when you deploy your vision application to the production environment.

While training, you specify the clientFromImage parameter of the tool’s train() function to supply the coordinate transformation that will render the font into characters that are approximately the same size as those expected to be found in runtime images.

As you train an OCVMax tool, you select the amount of clutter (noise or false image data) that the training image contains. Image clutter can come from a variety of sources, including irregular lighting and camera optics. Well-lit images with good contrast typically have low clutter level values. In practice, higher quality images produce better and faster results. You use the ccOCVMaxTrainParams::scoreMode() function to select the image clutter level the tool should consider when computing scores for characters.

Note: ccOCVMaxTrainParams::scoreMode() applies only to standard registration mode.

In addition to training, you can allow the OCVMax tool to tune certain parameters automatically (using the tool’s tune() function) by examining the features of the character string in the acquired image.

Tuning an OCVMax tool allows it to use PatMax technology to experiment with a variety of parameters and determine the best settings based on the degrees of freedom the characters in your strings are likely to experience.

The amount of time an OCVMax tool requires for tuning will vary depending on the number of characters and the type of font you use. Some character strings can require a significant amount of time to tune an OCVMax tool for successful use. For this reason, you can use the ccOCVMaxProgress object to check how far along any single tuning or training operation has proceeded.

If you provide a logical starting position for the search process by specifying the startPose parameter while using the tool’s tune() function, the search process begins with the assumption that the string will be found very close to the given position. If this is indeed the case, the tool can tune much faster than when it needs to search the entire image first.

Tuning is optional. Although you can disable automatic tuning as you train an OCVMax tool, it can be difficult for you to determine the best settings for various image and character-to-character parameters that allow the underlying PatMax technology to locate the strings in successive images.

The tuning operation is not always successful. In some cases, the OCVMax tool can report a failed attempt at tuning. In general, tuning fails for one of two reasons:

  • The string you rendered to train the OCVMax tool does not match the actual string that appears on the training image.
  • The tool graphics for the string are not close enough for PatMax technology to locate the actual string in the training image.

Finally, an OCVMax tool should be able to reliably locate and verify the characters in valid character strings once the tuning operation has completed. Be aware, however, that the time required to perform a verification can be excessive. By manually adjusting various search parameters after the tuning operation has assigned good starting values, you can typically reduce the amount of time required by the OCVMax tool to locate and verify the character strings in the images you acquire.