title: Changing the dataype of a Mat class instance in OpenCV C++ Interface
body: <p>How can i change the datatype used in storing the pixels in a Mat class instance?</p>
  
  <p>For example after reading an image using the line below</p>
  
  <p>Mat I = imread(file,0);</p>
  
  <p>i obtain a grayscale image with pixels of type unsigned char. I want to change this to a double.</p>
  
  <p>What's the best way to do the conversion? I wasn't able to find a function to do that. </p>
  
  <p>Thanks in advance</p>