title: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'
body: <p>I'm trying this sample face detection program using opencv in python.But there seems to be an error in the <code>detectMultiscale</code> function.The code is:</p>
  
  <pre><code>import cv2
  import sys
  
  imagePath = sys.argv[1]
  cascPath = "haarcascade_frontalface_default.xml"
  faceCascade = cv2.CascadeClassifier(cascPath)
  image = cv2.imread('face.jpg')
  gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
  
   faces = faceCascade.detectMultiScale(
      gray,
      scaleFactor=1.1,
      minNeighbors=5,
      minSize=(30, 30)
  
  )
  
  print("Found {0} faces!".format(len(faces)))
  
  
  for (x, y, w, h) in faces:
      cv2.rectangle(image, (x, y), (x+w, y+h), (0, 255, 0), 2)
  
  cv2.imshow("Faces found", image)
  cv2.waitKey(0)
  </code></pre>
  
  <p>This is the code.The file name being <code>main.py</code>.I placed all of the resources under <code>Myproject</code> file.When i tried running it from prompt i got this error.</p>
  
  <pre><code>C:\Myproject&gt;python main.py face.jpg
  Traceback (most recent call last):
    File "main.py", line 21, in &lt;module&gt;
      minSize=(30, 30)
  cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\objdetect\src\cascadedetect.cpp:1689: error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale'
  </code></pre>
  
  <p>Thanks for reading and help me solve this problem.</p>