Skip to content

DPI and you?

I have been experimenting with tasseract and occasionally get really terrible results when I know I should not. When I grab the images, change the dpi aka save them at a different resolution I get great results.

Tasseract wants 300 dpi. when I google dpi of digital images or how to change dpi on android most of the information is along the lines of “you dont want dpi, you dont know what you are talking about, your life is a lie and nobody cares about you”. So what is going on here?

Maybe some more details from Tasseract will help:

Is there a Minimum Text Size? (It won’t read screen text!)
There is a minimum text size for reasonable accuracy. You have to consider resolution as well as point size. Accuracy drops off below 10pt x 300dpi, rapidly below 8pt x 300dpi. A quick check is to count the pixels of the x-height of your characters. (X-height is the height of the lower case x.) At 10pt x 300dpi x-heights are typically about 20 pixels, although this can vary dramatically from font to font. Below an x-height of 10 pixels, you have very little chance of accurate results, and below about 8 pixels, most of the text will be “noise removed”.

So it looks like they want the letters to be within a certain range of pixels tall. They only give minimum pixels here, around 20 pixels minimum. But I believe there is also a maximum pixel height they will look for. In my previous post ‘tesseract’ small unclear text was picked up reliably but large very clear text was ignored. From what I can find on google it does not appear there is a configured maximum but a algorithm that tries to determine it based on picture height.

My current image is 115 x 59 and the text is about 1/3 of that height or about 19 to 20 pixels high. It seems silly to my that doubling the pixels in the picture with no quality improvement would yield better results but I guess I can give it a try.

So my next steps will be

  1. Make sure my text is above the minimum pixel xheight by a safe margin
  2. study up more on the max height algorithm. maybe I just need to zoom out?

Post a Comment

Your email is never published nor shared. Required fields are marked *