Commit bce6bf52 authored by cb's avatar cb

Beginning to center Text on videos

parent 6f8f424f
......@@ -271,13 +271,16 @@ def detectAndTrackMultipleFaces():
cv2.rectangle(resultImage, (int(width-50), 0), (int(width), 120), color, -1)
if fid in faceNames.keys():
# Name's alignment
cv2.putText(resultImage, faceNames[fid] ,
(int(t_x + t_w/2), int(t_y)),
(t_x+ int((t_w - len(faceNames[fid])*10)/2 +2), int(t_y)),
cv2.FONT_HERSHEY_SIMPLEX,
0.5, (255, 255, 255), 1, cv2.LINE_AA)
else:
cv2.putText(resultImage, "Detecting..." ,
(int(t_x + t_w/2), int(t_y)),
# Detecting
text = "Identifying"
cv2.putText(resultImage, text ,
(t_x + int((t_w - len(text)*10)/2 +2), int(t_y)),
cv2.FONT_HERSHEY_SIMPLEX,
0.5, (255, 255, 255), 1, cv2.LINE_AA)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment