title: Changing cv::Mat with image copied from buffer affects original image
body: <p>I have image buffer in 24bit RGB format. This buffer is copied to cv::Mat using</p>
  
  <pre><code>cv::Mat mat = cv::Mat(image-&gt;height, image-&gt;width, CV_8UC3, image-&gt;data);
  </code></pre>
  
  <p>Since this buffer is in RGB format and OpenCV uses BGR format, I'm converting <code>mat</code>to BGR with</p>
  
  <pre><code>cv::cvtColor(mat, mat, CV_RGB2BGR);
  </code></pre>
  
  <p>This works, but when I check original image its channels are inverted as well (and so they become wrong) and I don't want this to happen.</p>
  
  <p>I'd like to invert <code>mat</code> channels order leaving <code>image-data</code> (my image buffer) untouched. How can I do that?</p>