affine transform followed by translation understanding

I’ve been trying affine transform with translation. There are a few things I noticed while using them. It might be due to my limited understanding of the subject matter. Any help is highly appreciated. The notebook with the required transformations is here.

Following transformations have been done:

  1. Affine transform and translation
  2. Only affine transform
  3. Translation of output of step 2

The output of step 1 and 3 are the same although the parameters are different:
Affine parameters used in step 1 are (1.0956889234034184, -0.3093362626712529, -0.309336262671253, 1.0) and translation parameters are (-59.62704975761403, -211.33296716609343).

Same affine parameters have been used in step 2.

In step 3, the resampled image from step 2 is translated using the parameters (-125.0, -250.0). I’m not able to understand why the results are same. According to my understanding, translation using (-125.0, -250.0) in step 1 should be same as step 3, but this is not the case. I hope someone can help me on this.

Hello @prms,

The issue you are seeing is because what you are doing is not a composition of two transformations. You are resampling with one transformation and then resampling again. When you resample the first time you are transforming the original set of points with a shear, then to get the same translational effect you need to translate by shear_transform.TransformPoint(translation1) .