title: Opencv error -Unsupported depth of input image:
body: <p>I am trying to convert a normalised RGB image to HSV or LAB colour space. 
  Here is the normalisation function:<a href="https://i.stack.imgur.com/1R54v.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1R54v.png" alt="enter image description here"></a></p>
  
  <p>here is the basic code </p>
  
  <pre><code>print ('original image shape: ', image.shape)
  print ('normlaised image shape: ', needed_multi_channel_img.shape)
  # Converting to LAB color space
  
  
  lab_image = cv.cvtColor(needed_multi_channel_img, cv.COLOR_RGB2HSV)
  
  cv.imshow('Lab_space.jpg',lab_image.astype('float32'))
  cv.waitKey(0)
  cv.destroyAllWindows()
  </code></pre>
  
  <p>Here is the output trace:</p>
  
  <pre><code>    /home/centura/gitlab/Acne_model/Acne Model/rosaceaexperiment1.py:82: RuntimeWarning: invalid value encountered in true_divide
    norm.append(image[i,j,a]/rooted_matrix[i,j])
  /home/centura/gitlab/Acne_model/Acne Model/rosaceaexperiment1.py:82: RuntimeWarning: divide by zero encountered in true_divide
    norm.append(image[i,j,a]/rooted_matrix[i,j])
  original image shape:  (375, 600, 3)
  normlaised image shape:  (375, 600, 3)
  Traceback (most recent call last):
    File "/home/centura/gitlab/Acne_model/Acne Model/rosaceaexperiment1.py", line 121, in &lt;module&gt;
      lab_image = cv.cvtColor(needed_multi_channel_img, cv.COLOR_RGB2HSV)
  cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/color.hpp:257: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;3, 4&gt;; VDcn = cv::Set&lt;3&gt;; VDepth = cv::Set&lt;0, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
  &gt; Unsupported depth of input image:
  &gt;     'VDepth::contains(depth)'
  &gt; where
  &gt;     'depth' is 6 (CV_64F)
  </code></pre>
  
  <p>For zero division error, I have replaced it with 0 and nan is also replaced with 0.</p>
  
  <p>I also searched through StackOverflow but could not find any information to debug it.
  I do not understand the meaning of this error and how to rectify it.</p>