oliveiracwb / tesseract-ocr

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

Otsu Thresholding Edge Case #366

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Pre contrast enhance a 350DPI+ image that has a large amount of white, so 
that the histogram has a majority pixel count around value 255.
2. OCR image.

What is the expected output? What do you see instead?
Otsu thresholding value of around 150 producing perfect OCR, instead, a 
thresholding value of 254 which produces garbled output due to the increased 
noise.

Turned out be a simple overflow of a 32bit integer. Patch attached.

Original issue reported on code.google.com by Cyanide....@gmail.com on 30 Sep 2010 at 7:07

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the patch. I committed it as r488

Original comment by joregan on 30 Sep 2010 at 10:37