LoginSignup
0
2

More than 5 years have passed since last update.

日本語OCRメモ自分版

Posted at

環境

AWS EC2
ubuntu16.04

手順

http://qiita.com/bohemian916/items/67f22ee7aeac103dd205
こちらのページのまんまですが、URL等など打ったまんまを書きました。

依存関係をインストール

$ sudo apt update
$ sudo apt-get install autoconf automake libtool
$ sudo apt-get install libpng12-dev
$ sudo apt-get install libjpeg62-dev
$ sudo apt-get install libtiff5-dev #若干変更
$ sudo apt-get install zlib1g-dev
$ sudo apt-get install autoconf-archive
$ sudo apt-get install libicu-dev      # (if you plan to make the training tools)
$ sudo apt-get install libpango1.0-dev # (if you plan to make the training tools)
$ sudo apt-get install libcairo2-dev   # (if you plan to make the training tools)

画像ライブラリleptpnicaをインストール
※aptで入れるのもはバージョンが古いため使えない

$ wget http://www.leptonica.org/source/leptonica-1.74.1.tar.gz
$ gzip -dc leptonica-1.74.1.tar.gz |tar xvf -
$ cd leptonica-1.74.1/
$ ./configure
$ make
$ sudo make install

tesseractをインストール

$ cd
$ git clone https://github.com/tesseract-ocr/tesseract.git
$ cd tesseract
$ ./autogen.sh
$ ./configure
$ LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make
$ sudo make install
$ sudo ldconfig

#言語データ
$ wget https://github.com/tesseract-ocr/tessdata/raw/master/jpn.traineddata
$ sudo mv jpn.traineddata /usr/local/share/tessdata/
$ export TESSDATA_PREFIX="/usr/local/share/tessdata/tessdata/"

最後に実行

$ tesseract test.png out -l jpn
0
2
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
0
2