import cv2
cap = cv2.VideoCapture(‘data/zuqiu.mp4‘)
while cap.isOpened():
ret, frame = cap.read()
# 显示文字:图片,文字,位置,字体类型,字体大小,字体颜色,字体粗细
cv2.putText(frame, "foot ball", (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2)
cv2.imshow(‘frame‘, frame)
if cv2.waitKey(1) & 0xFF == ord(‘q‘):
break
cap.release()
cv2.destroyAllWindows()
查看更多关于Python+opencv显示文字的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did171832