dlareklami / tesseract-ocr

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

Segfault in WERD_CHOICE::certainty() #1112

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. run recognition (i used PSM_SINGLE_BLOCK) on a specific image. The property 
of the image that causes the bug is unknown, but an image known to reproduce it 
has been attached. 
2. Attempt to get the confidence from the ResultsIterator at level RIL_SYMBOL.
3. Segfault.

What is the expected output? What do you see instead?
The expected output is the confidence value for that symbol. Instead, it 
segfaults.

What version of the product are you using? On what operating system?
Tesseract 3.03 revision 1051 (the most recent revision as of today)
Ubuntu 12.04 LTS

Please provide any additional information below.
In LTRResultIterator::Confidence, at line 135, best_choice.certainties_ should 
be a pointer to a list of floats, but it is in fact a null pointer. It is then 
dereferenced inside the call at line 135, resulting in a segfault.
I made a workaround to simply return a confidence of 0 when this happens, but 
the circumstances that actually produce this error are entirely beyond my 
understanding. 
You should also know that images that produce this error are extremely rare (i 
processed ~50,000 images, and this error only arose a couple of times), but 
still common enough that I had to work around this before I could proceed.
I have attached one such image.

Original issue reported on code.google.com by shadyli...@gmail.com on 14 Feb 2014 at 6:00

Attachments:

GoogleCodeExporter commented 9 years ago
Please provide code - test case that demonstrate this problem.

Original comment by zde...@gmail.com on 14 Feb 2014 at 7:42

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1079.

Original comment by theraysm...@gmail.com on 24 Apr 2014 at 8:13