zengxiange / tesseract-android-tools

Automatically exported from code.google.com/p/tesseract-android-tools
0 stars 0 forks source link

Assert failed when using tesseract with PSM_OSD_ONLY flag #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build tesseract-android-tools
2. Bitmap is located under location specified in "_path" (.JPG file)
3. Code:
// prepare bitmap
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 4;
Bitmap bitmap = BitmapFactory.decodeFile(_path, options);

// Convert to ARGB_8888, required by tess
bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true);

// do OCR
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.setDebug(true);
baseApi.init(DATA_PATH, lang);
baseApi.setVariable(TessBaseAPI.VAR_CHAR_WHITELIST, "0123456789:");
baseApi.setPageSegMode(TessBaseAPI.PageSegMode.PSM_OSD_ONLY);
baseApi.setImage(bitmap);

// show recognized numbers
String recognizedText = baseApi.getUTF8Text();
baseApi.end();

4. run code on device

What is the expected output? What do you see instead?
expected output:
>> correctly recognized numbers with autorotation

what do I see instead (in my debug view):
13:39:01.485: ASSERT/libc(20219): Fatal signal 11 (SIGSEGV) at 0x00000000 
(code=1), thread 20219 (ski.myreader)
11-02 
11-02 13:39:01.370: INFO/Tesseract(native)(20219): Initialized Tesseract API 
with language=eng
11-02 13:39:02.045: INFO/DEBUG(1910): #00  pc 000bafba  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so (ERRCODE::error(char 
const*, TessErrorLogCode, char const*, ...) const+145)
11-02 13:39:02.045: INFO/DEBUG(1910): backtrace:
11-02 13:39:02.045: INFO/DEBUG(1910): #00  pc 000bafba  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so (ERRCODE::error(char 
const*, TessErrorLogCode, char const*, ...) const+145)
11-02 13:39:02.045: INFO/DEBUG(1910): #01  pc 000fddeb  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so 
(tesseract::ColumnFinder::AssignColumns(GenericVector<tesseract::ColPartitionSet
*> const&)+46)
11-02 13:39:02.045: INFO/DEBUG(1910): #02  pc 000ff475  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so 
(tesseract::ColumnFinder::MakeColumns(bool)+284)
11-02 13:39:02.045: INFO/DEBUG(1910): stack:
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66a0  00000003
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66a4  5e381528
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66a8  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66ac  5e6de660
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66b0  40076718  /system/lib/libc.so
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66b4  4004d2bd  /system/lib/libc.so 
(fputs+60)
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66b8  5e2bbd19  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66bc  bebb66e4  [stack]
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66c0  0000007d
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66c4  bebb66bc  [stack]
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66c8  00000001
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66cc  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66d0  40082a6c
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66d4  bebb6712  [stack]
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66d8  df0027ad
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66dc  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): #00  bebb66e0  bebb6b08  [stack]
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66e4  5f746573
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66e8  6e756f63
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66ec  3d3d2074
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66f0  69726720
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66f4  69656864
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66f8  28746867
11-02 13:39:02.045: INFO/DEBUG(1910): bebb66fc  72453a29
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6700  3a726f72
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6704  65737341
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6708  66207472
11-02 13:39:02.045: INFO/DEBUG(1910): bebb670c  656c6961
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6710  6e693a64
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6714  6c696620
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6718  6e6a2065
11-02 13:39:02.045: INFO/DEBUG(1910): bebb671c  6f632f69
11-02 13:39:02.045: INFO/DEBUG(1910): ........  ........
11-02 13:39:02.045: INFO/DEBUG(1910): #01  bebb6b08  5e2ccff6  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b0c  00000288
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b10  5e6da8b8
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b14  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b18  5e6da8b8
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b1c  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b20  00000001
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b24  5e211013  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so 
(tesseract::ColPartitionSet::LegalColumnCandidate()+44)
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b28  ffffffff
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b2c  5e6da984
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b30  bebb6b80  [stack]
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b34  5e6da8b8
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b38  5e6da8b8
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b3c  00000000
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b40  5e6da8b8
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b44  00000001
11-02 13:39:02.045: INFO/DEBUG(1910): ........  ........
11-02 13:39:02.045: INFO/DEBUG(1910): #02  bebb6b70  80018001
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b74  0000000c
11-02 13:39:02.045: INFO/DEBUG(1910): bebb6b78  ffffffff
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b7c  5e6beb00
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b80  5e2e6b70  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b84  00000000
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b88  00000004
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b8c  5e6da8a0
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b90  00000000
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b94  00000000
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b98  5e6de5d0
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6b9c  5e6bebc8
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6ba0  5e6de6a8
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6ba4  5e6de6d4
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6ba8  5e2e9c0c  
/data/data/pl.maciejdobrowolski.myreader/lib/libtess.so
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6bac  5e6de6cc
11-02 13:39:02.050: INFO/DEBUG(1910): memory near r4:
11-02 13:39:02.050: INFO/DEBUG(1910): 40082a4c 00000000 00000000 00000000 
00000000  ................
11-02 13:39:02.050: INFO/DEBUG(1910): 40082a5c 00000000 00000000 00000000 
00000000  ................
11-02 13:39:02.050: INFO/DEBUG(1910): 40082a6c 8fe63ce3 00000000 00000000 
00000000  .<..............
11-02 13:39:02.050: INFO/DEBUG(1910): 40082a7c 00000000 00000000 00000000 
00000000  ................
11-02 13:39:02.050: INFO/DEBUG(1910): 40082a8c 00000000 00000000 00000000 
00000000  ................
11-02 13:39:02.050: INFO/DEBUG(1910): memory near r5:
11-02 13:39:02.050: INFO/DEBUG(1910): bebb66f0 69726720 69656864 28746867 
72453a29   gridheight():Er
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6700 3a726f72 65737341 66207472 
656c6961  ror:Assert faile
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6710 6e693a64 6c696620 6e6a2065 
6f632f69  d:in file jni/co
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6720 6f675f6d 656c676f 65646f63 
7365745f  m_googlecode_tes
11-02 13:39:02.050: INFO/DEBUG(1910): bebb6730 61726573 615f7463 6f72646e 
732f6469  seract_android/s
11-02 13:39:02.050: INFO/DEBUG(1910): memory near r6:
11-02 13:39:02.050: INFO/DEBUG(1910): 5e2bba7c 65646e69 3d3e2078 26203020 
6e692026  index >= 0 && in
11-02 13:39:02.050: INFO/DEBUG(1910): 5e2bba8c 20786564 6973203c 755f657a 
5f646573  dex < size_used_
11-02 13:39:02.050: INFO/DEBUG(1910): 5e2bba9c 206e6900 656c6966 2c732520 
6e696c20  .in file %s, lin
11-02 13:39:02.050: INFO/DEBUG(1910): 5e2bbaac 64252065 696e6a00 6d6f632f 
6f6f675f  e %d.jni/com_goo
11-02 13:39:02.050: INFO/DEBUG(1910): 5e2bbabc 63656c67 5f65646f 73736574 
63617265  glecode_tesserac
11-02 13:39:02.050: INFO/DEBUG(1910): memory near r8:
11-02 13:39:02.050: INFO/DEBUG(1910): 5e381508 5e2bc387 5e2bc3ab 5e2bc3c9 
5e2bc3eb  ..+^..+^..+^..+^
11-02 13:39:02.050: INFO/DEBUG(1910): 5e381518 5e2ccf4e 5e2ccf6d 00000000 
5d181e78  N.,^m.,^....x..]
11-02 13:39:02.050: INFO/DEBUG(1910): 5e381528 5e2bc26b 5e2bc279 5e2bc289 
5e2bc29b  k.+^y.+^..+^..+^
11-02 13:39:02.050: INFO/DEBUG(1910): 5e381538 5e2bc2ad 5e2bc2d3 5e2bc2e7 
5e2bc2fc  ..+^..+^..+^..+^
11-02 13:39:02.050: INFO/DEBUG(1910): 5e381548 5e2bc30a 5e2bc325 5e2bc347 
5e2bc35d  ..+^%.+^G.+^].+^
11-02 13:39:02.050: INFO/DEBUG(1910): memory near sl:
11-02 13:39:02.050: INFO/DEBUG(1910): 5e6de640 5e2e6d28 0000000d 00000010 
5e6bef98  (m.^..........k^
11-02 13:39:02.050: INFO/DEBUG(1910): 5e6de650 00000000 00000000 00000015 
000001e9  ................
11-02 13:39:02.050: INFO/DEBUG(1910): 5e6de660 3f800000 00000000 3f800000 
00000000  ...?.......?....
11-02 13:39:02.050: INFO/DEBUG(1910): 5e6de670 3f800000 00000000 3f800000 
80000000  ...?.......?....
11-02 13:39:02.050: INFO/DEBUG(1910): 5e6de680 3f800000 00000000 5e2e6b70 
00000001  ...?....pk.^....
11-02 13:39:02.055: INFO/DEBUG(1910): memory near ip:
11-02 13:39:02.055: INFO/DEBUG(1910): 00003fe0 ffffffff ffffffff ffffffff 
ffffffff  ................
11-02 13:39:02.055: INFO/DEBUG(1910): 00003ff0 ffffffff ffffffff ffffffff 
ffffffff  ................
11-02 13:39:02.055: INFO/DEBUG(1910): 00004000 ffffffff ffffffff ffffffff 
ffffffff  ................
11-02 13:39:02.055: INFO/DEBUG(1910): 00004010 ffffffff ffffffff ffffffff 
ffffffff  ................
11-02 13:39:02.055: INFO/DEBUG(1910): 00004020 ffffffff ffffffff ffffffff 
ffffffff  ................
11-02 13:39:02.055: INFO/DEBUG(1910): memory near sp:
11-02 13:39:02.055: INFO/DEBUG(1910): bebb66c0 0000007d bebb66bc 00000001 
00000000  }....f..........
11-02 13:39:02.055: INFO/DEBUG(1910): bebb66d0 40082a6c bebb6712 df0027ad 
00000000  l*.@.g...'......
11-02 13:39:02.055: INFO/DEBUG(1910): bebb66e0 bebb6b08 5f746573 6e756f63 
3d3d2074  .k..set_count ==
11-02 13:39:02.055: INFO/DEBUG(1910): bebb66f0 69726720 69656864 28746867 
72453a29   gridheight():Er
11-02 13:39:02.055: INFO/DEBUG(1910): bebb6700 3a726f72 65737341 66207472 
656c6961  ror:Assert faile
11-02 13:39:02.055: INFO/DEBUG(1910): code around pc:
11-02 13:39:02.055: INFO/DEBUG(1910): 5e1c4f98 ec64f7bd a801491a 44793701 
31a86809  ..d..I...7yD.h.1
11-02 13:39:02.055: INFO/DEBUG(1910): 5e1c4fa8 ecc2f7bd d8082f03 f007e8df 
02020f0f  ...../..........
11-02 13:39:02.055: INFO/DEBUG(1910): 5e1c4fb8 681b2300 f7bdb90b 4812ee62 
49122202  .#.h....b..H.".I
11-02 13:39:02.055: INFO/DEBUG(1910): 5e1c4fc8 44782300 f7ff4479 f8ddffab 
68232404  .#xDyD.......$#h
11-02 13:39:02.055: INFO/DEBUG(1910): 5e1c4fd8 d001429a ec1ef7bd f50db003 
e8bd6d80  .B...........m..
11-02 13:39:02.055: INFO/DEBUG(1910): code around lr:
11-02 13:39:02.055: INFO/DEBUG(1910): 4004d29c 90042001 4620b113 ff39f7ff 
a9034620  . .... F..9. F..
11-02 13:39:02.055: INFO/DEBUG(1910): 4004d2ac fb9ff000 4606682a 4620b112 
ff3cf7ff  ....*h.F.. F..<.
11-02 13:39:02.055: INFO/DEBUG(1910): 4004d2bc b0064630 bf00bd70 00029216 
f0018981  0F..p...........
11-02 13:39:02.055: INFO/DEBUG(1910): 4004d2cc 2b090309 f7ffd101 2000bccd 
00004770  ...+....... pG..
11-02 13:39:02.055: INFO/DEBUG(1910): 4004d2dc 4ff8e92d 461d4614 460b4682 
4353468b  -..O.F.F.F.F.FSC

What version of the product are you using? On what operating system?
latest tesseract-android-tools
tesseract-ocr-3.02
tesseract-ocr-3.02.eng.tar.gz
leptonica-1.69.tar.gz

Original issue reported on code.google.com by maaciej...@gmail.com on 2 Nov 2013 at 12:51