title: initUndistortRectifyMap returns empty map matrices (c++)
body: <p>I have first calibrated my cameras using the sample code in the opencv package (stereo_calib.cpp). Now I want to use this to rectify the images for stereo matching. I started out rectifying one image but i can't get it to work simply because initUndistortRectifyMap returns a map containing nothing. I can't find out what I'm doing wrong.</p>
  
  <pre><code>Mat ciml, cimr, iml, imr, imlCalibrated, imrCalibrated;
  vector&lt;KeyPoint&gt; keyl, keyr, keyInPlane, keyMatched;
  
  //-- Load Images and convert to gray scale
  string filenamel = "img/imL2.png";
  string filenamer = "img/imR2.png";
  
  ciml = imread(filenamel, 0);
  cvtColor(iml, ciml, CV_GRAY2BGR);
  cimr = imread(filenamer, 0);
  cvtColor(imr, cimr, CV_GRAY2BGR);
  Size imageSize = iml.size();
  
  //-- Load calibration matrices
  FileStorage fs_in, fs_ex;
  fs_in.open( "intrinsics.yml", FileStorage::READ );
  fs_ex.open( "extrinsics.yml", FileStorage::READ );
  Mat rmap[2][2], cameraMatL, cameraMatR, coeffMatL, coeffMatR, R1, R2, P1, P2;
  fs_ex["R1"] &gt;&gt; R1;  fs_ex["R2"] &gt;&gt; R2;
  fs_ex["P1"] &gt;&gt; P1;  fs_ex["P2"] &gt;&gt; P2;
  fs_in["M1"] &gt;&gt; cameraMatL;  fs_in["M2"] &gt;&gt; cameraMatR;
  fs_in["D1"] &gt;&gt; coeffMatL;   fs_in["D2"] &gt;&gt; coeffMatR;
  cout &lt;&lt; "camera Matrix: " &lt;&lt; endl &lt;&lt; cameraMatL &lt;&lt; endl &lt;&lt; endl;
  
  //-- Find remap values
  initUndistortRectifyMap(cameraMatL, coeffMatL, R1, P1, imageSize, CV_16SC2, rmap[0][0], rmap[0][1]);
  initUndistortRectifyMap(cameraMatR, coeffMatR, R2, P2, imageSize, CV_16SC2, rmap[1][0], rmap[1][1]);
  </code></pre>
  
  <p>ANSWER:
  It was very simple since the images didn't load the image size was zero and so the map was an empty matrix.
  Will post answer as soon as I can.</p>