title: opencv cvtColor dtype issue(error: (-215) )
body: <p>I came across and figured out this dtype problem and hope it will be helpful for some.</p>
  
  <p>Normally we would convert color like this, which works:</p>
  
  <pre><code>img = cv2.imread("img.jpg"), 0)
  imgColor=cv2.cvtColor(img , cv2.COLOR_GRAY2BGR)
  </code></pre>
  
  <p>However sometimes you may normalize the image first:</p>
  
  <pre><code>img = cv2.imread("img.jpg"), 0)/255.
  imgColor=cv2.cvtColor(img , cv2.COLOR_GRAY2BGR)
  </code></pre>
  
  <p>It will result in this error:</p>
  
  <blockquote>
    <p>error: (-215) depth == CV_8U || depth == CV_16U || depth == CV_32F in function >cv::cvtColor</p>
  </blockquote>
  
  <p>The point is, in the former example, dtype is uint8, while in the latter it is float64.
  To correct this, add one line:</p>
  
  <pre><code>img = cv2.imread("img.jpg"), 0)/255.
  img=img.astype(numpy.float32)
  imgColor=cv2.cvtColor(img , cv2.COLOR_GRAY2BGR)
  </code></pre>