Specifies how to load in memory the master form data found in the repository.
public AutoFormsEngineMasterFormLoadType MasterFormLoadType { get; } public AutoFormsEngineMasterFormLoadType getMasterFormLoadType(); Public ReadOnly Property MasterFormLoadType() As AutoFormsEngineMasterFormLoadTypeGet
public:property AutoFormsEngineMasterFormLoadType^ MasterFormLoadType{AutoFormsEngineMasterFormLoadType^ get()}
Gets the load type for master form data.
This property is used to control the amount of memory used to hold master form data while maintaining the AutoFormsEngine's speed. The AutoFormsEngine performs the fastest when all master form data are loaded in memory. If the repository contains too many master forms to be loaded in memory, then there are two options:
MasterForm data on demand.AutoFormsEngine speed and the needed memory. Notice that the cache option works only when FullTextSearchManager is set, otherwise it will work as in the load on demand option.using Leadtools;using Leadtools.Codecs;using Leadtools.Forms.Common;using Leadtools.Forms.Auto;using Leadtools.Ocr;using Leadtools.Forms.Recognition;using Leadtools.Forms.Processing;using Leadtools.Barcode;public static void AutoFormsEngineCreateOptions_Example(){using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)){ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir);string root = Path.Combine(LEAD_VARS.ImagesDir, @"Forms\MasterForm Sets\Driving License");DiskMasterFormsRepository formsRepository = new DiskMasterFormsRepository(ocrEngine.RasterCodecsInstance, root);// Set the parameters for the AutoFormsEngineAutoFormsEngineCreateOptions autoFormsOptions = new AutoFormsEngineCreateOptions(){Repository = formsRepository,RecognitionOcrEngine = ocrEngine,ProcessingOcrEngine = ocrEngine,BarcodeEngine = null,Managers = AutoFormsRecognitionManager.Ocr | AutoFormsRecognitionManager.Default,MinimumConfidenceKnownForm = 30,MinimumConfidenceRecognized = 80,RecognizeFirstPageOnly = true,MasterFormLoadType = AutoFormsEngineMasterFormLoadType.UseCache};// Create the AutoFormsEngine using the options previously definedusing (AutoFormsEngine autoEngine = new AutoFormsEngine(autoFormsOptions)){// If caching masterform files, load 10 of them at a timeif (autoEngine.MasterFormLoadType == AutoFormsEngineMasterFormLoadType.UseCache)autoEngine.MasterFormCacheMaximumSize = 10;// Recognize and process the formautoEngine.FilledFormType = FormsPageType.IDCard;autoEngine.EnableQuickPreRecognitionCheck = false;AutoFormsRunResult result = autoEngine.Run(Path.Combine(LEAD_VARS.ImagesDir, @"Forms\Forms to be Recognized\Driving License\License.png"), null);if (result != null)Console.WriteLine(String.Format("Recognized as {0} with {1}% confidence.", result.RecognitionResult.MasterForm.Name, result.RecognitionResult.Result.Confidence));elseConsole.WriteLine("Form not recognized");}}}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS21\Bin\Common\OcrLEADRuntime";}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Forms.CommonImports Leadtools.Forms.AutoImports Leadtools.OcrImports Leadtools.Forms.RecognitionImports Leadtools.Forms.ProcessingImports Leadtools.BarcodePublic Shared Sub AutoFormsEngineCreateOptions_Example()Using ocrEngine As IOcrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD)ocrEngine.Startup(Nothing, Nothing, Nothing, LEAD_VARS.OcrLEADRuntimeDir)Dim root As String = Path.Combine(LEAD_VARS.ImagesDir, "Forms\MasterForm Sets\Driving License")Dim formsRepository As DiskMasterFormsRepository = New DiskMasterFormsRepository(ocrEngine.RasterCodecsInstance, root)' Set the parameters for the AutoFormsEngineDim autoFormsOptions As AutoFormsEngineCreateOptions = New AutoFormsEngineCreateOptions()autoFormsOptions.Repository = formsRepositoryautoFormsOptions.RecognitionOcrEngine = ocrEngineautoFormsOptions.ProcessingOcrEngine = ocrEngineautoFormsOptions.BarcodeEngine = NothingautoFormsOptions.Managers = AutoFormsRecognitionManager.Ocr Or AutoFormsRecognitionManager.DefaultautoFormsOptions.MinimumConfidenceKnownForm = 30autoFormsOptions.MinimumConfidenceRecognized = 80autoFormsOptions.RecognizeFirstPageOnly = TrueautoFormsOptions.MasterFormLoadType = AutoFormsEngineMasterFormLoadType.UseCache' Create the AutoFormsEngine using the options previously definedUsing autoEngine As AutoFormsEngine = New AutoFormsEngine(autoFormsOptions)' If caching masterform files, load 10 of them at a timeIf autoEngine.MasterFormLoadType = AutoFormsEngineMasterFormLoadType.UseCache ThenautoEngine.MasterFormCacheMaximumSize = 10End If' Recognize and process the formautoEngine.FilledFormType = FormsPageType.IDCardautoEngine.EnableQuickPreRecognitionCheck = FalseDim result As AutoFormsRunResult = autoEngine.Run(Path.Combine(LEAD_VARS.ImagesDir, "Forms\Forms to be Recognized\Driving License\License.png"), Nothing)If Not result Is Nothing ThenConsole.WriteLine(String.Format("Recognized as {0} with {1}% confidence.", result.RecognitionResult.MasterForm.Name, result.RecognitionResult.Result.Confidence))ElseConsole.WriteLine("Form not recognized")End IfEnd UsingEnd UsingEnd SubPublic NotInheritable Class LEAD_VARSPublic Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"Public Const OcrLEADRuntimeDir As String = "C:\LEADTOOLS21\Bin\Common\OcrLEADRuntime"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
