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

作者:控件中国网   出处:控件中国网   2015-09-15 09:57:41   阅读:21

OMR是一种光学扫描技术,在应用考试、统计评分中应用最广泛, Aspose.OCR可以帮助开发人员快速从各种图表片中进行OMR数据的提取,精确度极高,具体可以参考下面的部分代码:

Grids-filled-scan.png

//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();

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat