Why my image is in bad quality ?
BartC
bc at freeuk.com
Wed Dec 16 18:20:59 EST 2015
On 16/12/2015 21:53, fsn761304 at gmail.com wrote:
> On Thursday, December 17, 2015 at 1:36:55 AM UTC+4, BartC wrote:
>> You need to test step by step to see at what point it goes wrong. You're
>> scaling by 20 (which is a massive amount); what happens when scaling by
>> 1? And anti-alias is turned off? (Which might let you see by how many
>> pixels each successive line is out and could give a clue.)
>>
>> It does seem as though something is going amiss with recognising the
>> image dimensions, or you've inadvertently applied a 'shear' or 'slant'
>> transformation. (Maybe you can apply a reverse transform to fix it!)
>>
>> --
>> Bartc
>
> Original size: 150x30
> Original image the same, but without skew (usual upright letters).
> When scaling by less than 20 recognition quality is bad (in another code, which doesn't use buffer, screenshot, but loads image from a directory).
> Antialias makes no difference.
> Shear, slant - ok, show me how.
I've played with a 150x30 reduced image. The best I can do is apply a
shift that makes the letters slant the other way, but at only half the
angle. Trying to get them upright makes them wobbly. (I did this with
some code - not Python - that read each pixel and stored it at a shifted
position. But this is because I'm not familiar with manipulation programs.)
So whatever's gone wrong might be more complex. You should forget about
recognition quality, and find out what it is that's applying the skew
(another name for shear or slant). That seems to be being applied before
the scaling, which is giving the 'steps' in the sloping edges.
--
Bartc
More information about the Python-list
mailing list