Ask Your Question

Sasha's profile - activity

2017-11-13 13:22:31 -0600 marked best answer What am I doing wrong?

Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.

import cv2
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
img = cv2.imread('D:/14801853607540.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)

Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
cv2.error: D:\Build\OpenCV\opencv-3.3.0\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale
2017-11-13 13:22:31 -0600 received badge  Scholar (source)
2017-11-13 12:26:38 -0600 commented question What am I doing wrong?

I just pointed to the full path to 'haarcascade_frontalface_default.xml', and it worked. I am stupid. Thank you kind man

2017-11-13 11:32:40 -0600 asked a question What am I doing wrong?

What am I doing wrong? Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type