Multi-Core OCR Processing Sample

Language:
EN
Product-Line:
FineReader Engine
Version:
10, 11
Platform:
Windows
KB-Type:
Code Samples Collection
KB-Topic:
Recognition
Category:
Recognition, OCR: Speed & Quality
Image:
image: icon_multiprocessingrecognition.gif

This sample shows the gain in speed when processing a multi-page document in several recognition processes as compared to processing the same document in a single process. The sample uses methods of the FRDocument object for processing. This means that:

  • Image files are added to the FRDocument object one-by-one from the specified location.
  • Parallel recognition starts when all images have been added.
  • After all pages have been processed, the user can access the result of processing of the whole document.

Compare this sample with the Batch-Processing Recognition sample.

Screenshot made with a Laptop (2012) Quad i7-3720QM, 2,6 GHz, Windows 7, 16 GB RAM, 64 bit;
FineReader Engine 10 R7 - Std. sample files that are included

Screenshot made with a Laptop (2009) Core2 Duo T9800, 2,9 GHz, Windows 7, 4 GB RAM 32 bit;
FineReader Engine 10 R1 - Std. sample files that are included
Production machines are faster and have more cores =)

This sample shows the gain in speed when using multiprocessing recognition.

Description

The sample processes document images from the specified folder and, if necessary, saves them in PDF format. The sample compares the speed of processing in one thread and in parallel threads. The result of comparison is shown on a diagram.

To view how it works:

  1. Select the folder with images to process.
  2. Specify recognition languages of the processing documents.
  3. Specify the number of CPU cores to test on. The default number of CPU cores equals the maximum available number. You can reduce it to compare the difference in speed. The test for one CPU core is performed automatically during processing.
  4. Specify, whether to save recognized text. If the results are saved, the duration of all processing operations (analysis, recognition, synthesis, and export) is measured. Otherwise, only the time of analysis and recognition is measured.
  5. To run the sample, click Start.

The sample uses the following procedure of multiprocessing recognition:

  • Create the Engine object using the GetEngineObject function.
  • Load a predefined profile for your scenario using the LoadPredefinedProfile method of the Engine object.
  • Call the LoadModule method of the Engine object to load the FineReader Engine Processor module (FREM_FREngineProcessor).
  • Set the MultiProcessingParams property of the Engine object to use recognition in parallel processes.
  • Call the CreateFRDocument method of the Engine object to create the FRDocument object.
  • [optional] If you want to show a progress of processing, you can use the OnProgress method of the IFRDocumentEvents interface and the PageProcessingStageEnum constants.
  • Use the AddImageFile method to add pages to the document.
  • Call the AnalyzeAndRecognize method of the FRDocument object.
  • Call the Synthesize method of the FRDocument object.
  • Call the Export method of the FRDocument object to save the document into a file of the specified format.
  • Close the FRDocument object using the Close method.
  • Unload FineReader Engine — use the DeinitializeEngine function.


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.