Files
SnapOtter/apps/docs/ja/tools/image/ocr.md
T
SnapOtterandGitHub 4963ab3bbd feat(docs-i18n): translate all documentation into 20 languages
All 181 docs markdown files translated into 20 languages (apps/docs/<locale>/**). Companion to the i18n code PR; admin-merged because the file count exceeds GitHub's per-PR CI trigger limit. Validated by pnpm i18n:check (all surfaces, 0 stale/missing) and a clean all-locale docs build.
2026-07-11 13:52:47 +08:00

2.9 KiB
Raw Blame History

description, i18n_source_hash, i18n_provenance, i18n_output_hash
description i18n_source_hash i18n_provenance i18n_output_hash
AI による光学式文字認識で画像からテキストを抽出します。 3d85d423b82c human 26f22dbdf9c3

OCR / テキスト抽出

AI による光学式文字認識(OCR)で画像からテキストを抽出します。複数の言語と品質ティアに対応しています。

API エンドポイント

POST /api/v1/tools/image/ocr

処理: 同期的な JSON レスポンス。clientJobId が指定された場合、進捗も SSE 経由で報告されます。

モデルバンドル: ocr56 GB

パラメーター

パラメーター 必須 デフォルト 説明
file file Yes - 画像ファイル(マルチパート)
quality string No "balanced" 品質ティア: fastTesseract, balancedPaddleOCR v5, bestPaddleOCR VL
language string No "auto" 言語ヒント: auto, en, de, fr, es, zh, ja, ko
enhance boolean No true OCR 精度向上のために画像を前処理する
engine string No - 非推奨。代わりに quality を使用してください。tesseractfast に、paddleocrbalanced にマッピングします

リクエスト例

curl -X POST http://localhost:1349/api/v1/tools/image/ocr \
  -F "file=@document.png" \
  -F 'settings={"quality":"best","language":"en","enhance":true}'

レスポンス(200 OK

{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "filename": "document.png",
  "text": "Extracted text content from the image...",
  "engine": "paddleocr-vl"
}

進捗(SSE、オプション)

clientJobId フォームフィールドが指定された場合、進捗イベントがストリーミングされます。

event: progress
data: {"phase":"processing","stage":"Recognizing text...","percent":50}

注意事項

  • ocr モデルバンドル(5~6 GB)のインストールが必要です。
  • OCR は画像のダウンロード URL ではなく、抽出したテキストを直接返します。
  • フォールバックチェーンを使用します。上位の品質ティアがクラッシュした場合(例: PaddleOCR のセグメンテーション違反)、自動的に一段下のティアで再試行します。
  • クラッシュせずに空のテキストが返された場合も、次のティアにフォールバックします。
  • 品質ティアはエンジンにマッピングされます。fast = Tesseract、balanced = PaddleOCR v5、best = PaddleOCR VL。
  • HEIC/HEIF、RAW、TGA、PSD、EXR、HDR の入力フォーマットを自動デコードでサポートします。