Deconstructing affine transformations into rotation, scale, skew
  Home FAQ Contact Sign in
sci.math only
 
Advanced search
POPULAR GROUPS

more...

sci.math Profile…
 Up
Deconstructing affine transformations into rotation, scale, skew         


Author: Spud Demon
Date: Jun 30, 2008 15:10

Given a 2-dimensional affine transform (6 coefficients as defined at
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform.html )

[ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
[ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
[ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]

How can I separate this transformation into its components?

The translation vector is obviously , but after that it's not so
trivial. I would like to come up with:

* Rotation (scalar)
* Scaling or dilation (scalar or 2-D vector)
* Indication of whether the transform flips the image (bit)
* Skew (2-D vector?)

Pointers to info or even just the "right" terms to use in my web search
will be greatly appreciated!

--Spud Demon
5 Comments
Re: Deconstructing affine transformations into rotation, scale, skew         


Author: Ray Koopman
Date: Jul 1, 2008 01:15

On Jun 30, 3:10 pm, no_s...@e.THUNDERMAKER.NET (Spud Demon) wrote:
> Given a 2-dimensional affine transform (6 coefficients as defined athttp://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform...)
>
> [ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
> [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
> [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
>
> How can I separate this transformation into its components?
>
> The translation vector is obviously , but after that it's not so
> trivial. I would like to come up with:
>
> * Rotation (scalar)
> * Scaling or dilation (scalar or 2-D vector)
> * Indication of whether the transform flips the image (bit)
> * Skew (2-D vector?)
>
> Pointers to info or even just the "right" terms to use in my web search
> will be greatly appreciated!
> ...
Show full article (1.12Kb)
no comments
Re: Deconstructing affine transformations into rotation, scale, skew         


Author: Sylvain Croussette
Date: Jul 1, 2008 07:17

On 30 juin, 18:10, no_s...@e.THUNDERMAKER.NET (Spud Demon) wrote:
> Given a 2-dimensional affine transform (6 coefficients as defined athttp://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform...)
>
> [ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
> [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
> [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
>
> How can I separate this transformation into its components?
>
> The translation vector is obviously , but after that it's not so
> trivial. I would like to come up with:
>
> * Rotation (scalar)
> * Scaling or dilation (scalar or 2-D vector)
> * Indication of whether the transform flips the image (bit)
> * Skew (2-D vector?)
>
> Pointers to info or even just the "right" terms to use in my web search
> will be greatly appreciated!
> ...
Show full article (0.98Kb)
no comments
Re: Deconstructing affine transformations into rotation, scale, skew         


Author: Spud Demon
Date: Jul 13, 2008 07:03

Ray Koopman writes in article <23a2d297-2365-424c-a3e5-805ffee3e9f5@x19g2000prg.googlegroups.com> dated Tue, 1 Jul 2008 01:15:04 -0700 (PDT):
>On Jun 30, 3:10 pm, no_s...@e.THUNDERMAKER.NET (Spud Demon) wrote:
>> Given a 2-dimensional affine transform (6 coefficients as defined at
>> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform...)
>>
>> [ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
>> [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
>> [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
>>
>> How can I separate this transformation into its components?
>>
>> The translation vector is obviously , but after that it's not so
>> trivial. I would like to come up with:
>>
>> * Rotation (scalar)
>> * Scaling or dilation (scalar or 2-D vector)
>> * Indication of whether the transform flips the image (bit)
>> * Skew (2-D vector?)
>>
>> Pointers to info or even just the "right" terms to use in my web search ...
Show full article (2.19Kb)
no comments
Re: Deconstructing affine transformations into rotation, scale, skew         


Author: Ray Koopman
Date: Jul 14, 2008 00:23

On Jul 13, 7:03 am, no_s...@e.THUNDERMAKER.NET (Spud Demon) wrote:
> Ray Koopman writes in article <23a2d297-2365-424c-a3e5-805ffee3e...@x19g2000prg.googlegroups.com> dated Tue, 1 Jul 2008 01:15:04 -0700 (PDT):
>> On Jun 30, 3:10 pm, no_s...@e.THUNDERMAKER.NET (Spud Demon) wrote:
>>> Given a 2-dimensional affine transform (6 coefficients as defined at
>>> http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/AffineTransform...)
>>>
>>> [ x'] [ m00 m01 m02 ] [ x ] [ m00x + m01y + m02 ]
>>> [ y'] = [ m10 m11 m12 ] [ y ] = [ m10x + m11y + m12 ]
>>> [ 1 ] [ 0 0 1 ] [ 1 ] [ 1 ]
>>>
>>> How can I separate this transformation into its components?
>>>
>>> The translation vector is obviously , but after that it's
>>> not so trivial. I would like to come up with:
>>>
>>> * Rotation (scalar)
>>> * Scaling or dilation (scalar or 2-D vector)
>>> * Indication of whether the transform flips the image (bit)
>>> * Skew (2-D vector?)
>>> ...
Show full article (3.19Kb)
no comments
Re: Deconstructing affine transformations into rotation, scale, skew         


Author: Spud Demon
Date: Jul 15, 2008 17:42

Ray Koopman writes in article e39g2000hsf.googlegroups.com> dated Mon, 14 Jul 2008 00:23:56 -0700 (PDT):
>theta = (1/2) arctan( 2r / (p - q) ), where M'M = [p r],
>and the signs of the numerator & denominator [r q]
>determine the quadrant of 2*theta. Take quadrants 3 & 4
>as representing negative angles, so -PI/2 < theta <= PI/2.

That's great. I was going to use a numerical method (Newton's) to find
where the derivative was 0, but closed form is better.
>> The square roots of of f(theta) and f(theta+PI/2) would be the
>> diagonal of D. Then a little matrix inversion to calculate V'.
>
>No, you just solved for V = [ cos(theta) -sin(theta) ]
> [ sin(theta) cos(theta) ].

Of course -- we want the rotational transformation for -theta, not theta.
>To get U, normalize each column of MV = UD; i.e., divide
>by the appropriate d, which is the length of the column.

Since the Java API has an invert method built right in, I used
U = M*invert(D*V')

Thanks again for your help!

--Spud Demon
no comments

RELATED THREADS
SubjectArticles qty Group
Re: An affine connection ain't an affine connectionsci.math ·