human detection using python-opencv [closed]
I want to detect the movement of a person using:
bodydetection = cv2.CascadeClassifier('cascades/haarcascade_fullbody.xml')
but I think I am missing something.
import numpy as np
import sys
import cv2
body_cascade = cv2.CascadeClassifier('cascades/haarcascade_upperbody.xml')
img = cv2.imread('body/body4.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = body_cascade .detectMultiScale(gray, 1.1, 8)
for (x,y,w,h) in faces:
cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)
roi_gray = gray[y:y+h, x:x+w]
roi_color = img[y:y+h, x:x+w]
please try again in english.
thanks, alberto ;)
@Ezequiel1904 -- and the problem is ?
I guess he want to track the movement after detection. Look at this here https://docs.opencv.org/3.4.1/d2/d0a/... And be more precise in you question pls - ser más preciso :-)