1 | initial version |
it simply never found your 'haarcascade_frontalface_default.xml'
2 | No.2 Revision |
it simply never found your 'haarcascade_frontalface_default.xml'
i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.
in this case:
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong
img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about this
stop being a noob, and check your resources, please !
3 | No.3 Revision |
it simply never found your 'haarcascade_frontalface_default.xml'
i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.
in this case:
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong
# also:
img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about this
failing to do so.
stop being a noob, and check your resources, please !
4 | No.4 Revision |
it simply never found your 'haarcascade_frontalface_default.xml'
i know, noobs NEVER follow advice, but take my one on this -- whenever you're loading something from somewhere, bloody CHECK, if it worked, or not.
in this case:
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): # you got the path wrong
# also:
img = cv2.imread('D:/14801853607540.jpg')
if img.empty(): #same sillynes. every 4th SO question is about failing to do so.
stop being a noob, and check your resources, please !