ICR - Code Sample (Linux)

Language:
EN
Product-Line:
FineReader Engine
Version:
12
Platform:
Linux
Type:
Knowledge Base & Support
KB-Type:
Code Samples Collection
KB-Topic:
Recognition
Category:
Recognition
Coding:
C++
Image:
image: icon_icr.gif

This sample demonstrates how ABBYY FineReader Engine may be used for recognition of the handprinted text from the image documents.

Description

The procedure of the handprinted text recognition uses the basic objects and methods of ABBYY FineReader Engine.

Do the following:

  1. Create the Engine object using the InitializeEngine function.
  2. Call the CreateFRDocumentFromImage method of the Engine object to create the FRDocument object from the image document.
  3. Use the Element property of the FRPages object to gain an access to the first page of the document.
  4. Tune the recognition parameters of the text from the image document:
    1. Create the RecognizerParams object with the CreateRecognizerParams method of the Engine object to gain access to the recognition parameters of the text block.
    2. Set the language of the text from the image document with the SetPredefinedTextLanguage method of the RecognizerParams object.
    3. Set the TextTypes property of the RecognizerParams object to TT_Handprinted.
    4. Set the FieldMarkingType property of the RecognizerParams object to FMT_SimpleText.
    5. Put the text region on the document page with the specific recognition parameters:
      1. Get the layout of the image document with the Layout property of the FRPage object.
      2. Get the collection of blocks of the layout with the Blocks of the Layout object.
      3. Call the CreateRegion method of the Engine object to create a Region object.
      4. Get the width and height of the image document. Use the Width and Height properties of the Image object.
      5. Add an area into created Region object with the AddRect method.
      6. Create a Block object with the AddNew method of the LayoutBlocks object.
      7. Call the GetAsTextBlock method of the Block object to return the block as the TextBlock object.
      8. Use the RecognizerParams object to get the recognition parameters of the text block.
  5. Perform recognition of the document page with the Recognize method of the FRDocument object.
  6. Call the Export method of the FRDocument object to save the recognized text to a file of the specified format.
  7. Close the FRDocument object using the Close method.
  8. Unload FineReader Engine — use the DeinitializeEngine function.

For the description of used objects and their methods and properties see the Developer's Help.


Back To:

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.