Traceback (most recent call last):
File “FaceDetectionUsingHaarCascades.py”, line 19, in
key_pressed=cv2.waitkey(1) & 0xFF
AttributeError: module ‘cv2.cv2’ has no attribute ‘waitkey’
[ WARN:1] terminating async callback
Cannot understand the error
Hey @sagartiwari1711, it should be cv2.waitKey(1)
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
webcam is opening and getting closed within miliseconds
i also wrote cv2.waitKey(1)
Hey @sagartiwari1711, try running this,
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.
thanks a lot it worked ,where was i wrong anyway
Hey @sagartiwari1711, sometimes frame is not captured properly so you converted it into gray first and than check if it was captured properly or not by if ret==False, i just changed the order.
Happy Learning
1 Like