多言語に対応したOCRソフトCapture2Text_CLI

ダウンロード

キャプチャー2テキスト

Capture2Text – Browse /Capture2Text at SourceForge.net

追加のOCR言語のインストール

デフォルトでは、Capture2Textには英語、フランス語、ドイツ語、日本語、韓国語、ロシア語、スペイン語の言語がパッケージ化されています。

追加のOCR言語をインストールしたい場合は、以下の手順に従ってください:

  1. 適切なOCR言語辞書をダウンロードしてください。
  2. ダウンロードした「.zip」ファイルを7-Zipや類似の解凍ソフトで開いてください。
  3. zipファイル内のすべてのファイルをtessdataフォルダにドラッグしてください:
  4. https://sourceforge.net/projects/capture2text/files/Dictionaries/

アフリカーンス語(afr)	ギリシャ語(ell)	オディヤ(オリ)
アルバニア語(sqi)	グジャラート語(guj)	パンジャビ(パン)
アムハラ語(amh)	ハイチ(帽子)	ペルシャ語(fas)
古代ギリシャ語(grc)	ヘブライ語(ヘブライ語)	ポーランド語(ポーランド語)
アラビア語(ara)	ヒンディー語(ヒン)	ポルトガル語(por)
アッサム語(asm)	ハンガリー語(フン)	プシュト(膿)
アゼルバイジャン語(アゼ)	アイスランド語(ISL)	ルーマニア語(ron)
バスク語(eus)	インディック(インディック)	ロシア語(ロシア語)
ベラルーシ語(ベル)	インドネシア(インド)	サンスクリット語(san)
ベンガル語(ベン)	イヌクティトゥット(イク)	セルビア語(srp)
ボスニア語(bos)	アイリッシュ(gle)	シンハラ語(罪)
ブルガリア語(bul)	イタリア語(ita)	スロバキア語(slk)
ビルマ語(ミャー)	日本語(日本)	スロベニア語(slv)
カタルーニャ語(猫)	ジャワ語(jav)	スペイン語(スパ)
セブアノ(CEB)	カンナダ語(カン)	スワヒリ語(swa)
中央クメール(khm)	カザフ語(カズ語)	スウェーデン語(スウェーデン語)
チェロキー(chr)	キルギス語(キル)	シリア語(シリャ語)
中国語 - 簡体字(chi_sim)	韓国語(コル)	タガログ語(tgl)
中国語 - 繁体字(chi_tra)	クルフ(クル)	タジク(tgk)
クロアチア語(hrv)	ラオス(ラオス)	タミル語(タム)
チェコ語(CES)	ラテン語(ラテン語)	テルグ語(tel)
デンマーク語(ダン)	ラトビア語(lav)	タイ(tha)
オランダ語(オランダ語)	リトアニア語(直訳)	チベット語(ボディ)
ゾンカ(dzo)	マケドニア語(mkd)	ティグリニャ(ティル)
英語(英語)	マレー語(MSA)	トルコ語(tur)
エスペラント(エポ)	マラヤーラム語(mal)	ウイグル語(uig)
エストニア語(est)	マルタ語(mlt)	ウクライナ語(ウクライナ語)
フィンランド語(フィンランド語)	マラーティー語(mar)	ウルドゥー語(ウルド)
フランク語(frk)	数学/方程式(方程式)	ウズベク語(uzb)
フランス語(フランス語)	中英語(1100-1500)(ENM)	ベトナム語(vie)
ガリシア語(glg)	中期フランス語(1400-1600)(FRM)	ウェールズ語(cym)
ジョージア語(kat)	ネパール語(ネプ)	イディッシュ語(イディッシュ語)
ドイツ語(deu)	ノルウェー語(nor)

コマンドラインオプション

Usage: Capture2Text_CLI.exe [options]
Capture2Text may be used to OCR image files or part of the screen.
Examples:
  Capture2Text_CLI.exe --screen-rect "400 200 600 300"
  Capture2Text_CLI.exe --vertical -l "Chinese - Simplified" -i img1.png
  Capture2Text_CLI.exe -i img1.png -i img2.jpg -o result.txt
  Capture2Text_CLI.exe -l Japanese -f "C:\Temp\image_files.txt"
  Capture2Text_CLI.exe --show-languages

Options:
  -?, -h, --help                     Displays this help.
  -v, --version                      Displays version information.
  -b, --line-breaks                  Do not remove line breaks from OCR text.
  -d, --debug                        Output captured image and pre-processed
                                     image for debugging purposes.
  --debug-timestamp                  Append timestamp to debug images when
                                     using the -d option.
  -f, --images-file <file>           File that contains paths of image files to
                                     OCR. One path per line.
  -i, --image <file>                 Image file to OCR. You may OCR multiple
                                     image files like so: "-i <img1> -i <img2>
                                     -i <img3>"
  -l, --language <language>          OCR language to use. Case-sensitive.
                                     Default is "English". Use the
                                     --show-languages option to list installed
                                     OCR languages.
  -o, --output-file <file>           Output OCR text to this file. If not
                                     specified, stdout will be used.
  --output-file-append               Append to file when using the -o option.
  -s, --screen-rect <"x1 y1 x2 y2">  Coordinates of rectangle that defines area
                                     of screen to OCR.
  -t, --vertical                     OCR vertical text. If not specified,
                                     horizontal text is assumed.
  -w, --show-languages               Show installed languages that may be used
                                     with the "--language" option.
  --output-format <format>           Format to use when outputting OCR text.
                                     You may use these tokens:
                                     ${capture}   : OCR Text.
                                     ${linebreak} : Line break (\r\n).
                                     ${tab}       : Tab character.
                                     ${timestamp} : Time that screen or each
                                     file was processed.
                                     ${file}      : File that was processed or
                                     screen rect.
                                     Default format is "${capture}${linebreak}".
  --whitelist <characters>           Only recognize the provided characters.
                                     Example: "0123456789".
  --blacklist <characters>           Do not recognize the provided characters.
                                     Example: "0123456789".
  --clipboard                        Output OCR text to the clipboard.
  --trim-capture                     During OCR preprocessing, trim captured
                                     image to foreground pixels and add a thin
                                     border.
  --deskew                           During OCR preprocessing, attempt to
                                     compensate for slanted text.
  --scale-factor <factor>            Scale factor to use during pre-processing.
                                     Range: [0.71, 5.0]. Default is 3.5.
  --tess-config-file <file>          (Advanced) Path to Tesseract configuration
                                     file.

バッチファイル


set INPUT_FOLDER=C:\data\
set OUTPUT_FOLDER=Y:\output_txt

REM 出力フォルダがなければ作成
if not exist "%OUTPUT_FOLDER%" (
    mkdir "%OUTPUT_FOLDER%"
)
for %%f in ("%INPUT_FOLDER%\*.*") do (
"C:\app\Capture2Text\Capture2Text_CLI.exe"  --vertical -l "Chinese - Simplified"    -i "%%f" > "%OUTPUT_FOLDER%\%%~nf.txt"
REM "C:\app\Capture2Text\Capture2Text_CLI.exe" -l Japanese  -i "%%f" > "%OUTPUT_FOLDER%\%%~nf.txt"
)

OCR

Posted by eightban