Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100510

Re: Why my image is in bad quality ?

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Why my image is in bad quality ?
Date 2015-12-17 01:33 +1100
Message-ID <mailman.10.1450276418.30845.python-list@python.org> (permalink)
References <b16c8f76-2ca7-4662-aec2-d0fcf3a0ec31@googlegroups.com> <n4rrl4$8o2$2@dont-email.me> <424a0169-fe5b-4650-9673-46d265290c30@googlegroups.com>

Show all headers | View raw


On Thu, Dec 17, 2015 at 1:21 AM,  <fsn761304@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 06:04 -0800
  Re: Why my image is in bad quality ? Denis McMahon <denismfmcmahon@gmail.com> - 2015-12-16 14:15 +0000
    Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 06:21 -0800
      Re: Why my image is in bad quality ? Chris Angelico <rosuav@gmail.com> - 2015-12-17 01:33 +1100
        Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 08:33 -0800
          Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 08:35 -0800
          Re: Why my image is in bad quality ? Chris Angelico <rosuav@gmail.com> - 2015-12-17 03:41 +1100
            Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 09:01 -0800
              Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 09:17 -0800
                Re: Why my image is in bad quality ? BartC <bc@freeuk.com> - 2015-12-16 21:36 +0000
                Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-16 13:53 -0800
                Re: Why my image is in bad quality ? BartC <bc@freeuk.com> - 2015-12-16 23:20 +0000
  Re: Why my image is in bad quality ? Nobody <nobody@nowhere.invalid> - 2015-12-17 01:27 +0000
    Re: Why my image is in bad quality ? fsn761304@gmail.com - 2015-12-17 03:31 -0800

csiph-web