title: How can I permute dimensions in cv::Mat from CxWxH to WxHxC?
body: <p>How can I permute dimensions in cv::Mat from CxWxH to WxHxC (Width x Height x Channels)?</p>
  
  <p>I.e. how can I convert Mat:</p>
  
  <ul>
  <li><p>from <code>cv::Mat frame (1000, 1000, CV_8UC3) = cv::imread("image.jpg", -1);</code></p>
  
  <p>with dimesions: <strong>channels, width, height</strong></p></li>
  <li><p>to Mat with dimesions: <strong>width, height, channels</strong>
  <code>
  int sizes_inputs[] = { 3, 1000, 1000 };
  cv::Mat out_image(3, sizes_inputs, CV_8UC);
  </code></p></li>
  </ul>
  
  <p>Is there in OpenCV a ready-made fast function for such a conversion? Or should I implement this algorithm myself?</p>