dimanche 1 septembre 2019

Is there a way to detect if a loop has stopped in python

I am trying to detect when my loop has stopped so that i could use an if statement saying: if "the loop has stopped": print(text)

Code:

faces = detector(gray)

for face in faces:

    x, y = face.left(), face.top()
    x1, y1 = face.right(), face.bottom()
    rectangle = cv2.rectangle(frame, (x, y), (x1, y1), (0, 255, 0), 2)

    if "the loop has stopped":
        cv2.putText(frame, "Asleep", (50, 150), font, 7, (0, 0, 255))

Aucun commentaire:

Enregistrer un commentaire