Skip to content

Commit c23350f

Browse files
Add files via upload
1 parent 3a335de commit c23350f

File tree

3 files changed

+17059
-0
lines changed

3 files changed

+17059
-0
lines changed

Pedestrian_detection.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import cv2
2+
3+
cap = cv2.VideoCapture('in.avi')
4+
5+
6+
human_cascade = cv2.CascadeClassifier('haarcascade_fullbody.xml')
7+
8+
9+
while(True):
10+
# Capture frame-by-frame
11+
ret, frame = cap.read()
12+
13+
# Our operations on the frame come here
14+
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
15+
humans = human_cascade.detectMultiScale(gray, 1.9, 1)
16+
17+
# Display the resulting frame
18+
for (x,y,w,h) in humans:
19+
cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2)
20+
21+
22+
23+
cv2.imshow('frame',frame)
24+
if cv2.waitKey(1) & 0xFF == ord('q'):
25+
break
26+
27+
# When everything done, release the capture
28+
cap.release()
29+
cv2.destroyAllWindows()

0 commit comments

Comments
 (0)