title: What is the best way to use the OpenCV library in conjunction with the Armadillo library?
body: <p>I am building an image processing application using OpenCV. I am also using the Armadillo library because it has some very neat matrix related functions. The thing is though, in order to use Armadillo functions on cv::Mat I need frequent conversions from cv::Mat to arma::Mat .
  To accomplish this I convert the cv::Mat to an arma::Mat using a function like this</p>
  
  <pre><code>arma::Mat cvMat2armaMat(cv::Mat M)
  {
      copy cv::Mat data to a arma::Mat
      return arma::Mat
  }
  </code></pre>
  
  <p>Is there a more efficient way of doing this?</p>