ABBYY Cloud OCR SDK的名片识别接口
2013-09-30 11:01
507 查看
由于公司最近的软件项目设备选型是windows 8平板电脑,开发Windows app store上的Metro应用,该应用要实现客户名片识别的功能,即使用平板电脑上的摄像头给客户的名片拍照,应用能即时可识别该客户名片上的信息,并自动输入应用中,网上看了一大堆的资料,国内的开发商提供的接口服务费都太高了,动辄就要几十万。国外有个免费的,这个就是ABBYY Cloud OCR SDK,但ABBYY Cloud OCR SDK的名片识别接口没有js的接口。它只提供了C#语言和iPhone的例子。这样需要在服务器上用C#做一个转换的方法。由平板向服务器发送客户名片的照片,服务器再向ABBYY Cloud OCR SDK的名片识别接口发出识别请求,服务器接收到识别结果再向平板返回结果了。
C#的请求识别代码:
附:
1、 ocrsdk名片识别的接口:[POST] http(s)://cloud.ocrsdk.com/processBusinessCard
processBusinessCard Method
The method allows you to recognize a business card on an image. The method loads the image, creates a processing task for the image with the specified parameters, and passes the task for processing.
[POST] http(s)://cloud.ocrsdk.com/processBusinessCard
The image file is transmitted in the request body.
2、 C#语言的例子 http://ocrsdk.com/documentation/quick-start/cs/
3、 iPhone的例子 http://ocrsdk.com/documentation/quick-start/iphone-ocr-sdk/
C#的请求识别代码:
public void ProcessFile(string sourceFilePath, string outputFileBase, ProcessingSettings settings) { Console.WriteLine("Uploading to www.fenhon.com ..."); Task task = restClient.ProcessImage(sourceFilePath, settings); TaskId taskId = task.Id; while (true) { task = restClient.GetTaskStatus(taskId); if (!Task.IsTaskActive(task.Status)) break; Console.WriteLine(String.Format("Task status: {0}", task.Status)); System.Threading.Thread.Sleep(1000); } if (task.Status == TaskStatus.Completed) { Console.WriteLine("Processing completed."); for (int i = 0; i < settings.OutputFormats.Count; i++) { var outputFormat = settings.OutputFormats[i]; string ext = settings.GetOutputFileExt(outputFormat); restClient.DownloadUrl(task.DownloadUrls[i], outputFileBase + ext); } Console.WriteLine("Download completed."); } else if (task.Status == TaskStatus.NotEnoughCredits) { Console.WriteLine("Not enough credits to process the file. Please add more pages to your application balance."); } else { Console.WriteLine("Error while processing the task"); } }
附:
1、 ocrsdk名片识别的接口:[POST] http(s)://cloud.ocrsdk.com/processBusinessCard
processBusinessCard Method
The method allows you to recognize a business card on an image. The method loads the image, creates a processing task for the image with the specified parameters, and passes the task for processing.
[POST] http(s)://cloud.ocrsdk.com/processBusinessCard
The image file is transmitted in the request body.
2、 C#语言的例子 http://ocrsdk.com/documentation/quick-start/cs/
3、 iPhone的例子 http://ocrsdk.com/documentation/quick-start/iphone-ocr-sdk/
相关文章推荐
- Delphi XE2 之 FireMonkey 入门(39) - 控件基础: TScrollBox、TVertScrollBox、TFramedScrollBox、TFramedVertScrollBox
- 不要做浮躁的程序员,时刻提醒自己
- IT English Collection(17) of Selector
- 看懂IL代码[转]
- Delphi XE2 之 FireMonkey 入门(38) - 控件基础: TPopupMenu、TMenuItem、TMenuBar、TMainMenu
- C#读取和导出EXCEL类库(可操作多个SHEET)
- 多示例学习分类
- Ubuntu 12.04下使用PC喇叭Beep
- 巧用api提升钣金设计装配 1 - iLogic与Inventor API
- iptable 使用实例
- 如何用Shell病毒技术感染Linux脚本程序
- libj 0.8.2 发布,Java/JavaScript API 的 C++ 实现
- 数据库行列转换sql
- Delphi XE2 之 FireMonkey 入门(37) - 控件基础: TControl 概览
- Delphi XE2 之 FireMonkey 入门(36) - 控件基础: TForm
- hdu 4768 Flyer 二分
- WCDMA空中接口的信道
- [OGRE]看备注学编程(04):打地鼠03-实现地鼠动态效果
- 一些单选按钮和下拉列表框的操作
- ExtJs学习篇---OA系统主窗体设计