0

I would like to extract the font size of strings in images.

Here is an example image:

Example image

Output should be for example:

"Percentage of total music sales by method" -> 12pt

"Streams" -> 10pt

How can I achieve this?

tesserocr seemed to have provided something like this, but is no longer supported / provided, see:

get Font Size in Python with Tesseract and Pyocr

Cheers

  • do you deal with jpeg images as input? – samusa Aug 25 '22 at 14:52
  • yes jpeg and png – bananaconda Aug 25 '22 at 14:59
  • You may want to start with "how do I detect regions of text in images" first, before you worry about figuring out how many lines there are and what that means in terms of x-height and baseline spacing. (and of course: that's something to google/search SO for, image analysis using opencv is kind of the gold standard in this case and there are plenty of tutorials that teach you how to use it) – Mike 'Pomax' Kamermans Aug 25 '22 at 19:11

0 Answers0