User Pattern Training Utility - Sample (Windows)

FineReader Engine
10, 11, 12
Code Samples Collection
image: icon_userpatterntrainingutility.gif

This sample shows how you can work with user patterns when processing text sets in decorative fonts, texts containing unusual characters, large volumes of texts of low print quality.


Precompiled Sample 'User Pattern Training Utility'

The sample processes the specified image using built-in patterns and/or user patterns. You can either specify a path to an existing user pattern file, or create a new pattern and train it during recognition.

To view how it works:

  • Select the image to process.
  • Specify recognition languages of the processing document.
  • Select a pattern file to be used: create a new pattern or use an existing one.
  • Specify whether FineReader Engine should use its own built-in patterns for recognition. Not using built-in patterns may be useful for recognition of text typed with decorative or non-standard fonts.
  • To run the sample, click Recognize.

The sample uses the following procedure of pattern training:

  • Create the Engine object using the GetEngineObject function (version 10, 11 or InitializeEngine function (version 12).
  • Load a predefined profile for your scenario using the LoadPredefinedProfile method of the Engine object.
  • Call the CreateFRDocument method of the Engine object to create the FRDocument object.
  • Use the AddImageFile method to add pages to the document.
  • Create an empty user pattern file by using the CreateEmptyUserPattern method of the Engine object.
  • Create processing parameters using the CreateDocumentProcessingParams method of the Engine object.
  • Tune the RecognizerParams subobject:
    • Set the TrainUserPatterns property to true.
    • Specify the full path to the user pattern file in the UserPatternsFile property.
  • Call the Process method of the FRDocument object with these recognition parameters. Whenever an unknown character is encountered, the Pattern Training dialog will open, with the character image displayed within it.
  • Train your pattern — recognize one or more pages in Train User Pattern mode. Trained characters are saved in the user pattern file.
  • [Optional] If you wish to edit this pattern, call the EditUserPattern method of the Engine object.
  • Recognize the images by using this pattern.
  • Close the FRDocument object using the Close method.
  • Unload FineReader Engine — use the DeinitializeEngine function.


This website uses cookies which enable you to see pages or use other functions of our websites. You can turn off such cookies in your browser’s settings. If you continue to use these pages, you consent to the use of cookies.