没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
原创|使用教程|编辑:郝浩|2013-09-12 09:25:17.000|阅读 615 次
概述:无纸化报表和手动扫描纸质文档是归档账单、发票和财务报表的比较好的方式。然而,工作人员需要花较多的时间和精力来整理这些数字文件夹。并且,随着数字文档的增多,即使整理归档的人具有很好的记忆力和习惯,也容易出现差错。通过LEADTOOLS构建出的应用程序可以自动对比扫描文档与已知模板,然后准确地对扫描文档进行归类。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
文档图像虽然可以节约物理储存空间,但是某些情况下,它无法节约时间和省去麻烦。无纸化报表和手动扫描纸质文档是归档账单、发票和财务报表的比较好的方式。然而,工作人员需要花较多的时间和精力来整理这些数字文件夹。并且,随着数字文档的增多,即使整理归档的人具有很好的记忆力和习惯,也容易出现差错。
LEADTOOLS Forms Recognition and Processing拥有强大而灵活的图像库。通过LEADTOOLS构建出的应用程序可以自动对比扫描文档与已知模板,然后准确地对扫描文档进行归类。当文档被准确识别后,LEADTOOLS可以从表单上所定义的位置提取OCR、 OMR和Barcodes等。
处理文档库
解决文档归类问题的首要步骤就是处理和管理所有扫描文档归类时所存放的文档库。处理文档库的方法很多,本示例选择使用控制台应用程序来处理文档库。管理文档库的代码比较简单,因为它主要使用基本文件和带有System.IO命名空间的文件夹操作。而最关键的部分就是将应用程序传递到封装了LEADTOOLS Forms Recognition的DocumentClassifier,从而返回移动的数据并重命名文件。
// Check the scanned document repository for new documents string[] newDocuments = Directory.GetFiles(docRepositoryNewDocs); DocumentClassifier docClassifier = new DocumentClassifier(docRepositoryMasterForms); string movedDocumentName, masterFormSubFolder; foreach (string currentDoc in newDocuments) { movedDocumentName = null; // Try to match this document against known document types ClassifiedDocument classifiedDoc = docClassifier.ClassifyDocument(currentDoc); if (classifiedDoc.MasterFormName != null) { // Add the subfolder for the master form if it doesn't exist masterFormSubFolder = string.Format(@"{0}{1}\", docRepositoryRoot,classifiedDoc.MasterFormName); if (!Directory.Exists(masterFormSubFolder)) Directory.CreateDirectory(masterFormSubFolder); // rename the file according to the date found if (classifiedDoc.DocumentDate != DateTime.MinValue) { movedDocumentName = string.Format("{0}{1}{2}", masterFormSubFolder, classifiedDoc.DocumentDate.ToString("yyyyMMdd"), currentDoc.Substring(currentDoc.LastIndexOf('.'), currentDoc.Length - currentDoc.LastIndexOf('.'))); } else { // Didn't find a date to rename with, so just move it movedDocumentName = currentDoc.Replace(docRepositoryNewDocs, masterFormSubFolder); } } else { movedDocumentName = currentDoc.Replace(docRepositoryNewDocs, docRepositoryUnclassifiedDocs); } if (!string.IsNullOrEmpty(movedDocumentName)) File.Move(currentDoc, movedDocumentName); }
使用LEADTOOLS表单识别功能
在 LEADTOOLS归类文档前,必须创建一个Master Form模板集,使LEADTOOLS知道如何对文档进行分类。LEADTOOLS自带一个Master Form编辑器演示,我们根据演示为包含了发票日期字段的两张不同发票添加一个Master Form。
我们定义好Master Form后,接下来准备处理文档。我们已经扫描了2张基于Master Form的发票和tax form,将每个文件放置到 "New" 中, LEADTOOLS会自动对比主模板。如果LEADTOOLS找到匹配文件,它会处理文档的字段,然后返回表单名称和日期字段。
// Create an OCR Engine for each processor on the machine. This
// allows for optimal use of thread during recognition and processing.
ocrEngines = new List<IOcrEngine>();
for (int i = 0; i < Environment.ProcessorCount; i++)
{
ocrEngines.Add(OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false));
ocrEngines[i].Startup(formsCodec, null, String.Empty, String.Empty);
}
// Point repository to directory with existing master forms
formsRepository = new DiskMasterFormsRepository(formsCodec, _MasterFormFolder);
autoEngine = new AutoFormsEngine(formsRepository, ocrEngines, null, AutoFormsRecognitionManager.Default | AutoFormsRecognitionManager.Ocr, 30, 70, true);
// Run the forms recognition on this document
AutoFormsRunResult runResult = autoEngine.Run(document, null);
if (runResult != null)
{
// In this example we use two pieces of information to organize the classified forms:
// 1. Form name is used for the sub folder
// 2. "ClassificationRenameDate" field for the file name
retClassifiedDocument.MasterFormName = runResult.RecognitionResult.MasterForm.Name;
// Process the recognized form and extract desired info
foreach (FormPage formPage in runResult.FormFields)
{
foreach (FormField field in formPage)
{
if (field != null && field.Name == "ClassificationRenameDate")
{
retClassifiedDocument.DocumentDate = DateTime.Parse((
field.Result as TextFormFieldResult).Text);
}
}
}
}
你会看到两张发票完全与Master Form完全匹配,并根据日期重新命名。
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@evget.com
文章转载自:慧都控件网从 2025.2 版本开始,用于仪表板创建的 Stimulsoft 产品引入了InclusionMode属性,我们将在本文中对其进行探讨。
本文将为大家介绍如何在Telerik UI for WinForms应用中使用Kendo UI for Angular组件来交换通信和事件,欢迎下载新版组件体验!
本教程提供DevExpress WinFormsWinExplorer视图的基本信息,欢迎下载最新版组件体验!
在许多企业应用程序中,从 Visio 文件读取形状数据是一项常见需求,因为这些应用程序中的图表都包含有意义的元数据。本教程将借助Aspose.Diagram,以清晰实用的方式指导您使用 C# 读取形状数据。
20多年的老牌图像处理控件,支持TWAIN扫描、200多种图像效果、150多种图像格式…
LEADTOOLS Document Suite Developer ToolkitLEADTOOLS Document Imaging Suite SDK是LEADTOOLS SDK中各种特点的精选组合,这套强大的工具利用了LEAD行业领先的图像处理技术来智能地识别文档的特征,而根据文档的特征可以识别扫描的或传真的任何类型的表格图像。
LEADTOOLS Document Imaging Developer Toolkit多语言的文档图像处理控件,支持光符识别处理、条形码扫描识别等。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@evget.com
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
慧都科技 版权所有 Copyright 2003-
2025 渝ICP备12000582号-13 渝公网安备
50010702500608号