title: C++ openCV mat initialization
body: <p>I am completely new to OpenCV and I'm trying to initialize two <code>cv::Mat</code> matrices from two different type of data. One is simple one-channel array of <code>uint16_t</code> gray values, second should hold RGB values from array of <code>uint8_t</code> values holding RGB 565 (each pixel occupy 2 <code>uint8_t</code>, so it's basically array of <code>uint16_t</code>). I'd like to have one single-chanell matrix, and one 3-chanell matrix (which will probably be converted to one chanelly sometime... but I'm not quite there yet.</p>
  
  <pre><code>function(uint16_t *oneChanell, int oneChanellWidth, int oneChanellHeight, uint8_t *rgb, int rgbWidth, int rgbHeight){
  ...
      cv::Mat M1 = cv::Mat(oneChanellHeight, oneChanellWidth, CV_16UC1, oneChanell);
      cv::Mat M2 = cv::Mat(rgbHeight, rgbWidth, CV_16UC3, rgb);
  ...
  }
  </code></pre>
  
  <p>Now, I am aware that the second initialization is wrong. So that is one part of my question, how to best convert array of rgb565values to <code>cv::Mat</code>.
  In my understanding however, the first initialization should work. When tested with <code>cv::imwrite()</code>, the first yields just blank white picture of correct size, the second three partially overlapping silhouettes of the same (correct) picture, but not in RGB. Any advice would be appreciated.</p>