how do we interpret the "baseline" output of cv2.getTextSize?


If I do this for example:
cv2.getTextSize('blahblah', cv2.FONT_HERSHEY_SIMPLEX, 2, 2)
it returns ((262, 43), 19)

so the width and height of the text in pixels are 262 and 43, but what is the 19?

Here it says it "corresponds to the y coordinate of the baseline relative to the bottom of the text" but this still doesn’t make it clear to me, as I’m not sure what the "baseline" is here?

Asked By: Ryan



The baseline here is the yellow line in the figure on page 124. It is the line on which the letters sit. That is according to

Pay attention to how the three little points (red,cyan, and green) are drawn and also to how the yellow baseline is shown.

enter image description here

Answered By: Benjamin W.
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.