Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi,i am trying to execute face detection using webcam program in python

While executing the program i am getting following error:

OpenCV(3.4.1) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698 Traceback (most recent call last): File "new24.py", line 20, in <module> flags=cv2.CASCADE_SCALE_IMAGE cv2.error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win32-vc14-static\open cv\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale

What could be the reason for the error,how should i react to fix it? Thank you for your time and advise,

regards

pooja

Hi,i am trying to execute face detection using webcam program in python

While executing the program i am getting following error:

OpenCV(3.4.1) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698 Traceback (most recent call last): File "new24.py", line 20, in <module> flags=cv2.CASCADE_SCALE_IMAGE cv2.error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win32-vc14-static\open cv\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale

What could be the reason for the error,how should i react to fix it? Thank you for your time and advise,

regards

pooja

Hi,i am trying to execute face detection using webcam program in pythonOpenCV(3.4.1) Error: Assertion failed

While executing the program i am getting following error:

OpenCV(3.4.1) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698 Traceback (most recent call last): File "new24.py", line 20, in <module> flags=cv2.CASCADE_SCALE_IMAGE cv2.error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win32-vc14-static\open cv\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale

What could be the reason for the error,how should i react to fix it? Thank you for your time and advise,

regards

pooja

i am trying to execute following program

import cv2
import sys

cascPath = "C:\opencv\sources\data\haarcascades\haarcascade_frontalface_alt2.xml"
faceCascade = cv2.CascadeClassifier(cascPath)

video_capture = cv2.VideoCapture(0)

while True:
    ret, frame = video_capture.read()

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    faces = faceCascade.detectMultiScale(
        gray,
        scaleFactor=1.1,
        minNeighbors=5,
        minSize=(30, 30),
        flags=cv2.CASCADE_SCALE_IMAGE
        )
    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
    cv2.imshow('Video', frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
video_capture.release()
cv2.destroyAllWindows()

OpenCV(3.4.1) Error: Assertion failed

While executing the program i am getting following error:

OpenCV(3.4.1) Error: Assertion failed (!empty()) in cv::CascadeClassifier::detectMultiScale, file C:\build\master_winpack-bindings-win32-vc14-static\opencv\modules\objdetect\src\cascadedetect.cpp, line 1698 Traceback (most recent call last): File "new24.py", line 20, in <module> flags=cv2.CASCADE_SCALE_IMAGE cv2.error: OpenCV(3.4.1) C:\build\master_winpack-bindings-win32-vc14-static\open cv\modules\objdetect\src\cascadedetect.cpp:1698: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale

What could be the reason for the error,how should i react to fix it? Thank you for your time and advise,

regards

pooja

i am trying to execute following program

import cv2
import sys

cascPath = "C:\opencv\sources\data\haarcascades\haarcascade_frontalface_alt2.xml"
faceCascade = cv2.CascadeClassifier(cascPath)

video_capture = cv2.VideoCapture(0)

while True:
    ret, frame = video_capture.read()

    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)

    faces = faceCascade.detectMultiScale(
        gray,
        scaleFactor=1.1,
        minNeighbors=5,
        minSize=(30, 30),
        flags=cv2.CASCADE_SCALE_IMAGE
        )
    for (x, y, w, h) in faces:
        cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
    cv2.imshow('Video', frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
video_capture.release()
cv2.destroyAllWindows()