Aspose.OCR如何从扫描图片中提取OMR数据

作者:控件中国网   出处:控件中国网   2016-02-23 14:23:46   阅读:15

开发人员可以轻松使用Aspose.OCR识别控件提供的 Aspose.OMR类对OMR表单进行数据提取,如消费者调查、评估表,或者彩票等进行数据提取,Aspose.OMR类可以从扫描图片中识别和提取不同类型的表单元素,下面的代码主要用于扫描图片的OMR数据识别,具体如下:
 
//Load template file
OmrTemplate template = OmrTemplate.Load(MyDir + "Grids.amr");
//Load the image to be analyzed
OmrImage image = OmrImage.Load(MyDir + "Grids-filled-scan.jpg");
// Instantiate the recognition engine for the template
OmrEngine engine = new OmrEngine(template);
// Extract data. This template has only one page.
OmrProcessingResult result = engine.ExtractData(new OmrImage[] { image });
//Load actual result from
Hashtable OmrResult = result.PageData[0];
//Get Collection of Keys
ICollection key = OmrResult.Keys;
foreach (string k in key)
{
     Console.WriteLine(k + ": " + OmrResult[k]);
}
Console.ReadKey();
开发人员如果对Aspose.OCR控件产品感兴趣,可以从控件中国网上下载该产品的试用版,并进行测试。
Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat