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


Groups > comp.lang.postscript > #404 > unrolled thread

Magnifying pdf cleans irregularities?

Started byno.top.post@gmail.com
First post2011-10-22 21:41 +0000
Last post2011-10-23 10:29 +0200
Articles 3 — 3 participants

Back to article view | Back to comp.lang.postscript


Contents

  Magnifying pdf cleans irregularities? no.top.post@gmail.com - 2011-10-22 21:41 +0000
    Re: Magnifying pdf cleans irregularities? luser- -droog <mijoryx@yahoo.com> - 2011-10-22 23:19 -0700
    Re: Magnifying pdf cleans irregularities? Helge Blischke <h.blischke@acm.org> - 2011-10-23 10:29 +0200

#404 — Magnifying pdf cleans irregularities?

Fromno.top.post@gmail.com
Date2011-10-22 21:41 +0000
SubjectMagnifying pdf cleans irregularities?
Message-ID<j7vda5$2kk$1@dont-email.me>
By using gocr on:
http://www.cogsci.rpi.edu/~rsun/sun.clarion2005.pdf
I've been trying to extract the ASCII.

So far, using:
pdftoppm -f 13 -l 13 -r 300 sun.clarion2005.pdf | gocr -o ppm13.300
gives the best Optical Character recognition results.
But it sees "k" as "h".

What confuses me, is that when I view with xpdf, the text
looks as if it was printed by a bad-condition 1950 typewriter.

I especially remember "2004" where the 'bottoms' were 
badly un-aligned. But if I set xpdf to 'magnify' a section of
the text, it looks clean, and of course gocr decodes perfectly.

I don't know exactly how the rendering works, but imagine
that if the 'normal size' uses a bad quality font, and the 
magnified version uses a good quality font, that could
explain what I'm seeing.

Since the information that 'the char IS a "k" and not 
a "h" is in the *.pdf file, and quiet independant of ANY
rendering, and gocr can correctly decode BIG font,
should I not expect to be able to get gocr to decode
correctly, by <filtering it through a suiatble font>?

Thanks,

== Chris Glur.

[toc] | [next] | [standalone]


#405

Fromluser- -droog <mijoryx@yahoo.com>
Date2011-10-22 23:19 -0700
Message-ID<cf75aaaa-69e9-4d61-8489-c46de5f45411@1g2000vbx.googlegroups.com>
In reply to#404
On Oct 22, 4:41 pm, no.top.p...@gmail.com wrote:
> By using gocr on:http://www.cogsci.rpi.edu/~rsun/sun.clarion2005.pdf
> I've been trying to extract the ASCII.
>
> So far, using:
> pdftoppm -f 13 -l 13 -r 300 sun.clarion2005.pdf | gocr -o ppm13.300
> gives the best Optical Character recognition results.
> But it sees "k" as "h".
>
> What confuses me, is that when I view with xpdf, the text
> looks as if it was printed by a bad-condition 1950 typewriter.
>
> I especially remember "2004" where the 'bottoms' were
> badly un-aligned. But if I set xpdf to 'magnify' a section of
> the text, it looks clean, and of course gocr decodes perfectly.
>
> I don't know exactly how the rendering works, but imagine
> that if the 'normal size' uses a bad quality font, and the
> magnified version uses a good quality font, that could
> explain what I'm seeing.
>
> Since the information that 'the char IS a "k" and not
> a "h" is in the *.pdf file, and quiet independant of ANY
> rendering, and gocr can correctly decode BIG font,
> should I not expect to be able to get gocr to decode
> correctly, by <filtering it through a suiatble font>?
>
> Thanks,
>
> == Chris Glur.

It sounds more like round-off problems to me. If you ever
use Acrobat Reader on a slow computer, you can see it does
two passes over the image. The second pass processes the
"hints" in the font that help normalize the rounding.

So my guess is that xpdf doesn't do "hints". And without
them, you'll need a higher resolution so the lack is
less obvious.

Another option would be to use a bitmap font. These are
hand-tuned to fit the pixels nicely at the specified size.
But of course, bitmap fonts don't scale nicely to arbitrary
sizes.

In other words: it's a big can of worms.

[toc] | [prev] | [next] | [standalone]


#406

FromHelge Blischke <h.blischke@acm.org>
Date2011-10-23 10:29 +0200
Message-ID<9gi1itF8diU1@mid.individual.net>
In reply to#404
no.top.post@gmail.com wrote:

> By using gocr on:
> http://www.cogsci.rpi.edu/~rsun/sun.clarion2005.pdf
> I've been trying to extract the ASCII.
> 
> So far, using:
> pdftoppm -f 13 -l 13 -r 300 sun.clarion2005.pdf | gocr -o ppm13.300
> gives the best Optical Character recognition results.
> But it sees "k" as "h".
> 
> What confuses me, is that when I view with xpdf, the text
> looks as if it was printed by a bad-condition 1950 typewriter.
> 
> I especially remember "2004" where the 'bottoms' were
> badly un-aligned. But if I set xpdf to 'magnify' a section of
> the text, it looks clean, and of course gocr decodes perfectly.
> 
> I don't know exactly how the rendering works, but imagine
> that if the 'normal size' uses a bad quality font, and the
> magnified version uses a good quality font, that could
> explain what I'm seeing.
> 
> Since the information that 'the char IS a "k" and not
> a "h" is in the *.pdf file, and quiet independant of ANY
> rendering, and gocr can correctly decode BIG font,
> should I not expect to be able to get gocr to decode
> correctly, by <filtering it through a suiatble font>?
> 
> Thanks,
> 
> == Chris Glur.

If you look at the PDF properties, you'll recognize that the fonts used are 
bitmapped type3 fonts (in a fairly high resolution, though). That leads to 
degraded rendering whenever recalculation of the bitmaps is required due to 
the different resolution of the canvas.

Helge

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.postscript


csiph-web