title: Image transformation matrix in opencv
body: <p>I'm currently working on this <a href="https://code.ros.org/trac/opencv/browser/trunk/opencv/samples/cpp/descriptor_extractor_matcher.cpp" rel="nofollow">[opencv sample]</a></p>
  
  <p>The interesting part is at line 89 warpPerspectiveRand method. I want to set the rotation angle, translation, scaling and other transformation values manually instead of using random generated values. But I don't know how to calculate the matrix elements.</p>
  
  <p>A simple calculation example would be helpful.
  Thanks</p>