0
import numpy as np
import cv2
from matplotlib import pyplot as plt
%matplotlib inline

img=cv2.imread('./test_images/test1.jpg')
gray=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

face_cascade=cv2.CascadeClassifier('./opencv/haarcascade_frontalface_default.xml')

faces = face_cascade.detectMultiScale(gray, 1.3, 5)
faces

error ipython-input-9-a9e6253a492b> in ----> 1 faces = face_cascade.detectMultiScale(gray, 1.3, 5) 2 faces

error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-71670poj\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'

  • Hi RISHABH, Welcome to SO. As I can see your question is mostly code, can you please add some details like 'what are you trying to do?', 'what did you try?' and 'what went wrong?'. Also format the errors properly. – Aniket Tiratkar Nov 13 '20 at 13:18
  • hi Aniket, I was actually trying to implementing a image classification model using open_cv and is haar classification methods. i was just starting to use the haarcascade_frontalface_deafult.xml .While on calling it on detecting Multiscale i got an errror which probably says that file is not found. Although file is saved in the the right folder. i wonder if it's because of the wrong open_cv version or something wrong with my jupyter notebook – RISHABH JAIN Nov 15 '20 at 08:10
  • I get your problem. Please add that description to your question and format error messages properly (You can format it like code). Doing this will improve your question quality and you'll have better chances of getting a good answer. For more guidance, read this https://stackoverflow.com/help/how-to-ask – Aniket Tiratkar Nov 15 '20 at 12:19

0 Answers0