Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Steps to Recognize a Form

Steps To Recognize a Form:

  1. Create the Master Forms Repository that points to the storage location of the Master Forms.
    			
    RasterCodecs.Startup();
    string root = @"C:\Forms\FormsDemo\OCR_Test";
    RasterCodecs codecs = new RasterCodecs();
    DiskMasterFormsRepository repository = new DiskMasterFormsRepository(codecs, root);
    
  2. Create the OCR and Barcode engines to be used in Auto-Forms Engine.
    			
    List<IOcrEngine> ocrEngines = new List<IOcrEngine>();
    IOcrEngine ocrEngine;
    //to use four threads
    int numberOfThreads = 4;
    for(int i = 0; i < numberOfThreads; i++)
    {
        ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Professional, true);
        ocrEngine.Startup(null, null, null, null);
        ocrEngines.Add(ocrEngine);
    }
    BarcodeEngine.Startup(BarcodeMajorTypeFlags.Barcodes1d | 
    BarcodeMajorTypeFlags.Barcodes2dRead | BarcodeMajorTypeFlags.BarcodesDatamatrixRead | 
    BarcodeMajorTypeFlags.BarcodesPdfRead | BarcodeMajorTypeFlags.BarcodesQrRead);
    BarcodeEngine barcodeEngine = new BarcodeEngine();
    
  3. Create the Auto-Forms Engine using AutoFormsEngine Class.
    			
    AutoFormsEngine autoEngine = new AutoFormsEngine(repository,ocrEngines,barcodeEngine,30,80, 
    true);
    
  4. Recognize the form only.
    			
    AutoFormsRecognizeFormResult result = autoEngine.RecognizeForm(image, null);
    

See Also