App/OCR
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#k4a7989e]
#contents();
/////////////////////////////////////////////////////////...
* tesseract-ocr [#tesseract-ocr]
//=======================================================...
** 環境構築 [#n9ab119f]
- debian の場合は以下をインストールする:
tesseract-ocr
- 各国語毎の言語ファイルは別パッケージになっている。必要...
|~パッケージ |~言語 |
|tesseract-ocr-ces |チェコ語 |
|tesseract-ocr-jpn |日本語 |
|tesseract-ocr-jpn-vert |日本語縦書き |
|tesseract-ocr-deu |独逸語 |
|tesseract-ocr-deu-frak |独逸語フラクトゥール |
|tesseract-ocr-eng |英語 |
|tesseract-ocr-fra |仏語 |
|tesseract-ocr-all |全ての言語 |
-- その他の言語については、[[debian.orgのページ>https://p...
//=======================================================...
** 実行 [#n793887d]
//-------------------------------------------------------...
*** コマンドライン [#h22ada34]
tesseract <input-image-file> <out-file> -l <lang> -ps...
//-------------------------------------------------------...
*** option [#s1e08c32]
- <out-file>
-- 出力ファイル名。実際のファイル名はこの名前に更に ".txt...
- --tessdata-dir <path>
-- 言語データファイルの場所を <path> に指定する。
- --user-words <path-to-file>
-- ユーザ辞書ファイルとして <path-to-file> を指定する
- -c <var>=<val>
-- 設定値<var> の値を <val> にする
- -l <lang>
-- 使用言語を <lang> にする
-- jpn, ces, etc.,
- --psm <number>
-- Page segmentation modes:
--- 0 : Orientation and script detection (OSD) only.
言語データ:osd.traineddata 必須
OSD は Orientation and script detection の略
言語の種類やテキストの傾斜角度等を xxxxx.osd に出力
--- 1 : Automatic page segmentation with OSD.
言語データ:osd.traineddata 必須
回転(90度・180度・270度)したテキストも認識する
--- 2 : Automatic page segmentation, but no OSD, or OCR.
テキストの傾斜角度にかかわる情報を画面に標準出力する。
ファイルは何も作成されない。
--- 3 : Fully automatic page segmentation, but no OSD. (D...
デフォルトのオプション。
水平テキスト(横書き文書)と垂直テキスト(縦書き文書)に...
傾斜角度のあるテキストは非対応
--- 4 : Assume a single column of text of variable sizes.
可変サイズのテキストとして扱う。
--- 5 : Assume a single uniform block of vertically align...
ユニフォームブロックの垂直テキストと仮定する。
--- 6 : Assume a single uniform block of text.
ユニフォームブロックのテキストと仮定する。
デフォルトよりも認識率が良い。
--- 7 : Treat the image as a single text line.
単一のテキスト行として扱う。
画像内に複数行が存在する場合は、画像内の文字すべてが誤認...
--- 8 : Treat the image as a single word.
単語として扱う。行に複数の単語がある場合は、
単語間の空白は削られて出力される。「太陽 お月様」 → 「...
画像内に複数行が存在する場合は、画像内の文字すべてが誤認...
--- 9 : Treat the image as a single word in a circle.
画像を円の中の一つの単語として扱う。(丸囲みのことか?)
--- 10 : Treat the image as a single character.
1文字として扱う。2文字以上ある場合は、すべてが誤認識する。
--- 11 : Sparse text. Find as much text as possible in no...
色の薄いテキスト。できるだけ多くのテキストを探す。
デフォルトで探せなかったテキストも認識する。
--- 12 : Sparse text with OSD.
言語データ:osd.traineddata 必須
上記11番、及び、
回転(90度・180度・270度)したテキストも認識する
--- 13 : Raw line. Treat the image as a single text line,
bypassing hacks that are Tesseract-specific.
//=======================================================...
** 参考リンク [#na56b35d]
- [[Pythonで書くTesseract 4の基本的な使い方。APIとCLIから...
- [[tesseract のオプション PSM をいじってみた | Binary St...
終了行:
#topicpath
/////////////////////////////////////////////////////////...
* 目次 [#k4a7989e]
#contents();
/////////////////////////////////////////////////////////...
* tesseract-ocr [#tesseract-ocr]
//=======================================================...
** 環境構築 [#n9ab119f]
- debian の場合は以下をインストールする:
tesseract-ocr
- 各国語毎の言語ファイルは別パッケージになっている。必要...
|~パッケージ |~言語 |
|tesseract-ocr-ces |チェコ語 |
|tesseract-ocr-jpn |日本語 |
|tesseract-ocr-jpn-vert |日本語縦書き |
|tesseract-ocr-deu |独逸語 |
|tesseract-ocr-deu-frak |独逸語フラクトゥール |
|tesseract-ocr-eng |英語 |
|tesseract-ocr-fra |仏語 |
|tesseract-ocr-all |全ての言語 |
-- その他の言語については、[[debian.orgのページ>https://p...
//=======================================================...
** 実行 [#n793887d]
//-------------------------------------------------------...
*** コマンドライン [#h22ada34]
tesseract <input-image-file> <out-file> -l <lang> -ps...
//-------------------------------------------------------...
*** option [#s1e08c32]
- <out-file>
-- 出力ファイル名。実際のファイル名はこの名前に更に ".txt...
- --tessdata-dir <path>
-- 言語データファイルの場所を <path> に指定する。
- --user-words <path-to-file>
-- ユーザ辞書ファイルとして <path-to-file> を指定する
- -c <var>=<val>
-- 設定値<var> の値を <val> にする
- -l <lang>
-- 使用言語を <lang> にする
-- jpn, ces, etc.,
- --psm <number>
-- Page segmentation modes:
--- 0 : Orientation and script detection (OSD) only.
言語データ:osd.traineddata 必須
OSD は Orientation and script detection の略
言語の種類やテキストの傾斜角度等を xxxxx.osd に出力
--- 1 : Automatic page segmentation with OSD.
言語データ:osd.traineddata 必須
回転(90度・180度・270度)したテキストも認識する
--- 2 : Automatic page segmentation, but no OSD, or OCR.
テキストの傾斜角度にかかわる情報を画面に標準出力する。
ファイルは何も作成されない。
--- 3 : Fully automatic page segmentation, but no OSD. (D...
デフォルトのオプション。
水平テキスト(横書き文書)と垂直テキスト(縦書き文書)に...
傾斜角度のあるテキストは非対応
--- 4 : Assume a single column of text of variable sizes.
可変サイズのテキストとして扱う。
--- 5 : Assume a single uniform block of vertically align...
ユニフォームブロックの垂直テキストと仮定する。
--- 6 : Assume a single uniform block of text.
ユニフォームブロックのテキストと仮定する。
デフォルトよりも認識率が良い。
--- 7 : Treat the image as a single text line.
単一のテキスト行として扱う。
画像内に複数行が存在する場合は、画像内の文字すべてが誤認...
--- 8 : Treat the image as a single word.
単語として扱う。行に複数の単語がある場合は、
単語間の空白は削られて出力される。「太陽 お月様」 → 「...
画像内に複数行が存在する場合は、画像内の文字すべてが誤認...
--- 9 : Treat the image as a single word in a circle.
画像を円の中の一つの単語として扱う。(丸囲みのことか?)
--- 10 : Treat the image as a single character.
1文字として扱う。2文字以上ある場合は、すべてが誤認識する。
--- 11 : Sparse text. Find as much text as possible in no...
色の薄いテキスト。できるだけ多くのテキストを探す。
デフォルトで探せなかったテキストも認識する。
--- 12 : Sparse text with OSD.
言語データ:osd.traineddata 必須
上記11番、及び、
回転(90度・180度・270度)したテキストも認識する
--- 13 : Raw line. Treat the image as a single text line,
bypassing hacks that are Tesseract-specific.
//=======================================================...
** 参考リンク [#na56b35d]
- [[Pythonで書くTesseract 4の基本的な使い方。APIとCLIから...
- [[tesseract のオプション PSM をいじってみた | Binary St...
ページ名: