frame_decoration
original (2019/05/14 付) Google 翻訳 (2019/05/21 付)
# Installing Tesseract from Git #GitからTesseractをインストールする
##### Table of Contents ##### 目次
* Installing With Autoconf Tools * Autoconf Toolsを使ったインストール
* Build with Training Tools * トレーニングツールを使ってビルド
* Unit test builds * 単体テストビルド
* Debug builds * デバッグビルド
* Profiling builds * プロファイリングビルド
* Release Builds for Mass Production * 量産用ビルドのビルド
* Builds for fuzzing * ファジング用にビルド
* Building using Windows Visual Studio * Windows Visual Studioを使ったビルド
These are the instructions for installing Tesseract from the git repository. You should be ready to face unexpected problems. これらはGitリポジトリからTesseractをインストールするための指示です。予想外の問題に直面する準備ができているはずです。
## Installing With Autoconf Tools ## Autoconfツールを使ったインストール
In order to do this; you must have automake, libtool, leptonica, make and pkg-config installed. In addition, you need Git and a C++ compiler. これを行うためには; automake、libtool、leptonica、make、およびpkg-configがインストールされている必要があります。さらに、GitとC ++コンパイラが必要です。
On Debian or Ubuntu, you can probably install all required packages like this: DebianやUbuntuでは、おそらく以下のような全ての必要なパッケージをインストールすることができます。
` | `
apt-get install automake g++ git libtool libleptonica-dev make pkg-config apt-getインストールautomake g ++ git libtool libleptonica-dev make pkg-config
` | `
The optional manpages are built with asciidoc: オプションのマンページはasciidocで構築されています。
` | `
apt-get install --no-install-recommends asciidoc apt-get install --no-install-recommend asciidoc
` | `
If you want to build the Tesseract training tools as well, you'll also require Pango: Tesseractトレーニングツールも構築したい場合は、Pangoも必要です。
` | `
apt-get install libpango1.0-dev libpango1.0-devのapt-getインストール
` | `
--- ---
Afterwards, to clone the master branch to your computer, do this: その後、マスターブランチをあなたのコンピュータにクローンするために、これをしてください:
` | `
git clone https://github.com/tesseract-ocr/tesseract.git git clone https://github.com/tesseract-ocr/tesseract.git
` | `
or to make a shallow clone with commit history truncated to the latest commit only: コミット履歴を最新のコミットのみに切り捨てた、シャロークローンを作成します。
` | `
git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git git clone --depth 1 https://github.com/tesseract-ocr/tesseract.git
` | `
or to clone a different branch/version: または別のブランチ/バージョンを複製するには
` | `
git clone https://github.com/tesseract-ocr/tesseract.git --branch --single-branch git clone https://github.com/tesseract-ocr/tesseract.git --branch --single-branch
` | `
--- ---
Note: Tesseract requires Leptonica v1.74 or newer. If your system has only older versions of Leptonica, you must compile it manually from source available at DanBloomberg/leptonica. 注: TesseractはLeptonica v1.74以降を必要とします。システムにLeptonicaの古いバージョンしかない場合は、DanBloomberg / leptonicaで入手可能なソースから手動でコンパイルする必要があります。
Finally, run these: 最後に、これらを実行してください。
` | `
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
./configure ./configure
make 作る
sudo make install sudo make install
sudo ldconfig sudo ldconfig
` | `
If you get this error: このエラーが発生した場合:
` | `
make all-recursive すべて再帰的にする
Making all in ccstruct すべてccstructにする
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. - / bin / sh ../libtool --tag = CXX --mode =コンパイルg ++ -DHAVE_CONFIG_H -I -
I.. -I../ccutil -I../cutil -I../image -I../viewer -I/opt/local/ -I / ccutil -I / cutil -I /画像-I /ビューア-I / opt / local /
include -I/usr/local/include/leptonica -g -O2 -MT blobbox.lo -MD -MP - インクルード-I / usr / local /インクルード/ leptonica -g -O2 -MT blobbox.lo -MD -MP -
MF .deps/blobbox.Tpo -c -o blobbox.lo blobbox.cpp MF .deps / blobbox.Tpo -c -o blobbox.lo blobbox.cpp
mv -f .deps/blobbox.Tpo .deps/blobbox.Plo mv -f .deps / blobbox.Tpo .deps / blobbox.Plo
mv: rename .deps/blobbox.Tpo to .deps/blobbox.Plo: No such file or mv:.deps / blobbox.Tpoのファイル名を.deps / blobbox.Ploに変更します。
directory ディレクトリ
make[3]: *** [blobbox.lo] Error 1 make [3]:*** [blobbox.lo]エラー1
make[2]: *** [all-recursive] Error 1 make [2]:*** [all-recursive]エラー1
make[1]: *** [all-recursive] Error 1 make [1]:*** [all-recursive]エラー1
make: *** [all] Error 2 make:*** [all]エラー2
` | `
Try to run autoreconf -i after running ./autogen.sh. 。/ autogen.shを実行した後にautoreconf -iを実行してみてください。
### Build with Training Tools ###トレーニングツールを使って構築する
The above does not build the Tesseract training tools. 上記はTesseractトレーニングツールを構築するものではありません。
If you plan to install the training tools, you also need the following libraries: トレーニングツールをインストールする予定の場合は、次のライブラリも必要です。
` | `
sudo apt-get install libicu-dev sudo apt-get install libicu-dev
sudo apt-get install libpango1.0-dev sudo apt-get install libpango1.0-dev
sudo apt-get install libcairo2-dev sudo apt-get libcairo2-devをインストールする
` | `
To build Tesseract with training tools, run the following: Tesseractをトレーニングツールで構築するには、以下を実行してください。
` | `
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
./configure ./configure
make 作る
sudo make install sudo make install
sudo ldconfig sudo ldconfig
make training トレーニングをする
sudo make training-install sudo作るトレーニングインストール
` | `
You can specify extra options for configure, as needed. eg. 必要に応じて、configureに追加のオプションを指定できます。例えば。
./configure --disable-openmp --disable-debug --disable-opencl --disable-graphics --disable-shared 'CXXFLAGS=-g -O2 -Wall -Wextra -Wpedantic' ./configure --disable-openmp --disable-debug --disable-opencl --disable-graphics --disable-shared 'CXXFLAGS = -g -O2 -Wall -Wextra -Wpedantic'
### Unit test builds ###単体テストビルド
Such builds can be used to run the automated regression tests, which have additional requirements. This includes the additional dependencies for the training tools (as mentioned above), and downloading all git submodules, as well as the model repositories (*.traineddata): このようなビルドは自動回帰テストを実行するために使用することができます。これには追加の要件があります。これには(上で述べたような)トレーニングツールのための追加の依存関係、そしてすべてのgitサブモジュールのダウンロード、そしてモデルリポジトリ( * .traineddata)が含まれます。
# Clone the Tesseract source tree: #Tesseractソースツリーを複製します。
git clone https://github.com/tesseract-ocr/tesseract.git git clone https://github.com/tesseract-ocr/tesseract.git
# Clone repositories with model files (from the same directory): #モデルファイルを含むリポジトリを(同じディレクトリから)複製します。
git clone https://github.com/tesseract-ocr/tessdata.git git clone https://github.com/tesseract-ocr/tessdata.git
git clone https://github.com/tesseract-ocr/tessdata_best.git git clone https://github.com/tesseract-ocr/tessdata_best.git
git clone https://github.com/tesseract-ocr/tessdata_fast.git git clone https://github.com/tesseract-ocr/tessdata_fast.git
git clone https://github.com/tesseract-ocr/langdata_lstm.git git clone https://github.com/tesseract-ocr/langdata_lstm.git
# Change to the Tesseract source tree and get all submodules: #Tesseractソースツリーに変更して、すべてのサブモジュールを取得します。
cd tesseract cdテセラクト
git submodule update --init gitサブモジュールの更新--init
# Build the training tools (see above). Here we use a release built with sanitizers: #トレーニングツールを構築します(上記参照)。ここでは、消毒剤を使ってビルドされたリリースを使います。
./autogen.sh ./autogen.sh
mkdir -p bin/unittest mkdir -p bin / unittest
cd bin/unittest cd bin / unittest
../../configure --disable-shared 'CXXFLAGS=-g -O2 -Wall -Wextra -Wpedantic -fsanitize=address,undefined -fstack-protector-strong -ftrapv' ../../configure --disable-shared 'CXXFLAGS = -g -O2 -Wall -Wextra -Wpedantic -fsanitize = address、undefined -fstack-protector-strong -ftrapv'
make training トレーニングをする
# Run the unit tests: #単体テストを実行します。
make check 確認する
cd ../.. cd ../ ..
This will create log files for all unit tests, both individual and accumulated, under bin/unittest/unittest. They can also be run standalone, for example これは bin / unittest / unittestの下に、すべての単体テスト(個々のものと累積されたもの)のログファイルを作成します。たとえば、それらはスタンドアロンで実行することもできます。
bin/unittest/unittest/stringrenderer_test bin / unittest / unittest / stringrenderer_test
Failed tests will show prominently as segfaults or SIGILL handlers (depending on the platform). 失敗したテストは、セグメンテーションフォールトまたはSIGILLハンドラとして(プラットフォームに応じて)顕著に表示されます。
### Debug Builds ###デバッグビルド
Such builds produce Tesseract binaries which run very slowly. They are not useful for production, but good to find or analyze software problems. This is a proven build sequence: そのようなビルドはとても遅いTesseractバイナリを生成します。実稼働には役立ちませんが、ソフトウェアの問題を発見または分析するのに役立ちます。これは実証済みのビルドシーケンスです。
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
mkdir -p bin/debug mkdir -p bin / debug
cd bin/debug cd bin / debug
../../configure --enable-debug --disable-shared 'CXXFLAGS=-g -O0 -Wall -Wextra -Wpedantic -fsanitize=address,undefined -fstack-protector-strong -ftrapv' ../../configure --enable-debug - disable-shared 'CXXFLAGS = -g -O0 -Wall -Wextra -Wpedantic -fsanitize = address、undefined -fstack-protector-strong -ftrapv'
# Build tesseract and training tools. Run make if you don't need the training tools. #散文とトレーニングツールを構築します。あなたがトレーニングツールを必要としないのなら makeを実行してください。
make training トレーニングをする
cd ../.. cd ../ ..
This activates debug code, does not use a shared Tesseract library (that makes it possible to run tesseract without installation), disables compiler optimizations (allows better debugging with gdb), enables lots of compiler warnings and enables several run time checks. これはデバッグコードを有効にし、(インストールなしで tesseractを実行することを可能にする)共有Tesseractライブラリを使わず、コンパイラの最適化を無効にし(gdbを使ったより良いデバッグを可能にします) 。
### Profiling Builds ###プロファイリングビルド
Such builds can be used to investigate performance problems. Tesseract will run slower than without profiling, but with acceptable speed. This is a proven build sequence: このようなビルドはパフォーマンスの問題を調査するために使用できます。 Tesseractはプロファイリングしない場合よりも遅くなりますが、許容できる速度です。これは実証済みのビルドシーケンスです。
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
mkdir -p bin/profiling mkdir -p bin / profiling
cd bin/profiling CDビン/プロファイリング
../../configure --disable-shared 'CXXFLAGS=-g -p -O2 -Wall -Wextra -Wpedantic' ../../configure --disable-shared 'CXXFLAGS = -g -p -O2 -Wall -Wextra -Wpedantic'
# Build tesseract and training tools. Run make if you don't need the training tools. #散文とトレーニングツールを構築します。あなたがトレーニングツールを必要としないのなら makeを実行してください。
make training トレーニングをする
cd ../.. cd ../ ..
This does not use a shared Tesseract library (that makes it possible to run tesseract without installation), これは共有のTesseractライブラリを使用しません(これはインストールなしで tesseractを実行することを可能にします)、
enables profiling code, プロファイリングコードを有効にします。
enables compiler optimizations and enables lots of compiler warnings. コンパイラの最適化を有効にし、多くのコンパイラ警告を有効にします。
Optionally this can also be used with debug code by adding --enable-debug and replacing -O2 by -O0. オプションとして、これは --enable-debugを追加して-O2-O0に置き換えることでデバッグコードと一緒に使うこともできます。
The profiling code creates a file named gmon.out in the current directory when Tesseract terminates. Tesseractが終了すると、プロファイリングコードはカレントディレクトリに gmon.outという名前のファイルを作成します。
GNU gprof is used to show the profiling information from that file. そのファイルからプロファイリング情報を表示するためにGNU gprofが使用されます。
### Release Builds for Mass Production ###量産向けにビルドをビルド
The default build creates a Tesseract executable which is fine for processing of single images. Tesseract then uses 4 CPU cores to get an OCR result as fast as possible. デフォルトのビルドはTesseractの実行可能ファイルを作成しますが、これは単一のイメージの処理に適しています。その後、Tesseractは4つのCPUコアを使用してOCRの結果をできるだけ早く取得します。
For mass production with hundreds or thousands of images that default is bad because the multi threaded execution has a very large overhead. It is better to run single threaded instances of Tesseract, so that every available CPU core will process a different image. 何百または何千もの画像を使用した大量生産では、マルチスレッド実行には非常に大きなオーバーヘッドがあるため、デフォルトは良くありません。利用可能なすべてのCPUコアが異なるイメージを処理するように、Tesseractのシングルスレッドインスタンスを実行することをお勧めします。
This is a proven build sequence: これは実証済みのビルドシーケンスです。
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
mkdir -p bin/release mkdir -p bin / release
cd bin/release cd bin / release
../../configure --disable-openmp --disable-shared 'CXXFLAGS=-g -O2 -fno-math-errno -Wall -Wextra -Wpedantic' ../../configure --disable-openmp --disable-shared 'CXXFLAGS = -g -O2 -fno-math-errno -Wall -Wextra -Wpedantic'
# Build tesseract and training tools. Run make if you don't need the training tools. #散文とトレーニングツールを構築します。あなたがトレーニングツールを必要としないのなら makeを実行してください。
make training トレーニングをする
cd ../.. cd ../ ..
This disabled OpenMP (multi threading), does not use a shared Tesseract library (that makes it possible to run tesseract without installation), enables compiler optimizations, これはOpenMP(マルチスレッド)を無効にし、共有Tesseractライブラリを使用しません(これはインストールなしで tesseractを実行することを可能にします)、コンパイラの最適化を可能にします、
disables setting of errno for mathematical functions (faster execution!) and enables lots of compiler warnings. 数学関数に対する errnoの設定を無効にし(より速い実行!)、たくさんのコンパイラ警告を有効にします。
### Builds for fuzzing ###ファジング用にビルド
Fuzzing is used to test the Tesseract API for bugs. Tesseract uses OSS-Fuzz, ファジングはTesseract APIのバグをテストするために使用されます。 TesseractはOSS-Fuzzを使います、
but fuzzing can also run locally. A newer Clang++ compiler is required. ファジングはローカルでも実行できます。新しいClang ++コンパイラが必要です。
Build example (fix the value of CXX for the available clang++): 構築例(利用可能なclang ++のCXXの値を修正):
cd tesseract cdテセラクト
./autogen.sh ./autogen.sh
mkdir -p bin/fuzzer mkdir -p bin / fuzzer
cd bin/fuzzer cd bin / fuzzer
../../configure --disable-openmp --disable-shared CXX=clang++-7 CXXFLAGS='-g -O2 -Wall -Wextra -Wpedantic -D_GLIBCXX_DEBUG -fsanitize=fuzzer-no-link,address,undefined' ../../configure --disable-openmp --disable-shared CXX = clang ++ - 7 CXXFLAGS = ' - g -O2 -Wextra -Wpedantic -D_GLIBCXX_DEBUG -fsanitize = fuzzer-no-link、address、undefined'
# Build the fuzzer executable. #fuzzer実行ファイルをビルドします。
make fuzzer-api fuzzer-apiを作る
cd ../.. cd ../ ..
Example (Show help information): 例(ヘルプ情報を表示):
bin/fuzzer/fuzzer-api -help=1 bin / fuzzer / fuzzer-api -help = 1
Example (Run the fuzzer with a know test case): 例(既知のテストケースでファザーを実行します):
bin/fuzzer/fuzzer-api clusterfuzz-testcase-minimized-fuzzer-api-5670045835853824 bin / fuzzer / fuzzer-api clusterfuzzテストケース最小化fuzzer-api-5670045835853824
Example (Run the fuzzer to find new bugs): 例(新しいバグを見つけるためにファザーを実行する):
Example (Run the fuzzer with a know test case): 例(既知のテストケースでファザーを実行します):
nice bin/fuzzer/fuzzer-api -jobs=16 -workers=16 すてきなビン/ fuzzer / fuzzer-api -jobs = 16 -workers = 16
## Building using Windows Visual Studio ## Windows Visual Studioを使って構築する
See Compiling for Windows. Windows用にコンパイルするを参照してください。
最終更新:2019年06月18日 20:24