February 27th, 2007, 10:43 PM
Trapezoid 2d Affine Transform
I'm trying to get an affine transform that will turn a square image into a trapezoid like this:
I understand that the transform matrix has a row for each axis and that each axis has a scale and a skew, but that's about it. Sometimes the numbers get together behind the scenes and hold a seance where they do inexplicable things like boil frogs and rotate entire images. So if there's a good resource on that, I'd like to know about it.
Thanks for any help
February 27th, 2007, 11:02 PM
Here is the matrix for 2D transformations:
1 2 3
4 5 6
7 8 9
You will want to mess with values 7 and 8.
They are usually 0.
I agree matrixes are magical in nature at first, but after you use them long enough then they loose their magic and gain ingenuity.
Last edited by BioSlayer; February 27th, 2007 at 11:06 PM.
February 27th, 2007, 11:47 PM
Do you know how to do it in Java? It looks to me like they don't want you playing with the bottom row.
Here's the javadoc for AffineTransform
February 28th, 2007, 01:10 AM
You might be confused here: an affine transformation can never map a square to a trapezoid, only to a parallelogram. What you really want is a projective transformation.
February 28th, 2007, 02:44 AM
Since that bottom row is implied (not really there) you can't do what you want.
Originally Posted by Nialsh