翻譯|行業(yè)資訊|編輯:胡濤|2022-08-18 10:49:01.003|閱讀 216 次
概述:LEADTOOLS是一個綜合工具包的集合,本文將介紹無紙化辦公下,leadtools如何高效幫你處理文檔識別
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
LEADTOOLS是一個綜合工具包的集合,用于將識別、文檔、醫(yī)療、成像和多媒體技術(shù)整合到桌面、服務(wù)器、平板電腦、網(wǎng)絡(luò)和移動解決方案中,是一項企業(yè)級文檔自動化解決方案,有捕捉,OCR,OMR,表單識別和處理,PDF,打印捕獲,歸檔,注釋和顯示功能。利用業(yè)界領(lǐng)先的圖像處理技術(shù),能夠智能識別文件,可以用來識別任何類型的掃描或傳真形式的圖像。
在無紙化辦公室工作時,企業(yè)會收到來自不同供應(yīng)商的數(shù)百種不同的表格和發(fā)票。手動查找、提取和存儲所有必要信息通常是一個主要的痛點和瓶頸。值得慶幸的是,借助 LEADTOOLS 文檔 SDK 和我們獲得專利的 表單識別 技術(shù),一切都可以輕松自動化,以提高工作流程的生產(chǎn)力和效率。
使用 LEADTOOLS,用戶只需為每個不同的發(fā)票或表單類型創(chuàng)建模板,也稱為主表單。然后將這些主表單存儲在存儲庫中,并用于自動識別當(dāng)前正在處理哪種類型的填寫表單。
在下面的演示中,我們獲取填寫表格的目錄并將它們與主表格列表進行比較。我們將首先加載希望識別的填寫表格以及我們希望與之比較的主表格。
填充的表單可以跨越多個頁面,因此我們需要從填充的表單中讀取圖像數(shù)據(jù),并將每個頁面添加到 FormRecognitionAttributes 類的實例中。
private static FormRecognitionAttributes LoadFilledFormAttributes(string filledFormName) { FormRecognitionAttributes filledFormAttributes = recognitionEngine.CreateForm(null); RasterImage currentForm = codecs.Load(filledFormName, 0, CodecsLoadByteOrder.BgrOrGray, 1, -1); for (int i = 0; i < currentForm.PageCount; i++) { recognitionEngine.AddFormPage(filledFormAttributes, currentForm, null); currentForm.Page = i + 1; } recognitionEngine.CloseForm(filledFormAttributes); return filledFormAttributes; }
加載主表單就像讀取主表單的 .bin 文件并將其加載到 FormRecognitionAttributes 類的實例中一樣簡單。
private static FormRecognitionAttributes LoadMasterFormAttributes(string masterFormName) { FormRecognitionAttributes masterFormAttributes = new FormRecognitionAttributes(); masterFormAttributes.SetData(File.ReadAllBytes(masterFormName)); return masterFormAttributes; }
現(xiàn)在我們已經(jīng)準(zhǔn)備好遍歷一個充滿填寫表格的整個目錄,并找到它們對應(yīng)的主表格。
private static void RecognizeForms() { Console.WriteLine("Recognizing Forms\n"); string[] formsToRecognize = Directory.GetFiles(filledFormsDirectory, "*.tif", SearchOption.AllDirectories); string[] masterFileNames = Directory.GetFiles(masterFormsDirectory, "*.bin", SearchOption.AllDirectories); foreach (string filledFormName in formsToRecognize) { FormRecognitionAttributes filledFormAttributes = LoadFilledFormAttributes(filledFormName); string resultMessage = ""; foreach (string masterFileName in masterFileNames) { FormRecognitionAttributes masterFormAttributes = LoadMasterFormAttributes(masterFileName); //Compares the master form to the filled form FormRecognitionResult recognitionResult = recognitionEngine.CompareForm(masterFormAttributes, filledFormAttributes, null); //When the Recognition Engine compares the two documents it also sets a confidence level for how closely the engine thinks the two documents match if (recognitionResult.Confidence >= AllowedConfidenceLevel) { resultMessage = $"Form {Path.GetFileNameWithoutExtension(filledFormName)} has been recognized as a(n) {Path.GetFileNameWithoutExtension(masterFileName)} with a confidence level of {recognitionResult.Confidence}"; break; } resultMessage = $"The form {Path.GetFileNameWithoutExtension(filledFormName)} failed to be recognized with a confidence level of {recognitionResult.Confidence}"; } Console.WriteLine(resultMessage); Console.WriteLine("=============================================================\n"); } }
以上便是如何快速通過使用leadtools控件,快速提取表單的操作,當(dāng)然除了表單提取之外,leadtools也支持其他格式的文件提取,歡迎下載體驗。
歡迎下載|體驗更多LEADTOOL產(chǎn)品
您還可以加入產(chǎn)品技術(shù)交流Q群:731259648
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn