My problem: no upper bodies are being detected when using haarcascade_profileface.xml or haarcascade_mcs_profileface.xml.
Software used:
print cv2._ _version__ yields 3.0.0 although the x86 version (cv2.pyd) of OpenCV 3.1 is used
Python 2.7 x86
- Eclipse x86
- Windows 7 x64
The following code is used:
import numpy as np
import cv2
img = cv2.imread('723.jpg',0)
upperBody_cascade = cv2.CascadeClassifier('haarcascade_upperbody.xml')
arrUpperBody = upperBody_cascade.detectMultiScale(img)
print arrUpperBody
if arrUpperBody != ():
for (x,y,w,h) in arrUpperBody:
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
print 'body found'
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Result: no upper bodies detected:
Using haarcascade_upperbody.xml also yields NO detection. When other haarcascades (eye, nose, mouth, face_default) are used, detection works fine. (Similar code using a webcam stream shows the same behaviour)
Does anyone have an idea what can be the issue here?