Why my image is in bad quality ?
fsn761304 at gmail.com
fsn761304 at gmail.com
Wed Dec 16 11:33:59 EST 2015
On Wednesday, December 16, 2015 at 6:33:56 PM UTC+4, Chris Angelico wrote:
> On Thu, Dec 17, 2015 at 1:21 AM, <fsn761304 at gmail.com> wrote:
> > I tried also another code (see below) and without scaling by 20 quality of recognition was very bad.
> >
> > from pytesseract import image_to_string
> > from PIL import Image
> >
> > im = Image.open("screen.png")
> > print(im)
> > im = im.resize((214*20,26*20), Image.ANTIALIAS)
> > print(image_to_string(im))
>> If you need to scale by 20x20 to get the text recognition to work, I
> would recommend using something other than an anti-alias filter. Omit
> the second argument to use a simpler algorithm; you'll get a blocky
> result, which might parse more cleanly for you.
>> ChrisA
It didn't help to recognize words, the main problem is that image is inclined to the left, like backslash.
More information about the Python-list
mailing list