title: OpenCV - store camera matrix and distortion coefficients as Mat
body: <p>I've used the sample OpenCV program to calculate the camera matrix and distortion coefficients from my camera and produced an xml file with the relevant data.</p>
  
  <p>I'm trying to use it through the <code>undistort</code> function but I'm not sure how to store the values as a <code>Mat</code>.</p>
  
  <pre><code>Mat cameraMatrix;
  Mat distortionCoefficients;
  undistort(image, newImage, cameraMatrix, distortionCoefficients);
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>Mat cameraMatrix = 1.7514028018776246e+03 0. 1.2635000000000000e+03 0. 1.7514028018776246e+03 9.2750000000000000e+02 0. 0. 1.;
  Mat distortionCoefficients = 1.3287735059062630e-01 -6.8376776294978103e-01 0. 0. 8.1215478360827675e-01;
  </code></pre>
  
  <p>Do I need to try and specify a series of rows and columns to the <code>Mat</code> var and then assign each value an index?</p>