title: error: C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:11111: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
body: <p>i  have followed a tutorial on creating a training set to recognize a face 
  here is the code</p>
  
  <pre><code>import cv2
  import numpy as np
  
  # Load HAAR face classifier
  face_classifier = cv2.CascadeClassifier('Haarcascades/haarcascade_frontalface_default.xml')
  
  # Load functions
  def face_extractor(img):
      # Function detects faces and returns the cropped face
      # If no face detected, it returns the input image
  
      gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
      faces = face_classifier.detectMultiScale(gray, 1.3, 5)
  
      if faces is ():
          return None
  
      # Crop all faces found
      for (x,y,w,h) in faces:
          cropped_face = img[y:y+h, x:x+w]
  
      return cropped_face
  
  # Initialize Webcam
  cap = cv2.VideoCapture(0)
  count = 0
  
  # Collect 100 samples of your face from webcam input
  while True:
  
      ret, frame = cap.read()
      if face_extractor(frame) is not None:
          count += 1
          face = cv2.resize(face_extractor(frame), (200, 200))
          face = cv2.cvtColor(face, cv2.COLOR_BGR2GRAY)
  
          # Save file in specified directory with unique name
          file_name_path = r'C:\Users\madhumani\path\\' + str(count) + '.jpg'
          cv2.imwrite(file_name_path, face)
  
          # Put count on images and display live count
          cv2.putText(face, str(count), (50, 50), cv2.FONT_HERSHEY_COMPLEX, 1, (0,255,0), 2)
          cv2.imshow('Face Cropper', face)
  
      else:
          print("Face not found")
          pass
  
      if cv2.waitKey(1) == 13 or count == 100: #13 is the Enter Key
          break
  
  cap.release()
  cv2.destroyAllWindows()      
  print("Collecting Samples Complete")
  </code></pre>
  
  <p>and whenever i tried to run this code in my jupyter notebook i have got this error</p>
  
  <pre><code>error: C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:11111: error: (-215) scn == 3 || scn == 4 in function cv::cvtColor
  </code></pre>
  
  <p>and tried to figure out the issue by searching this over stackoverflow and all other sites even after searching i couldnt understand the reason  behind this issue 
  here is the commplete traceback of the error
  error                                 </p>
  
  <pre><code>    Traceback (most recent call last)
  &lt;ipython-input-13-6aa561124bc3&gt; in &lt;module&gt;()
       30 
       31     ret, frame = cap.read()
  ---&gt; 32     if face_extractor(frame) is not None:
       33         count += 1
       34         face = cv2.resize(face_extractor(frame), (200, 200))
  
  &lt;ipython-input-13-6aa561124bc3&gt; in face_extractor(img)
       11 
       12     gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  ---&gt; 13     faces = face_classifier.detectMultiScale(gray, 1.3, 5)
       14 
       15     if faces is ():
  </code></pre>
  
  <p>and i have tried adding 2.4.13 v dll files in the python  root directory as well as added them to the environment variable but still its of no use </p>