FlexiCapture Processors Pool

FlexiCapture Engine
10, 11
Knowledge Base & Support
Code Samples Collection
Programming Aspects
Integration, Recognition, OCR: Speed & Quality
image: icon_batchprocessingrecognition.gif

This sample on the one hand provides a complete reusable solution for a pool of FlexiCapture processors in a multithreaded application, and on the other hand demonstrates the gain in speed when using multiprocessing.


The sample processes images from a predefined folder (SampleImages\ISBN (photo)). It creates a pool of processors, which recognize images from this folder in parallel. The default number of threads equals the number of CPU cores. You can reduce it to compare the difference in speed.

The special feature of this sample is a single custom image source, which is used by all the processors simultaneously. Processors take the next image from the source, when finish processing the previous image. The client code does not need to manage the processors and pass the images to processors explicitly. This approach is simple to use and very effective.

To run the sample, click Go.

The sample uses the following procedure for initialization of a processor:

  1. Ordered List ItemUse the WorkProcessLoader object to load the Engine object as an out-of-process server. The Load method loads and initialize FlexiCapture Engine.
  2. Create an instance of FlexiCapture processor using the CreateFlexiCaptureProcessor method of the Engine object.
  3. Configure the processor:
    1. Add required Document Definitions with the help of the AddDocumentDefinitionFile method of the FlexiCaptureProcessor object.
    2. Set necessary settings (assembling mode, image loading parameters, etc.)
  4. Prepare the FlexiCapture processor for work by preloading all Document Definitions in memory and performing all required configuration steps. Use the PrepareProcessing method of the FlexiCaptureProcessor object.

After a processor is initialized:

  1. Set the image source for the processor using the SetCustomImageSource method of the FlexiCaptureProcessor object. The same image source is set for each processor.
  2. Recognize next document using the RecognizeNextDocument method of the FlexiCaptureProcessor object.
  3. Check if an error occurs when accessing an image. Use the GetLastProcessingError method of the FlexiCaptureProcessor object.

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.