http://www.cnblogs.com/brooks-dotnet/archive/2010/10/07/1845313.html
上一次我们讨论了Tesseract OCR引擎的用法,作为一款老牌的OCR引擎,目前已经开源,最新版本3.0中更是加入了中文OCR功能,再加上Google的更新、维护,可以说是潜力很大,值得期待。由上一次的测试结果也可以看出,Tesseract的OCR结果还不是很理想,尤其是中英文混合的文字,其识别率有限。本次我们来关注下Office 2010中的Onenote,调用其API来测试OCR功能。
PS:在公司经理一直推荐使用MyBase来记录工作中遇到的问题、工作日志等,但是我一直坚持使用Onenote :)
在Visual Studio 2010 Ultimate + Onenote 2010 x64中测试通过
转载请注明出处:http://www.cnblogs.com/brooks-dotnet/archive/2010/10/07/1845313.html
1、Onenote 2010 新特性:
New features in 2010:
Gather, organize, and search | Sharing and universal access |
|
|
Examples:
| Organize topics using subpages Drag tabs to indent and organize pages within a section. | ||||
Keep notes visible during other tasks OneNote will link notes to documents and Web pages you view.
| |||||
| What's new in a shared notebook? Unread changes are shown automatically. | ||||
| What notes are teammates working on?
| ||||
Select location when sending to OneNote When sending from Outlook or Internet Explorer | |||||
Link to information for yourself and others
|
More Resources Online
Videos, templates, training, help, and discussion groups.
Microsoft® OneNote® 2010 Guide Notebook
Copyright © 2009 Microsoft Corporation. All rights reserved.
The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, places, or events is intended or should be inferred.
2、Onenote中的OCR功能
园子里的朋友斯克迪亚很早就写过一片博文,详细介绍了GUI下使用OCR功能的方法,当时我也看了,想用编程来实现Onenote的OCR功能。后来忙其他事就没有细究,国庆假期我正好在查找一些OCR工具,又想起了这回事,于是多方查找资料、测试,今天终于是略有小成,特与大家分享。程序还存在很多问题,欢迎拍砖。
2.1、关于Onenote OCR功能的一处细节要先提一下,那就是如果从网络上复制一幅图片到Onenote中,是无法进行OCR的;但是如果从本地插入一幅图片到Onenote中,则可以进行OCR:
左边是本地图片,右边是网络图片,可以看出,网络图片右键菜单中的【Copy Text from Picture】是灰掉的,无法点击。
2.2、我用WPF写的小程序界面如下,和上一次TesseractGUI如出一辙,不过是换药未换汤。
左边选择图片,支持本地图片、网络图片预览、缩放、移动,右边选择输出目录、显示OCR结果:
2.3、MSDN杂志上有一篇文章给了我很大的启发,介绍了Onenote 2010中的对象模型,感兴趣的朋友可以深入阅读。CodePlex上还有一个托管的Onenote对象模型项目ONOM,对Onenote PIA提供了更好的封装。建立WPF项目并添加引用时要注意一下:
首先,由于与 Visual Studio 2010 随附的 OneNote 互操作程序集不匹配,您不应该在"添加引用"对话框的".NET"选项卡上直接引用 Microsoft.Office.Interop.OneNote 组件,而是应该在"COM"选项卡上引用 Microsoft OneNote 14.0 类型库组件。这样做仍会向项目的引用中加入 OneNote 互操作程序集。
其次,OneNote 14.0 类型库与 Visual Studio 2010"NOPIA"功能不兼容。在 NOPIA 功能中,主互操作程序集默认情况下不会嵌入到应用程序中。因此,请务必将 OneNote 互操作程序集引用的"嵌入互操作类型"属性设置为 False。
2.4、Onenote没有采用OpenXML格式进行描述,而是使用了原始的XML ,一个完整的页面的描述代码如下: