human detection using python-opencv [closed]

asked 2018-04-26 20:46:06 -0600

updated 2018-04-27 04:46:10 -0600

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]
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-11-17 04:39:07.772036

Comments

1

please try again in english.

berak gravatar imageberak ( 2018-04-27 01:12:17 -0600 )edit

thanks, alberto ;)

berak gravatar imageberak ( 2018-04-27 05:19:36 -0600 )edit

@Ezequiel1904 -- and the problem is ?

berak gravatar imageberak ( 2018-04-27 05:28:18 -0600 )edit
1

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 :-)

holger gravatar imageholger ( 2018-04-27 10:43:41 -0600 )edit