title: Opencv Mat as parameter of a function
body: <p>I have a trouble now with opencv Mat.</p>
  
  <p>Here's a function</p>
  
  <pre><code>void getMat(Mat a){
  
     double b[3]={1,2,3};
  
     a=Mat(3,1,CV_64FC1,b);
  
  }
  </code></pre>
  
  <p>When I use the function in main</p>
  
  <pre><code>Mat mat(3,1,CV_64FC1);
  
  getMat(mat);
  </code></pre>
  
  <p>but the result of mat is</p>
  
  <pre><code>[-9.255963134931783e+61;
    -9.255963134931783e+61;
    -9.255963134931783e+61]
  </code></pre>
  
  <p>so could someone help me out of the problem?</p>
  
  <p>Thanks very much</p>
  
  <p>Best</p>
  
  <p>Jing</p>