Tuesday, 23 February 2021

How to find the font size in Python from an image?

I am currently trying to find out how I can find out the font size from an image, using tesseract ocr or maybe something else within Python.

My current image here: Image 1. Within the image, at the top I know for certain it is a font 6 and the bottom is font 7.

I am starting out a side project of scanning the image and seeing if it has a minimum legal font requirement (which is a font 7).

How can I determine whether all text within the image is at font 7 and not below 7?

Here is what I'm thinking to do:

legal_font = 7

if legal_font > 6:
    print("Illegal")
else:
    print("Legal")

the number 6 is the one that will wary, due to loads of text around the image.



from How to find the font size in Python from an image?

No comments:

Post a Comment