Why the window is not closing on pressing 'q' in face detection using haarcascade code?

In face detection using haarcascade , If i press ‘q’ , the window is not closing.

Make sure you have implemented the cv2.waitkey(1) & 0xff == ord(‘q’) at the right place.
If error still persists, share the code after saving it on ide.

Happy Learning :blush:

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.