翻譯|使用教程|編輯:莫成敏|2020-04-29 14:11:45.753|閱讀 274 次
概述:本文主要介紹通過LEADTOOLS 識別SDK技術,解決在表單掃描過程掃描儀可能產生噪音以及其他的問題。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
LEADTOOLS (Lead Technology)由Moe Daher and Rich Little創建于1990年,其總部設在北卡羅來納州夏洛特。LEAD的建立是為了使Daher先生在數碼圖象與壓縮技術領域的發明面向市場。在過去超過20多年的發展歷程中,LEAD以其在全世界主要國家中占有的市場領導地位,在數碼圖象開發工具領域中已成為既定的全球領導者。LEADTOOLS開發與發布的LEAD是屢獲殊榮的開發工具包。
本文主要介紹通過LEADTOOLS 識別SDK技術,可以解決在表單掃描過程掃描儀可能產生噪音以及其他的問題。
LEADTOOLS中包含表單識別和處理SDK技術的產品有,LEADTOOLS Recognition Imaging Developer Toolkit、LEADTOOLS Document Imaging Developer Toolkit。
快速準確的表單識別的主要組件來自兩個LEADTOOLS引擎,AutoFormsEngine和和IOcrEngine。AutoFormsEngine提供了高級的表單識別和處理能力,以識別、處理和創建表單,而IOcrEngine是LEADTOOLS提供的所有OCR功能的切入點。
下面的代碼顯示了運行.NET表單識別和OCR應用程序所需的核心。
// Add these global members
static AutoFormsEngine autoEngine;
static RasterCodecs codecs;
static IOcrEngine ocrEngine;
static DiskMasterFormsRepository formsRepository;
// Initialize the Engines
static void InitFormsEngines()
{
codecs = new RasterCodecs();
ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD, false);
ocrEngine.Startup(codecs, null, null, @"C:\LEADTOOLS 20\Bin\Common\OcrLEADRuntime");
formsRepository = new DiskMasterFormsRepository(codecs, @"C:\Users\Public\Documents\
LEADTOOLS Images\Forms\MasterForm Sets\OCR");
autoEngine = new AutoFormsEngine(formsRepository, ocrEngine, null,
AutoFormsRecognitionManager.Default | AutoFormsRecognitionManager.Ocr, 30, 80, true);
}
// Recognize and Process a Form
static void RecognizeAndProcessForm()
{
string resultMessage = "Form not recognized";
string formToRecognize = @"C:\Users\Public\Documents\LEADTOOLS Images\Forms\Forms to be Recognized\
OCR\W9_OCR_Filled.tif";
AutoFormsRunResult runResult = autoEngine.Run(formToRecognize, null);
if (runResult != null)
{
FormRecognitionResult recognitionResult = runResult.RecognitionResult.Result;
resultMessage = $@"This form has been recognized as a
{runResult.RecognitionResult.MasterForm.Name} with {recognitionResult.Confidence} confidence.";
}
Console.WriteLine("Recognition Results:");
Console.WriteLine("=========================================================================");
ShowProcessedResults(runResult);
}
// Print the output of the results
private static void ShowProcessedResults(AutoFormsRunResult runResult)
{
string resultsMessage = "";
foreach (FormPage formPage in runResult.FormFields)
foreach (FormField field in formPage)
if (field != null)
resultsMessage = $"{resultsMessage}{field.Name} =
{(field.Result as TextFormFieldResult).Text}\n";
Console.WriteLine("Field Processing Results:");
Console.WriteLine(resultsMessage);
}
如果要自己進行測試,請確保從我們網站直接獲得最新的LEADTOOLS SDK安裝包,讓您免費體驗!
相關內容推薦:
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: