Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14011

Fullbody Detection Using OpenCV Haar Cascades

$
0
0

I want to detect the full body of human within image using OpenCV fullbody Haar Cascades. Here's my code:

import numpy as npimport cv2from matplotlib import pyplot as pltbodydetection = cv2.CascadeClassifier('cascades/haarcascade_fullbody.xml')img = cv2.imread('gambar/fullbody2.jpg')gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)body = bodydetection.detectMultiScale(gray, 1.3, 5)for (x,y,w,h) in body:   cv2.rectangle(img,(x,y),(x+w,y+h),(0,255,0),2)cv2.imshow('img',img)cv2.waitKey(0)cv2.destroyAllWindows()

Here's the result:

Result

As you can see, my code didn't detect the full body of human in the image.

By the way I'm newbie in OpenCv and this is my first question in here, so just correct me if I'm doing something wrong and I hope someone can help me to correct my code.

Sorry for bad English ;).


Viewing all articles
Browse latest Browse all 14011

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>