如何在python中的帧上实时显示人脸检测?

时间:2019-08-18 07:05:47

标签: python python-3.x face-detection face-recognition

我已经使用OpenCV在python中进行人脸检测, 我想在红色的帧上添加实时(AM和PM)

1 个答案:

答案 0 :(得分:1)

获取当前日期和时间

import datetime
now = datetime.datetime.now()

在框架中添加文本矩形

# Draw a rectangle around the text
ori = cv2.rectangle(img,(10,180), (500,300), (0,0,255), 4)
font = cv2.FONT_HERSHEY_SIMPLEX
cv2.putText(ori,'Put-Your-Format-Here',(30,256), font, 2.5,(255,255,255),2,cv2.LINE_AA)