OpenCV putText() new line character

Unfortunately putText doesn’t correctly handle \n symbols. See the relevant rejected pull request. You need to split your text yourself and make several putText calls, something like:

text = "This is \n some text"
y0, dy = 50, 4
for i, line in enumerate(text.split('\n')):
    y = y0 + i*dy
    cv2.putText(img, line, (50, y ), cv2.FONT_HERSHEY_SIMPLEX, 1, 2)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)