Search code examples
pythonpython-3.xface-detectionface-recognition

How to show real-time in face detection on a frame in python?


I have made face detection in python using OpenCV, I want to add real-time (AM and PM ) on a frame in red colour


Solution

  • To get current date and time

    import datetime
    now = datetime.datetime.now()
    

    Add a text rectangle in Frame

    # 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)