Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Upper body detection not working in all examples with OpenCV 3.1

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: 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) Result with HAAR facecascade

Does anyone have an idea what can be the issue here?

Upper body detection not working in all examples with OpenCV 3.1

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: Result: no upper bodies detected

Using haarcascade_upperbody.xml haarcascade _mcs_upperbody.xml also yields NO detection.

When other haarcascades (eye, nose, mouth, face_default) are used, detection works fine. (Similar (And similar code using a webcam stream shows the same behaviour) Result with HAAR facecascade

Does anyone have an idea what can be the issue here?

Upper body detection not working in all examples with OpenCV 3.1

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: Result: no upper bodies detected

Using haarcascade _mcs_upperbody.xml also yields NO detection.

When other haarcascades (eye, nose, mouth, face_default) are used, detection works fine. (And similar code using a webcam stream shows the same behaviour) Result with HAAR facecascade

Does anyone have an idea what can be the issue here?

OpenCV 3.1 - Upper body detection not working in all examples with OpenCV 3.1any example

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)
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: Result: no upper bodies detected

Using haarcascade _mcs_upperbody.xml also yields NO detection.

When other haarcascades (eye, nose, mouth, face_default) are used, detection works fine. (And similar code using a webcam stream shows the same behaviour) Result with HAAR facecascade

Does anyone have an idea what can be the issue here?

OpenCV 3.1 - Upper body detection not working in any example

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

  • Numpy 11.1.0 x86
  • Eclipse x86
  • Windows 7 x64

(I tried with all x64 version but upperbodies remain undetected)

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)
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: Result: no upper bodies detected

Using haarcascade _mcs_upperbody.xml also yields NO detection.

When other haarcascades (eye, nose, mouth, face_default) are used, detection works fine. (And similar code using a webcam stream shows the same behaviour) Result with HAAR facecascade

Does anyone have an idea what can be the issue here?