title: Creating a Mat object from a YV12 image buffer
body: <p>I have a buffer which contains an image in <strong>YV12</strong> format. Now I want to either convert this buffer to <strong>RGB</strong> format or create a Mat object from it directly! Can someone help me? I tried this code : </p>
  
  <pre><code>cv::Mat input(widthOfImg, heightOfImg, CV_8UC1, vy12Buffer);
  cv::Mat converted;
  cv::cvtColor(input, converted, CV_YUV2RGB_YV12);
  </code></pre>