title: Convert a byte arry to OpenCV image in C++
body: <p>I have a byte array that represents a .jpg file that I want to convert directly to an OpenCV Mat object.</p>
  
  <p>I have something like</p>
  
  <pre><code>byte* data; // Represents a JPG that I don't want to disk and then read.
  // What goes here to end up with the following line?
  cv::Mat* image_representing_the_data;
  </code></pre>