[Insight-users] Doing Shearing by using Rotation + non-homogeneous Scaling

Luis Ibanez luis.ibanez at kitware.com
Thu Aug 11 18:50:12 EDT 2005


Hi Dennis,


Here is how you can decompose a Shearing Transform into
a combination of rotations and non-homogeneous scaling
operations:


1) Apply a 45 degrees rotation transform

      | r  -r |
      | r   r |

    where r = sqrt(2)/2


2) Apply a non-homogeneous scaling by a factor k

     | 1  0 |
     | 0  k |


3) Apply a rotation that will align the original Y
    axis with the current one


     |  k  1 |
     |       | . 1/sqrt( 1 + k^2 )
     | -1  k |


4) Correct for the differenct between the horizontal
    and vertical expansions, using another
    non-homogeneouos scaling:


     | 1/(k.sqrt(2))            0        |
     |       0         1/sqrt(2.(1+k^2)) |



This sequence of operation will be equivalent to
the shearing that you proposed:


    |   1    0  |
    |   S    1  |


  as long as we choose k to satisfy the relationship


       S = ( k^1 - 1 ) / sqrt( k^2+1)





A more elegant descripcion could be done using elements
of transformational geometry.. but unfortunately is
harder to represent it in an email.


For the intuitive support of the opreration you may
consider the analogy of taking a matrix and computing
its UL decomposition, which after all, is like applying
two shearing operations one after another.  You may
also want to consider the analogy of QR matrix
decomposition.


...The transformational geometry equivalent is still the
most elegant though...



    Regards,


       Luis


-------------------
Dennis Wenzel wrote:
> Hello Luis,
> 
>> I will be interested in seeing your counter examples that
>> indicate that non-homogeneous scaling combined with
>> rotation is not equivalent to shearing.
> 
> 
> Ok, given the following 4x4 matrix with shear_xy
> 
> | 1    0 0 0 |
> | s_xy 1 0 0 |
> | 0    0 1 0 |
> | 0    0 0 1 |
> 
> How do you decompose this into rotations and scale only?
> 
> 
>>
>> About the ScaleSkewVersor transform... if you dont want
>> skew to happen, then simply set the skew parameters to
>> zero...
> 
> 
> That is fine if I want to *set* the skew parameters, but the 
> optimizer(s) know nothing about which parameters *not* to try in a 
> particular transform, i.e. to skip the skew parameters.  My whole 
> concern is about the transform determined by the optimizer!
> 
>>
>>
>> Otherwise, plan B, is for you to take the source code
>> of the Similarity3DTransform or the ScaleSkewVersorTransform
>> and modify it to suit your needs.  If you do so, we will
>> be happy to include your new transform into the toolkit.
>> Writing a transform is not too difficult. You mainly have
>> to work on the "TransformPoint" method and the "GetJacobian"
>> method.
> 
> 
> I had begun to decide that is something I am probably going to have to 
> do. I will start to look at Similarity3DTransform (downloaded from CVS) 
> to see what is involved.
> 
>>
>> Please let us know if you need any assistance in writing
>> these new Transform class.
> 
> 
> Thanks.  I appreciate that.
> 
> Dennis
> 
> 




More information about the Insight-users mailing list