[Image-SIG] Need better quality from crop
Bryan Fodness
bryan.fodness at gmail.com
Thu Feb 19 16:24:55 CET 2009
I am trying to extract data from a large number of images. I am
trying to use pytesser, but I am not getting the desired results. I
tried to recognize the entire image and it was not consistent at all.
So, I cropped the picture with PIL in the sections that I am
interested in, and then tried to run. The problem I am having is with
the date and time block as well as the numerical data. I have tried
to use the ImageEnhance and ImageFilter but I have not been able to
increase the accuracy. Does anyone have any experience making the
'text' in an image easily detectable for an ocr.
import ImageEnhance, ImageFilter
from pytesser import *
im = Image.open('C:\\Users\\bryan\\Desktop\\10-28-08.bmp')
im1 = im.crop([156,105,265,120]) # Date/Time
im1 = im1.convert('RGB')
im2 = im.crop([380,815,430,833]) # Couch Vrt
im2 = im2.convert('RGB')
text1, text2 = image_to_string(im1), image_to_string(im2)
>>> text1
'\n'
>>> text2
'HIS\n\n'
>>>
--
"The game of science can accurately be described as a never-ending
insult to human intelligence." - João Magueijo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DateTime.bmp
Type: image/bmp
Size: 4974 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090219/2a9f51c1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CouchVrt.bmp
Type: image/bmp
Size: 2790 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/image-sig/attachments/20090219/2a9f51c1/attachment-0001.bin>
More information about the Image-SIG
mailing list