title: OpenCV: Passing a matrix as an optional argument
body: <p>I would like to know how to pass a matrix as an optional argument in a function. If the argument is not given, then it is set to be an identity matrix.</p>
  
  <p>If I do something like</p>
  
  <pre><code>Mat function(const Mat &amp;I, Mat &amp;matrix=Mat::eye(2, 3, CV_32F))
  {
      /// some code
  
      return matrix;
  }
  </code></pre>
  
  <p>then I get the following error:</p>
  
  <blockquote>
    <p>error: could not convert ‘cv::Mat::eye(int, int, int)(3, 5)’ from
    ‘cv::MatExpr’ to ‘cv::Mat&amp;’</p>
  </blockquote>
  
  <p>Thanks in advance for any suggestions.</p>