• Stars
    star
    212
  • Rank 185,300 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Using UWP API Windows.Media.Ocr as an executable command line tool

Windows.Media.Ocr.Cli

Ocr 命令行工具, 本地调用 UWP API Windows.Media.Ocr 支持多种语言识别。

使用

下载

https://github.com/zh-h/Windows.Media.Ocr.Cli/releases

命令行执行

PS C:\Tools>Windows.Media.Ocr.Cli.exe .\x.png
9·哪位科学家发现了电磁感应现象?
PS C:\Tools>Windows.Media.Ocr.Cli.exe -o .\res.txt .\x.png
-> 将内容输出到res.txt中

x-out.png

查看帮助

PS C:\Tools>Windows.Media.Ocr.Cli.exe -h
Usage: Windows.Media.Ocr.Cli.exe [options...] <image file path>
Example: Windows.Media.Ocr.Cli.exe -o c:\res.txt x.png
-l      <language>  Default:zh-Hans-CN   Specify language to reconizing
-o      <output_path> Output the resalut to a file, It should end with a file name, such as res.txt.
-s      Show all supported languages
-h      Show help like this

运行依赖

  1. 需要 Windows 10 系统,其他平台没有测试,理论上可以支持所有支持 UWP 的设备,包括 Xbox 甚至安装 Windows 10 IoT 的树莓派,不太了解 Xamarin 能不能引入 UWP 的 runtime,如果能引入 UWP 就可以用在 iOS 和 Android 平台。

功能

  • 文字识别
  • 输出到文件
  • 输出图片显示文字区域方块
  • 提供提高对比参数(有时后明明图片很清晰,但是不调高对比度什么文字都没识别)

参考

声明

仅供学习参考,请勿用于服务器端生产环境。

请遵守微软 Windows Runtime 使用协议 MICROSOFT OCR LIBRARY FOR WINDOWS RUNTIME

distribute Distributable Code to run on a platform other than the Windows Store or Windows Phone;