Analyzes input image by detecting, recognizing, and parsing MRZ code.
public MRZReader ProcessAtOnce(
RasterImage image,
bool ownImage,
CancellationToken ct
)
image
A RasterImage reference.
ownImage
A boolean value to indicate whether to use its own image.
ct
A CancellationToken
value.
This function ignores any feeds received by the Process()
function, if any, and takes this frame (passed in the parameter) and uses it as a key frame and will try to parse the MRZ code.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms.Common;
using Leadtools.Ocr;
using Leadtools.Forms.Commands;
public void ProcessAtOnceMRZCode(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.ProcessAtOnce(rasterImage,true);
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";
}