Steps To Recognize a Form:
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);
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();
Create the Auto-Forms Engine using AutoFormsEngine Class. AutoFormsEngine autoEngine = new AutoFormsEngine(repository,ocrEngines,barcodeEngine,30,80, true);
Recognize the form only. AutoFormsRecognizeFormResult result = autoEngine.RecognizeForm(image, null);