OpenCV putText函数
来源:互联网 发布:斗牛开挂软件 编辑:程序博客网 时间:2024/05/16 09:04
在Python中,putText函数常用于在图像上绘图。其原型为:
cv2.putText(img, text, org, fontFace, fontScale, color)#img – 想要打印上文字的图像#text – 想要打印的文字#org – 文字的左下角坐标#fontFace – 字体,可选的有:FONT_HERSHEY_SIMPLEX, # FONT_HERSHEY_PLAIN, FONT_HERSHEY_DUPLEX, # FONT_HERSHEY_COMPLEX, FONT_HERSHEY_TRIPLEX, # 以及 FONT_HERSHEY_SCRIPT_COMPLEX, 其中任意一种字体# 都可加上 FONT_ITALIC 使其变为斜体#fontScale – 字号#color – 颜色
下面是代码应用,具体代码将在文章最后展示。
用摄像头获取图像,并在图像上打印出 “Hello World!”。
图一:在图片上打印 “Hello World!”
Python代码:
# Author Junkun Di# Create at: 29/6/2017# Description: Get an image by using the webcamera and put text "Hello World" in the imageimport cv2cap = cv2.VideoCapture(0)while(cap.isOpened()): # read image ret, img = cap.read() # Display the text cv2.putText(img, "Hello World!", (50, 150), cv2.FONT_HERSHEY_SIMPLEX, 3, 1) # show appropriate images in windows cv2.imshow('putText', img) k = cv2.waitKey(10) if k == 27: break
阅读全文
0 0
- OpenCV putText函数
- OpenCV之putText()函数详解
- opencv中puttext()函数的使用
- opencv,cv2.putText()用法
- putText
- opencv putText图片中写文字
- OpenCV Tutorial: 繪圖(line、rectangle、circle、ellipse、polylines、putText)
- opencv 从putText()中获取像素的大小
- 利用opencv2函数putText()在图片上写文字
- puttext.c
- openCV3 cv2.putText()
- OpenCV函数
- opencv 函数
- OpenCV 函数
- opencv函数
- 【OpenCV】OpenCV的fillPoly函数
- 'putText' is not a member of 'cv'
- 繪圖(line、rectangle、circle、ellipse、polylines、putText)
- java 新IO
- git如何恢复stash save后被reset hard清空的代码
- 编写mysql函数 随机生成中文姓名
- centos7中编译安装mysql5.7
- linux升级内核及设置默认内核
- OpenCV putText函数
- CocoaPods安装过程及使用
- sugarorm与access to method denied
- POJ3465-Battle
- 文本处理工具sed
- Linux中TFTP使用详解
- the_number_of_javaer
- 中文乱码解决问题(转载)
- Python小练习