LoginSignup
4
5

More than 3 years have passed since last update.

Windows 10のChromeで文字認識(OCR)

Last updated at Posted at 2020-01-22

Shape Detection APIのTextDetectorText Detection not implemented. というエラーが出たのでメモ。

【重要】Windows 10にEnglishの言語機能(光学式文字認識)をインストール

日本語のWindowsには、Englishの言語機能は入ってないので注意が必要。
PowerShellを管理者権限で開く

Add-WindowsCapability -Online -Name "Language.OCR~~~en-US~0.0.1.0"

# インストールできたか確認
Get-WindowsCapability -Online -Name "Language.OCR*en-US*"

ChromeのExperimental Web Platform featuresを有効化

chrome://flags/#enable-experimental-web-platform-featuresにアクセスし、Enabledに変更し、ChromeをRelaunch
スクリーンショット (3).png

画像からOCR

画像を選択すると自動でOCRを行います。

See the Pen Windows 10 Chrome OCR by John Doe (@04) on CodePen.

WebカメラからリアルタイムOCR

WebカメラからOCRを行います。リアルタイムでBoundingBoxが付きます。

[Violation] Feature policy violation: camera is not allowed in this document. で動かないので右上の EDIT ON CODEPEN を押して動かしてください。

See the Pen Windows 10 Chrome Realtime OCR by John Doe (@04) on CodePen.

FullHD、フルスクリーンでOCRするサンプルもあります。
https://codepen.io/04/pen/wvBRQYg

まとめ

  • 英数字や記号しか認識できませんが、Tesseract.jsよりも高速で精度が高いので追跡番号などを認識するのにおすすめです。
  • オフラインで動作するので、Google VisionやAmazon Textractが使えない環境にもおすすめです。画像をクラウドにアップすると時間がかかりますが、エッジでやれば、高速でお金もかかりません。
4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5