Perspective projection and Transformations

Similar documents
Feature descriptors and matching

CSE 252B: Computer Vision II

Projective geometry for Computer Vision

Discriminant Functions for the Normal Density

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Agenda. Rotations. Camera models. Camera calibration. Homographies

Epipolar Geometry Prof. D. Stricker. With slides from A. Zisserman, S. Lazebnik, Seitz

3-D D Euclidean Space - Vectors

Introduction to Computer Vision

3D Geometry and Camera Calibration

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Camera Model and Calibration

Agenda. Rotations. Camera calibration. Homography. Ransac

Polar Coordinates. Chapter 10: Parametric Equations and Polar coordinates, Section 10.3: Polar coordinates 27 / 45

Rigid Body Motion and Image Formation. Jana Kosecka, CS 482

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems

Agenda. Perspective projection. Rotations. Camera models

Perspective Projection in Homogeneous Coordinates

Overview. By end of the week:

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

Homogeneous coordinates, lines, screws and twists

Augmented Reality II - Camera Calibration - Gudrun Klinker May 11, 2004

2D transformations: An introduction to the maths behind computer graphics

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Pin Hole Cameras & Warp Functions

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

Math 209 (Fall 2007) Calculus III. Solution #5. 1. Find the minimum and maximum values of the following functions f under the given constraints:

CS231A. Review for Problem Set 1. Saumitro Dasgupta

Polar Coordinates. Chapter 10: Parametric Equations and Polar coordinates, Section 10.3: Polar coordinates 28 / 46

Computer Vision Project-1

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

Computer Vision I - Appearance-based Matching and Projective Geometry

Three-Dimensional Viewing Hearn & Baker Chapter 7

Camera Model and Calibration. Lecture-12

GEOMETRIC TRANSFORMATIONS AND VIEWING

Cameras and Radiometry. Last lecture in a nutshell. Conversion Euclidean -> Homogenous -> Euclidean. Affine Camera Model. Simplified Camera Models

Assignment 2 : Projection and Homography

CSE152a Computer Vision Assignment 1 WI14 Instructor: Prof. David Kriegman. Revision 0

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Computer Vision I - Appearance-based Matching and Projective Geometry

Midterm Exam Solutions

So we have been talking about 3D viewing, the transformations pertaining to 3D viewing. Today we will continue on it. (Refer Slide Time: 1:15)

calibrated coordinates Linear transformation pixel coordinates

Last week. Machiraju/Zhang/Möller/Fuhrmann

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Computer Graphics 7: Viewing in 3-D

Scene Modeling for a Single View

Pin Hole Cameras & Warp Functions

Computer Graphics: Geometric Transformations

521466S Machine Vision Exercise #1 Camera models

Single View Geometry. Camera model & Orientation + Position estimation. What am I?

1 Affine and Projective Coordinate Notation

Precomposing Equations

Specifying Complex Scenes

2D Object Definition (1/3)

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

Single View Geometry. Camera model & Orientation + Position estimation. Jianbo Shi. What am I? University of Pennsylvania GRASP

DD2423 Image Analysis and Computer Vision IMAGE FORMATION. Computational Vision and Active Perception School of Computer Science and Communication

CHAPTER 3. Single-view Geometry. 1. Consequences of Projection

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

1 Projective Geometry

Perspective Projection [2 pts]

Viewing with Computers (OpenGL)

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Homogeneous Coordinates. Lecture18: Camera Models. Representation of Line and Point in 2D. Cross Product. Overall scaling is NOT important.

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Computer Graphics Geometric Transformations

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

MAE : Lecture #12 - Projection and Perspective. Lecture Overview:

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

ME5286 Robotics Spring 2014 Quiz 1 Solution. Total Points: 30

Transforms. COMP 575/770 Spring 2013

Visual Recognition: Image Formation

Math 233. Lagrange Multipliers Basics

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Camera Projection Models We will introduce different camera projection models that relate the location of an image point to the coordinates of the

Calculus III. Math 233 Spring In-term exam April 11th. Suggested solutions

COMP 558 lecture 19 Nov. 17, 2010

Camera Calibration. Schedule. Jesus J Caban. Note: You have until next Monday to let me know. ! Today:! Camera calibration

Projective geometry, camera models and calibration

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

COSC579: Scene Geometry. Jeremy Bolton, PhD Assistant Teaching Professor

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

Robot Vision: Projective Geometry

Single View Geometry. Camera model & Orientation + Position estimation. What am I?

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

Answers to practice questions for Midterm 1

DD2429 Computational Photography :00-19:00

Models and The Viewing Pipeline. Jian Huang CS456

Structure from Motion. Prof. Marco Marcon

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

CS 351: Perspective Viewing

Geometric camera models and calibration

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

Computer Vision Projective Geometry and Calibration. Pinhole cameras

CS201 Computer Vision Camera Geometry

CS-9645 Introduction to Computer Vision Techniques Winter 2019

Linear Algebra Simplified

Transcription:

Perspective projection and Transformations

The pinhole camera

The pinhole camera P = (X,,) p = (x,y) O λ = 0 Q λ = O λ = 1 Q λ = P =-1 Q λ X = 0 + λ X 0, 0 + λ 0, 0 + λ 0 = (λx, λ, λ)

The pinhole camera Pinhole camera collapses ray OP to point p Any point on ray OP = O + λ P O = λx, λ, λ For this point to lie on =-1 plane: λ = 1 λ = 1 Coordinates of point p: P = (X,,) O p = (x,y) ( X,, )=( X,, 1) X =-1

The projection equation A point P = (X,, ) in 3D projects to a point p = (x,y) in the image x = X y = But pinhole camera s image is inverted, invert it back! x = X y =

Another derivation P = (X,,) O 1 = y 1 y p = (x,y,z)

A virtual image plane A pinhole camera produces an inverted image Imagine a virtual image plane in the front of the camera P P 1 y O y 1 O

The projection equation x = X y =

Consequence 1: Farther away objects are smaller (X, + h, ) (X,, ) Image of foot: Image of head: ( X, ) ( X, + h ) + h = h

Consequence 2: Parallel lines converge at a point Point on a line passing through point A with direction D: Q λ = A + λd Parallel lines have the same direction but pass through different points Q λ = A + λd R λ = B + λd

Consequence 2: Parallel lines converge at a point Parallel lines have the same direction but pass through different points Q λ = A + λd R λ = B + λd A = A 7, A 8, A 9 B = B 7, B 8, B 9 D = D 7, D 8, D 9

Consequence 2: Parallel lines converge at a point Q λ = A 7 + λd 7, A 8 + λd 8, A 9 + λd 9 R λ = B 7 + λd 7, B 8 + λd 8, B 9 + λd 9 q λ = ; <=>? < ; @ =>? @, ; A=>? A ; @ =>? @ r λ = C <=>? < C @ =>? @, C A=>? A C @ =>? @ Need to look at these points as goes to infinity Same as λ

Consequence 2: Parallel lines converge at a point q λ = ; <=>? < ; @ =>? @, ; A=>? A ; @ =>? @ r λ = C <=>? < C @ =>? @, C A=>? A C @ =>? @ lim!1 A X + D X A + D = lim!1 A X + D X A + D = D X D lim!1 q( )=( D X D, D D ) lim!1 r( )=( D X D, D D )

Consequence 2: Parallel lines converge at a point Parallel lines have the same direction but pass through different points Q λ = A + λd R λ = B + λd Parallel lines converge at the same point (? <? @,? A? @ ) This point of convergence is called the vanishing point What happens if D 9 = 0?

Consequence 2: Parallel lines converge at a point

What about planes? N X X + N + N = d ) N X X + N + N = d ) N X x + N y + N = d Take the limit as approaches infinity N X x + N y + N =0 Vanishing line of a plane

Changing coordinate systems P = (X,,) O O X X

Changing coordinate systems O X X

Changing coordinate systems O X

Changing coordinate systems O X

Changing coordinate systems O X

Changing coordinate systems O X

Rotations and translations How do you represent a rotation? A point in 3D: (X,,) Rotations can be represented as a matrix multiplication v 0 = Rv What are the properties of rotation matrices?

Properties of rotation matrices Rotation does not change the length of vectors v 0 = Rv kv 0 k 2 = v 0T v 0 = v T R T Rv kvk 2 = v T v ) R T R = I

Properties of rotation matrices ) R T R = I ) det(r) 2 =1 ) det(r) =±1 det(r) =1 det(r) = 1 Rotation Reflection

Rotation matrices Rotations in 3D have an axis and an angle Axis: vector that does not change when rotated Rv = v Rotation matrix has eigenvector that has eigenvalue 1

Rotation matrices from axis and angle Rotation matrix for rotation about axis v and θ First define the following matrix [v] = 2 4 0 v z v y v z 0 v x v y v x 0 Interesting fact: this matrix represents cross product [v] x = v x 3 5

Rotation matrices from axis and angle Rotation matrix for rotation about axis v and θ Rodrigues formula for rotation matrices R = I +(sin )[v] +(1 cos )[v] 2

Translations x 0 = x + t Can this be written as a matrix multiplication?

Putting everything together Change coordinate system so that center of the coordinate system is at pinhole and axis is along viewing direction x 0 w = Rx w + t Perspective projection x 0 w (X,, ) x 0 img (x, y) x = X y =

The projection equation x = X y = Is this equation linear? Can this equation be represented by a matrix multiplication?

Is projection linear? X 0 = ax + b 0 = a + b 0 = a + b x 0 = ax + b a + b y 0 = a + b a + b

Can projection be represented as a matrix multiplication? Matrix multiplication apple a b c p q r 2 3 X 4 5 = apple ax + b + c px + q + r Perspective projection x = X y =

The space of rays Every point on a ray maps it to a point on image plane Perspective projection maps rays to points All points (λx, λy, λ) map to the same image point (x,y,1) (λx, λy, λ) (x,y,1) O

Projective space R 2 Standard 2D space (plane) : Each point represented by 2 coordinates (x,y) Projective 2D space (plane) P 2 : Each point represented by 3 coordinates (x,y,z), BUT: λx, λy, λz x, y, z Mapping R 2 to P 2 (points to rays): (x, y)! (x, y, 1) Mapping to R 2 (rays to points): P 2 (x, y, z)! ( x z, y z )

Projective space and homogenous coordinates Mapping to (points to rays): R 2 P 2 Mapping to (rays to points): (x, y)! (x, y, 1) P 2 R 2 (x, y, z)! ( x z, y z ) A change of coordinates Also called homogenous coordinates

Homogenous coordinates In standard Euclidean coordinates 2D points : (x,y) 3D points : (x,y,z) In homogenous coordinates 2D points : (x,y,1) 3D points : (x,y,z,1)

Why homogenous coordinates? 2 1 0 0 3 0 40 1 0 05 0 0 1 0 2 3 X 6 4 1 7 5 = 2 3 X 4 5 2 4 X 1 3 5 Homogenous coordinates of world point Homogenous coordinates of image point

Why homogenous coordinates? 2 1 0 0 3 0 40 1 0 05 0 0 1 0 2 3 X 6 4 1 7 5 = 2 3 X 4 5 2 4 X 1 3 5 P~x w = ~x img Perspective projection is matrix multiplication in homogenous coordinates!

Why homogenous coordinates? 2 3 2 3 1 0 0 t x X 60 1 0 t y 7 6 7 40 0 1 t z 5 4 5 = 0 0 0 1 1 2 3 X + t x 6 + t y 7 4 + t z 5 1 Translation is matrix multiplication in homogenous coordinates!

Homogenous coordinates 3 a b c t x d e f t y 7 5 g h i t z 0 0 0 1 apple M t 0 T 1 2 X 6 4 1 apple xw 1 3 7 5 = = 2 3 ax + b + c + t x 6dX + e + f + t y 7 4gX + h + i + t 5 z 1 apple Mxw + t 1

Homogenous coordinates 2 3 2 3 X 1 0 0 0 40 1 0 05 6 7 4 5 = 0 0 1 0 1 2 1 0 0 3 0 40 1 0 05 0 0 1 0 2 3 X 4 5 I 2 4 0 X 1 3 5

Perspective projection in homogenous coordinates ~x img = I 0 apple R t 0 T 1 ~x w ~x img = R t ~x w

More about matrix transformations I 0 3 x 4 : Perspective projection apple I t 0 T 1 4 x 4 : Translation apple M t 0 T 4 x 4 : Affine transformation 1 (linear transformation + translation)

More about matrix transformations apple M t 0 T 1 M T M = I Euclidean

More about matrix transformations apple M t 0 T 1 M = sr R T R = I Similarity transformation

More about matrix transformations apple M t 0 T 1 M = 2 3 s x 0 0 4 0 s y 0 5 0 0 s z Anisotropic scaling and translation

More about matrix transformations apple M t 0 T 1 General affine transformation

Matrix transformations in 2D