I am experiencing issues in detecting human body with default “haarcascade_fullbody.xml” in python, i need this for my school project on raspberry pi. This code “kinda” works, however its not very good at recognizing humans. I really need light code which can detect humans efficiently, i am new in opencv, however i know python pretty good
import cv2
body=cv2.CascadeClassifier('haarcascade_fullbody.xml')
cap = cv2.VideoCapture(0)
cap.set(3,1280)
cap.set(4,720)
while True:
ret, img = cap.read()
detection=body.detectMultiScale(img,scaleFactor=1.5,minSize=(50,50))
for (x,y,w,h) in detection:
cv2.rectangle(img,(x,y),(x+w,y+h),(0,0,255),2)
cv2.imshow('Capture', img)
cap.release()