NHocr: OCR engine for Japanese language
上記アドレスから、下記をダウンロードする
nhocr-0.22/READMEの説明通り、
$./configure
$make
…
g++ -I../libnhocr -I../include -O3 --unroll-loops -o makedic makedic.o -L../libnhocr -L../O2-tools/lib -lm -lnhocr -lufp -lsip
make[1]: ディレクトリ `/home/jeff/nhocr-0.22/makedic' から出ます
make[1]: ディレクトリ `/home/jeff/nhocr-0.22' に入ります
make[1]: `all-am' に対して行うべき事はありません.
make[1]: ディレクトリ `/home/jeff/nhocr-0.22' から出ます
# ls -l nhocr/
…
-rwxr-xr-x. 1 root root 261083 7月 9 23:51 2015 nhocr
…
上記が生成すればOK
事前に準備したjpgファイルをpgm形式に変換する。
# convert receipt.jpg receipt.pgm
下記のように、コマンドを実行すれば、写真の中の文字を識別できる。
# NHOCR_DICDIR=dic nhocr/nhocr -block -o output.txt receipt.pgm
--
参考情報
※make時に下記のようなエラーが発生した場合、
--------------------------------------------
makechar.cpp:18:22: error: ft2build.h: そのようなファイルやディレクトリはあり ません
makechar.cpp:19:10: error: #include は "ファイル名" あるいは <ファイル名> を必要とします
makechar.cpp:85: error: variable or field 'draw_bitmap' declared void
makechar.cpp:85: error: 'FT_Bitmap' was not declared in this scope
makechar.cpp:85: error: 'bitmap' was not declared in this scope
makechar.cpp:85: error: 'FT_Int' was not declared in this scope
makechar.cpp:85: error: 'FT_Int' was not declared in this scope
make[1]: *** [makechar.o] エラー 1
-------------------------------------------------
対象方法として、以下を実施する。
ln -s /usr/local/include/freetype2/freetype /usr/include/freetype
/usr/local/include/freetype2/freetypeフォルダがない場合、
#yum -y install freetype freetype-devel
を実行してから、「ln -s 」のリンクコマンドを実施する。
(1)写真(レシート)
(2)識別した文字(あんまり識別度が低いようです)
/
ぽ
>ト
j
イオンM店
TEl Ti-q-8000 FAX.-q-8787
http://wu. aeon. info/
■
■
2 X 2g8
翻
囲
■
■
イオ.瓶茸牡
TV莱焼き7‐モン ド 5gB
TVll'7+
2X 2g
Tvお莱 缶
3X gg
gg
5B
マルキヨ製菓 生菓千 2g7
口ール巻ポリ蟻
B8
B Pティ ッシユぺーパー j78
. ̄許~‐_‐一一‐‐‐‐‐‐‐‐‐‐‐‐ーー‐.‐
WrWi支払
お 釣
\T.2gB
\l.2g8
おエ上げ商品撒: vo
\0
{消費税等)
BT
レう゛T02 20js/ol〃5(火曜日ij7:og
取瑚Tifl 担当ij■■ 藁子
T.‐‐.一‐‐.‐-.…‐‐‐‐.リu‐.一ー‐‐
=**********#*f['8
WiWi支払輯:
WrWi残輯 =
\T.2gB
判j7
(内ポイン ト封韓金輯 \T.2gB )
今回ポイント:
f2 P
【内ポイン ト2倍封寓 j2 P 〕
累計ポィント:
j42 p
■
..............................