Lecture 7 --- 6.837 Fall '01 - Research | MIT...

Post on 31-May-2020

7 views 0 download

Transcript of Lecture 7 --- 6.837 Fall '01 - Research | MIT...

6.837 LECTURE 71. Geometric Image Transformations 2. Two-Dimensional Geometric Transforms

3. Translations 4. Groups and Composition

5. Rotations 6. Euclidean Transforms

7. Problems with this Form 8. Choose a Subspace

9. Playing with Euclidean Transforms 10. Similitude Transforms

11. Playing with Similitude Transforms 12. Affine Transformations

13. Affine Properties 13a. Examples of Affine Transformations

14. Playing with Affine Transforms 15. Determining Affine Transforms

16. Solution Method 17. Projective Transformations

18. Projection 19. Projective Transforms

20. Degrees of Freedom 21. Specifying a projective transform

22. Projective Example 23. Next Time

  Lecture 7   Outline   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/index.html [10/2/2001 5:26:14 PM]

Geometric Image Transformations

Algebraic Groups●

Euclidean●

Affine●

Projective●

Bovine●

  Lecture 7   Slide 1   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide01.html [10/2/2001 5:20:39 PM]

Two-Dimensional Geometric TransformsGeometric transforms are functions that map points from one place to another

Geometric transformscan be applyed to

drawing primitives(lines, conics, triangles)

pixel coordinates of an image (or sprites)

We'll begin with simple transforms and generalize them.

Lecture 7   Slide 2   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide02.html [10/2/2001 5:20:41 PM]

TranslationsTranslations are a simple family of two-dimensional transforms. Translations were at theheart of our Sprite implementations in Project #1.

Translations have the following form

x' = x + txy' = y + ty

For every translation there exists an inverse function which undoes the translation. In ourcase the inverse looks like:

x = x' - txy = y' - ty

There also exists a special translation, called the identity, that leaves every point unchanged.

x' = x + 0y' = y + 0

Lecture 7   Slide 3   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide03.html [10/2/2001 5:20:45 PM]

Groups and Composition

For Translations:

There exists an inverse mapping for each function1.

There exists an identity mapping2.

The composition operation is associative3.

The functions are "closed under composition"4.

These properties might seem trivial at first glance, but they are actually veryimportant, because when these conditions are shown for any class of functions andtheir two-argument composition operation, then they form an algebraic group. Oneof the consequences is that any series of translations can be composed to a singletranslation. Another consequence is that the inverse is unique.

Lecture 7   Slide 4   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide04.html [10/2/2001 5:20:47 PM]

RotationsAnother group of 2-transforms are the rotations about the origin.

Lecture 7   Slide 5   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide05.html [10/2/2001 5:20:49 PM]

Euclidean TransformsThe union of translations and rotation functions defines the Euclidean Set

Properties of Euclidean Transformations:

They preserve distances●

They preserve angles●

How do you represent these functions?

Lecture 7   Slide 6   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide06.html [10/2/2001 5:21:35 PM]

Problems with this FormMust consider Translation and Rotation separately●

Computing the inverse transform involves multiple steps●

Order matters between the R and T parts

These problem can be remedied by considering our 2 dimensional image plane as a 2Dsubspace within 3D.

Lecture 7   Slide 7   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide07.html [10/2/2001 5:21:38 PM]

Choose a SubspaceWe can use any planar subspace as long as it does not contain the origin

WLOG assume the our 2D space of points lies on the 3D plane z = 1

Now we can express all Euclidean Transforms in matrix form:

This gives us a three parameter group of Transformations.

Lecture 7   Slide 8   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide08.html [10/2/2001 5:21:40 PM]

Playing with Euclidean Transforms

In what order are the translation and rotation performed?●

Will this family of transforms always generate points on our choosen3-D plane?Why?

Lecture 7   Slide 9   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide09.html [10/2/2001 5:21:42 PM]

Similitude TransformsWe can define a 4-parameter superset of Euclidean Transforms with additional capabilities

Properties of Similitudes:

Distance between any 2 pointsare changed by a fixed ratio

Angles are preserved●

Maintains "similar" shape(similar triangles, circles map to circles, etc)

Lecture 7   Slide 10   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide10.html [10/2/2001 5:21:44 PM]

Playing with Similitude Transforms

Adds reflections●

Scales in x and y must be the same. Why?●

Order?●

Will this family of transforms always generate points on our choosen3-D plane?Why?

Lecture 7   Slide 11   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide11.html [10/2/2001 5:21:45 PM]

Affine TransformationsA 6-parameter group of transforms

Lecture 7   Slide 12   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide12.html [10/2/2001 5:21:48 PM]

Affine Properties

To the right is a simple illustration of how wecan map our parameters into the fourcomponents of the affine transformationmatrix.

Properties of Affine Transforms:

They perserve our selected plane(sometimes called the Affine plane)

They preserve parallel lines●

Lecture 7   Slide 13   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide13.html [10/2/2001 5:21:49 PM]

Examples of Affine Transformations

Source: Dave Mount, U. Maryland, Notes for CMSC 427, Fall 2000.

Lecture 7   Slide 13a   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide13a.html [10/2/2001 5:21:51 PM]

Playing with Affine Transforms

σx scales the x-dimension●

σy scales the y-dimension●

σxy is often called the skew parameter●

Lecture 7   Slide 14   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide14.html [10/2/2001 5:21:53 PM]

Determining Affine TransformsThe coordinates of three corresponding points uniquely determine and Affine Transform

If we know where we would like at least three points to map to, we can solve for an Affinetransform that will give this mapping.

Lecture 7   Slide 15   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide15.html [10/2/2001 5:21:54 PM]

Solution Method

We've used this technique severaltimes now. We set up 6 linearequations in terms of our 6unknown values. In this case, weknow the coordinates before andafter the mapping, and we wish tosolve for the entries in our Affinetransform matrix.

This gives the following solution:

Lecture 7   Slide 16   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide16.html [10/2/2001 5:21:56 PM]

Projective TransformationsThe most general linear transformation that we can apply to 2-D points

There is something different about this group of transformations. The resultwill not necessarily lie on our selected plane. Since our world (to this point) is2D we need some way to deal with this.

Lecture 7   Slide 17   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide17.html [10/2/2001 5:22:27 PM]

Projection

The mapping of points from an N-D space to a M-D subspace (M < N)

We need a rule for mapping points resulting of this transform back onto our plane z = 1.

We will identify points by lines through the origin of the 3-D space that we have embeddedour plane within.

Thus,

Since the origin lies on all of these lines (and thus cannot be uniquely specified) we willdisallow it. This is no big loss since it wasn't on our selected plane anyway (This is the realreason that we chose a plane not containing the origin).

If we want to find the coordinate of any point in our selected plane we need only scale itsuch that it's third coordinate, w, is 1.

Lecture 7   Slide 18   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide18.html [10/2/2001 5:22:30 PM]

Projective Transforms

Since all of the resulting points are defined to within a non-zero scale factor. We can alsoscale the transformation by an arbitrary and it will still give the same result.

We might as well choose α so that one of the parameters of our matrix is 1 (i.e. p33 = 1).

Lecture 7   Slide 19   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide19.html [10/2/2001 5:22:33 PM]

Degrees of FreedomA projective transform has 8 free-parameters

Lecture 7   Slide 20   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide20.html [10/2/2001 5:23:28 PM]

Specifying a projective transformA projective transform can be uniquely defined by how it maps 4 points

Lecture 7   Slide 21   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide21.html [10/2/2001 5:24:04 PM]

Projective Example

With the applet on the right you can select any corner and drag it to where you would like.

Things are starting to look 3-D... We'll get there soon.

Lecture 7   Slide 22   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide22.html [10/2/2001 5:24:08 PM]

Next Time

Lecture 7   Slide 23   6.837 Fall '01

Lecture 7 --- 6.837 Fall '01

http://graphics/classes/6.837/F01/Lecture07/Slide23.html [10/2/2001 5:24:12 PM]