Homogeneous Coordinates

Similar documents
A geometric interpretation of the homogeneous coordinates is given in the following Figure.

Robotics - Homogeneous coordinates and transformations. Simone Ceriani

Kinematics. Basilio Bona. October DAUIN - Politecnico di Torino. Basilio Bona (DAUIN - Politecnico di Torino) Kinematics October / 15

1. Projective geometry

Projective geometry and spacetime structure. David Delphenich Bethany College Lindsborg, KS USA

Kinematics. Basilio Bona. Semester 1, DAUIN Politecnico di Torino. B. Bona (DAUIN) Kinematics Semester 1, / 15

Kinematics. Basilio Bona. Semester 1, DAUIN Politecnico di Torino. B. Bona (DAUIN) Kinematics Semester 1, / 15

1 Overview. CS348a: Computer Graphics Handout #8 Geometric Modeling Original Handout #8 Stanford University Thursday, 15 October 1992

Exercises for Unit I (Topics from linear algebra)

MSMS Vectors and Matrices

Pose estimation from point and line correspondences

Exercises for Unit I (Topics from linear algebra)

Lines and points. Lines and points

Exercises for Unit I I (Vector algebra and Euclidean geometry)

COMP 175 COMPUTER GRAPHICS. Lecture 04: Transform 1. COMP 175: Computer Graphics February 9, Erik Anderson 04 Transform 1

Linear Algebra 1 Exam 2 Solutions 7/14/3

1.1 Single Variable Calculus versus Multivariable Calculus Rectangular Coordinate Systems... 4

Math 302 Outcome Statements Winter 2013

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

ROBOTICS 01PEEQW. Basilio Bona DAUIN Politecnico di Torino

Matrices A brief introduction

Multiple View Geometry in Computer Vision

Study guide for Exam 1. by William H. Meeks III October 26, 2012

The complex projective line

Introduction. Chapter Points, Vectors and Coordinate Systems

Lecture 8: Coordinate Frames. CITS3003 Graphics & Animation

Computer Graphics MTAT Raimond Tunnel

Lecture 4: Affine Transformations. for Satan himself is transformed into an angel of light. 2 Corinthians 11:14

Position and orientation of rigid bodies

What you will learn today

Course Summary Math 211

Chapter 12. The cross ratio Klein s Erlanger program The projective line. Math 4520, Fall 2017

IDEAL CLASSES AND SL 2

Conics and their duals

Contents. 1 Vectors, Lines and Planes 1. 2 Gaussian Elimination Matrices Vector Spaces and Subspaces 124

Camera Models and Affine Multiple Views Geometry

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Chapter 5. Linear Algebra. Sections A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Solutions to Math 51 First Exam October 13, 2015

Math 3108: Linear Algebra

Nonholonomic Constraints Examples

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Finite affine planes in projective spaces

ELEMENTARY LINEAR ALGEBRA

Analysis-3 lecture schemes

Mathematics I. Exercises with solutions. 1 Linear Algebra. Vectors and Matrices Let , C = , B = A = Determine the following matrices:

Linear algebra I Homework #1 due Thursday, Oct. 5

Linear Algebra. Preliminary Lecture Notes

Spring, 2006 CIS 610. Advanced Geometric Methods in Computer Science Jean Gallier Homework 1

Inverse differential kinematics Statics and force transformations

(A B) 2 + (A B) 2. and factor the result.

11.1 Three-Dimensional Coordinate System

MTH501- Linear Algebra MCQS MIDTERM EXAMINATION ~ LIBRIANSMINE ~

Chapter 5. Linear Algebra. A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Chapter 5. Linear Algebra. Sections A linear (algebraic) equation in. unknowns, x 1, x 2,..., x n, is. an equation of the form

Matrices A brief introduction

Lecture 16: Projection and Cameras. October 17, 2017

chapter 1 vector geometry solutions V Consider the parallelogram shown alongside. Which of the following statements are true?

4.1 Distance and Length

Slope Fields and Differential Equations. Copyright Cengage Learning. All rights reserved.

Math Linear Algebra II. 1. Inner Products and Norms

web: HOMEWORK 1

Introduction and Vectors Lecture 1

Matrices Gaussian elimination Determinants. Graphics 2009/2010, period 1. Lecture 4: matrices

Lecture 4: Affine Transformations. for Satan himself is transformed into an angel of light. 2 Corinthians 11:14

Robotics & Automation. Lecture 17. Manipulability Ellipsoid, Singularities of Serial Arm. John T. Wen. October 14, 2008

8. Find r a! r b. a) r a = [3, 2, 7], r b = [ 1, 4, 5] b) r a = [ 5, 6, 7], r b = [2, 7, 4]

MATH 315 Linear Algebra Homework #1 Assigned: August 20, 2018

Notes on multivariable calculus

MATRICES EXAM QUESTIONS

Fractions, Projective Representation, Duality, Linear Algebra and Geometry

LS.1 Review of Linear Algebra

Part II. Geometry and Groups. Year

Projective Geometry Lecture Notes

Course Notes Math 275 Boise State University. Shari Ultman

Systems of Linear Equations

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra /34

Extra Problems for Math 2050 Linear Algebra I

Rigid body dynamics. Basilio Bona. DAUIN - Politecnico di Torino. October 2013

Math Bootcamp An p-dimensional vector is p numbers put together. Written as. x 1 x =. x p

VECTORS AND THE GEOMETRY OF SPACE

Equality: Two matrices A and B are equal, i.e., A = B if A and B have the same order and the entries of A and B are the same.

Linear Algebra. Preliminary Lecture Notes

ELEMENTARY LINEAR ALGEBRA

Vector Geometry. Chapter 5

Math 118, Fall 2014 Final Exam

Math Camp II. Basic Linear Algebra. Yiqing Xu. Aug 26, 2014 MIT

homogeneous 71 hyperplane 10 hyperplane 34 hyperplane 69 identity map 171 identity map 186 identity map 206 identity matrix 110 identity matrix 45

1. Let m 1 and n 1 be two natural numbers such that m > n. Which of the following is/are true?

Fractals and Linear Algebra. MAA Indiana Spring Meeting 2004

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

Synthetic Geometry. 1.4 Quotient Geometries

Introduction to Linear Algebra, Second Edition, Serge Lange

Exercise Sheet 7 - Solutions

Vector Spaces. Addition : R n R n R n Scalar multiplication : R R n R n.

Homographies and Estimating Extrinsics

MORE EXERCISES FOR SECTIONS II.1 AND II.2. There are drawings on the next two pages to accompany the starred ( ) exercises.

MATH 423/ Note that the algebraic operations on the right hand side are vector subtraction and scalar multiplication.

III.3. Analytic Functions as Mapping, Möbius Transformations

Linear Algebra. Workbook

Transcription:

Homogeneous Coordinates Basilio Bona DAUIN-Politecnico di Torino October 2013 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 1 / 32

Introduction Homogeneous coordinates are an augmented representation of points and lines in R n spaces, embedding them in R n+1, hence using n+1 parameters. This representation is useful in dealing with perspective and projective transformation (computer graphics, etc.) and for rigid displacement representation. We start introducing the concept on 2D spaces. Given a point p in R 2, represented as P = (p 1,p 2 ), i.e., the vector p = [ p 1 p 2 ] T its homogeneous representation (using homogeneous coordinates) is p = [ p 1 p 2 p 3 ] T; with [ 0 0 0 ] T not allowed The vector representation is obtained dividing the first n homogeneous components by the (n +1)-th, that is often called scale. p 1 = p 1 / p 3 ; p 2 = p 2 / p 3 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 2 / 32

A geometric interpretation of the homogeneous coordinates is given in the following Figure. Figure: Geometric interpretation of homogeneous coordinates. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 3 / 32

We embed the plane π : z = 1 in a 3D space and we consider the planar coordinates as the intersection of a projection line that goes through the origin of the RF {i,j,k}. As z goes to we can represent the origin, while as z goes to 0, we can represents points at infinity, along a well defined direction. The set of all points at infinity represents the line at infinity. Figure: Points at. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 4 / 32

The same approach is valid for 3D homogeneous coordinates: given a point p in R 3, represented as P = (p 1,p 2,p 3 ), or else by a vector its homogeneous representation is p = [ p 1 p 2 p 3 ] T p = [ p 1 p 2 p 3 p 4 ] T Hence p 1 = p 1 / p 4 ; p 2 = p 2 / p 4 ; p 3 = p 3 / p 4 In robotics it is common to set p 4 = 1. We will adhere to this convention. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 5 / 32

Some author treats differently the homogeneous representation of a point (geometric vector v p ) by that of an oriented segment (physical vector v ab ). In the first case while in the second case ṽ ab = [ vb ṽ p = 1 ] [ vp 1 ] [ ] va = 1 [ ] vab 0 Not all textbooks adhere to this convention, since in this case the sum of two geometric vectors produces [ ] [ ] [ ] vp vq vp +v ṽ p +ṽ q = + = q 1 1 2 This sum, once transformed back in 3D space, becomes not the usual parallelogram sum of segments, but the midpoint of the parallelogram (see also Affine Spaces). Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 6 / 32

Figure: Homogeneous sum of two geometric vectors. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 7 / 32

Affine spaces Briefly, affine spaces are spaces where the origin is not considered to be a special point, and homogeneous coordinates are used to characterize the affine elements (points and planes). Figure: Linear and affine subspaces. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 8 / 32

Rigid displacements and homogeneous coordinates Using homogeneous representation, the generic displacement (R, t) is given by the following homogeneous transformation matrix [ ] R t H H(R,t) = 0 T 1 since [ ] [v ] R t Hṽ = 0 T = Rv+t 1 1 Hence, the SE(3) group transformation g = (R,t) SE(3), is represented by the 4 4 homogeneous matrix H through the use of homogeneous coordinates: p a = g ab p b p a = H ab (R ab,t ab ) p b Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 9 / 32

Transformation composition g ab g bc is obtained by the homogeneous matrix product H ab (R ab,t ab )H bc (R bc,t bc ) i.e., [ ][ ] [ ] Rab t ab Rbc t bc Rab R bc R ab t bc +t ab 0 T 1 0 T = 1 0 T 1 Often it is convenient to write the time derivative of a homogeneous vector as p = ṗ 1 ṗ2 This notation will prove useful when dealing with twists. ṗ3 0 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 10 / 32

Introduction to projective/perspective geometry Homogeneous coordinates p are used for describing point in projective spaces P n of dimension n. Two points ã and b are equal (ã b) if there exist a real λ 0 such that ã = λ b b λ b collinear points are equal this also means that vectors are equal up to a scale factor. We say that ã and b belong to the same line, i.e., to the same affine subspace of R n+1. Consider the planar (2D) projection through a pinhole camera of a 3D point P,p = [ x y z ] T. The ray of light intercepts the image plane in the 2D image point P i, whose homogeneous coordinates on the image plane are p i = x y f where f is the focal distance p i = [ ] T x/f = 1 [ T x y/f f y] Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 11 / 32

Figure: Example of projection through a pinhole camera. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 12 / 32

Considering the similar triangles in Figure, we have: x f = X Z ; y f = Y Z If we set λ = Z/f, where f is known and the distance Z from π of the point p is unknown, we have X = λx, Y = λy, Z = λf Hence, if we compute the cartesian coordinates of p i on π from homogeneous coordinates, we have [ ] x/f p i = p y/f i = fx fy λ x y x y Z 1 f and every 3D point with homogeneous coordinates λ [ x y f ] T is projected onto the same point p i of the image plane π. Notice that the above transformation is a nonlinear one. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 13 / 32

The nonlinear mapping R 3 R 2 can be expressed as a (linear) matrix transformation between the homogeneous spaces R 4 R 3 as fx fy λ x y = f 0 0 0 X [ 0 f 0 0 Y p Z λ p i = P 1] Z 1 0 0 1 0 }{{} 1 P Nonsingular (i.e., invertible) mappings between projective spaces are described by products of full rank square matrices T by homogeneous coordinates, p a = T ab p b An invertible mapping from P n onto itself preserves collinearities, i.e., if two points belong to a line, also the transformed points will belong to a line. Affine transformations preserve not only collinearities, but also parallelism between lines and ratios of distances. Similarity transformations preserves also angles, but not scales, while Euclidean (rigid) transformations preserve also scales Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 14 / 32

Figure: Examples of different mappings. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 15 / 32

Hyperplanes A hyperplane in R n is defined by the equation between a set of points p i and a set of (real) coefficients l i l 1 p 1 +l 2 p 2 + +l n p n +l n+1 = 0 Using the homogeneous coordinates we obtain an homogeneous linear equation in P n l T p = 0 where l = l 1. l n l n+1 ; p = p 1. p n 1 The two homogeneous vectors can exchange their roles; we say that they are dual. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 16 / 32

Remember that, given a vector p V(F), the set of all linear transformations f(p) : V R 1 form another vector space V, and f V are called dual vectors or 1 forms. For example, the total time derivative of a scalar function f(p) on R 3 is df(p(t)) dt = p φ(p)ṗ(t) is a dual vector wrt ṗ. Another dual vector is the divergence [ ] T p 1 p = p 1 p. n p n or the Laplacian (gradient of the divergence) f [ ] 2 T p 1 f = f = p 1 p n. f p n Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 17 / 32

Duality in projective spaces The space of all hyperplanes in R n defines another perspective space, called the dual of the original P n Duality principle: for all projective results established using points and planes, a symmetrical result holds interchanging the role of planes and points. Example: two points define a line two lines define a point Notice that the projective plane P 2 whose point are defined by homogeneous coordinates, has more point that the usual R 2 plane, since it includes also points at. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 18 / 32

A collineation given by a full rank matrix T transforms points as p a = T ab p b A hyperplane l T b p b = 0 is transformed as hence yielding lt b p b = 0 l T a p a = 0 lt a T ab p b l T b = l T a T ab la = T T ab l T b Matrix T T ab is called the dual of T ab Comparing this last equation with the first one, we conclude that points and lines can be transformed, but using different (dual) collineation matrices T ab and T T ab. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 19 / 32

Points and lines We restrict our analysis on the 2D projective space P 2 ; for the sake of clarity, we drop the sign on top of the homogeneous vectors, i.e., ã is now indicated as a. A line l = [ l 1 l 2 l 3 ] can be characterized by three parameters: 1 the slope l 1 /l 2 2 the x-intercept l 3 /l 1 3 the y-intercept l 3 /l 2 Points p and lines l are related by l T p = 0 in the sense that a point is on a line or a line include a point iff the previous relation holds. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 20 / 32

Duality A line l passing for two points p 1 and p 2 is defined as l = p 1 p 2 = S(p 1 )p 2 A point p belonging to two lines (intercept) l 1 and l 2 is defined as p = l 1 l 2 = S(l 1 )l 2 Points at infinity or ideal points have the following representation p = [ p 1 p 2 0 ] T All ideal points lie on the ideal line, represented by l = [ 0 0 1 ] T Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 21 / 32

Three points p 1,p 2,p 3 lie on the same line (they are collinear) iff det [ p 1 p 2 p 3 ] = 0 Since the duality principle holds, three lines l 1,l 2,l 3 meet at the same point (they are concurrent) iff det [ l 1 l 2 l 3 ] = 0 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 22 / 32

Parallelism Two lines m = m 1 ; n = n 1 m 2 m 3 n 2 n 3 are parallel when the intersection point is at infinity, i.e., p = m n = p 1 p 2 0 This reduces to the conditions The direction k m 1 m 2 = n 1 n 2 [ ] m1 n or det 1 = 0 m 2 n 2 [ ] p1 points toward the point at infinity. p 2 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 23 / 32

Summary point p = [ p 1 p 2 p 3 ] T line l = [ l 1 l 2 l 3 ] T incidence p T l = 0 incidence l T p = 0 line l = p 1 p 2 point p = l 1 l 2 collinearity det [ p 1 p 2 p 3 ] = 0 collinearity det [ l1 l 2 l 3 ] = 0 point [ p1 p 2 0 ] T line [ 0 0 l3 ] T Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 24 / 32

Transformations in P 2 The generic projective transformation (also called homographies) in P 2 is represented by a non singular 3 3 matrix (acting on homogeneous vectors), whose elements are T = t 11 t 12 t 13 t 21 t 22 t 23 t 31 t 32 t 33 Since the transformations are equivalent up to a scale factor, the number of dof in T is 8. According to structural constraint, we have a hierarchy of transformations, from the most general to the least one; in particular Transformations in P 2 (most general) projective affine similarity Euclidean (rigid) Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 25 / 32

The affine transformation must preserve the ideal line and the ideal points (as well as parallelism); hence, for any arbitrary scaling factor λ λ p 1 p 2 = T p 1 p 2 0 0 that implies T = t 11 t 12 t 13 t 21 t 22 t 23 dof=6 0 0 t 33 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 26 / 32

The similarity transformation must preserve angles and ratios of lengths; that implies T = cosθ sinθ t 13 sinθ cosθ t 23 dof=3 0 0 t 33 with t 33 1. The effects of the last column in T is to produce a shear i.e., a scale variation that is non uniform in all directions. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 27 / 32

The Euclidean (rigid) transformation must preserve also lengths; that implies T = cosθ sinθ t 13 sinθ cosθ t 23 dof=3 0 0 1 Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 28 / 32

Historical notes Homogeneous coordinates were introduced in 1827 by Möbius in the context of barycentric coordinates. Given a triangle, the barycentric coordinates of a point P are the weights required at the triangle vertices such that P become the center of gravity of the triangle. The point is computed as p = [ w a x w b y w c z ] T, with w a +w b +w c = 1 Figure: Example of barycentric coordinates. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 29 / 32

From homogeneous coordinates to quaternions There exist a link between homogeneous coordinates and quaternions that goes through the Möbius transformation. Given two complex numbers x = x 1 +jx 2, y = y 1 +jy 2 C, the ordered pair of complex numbers z = [ x y ] T C 2, z [ 0 0 ] T are the homogeneous coordinates of z = z 1 +jz 2 z = x y = z 1 +jz 2 = x 1 +jx 2 y 1 +jy 2 To every pair of complex numbers (x,y) a unique complex numbers z corresponds, while for every complex number z there is an infinite number of complex pairs (projective transformation). Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 30 / 32

Transformation between homogeneous representations [ [ [ [ ] x u u a b x z = w = where = = y] v] v] c d][ y where a,b,c,d are complex numbers. We can compute the transformed complex number as [ ] ax +by cx +dy w = u v ax +by = cx +dy = ax y +b az +b = +d cz +d c x y This is nothing else that the Möbius transformation. Möbius transformation w = az +b cz +d ; a,b,c,d,w,z C Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 31 / 32

If we take a particular form of the Möbius transformation, due to Gauss: w = az +b b z +a we know that every rotation of the sphere can be expressed by a complex function as the one above, and we notice that it can be represented by the matrix of its coefficients [ ] a b b a [ ] α+jβ γ +jδ = γ +jβ α jβ [ ] [ 1 0 j 0 = α +β 0 1 0 j = α1+βi+γj+δk = a quaternion ] +γ [ ] 0 1 +δ 1 0 [ ] 0 j j 0 For further details see: T. Needham, Visual Complex Analysis, OUP, 1997. Basilio Bona (DAUIN-Politecnico di Torino) Homogeneous Coordinates October 2013 32 / 32