|
|
Up |
|
|
  |
Author: Spud DemonSpud 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 |
|
  |
Author: Ray KoopmanRay Koopman Date: Jul 1, 2008 01:15
> 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 |
|
  |
Author: Sylvain CroussetteSylvain Croussette Date: Jul 1, 2008 07:17
> 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 |
|
  |
Author: Spud DemonSpud 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):
>> 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 |
|
  |
Author: Ray KoopmanRay Koopman Date: Jul 14, 2008 00:23
> Ray Koopman writes in article <23a2d297-2365-424c-a3e5-805ffee3e...@x19g2000prg.googlegroups.com> dated Tue, 1 Jul 2008 01:15:04 -0700 (PDT):
>>> 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 |
|
  |
|
|
  |
Author: Spud DemonSpud 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 |
  |
|
|
|