title: OpenCV: get perspective matrix from translation & rotation
body: <p>I'm trying to verify my camera calibration, so I'd like to rectify the calibration images.  I expect that this will involve using a call to <code>warpPerspective</code> but I do not see an obvious function that takes the camera matrix, and the rotation and translation vectors to generate the perspective matrix for this call.</p>
  
  <p>Essentially I want to do the process described <a href="https://engineering.purdue.edu/kak/courses-i-teach/ECE661.08/solution/hw2_s2.pdf" rel="nofollow noreferrer">here</a> (see especially the images towards the end) but starting with a known camera model and pose.</p>
  
  <p>Is there a straightforward function call that takes the camera intrinsic and extrinsic parameters and computes the perspective matrix for use in <code>warpPerspective</code>?</p>
  
  <p>I'll be calling <code>warpPerspective</code> after having called <code>undistort</code> on the image.</p>
  
  <p>In principle, I could derive the solution by solving the system of equations defined at the top of the <a href="http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html" rel="nofollow noreferrer">opencv camera calibration documentation</a> after specifying the constraint <code>Z=0</code>, but I figure that there must be a canned routine that will allow me to orthorectify my test images.</p>
  
  <p>In my seearches, I'm finding it hard to wade through all of the stereo calibration results -- I only have one camera, but want to rectify the image under the constraint that I'm only looking a a planar test pattern.</p>