title: Error (-215) while performing CLAHE on images with python
body: <p>The following is the code i had entered in the Spyder Environment :</p>
  
  <pre><code>import os 
  import cv2
  import numpy as np
  path1="E:\\academic\\FINAL YR PROJ\\PROJECT_DATASETS\\floyd_jan\\dr"
  path2="E:\\academic\\FINAL YR PROJ\\PROJECT_DATASETS\\floyd_jan\\greendr"
  names=[]
  names=os.listdir(path1)
  for i in names:
   bgr = cv2.imread(path1+"\\"+i,1)
   green = bgr[: , : , 1]
   lab = cv2.cvtColor(green, cv2.COLOR_BGR2LAB)
   lab_planes = cv2.split(lab)
   clahe = cv2.createCLAHE(clipLimit=2.0,tileGridSize=(8,8))
  
   lab_planes[0] = clahe.apply(lab_planes[0])
   lab = cv2.merge(lab_planes)
   bgr = cv2.cvtColor(lab, cv2.COLOR_LAB2BGR)
   cv2.imwrite(path2+"\\"+i,bgr)
  </code></pre>
  
  <p>I am getting the following error on running the code :</p>
  
  <blockquote>
    <p>Traceback (most recent call last):</p>
    
    <p>File "", line 8, in 
        lab = cv2.cvtColor(green, cv2.COLOR_BGR2LAB)</p>
    
    <p>error:
    C:\projects\opencv-python\opencv\modules\imgproc\src\color.cpp:10724:
    error: (-215) (scn == 3 || scn == 4) &amp;&amp; (depth == CV_8U || depth ==
    CV_32F) in function cv::cvtColor</p>
  </blockquote>
  
  <p>Unable to figure out the solution!</p>