Sets the IOcrEngine class used to recognize the detected MRZ zone.
public void MRZReaderOCR(
IOcrEngine ocr
)
ocr
An IOcrEngine reference.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms.Common;
using Leadtools.Ocr;
using Leadtools.Forms.Commands;
public void ProcessMRZCode(RasterImage rasterImage)
{
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD);
ocrEngine.Startup(null, null, null, LEAD_VARS.OcrLEADRuntimeDir);
if (ocrEngine.SettingManager.IsSettingNameSupported("Recognition.RecognitionModuleTradeoff"))
ocrEngine.SettingManager.SetEnumValue("Recognition.RecognitionModuleTradeoff", "Accurate");
MRZReader reader = new MRZReader();
reader.MRZReaderOCR(ocrEngine);
var results = reader.Process(rasterImage);
if (reader.Results != null)
{
foreach (var item in reader.Results)
{
Console.WriteLine("Field name : " + item.Key.ToString() + "Value : " + item.Value.ToString());
}
}
reader.Dispose();
}
static class LEAD_VARS
{
public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS22\Bin\Common\OcrLEADRuntime";
}