300 likes | 765 Views
Overview Geometric Primitives Points, Lines, Planes 2D Geometric Transformations Translation, Rotation, Scaling, Affine, Projective 3D Geometric Transformations Rotation About Arbitrary Axes. 04 – Geometric Transformations.
E N D
Overview Geometric Primitives Points, Lines, Planes 2D Geometric Transformations Translation, Rotation, Scaling, Affine, Projective 3D Geometric Transformations Rotation About Arbitrary Axes 04 – Geometric Transformations
Before we can understand how digital images are formed we must review some geometry Geometric primitives 2D and 3D geometric transformations Then we will discuss how cameras create digital images of the world 3D to 2D projection Image sampling Overview
2D points x=(x,y) in Euclidean coordinates x=(x,y,w) in homogeneous coordinates where x=x/w and y=y/w 3D points x=(x,y,z) in Euclidean coordinates x=(x,y,z,w) in homogeneous coordinates where x=x/w , y=y/w and z=z/w Geometric Primitives
2D lines ax+by+c=0 is basic 2D line equation (a,b,c).(x,y,1)=0 using dot product notation (nx,ny,d) .(x,y,1)=0 where n=(nx,ny) is unit normal to line and d is distance from line to origin Geometric Primitives
3D lines r = (1-l)p + lq is parametric line equation In this case p, q and r are 3D points When l = [0..1] we have 3D line segment Geometric Primitives
3D planes ax+by+cz+d=0 is basic 3D plane equation (a,b,c,d).(x,y,z,1)=0 using dot product notation (nx,ny,nz,d) .(x,y,z,1)=0 where n=(nx,ny,nz) is unit normal and d is distance from plane to origin Geometric Primitives
The simplest geometric transformations that occur in the 2D plane are: translation, Euclidean, similarity, affine and projective 2D Geometric Transformations
2D Translation: 2D Geometric Transformations
2D Scaling: 2D Geometric Transformations
2D Rotation: 2D Geometric Transformations
2D Rotation around arbitrary point: Translate to origin, rotate, translate back 2D Geometric Transformations
2D Scaling around arbitrary point: Translate to origin, scale, translate back 2D Geometric Transformations
2D Euclidean (rotation + translation): Preserves distances between points 2D Geometric Transformations
2D Similarity (scaling + rotation + translation): Preserves angles between lines 2D Geometric Transformations
2D Affine: Parallel lines remain parallel 2D Geometric Transformations
2D Projective: Straight lines remain straight 2D Geometric Transformations
2D Transformation hierarchy 2D Geometric Transformations
3D translation is very similar to 2D translation There are now 3 coordinates to translate (tx,ty,tz) We use 4x4 matrix to perform operation 3D scaling is very similar to 2D scaling We still only have one scale factor S We use 4x4 matrix to perform operation 3D Geometric Transformations
There are three ways to perform 3D rotations 1) Rotate about the X,Y,Z axes 2) Rotate about an arbitrary axis 3) Use unit quaternions to perform rotation Option 1 is easiest to understand Options 2 and 3 provide smoother motions 3D Geometric Transformations
3D Rotation about Z axis: 3D Geometric Transformations
3D Rotation about Y axis: 3D Geometric Transformations
3D Rotation about X axis: 3D Geometric Transformations
3D Rotation about arbitrary axis in X-Y plane Find angle a between rotation axis and X axis Rotate around Z axis by -a degrees Rotate around X axis by desired angle q Rotate around Z axis by a degrees Same approach works for rotations about an arbitrary axis in Y-Z plane or Z-X plane 3D Geometric Transformations
3D Rotation about an arbitrary axis Project arbitrary axis onto Y-Z plane Find angle b between projected axis and Y axis Rotate around X axis by -b degrees Now rotate about axis in X-Y plane Rotate around X axis by b degrees Same approach can be used to project the arbitrary axis onto Y-Z plane or Z-X plane 3D Geometric Transformations
3D Transformation hierarchy 3D Geometric Transformations