title: Combine rotation and translation in opencv, in one pass
body: <p>I have a piece of code for rotating and translating image:</p>
  
  <pre><code>Point2f pt(0, in.rows);
  double angle = atan(trans.c / trans.b) * 180 / M_PI;
  Mat r = getRotationMatrix2D(pt, -angle, 1.0);
  warpAffine(in, out, r, in.size(), interpolation); /* rotation */
  
  Mat t = (Mat_&lt;double&gt;(2, 3) &lt;&lt; 1, 0, trans.a, 0, 1, -trans.d);
  warpAffine(out, out, t, in.size(), interpolation); /* translation */
  </code></pre>
  
  <p>The problem is that I'm doing this in two times. So if I have an angle of 90degree for example, the first "out" variable will be empty because all data are out of bounds. Is there a way to do it in one pass ? In order to avoid loosing my data and having black image.</p>
  
  <p>I think that the best thing would be to combine r and t in one matrix but I'm a little lost.</p>
  
  <p>Best regards,</p>