title: Affine Transformation Matrix
body: <p>I'm trying to perform image stabilization on a set of images. I have identified matching pairs of corner points in each image and am trying to calculate the affine transformation matrix for each set of matching pairs (source vs. destination). When I do this, though, using a least squares method, the resulting transformation matrix produces images that are not stabilized. I am following this process:</p>
  
  <pre><code>source_points = [[219, 187], [221, 387], [347, 31], [135, 311], [296, 615], [86, 417]]
  dst_points = [[221, 187], [222, 387], [348, 30], [137, 310], [299, 615], [88, 417]]
  
  transform_mat, res, rank, s = np.linalg.lstsq(source_points, dst_points)
  
  #looping through all dst_coordinates in a blank array of size = source image
  transformed_coor = np.dot(transform_mat,dst_coordinate)
  </code></pre>
  
  <p>After looping through the coordinates in the blank array, I grab the interpolated value of the transformed_coor from the source image and place that value at the dst_coordinate in the blank array. When the process completes I get a transformed image but it is not stabilized when I compare it with the source image.</p>
  
  <p>Is this process correct? Am I missing a step?</p>