对python opencv 添加文字 cv2.putText 的各参数介绍
如下所示:
cv2.puttext(img, str(i), (123,456)), font, 2, (0,255,0), 3)
各参数依次是:图片,添加的文字,左上角坐标,字体,字体大小,颜色,字体粗细
其中字体可以选择
font_hershey_simplex
python: cv.font_hershey_simplex
normal size sans-serif font
font_hershey_plain
python: cv.font_hershey_plain
small size sans-serif font
font_hershey_duplex
python: cv.font_hershey_duplex
normal size sans-serif font (more complex than font_hershey_simplex)
font_hershey_complex
python: cv.font_hershey_complex
normal size serif font
font_hershey_triplex
python: cv.font_hershey_triplex
normal size serif font (more complex than font_hershey_complex)
font_hershey_complex_small
python: cv.font_hershey_complex_small
smaller version of font_hershey_complex
font_hershey_script_simplex
python: cv.font_hershey_script_simplex
hand-writing style font
font_hershey_script_complex
python: cv.font_hershey_script_complex
more complex variant of font_hershey_script_simplex
font_italic
python: cv.font_italic
flag for italic font
字体大小,数值越大,字体越大
字体粗细,越大越粗,数值表示线占有直径像素个数
void cv::puttext( inputoutputarray img, const string & text, point org, int fontface, double fontscale, scalar color, int thickness = 1, int linetype = line_8, bool bottomleftorigin = false ) python: img =cv.puttext(img, text, org, fontface,fontscale, color[, thickness[, linetype[, bottomleftorigin]]])
以上这篇对python opencv 添加文字 cv2.puttext 的各参数介绍就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。
上一篇: Androidstudio 动态申请权限