Measure how Straight/Smooth the Borders are Rendered in an Image I have two images:





I want to measure how straight/smooth the text borders are rendered. 

First image is rendered perfectly straight, so it deserves a quality measure 1. On the other hand, the second image is rendered with a lot of varied curves (rough in a way) that is why it deserves a quality measure less than 1. How will I measure it using image processing or any Python function or any function written in other languages?

Clarification :

There are font styles that are rendered originally with straight strokes but there are also font styles that are rendered smoothly just like the cursive font styles. What I'm really after is to differentiate the text border surface roughness of the characters by giving it a quality measure.

I want to measure how straight/smooth the text borders are rendered in an image. Inversely, it can also be said that I want to measure how rough the text borders are rendered in an image.
I'd try a very "tinkery" approach here:


Erode the image, so that the black area is shrunk by a fixed radius of pixels from its border (say, 5px).
Dilate the resulting image by the same amount
measure the amount of difference between original and processed image.


The idea is that something that is a locally convex border doesn't suffer through erosion (it's only shrunk) significantly, and that this erosion can be reverted by dilatation.