In the below code,
faces = face_cascade.detectMultiScale(gray_frame,1.3,5). why we are passing gray_frame ? opencv is able to make rectangle if I am passing frame (colored) here and what is the last argument (2) which we are passing in cv2.rectangle function?
Haarcascades classifer implementation doubt
hey @Mohit2000 ,
by default these haarcascades are trained on gray scale images , hence it is recommended to use them on gray scale images for better results. It will work on coloured images too , but results might vary.
It is the width of the line used to make a rectangle.
I hope this helped.
Okay. when i am closing the video stream by pressing the ‘q’ key, command prompt is showing that module ‘cv2.cv2’ has no attribute ‘release’
you might have done something like
v = cv2.VideoCapture()
so try doing
v.release()
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.