Extracting sparse digits from images

58 views
Skip to first unread message

Mat

unread,
May 26, 2017, 2:19:17 AM5/26/17
to tesseract-ocr
Hi,

I'm working with some image products and trying to extract numbers from an image. I've been trying to segment and extract digits from specific areas, but I haven't had great results.

I converted the attached image to a .tif (for some reason my environment was seg faulting with the .gif), extracted a specific area (also attached), resized it, and processed via tesseract. 

Below are 3 of the many iterations/configuration combinations I ran with corresponding output:

# Test 1: No options
$ tesseract cropped
.tif stdout        
Page 1
Empty page!!
Empty page!!


# Test 2: Setting psm, resulted in better results but still lots of junk
$ tesseract cropped
.tif stdout -psm 11
Page 1

14-15

..................

10-11


113-14

_ I
.

i


# Test 3: Setting psm and whitelisting

# ./config/digits file
tessedit_char_whitelist
0123456789

$ tesseract cropped
.tif stdout -psm 11 ./config/digits
Page 1
14 15
     
10 11

113 14

3



As you can see, I got the best results when I whitelisted for just 0-9 (test 3). However, it's still not perfect and missing the 18, which is probably the most critical for my application.


I did some tweaking of the command line values (i.e. http://www.sk-spell.sk.cx/tesseract-ocr-parameters-in-302-version) but this didn't result in anything better.


Are there any other suggested configuration parameters I can play with to increase accuracy?  


Thanks.




PKFA88.2017011000.gif
cropped.tif

Zdenko Podobný

unread,
May 26, 2017, 2:42:55 AM5/26/17
to tesser...@googlegroups.com
https://github.com/tesseract-ocr/tesseract/wiki/ImproveQuality

=> you must remove all noise (=> everything excluding text) from input image.
Image preprocessing is your task. No tesseract parameter will do it instead of you.


Zdenko

--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+unsubscribe@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/4dfec158-280e-446d-a5ae-cf0b93e9d392%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages