Transformations Szirmay-Kalos László. Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line.

Slides:



Advertisements
Similar presentations
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
Advertisements

1 A camera is modeled as a map from a space pt (X,Y,Z) to a pixel (u,v) by ‘homogeneous coordinates’ have been used to ‘treat’ translations ‘multiplicatively’
Computer Graphics Lecture 4 Geometry & Transformations.
Primitives Behaviour at infinity HZ 2.2 Projective DLT alg Invariants
Transformations.
1 Computer Graphics Chapter 8 3D Transformations.
Geometric Transformations
1 Computer Graphics Chapter 6 2D Transformations.
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
Camera Models A camera is a mapping between the 3D world and a 2D image The principal camera of interest is central projection.
Chapter 4.1 Mathematical Concepts
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2006 Some slides from Steve Seitz
Linear Algebra and SVD (Some slides adapted from Octavia Camps)
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2005 Some slides from Steve Seitz
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
CAP4730: Computational Structures in Computer Graphics
Image Warping (Szeliski 3.6.1) cs129: Computational Photography James Hays, Brown, Fall 2012 Slides from Alexei Efros and Steve Seitz
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Warping CSE 590 Computational Photography Tamara Berg.
Homogeneous Coordinates (Projective Space) Let be a point in Euclidean space Change to homogeneous coordinates: Defined up to scale: Can go back to non-homogeneous.
Autonomous Navigation for Flying Robots Lecture 2.2: 2D Geometry
CGPage: 1 東吳資訊科學 江清水 3.1 2D Geometry - points and polygons X Y A point in 2D is represented by two real numbers (X,Y) A line segment is represented by.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Transformations Jehee Lee Seoul National University.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Geometric Objects and Transformation
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
CS654: Digital Image Analysis Lecture 6: Basic Transformations.
Two-Dimensional Geometric Transformations ch5. 참조 Subjects : Basic Transformations Homogeneous Coordinates Composite Transformations Other Transformations.
1 Chapter 2: Geometric Camera Models Objective: Formulate the geometrical relationships between image and scene measurements Scene: a 3-D function, g(x,y,z)
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Geometric Transformations UBI 516 Advanced Computer Graphics Aydın Öztürk
January 19, y X Z Translations Objects are usually defined relative to their own coordinate system. We can translate points in space to new positions.
Affine Geometry.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Recap from Monday DCT and JPEG Point Processing Histogram Normalization Questions: JPEG compression levels Gamma correction.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Analytic geometry refreshment Szirmay-Kalos László.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Image Warping 2D Geometric Transformations
Modeling Transformation
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
Transformations Szirmay-Kalos László.
Transforms.
3. Transformation
Geometric Transformations Hearn & Baker Chapter 5
Review: Transformations
Computer Graphics Transformations.
Review: Transformations
VECTORS APPLICATIONS NHAA/IMK/UNIMAP.
Chapter IV Spaces and Transforms
컴퓨터 그래픽스를 위한 기하학적 기초 (Line Geometry for Computer Graphics)
Transformations 2 University of British Columbia
Presentation transcript:

Transformations Szirmay-Kalos László

Transformations Can destroy our equations Limit the transformations and the shapes and require invariance – Line (segment), plane (polygon) Affine transformations – Preserve lines and parallelism – Linear in Cartesian coordinates (x,y) (x’,y’) = T(x,y) Homogenous linear transformations Preserve lines Linear in homogeneous coordinates x’ = a 11 x + a 21 y + a 31 y’ = a 12 x + a 22 y + a 32

Perspective

Team of Computer Graphics Ideal point

Euclidean  Projective plane Euclid’s axioms: Two points define a line. A line has at least two points. If a is a line and A is a point not on this line, then there is exactly one other line that crosses point A but not line a. Axioms of projective geometry: Two points define a line. A line has at least two points. Two lines intersect in a single point. 

Homogenous coordinates (2D) XhXh YhYh w (0,0) (1,0) (0,1) r[X h,Y h,h] = X h  (1,0)+Y h  (0,1)+w  (0,0) h r[X h,Y h,h] = (, ) XhhXhh YhhYhh x = XhhXhh YhhYhh y = (x, y)  [x, y, 1]  [x  h, y  h, h]= [X h, Y h, h] h= X h +Y h +w

Homogeneous coordinates in ideal points: h=0 x y [x,y,1] [2x,2y,1]  [x,y,1/2] [x,y,1/3] [x,y,0] Euclidean plane + ideal points = projective plane Ideal point

Homogenous coordinates (3D) YhYh ZhZh w Total weight: h = X h +Y h +Z h +w Center of mass: [X h,Y h,Z h,h] XhXh All cannot be simultaneously zero x = XhhXhh YhhYhh y = ZhhZhh z =

Line in projective space X1X1 Y1Y1 w1w1 line = combination of two points segment = convex combination of two points [X(t),Y(t),Z(t),h(t)]=[X 1,Y 1,Z 1,h 1 ]·t +[X 2,Y 2,Z 2,h 2 ]·(1-t)

Euclidean space, Cartesian coordinates: n x x + n y y + n z z + d = 0 Euclidean space, homogeneous coordinates: n x X h /h + n y Y h /h + n z Z h /h +d = 0 Projective space: n x X h + n y Y h + n z Z h +d h = 0 [X h,Y h,Z h,h]· = 0 nxnynzdnxnynzd Plane h0h0 h0h0 × (r – r0)  n = 0 y n z x r0r0 r

Homogeneous linear transformations Matrix-vector multiplication 2D transformation: 3x3 matrix [X h ’,Y h ’,h ’ ] =[X h,Y h,h]·T 3x3 3D transformation: 4x4 matrix [X h ’,Y h ’,Z h ’,h ’ ] = [X h,Y h,Z h,h]·T 4x4 Concatenation of transformations: Associativity [X h ’,Y h ’,Z h ’,h ’ ]=(...([X h,Y h,Z h,h]·T 1 )·T 2 )...T n ) = = [X h,Y h,Z h,h]·(T 1 ·T 2 ·... ·T n ) = = [X h,Y h,Z h,h]·T

Affine transformations l Last column is [0,0,1] T or [0,0,0,1] T l Linear in Cartesian coordinates l Preserves lines and parallelism [x’,y’,1] = [x,y,1] a 11 a 12 0 a 21 a 22 0 a 31 a 32 1 x’ = a 11 x + a 21 y + a 31 y’ = a 12 x + a 22 y + a 32

Rows of affine transformations (x’, y’) = o + xu + yv u x u y 0 v x v y 0 o x o y 1 [x’,y’,1]=[x,y,1]  u v o  x,y) (x’,y’) [0, 0, 1] [o x o y 1 ] [1, 0, 1] [o x +u x o y +u y 1 ] [0, 1, 1] [o x +v x o y +v y 1 ]

Properties of invertible homogeneous linear transformations Lines to lines, convex combinations to convex combinations Lines to lines: [X(t),Y(t),Z(t),h(t)]=[X 1,Y 1,Z 1,h 1 ]·t + [X 2,Y 2,Z 2,h 2 ]·(1-t) P(t) = P 1 ·t + P 2 ·(1-t)// · T P*(t) = P(t)·T = (P 1 ·T)·t + (P 2 ·T)·(1-t)

Invertible homogeneous linear transformations: Planes to planes P·N T = 0 T P P* = P·T T -1 (P*·T -1 )·N T = 0 P*·(T -1 ·N T ) = 0 P*·N* T = 0 N*=N · (T -1 ) T Inverse transpose

Translation (x’, y’, z’)=(x+p x, y+p y, z+p z ) [x’,y’,z’,1] = [x,y,z,1] p x p y p z 1 p

Scaling x’=S x  x, y’=S y  y, z’=S z  z [x’,y’,z’,1] = [x,y,z,1] S x S y S z

Rotation around axis Z x = r cos  y = r sin  x’ = r cos(  = r cos  cos  r sin  sin  y’ = r sin(  = r cos  sin  r sin  cos  x’ = r cos(  = x  cos  y  sin  y’ = r sin(  = x  sin  y  cos  [x,y] [x’,y’]   r cos  sin  -sin  cos      [x’,y’,z’,1] = [x,y,z,1] z’= z

Rotation around axis z

Rotation around a line crossing the origin and of direction w: Rodrigues formula w : axis of rotation, let it be unit vector w  r  = w  r  r r || = w(r  w)= r’ || r=r-w(rw)r=r-w(rw) r’r’ r’= r’ || +r’  r’=w(r  w)+(r-w(r  w))cos(  )+w  r sin(  ) = r cos(  )+w(r  w)(1-cos(  ))+w  r sin(  ) Rows of the matrix: apply for i, j,k

Central projection(2D) 1  0 p 0 1 q [x, y, 1] [x, y, px+qy] x px+qy y px+qy x, y x’, y’ px+qy=1 x/y=x’/y’ és 

Wrap around problem =Projective line (topology) Ideal point Line segment ?????