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 ?

Path csiph.com!au2pb.net!feeder.erje.net!2.eu.feeder.erje.net!newsfeed0.kamp.net!newsfeed.kamp.net!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Why my image is in bad quality ?
Date Thu, 17 Dec 2015 01:33:36 +1100
Lines 17
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>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de uSeNJHF/U4ZEpJ1O/7zK4wDoO7SVxhSQzlC6lz3awsfg==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'below)': 0.07; 'omit': 0.07; 'scaling': 0.07; 'cc:addr:python-list': 0.09; 'pil': 0.09; 'subject:Why': 0.09; 'argument': 0.15; 'thu,': 0.15; 'cleanly': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:image': 0.16; 'wrote:': 0.16; 'result,': 0.18; '2015': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '(see': 0.20; 'work,': 0.21; 'parse': 0.22; 'simpler': 0.22; 'am,': 0.23; 'dec': 0.23; 'second': 0.24; 'tried': 0.24; 'import': 0.24; 'header:In-Reply- To:1': 0.24; 'scale': 0.27; 'subject: ?': 0.27; 'message- id:@mail.gmail.com': 0.27; 'bad.': 0.29; 'code': 0.30; 'another': 0.32; 'received:google.com': 0.35; 'text': 0.35; 'something': 0.35; 'skip:i 20': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'received:209.85.213': 0.37; 'received:209': 0.38; 'skip:p 20': 0.38; "you'll": 0.61; 'more': 0.63; 'you.': 0.64; 'quality': 0.72; 'chrisa': 0.84; 'recognition': 0.84; 'subject:quality': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=KXRU4I6vo6q/ZSTGeO8CZHkQ37CCmvsMRB4XHHJmYyA=; b=sV5JWdjlcDmE8FdLNhquuG+76oOL9mnoAi7B5s2VuFi7LTVJRj1IrrugG7NeF581Zx 4oayCi3ksZOrr2SmjsVbL9OM0onrR9E6rlAjK0V0fQPuOBOFkyeQjmiOJ4z2DE0cWimS PyWmTDnXZ5EwltnHWTOQUabk6whiBJBHYRlqcKINepnhB/mK29ohfvOkuzGZSzLobcu/ AAXgraYKoIVsOfiBj5R9zA9oBoOvPOMeQZ+B7auQHT9A7YrmQsVHlFBJha9rK746bSwv LB4TXCpKs+1PNGqBZfdCDZIw/dI4BjvTHL4QujPyflHusLvV/bhtM8NFoGzVkhkzzwdB U7QQ==
X-Received by 10.50.79.138 with SMTP id j10mr10891624igx.92.1450276416488; Wed, 16 Dec 2015 06:33:36 -0800 (PST)
In-Reply-To <424a0169-fe5b-4650-9673-46d265290c30@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Xref csiph.com comp.lang.python:100510

Show key headers only | 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