Load TrueType Font to OpenCV

后端 未结 3 1221
长情又很酷
长情又很酷 2020-12-05 11:35

Can we load a custom TrueType font and use it with cv2.putText function ?

font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(img,\'OpenCV\',(10,500), f         


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-05 11:49

    For new viewers, OpenCV supports custom fonts since OpenCV 3.0.0 via the FreeType2 class. See here some nice sample code: https://docs.opencv.org/4.1.1/d9/dfa/classcv_1_1freetype_1_1FreeType2.html

提交回复
热议问题