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

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

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

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

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

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

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Projection and viewing. Computer Graphics CSE 167 Lecture 4

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

GEOMETRIC TRANSFORMATIONS AND VIEWING

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Viewing with Computers (OpenGL)

Perspective projection and Transformations

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CSE 167: Introduction to Computer Graphics Lecture #2: Coordinate Transformations

Introduction to Computer Vision

Specifying Complex Scenes

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

CIS 580, Machine Perception, Spring 2015 Homework 1 Due: :59AM

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

Camera Model and Calibration

CIS 580, Machine Perception, Spring 2016 Homework 2 Due: :59AM

Viewing and Projection

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

CSE328 Fundamentals of Computer Graphics

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CV: 3D sensing and calibration

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

Viewing and Projection

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

CS230 : Computer Graphics Lecture 6: Viewing Transformations. Tamar Shinar Computer Science & Engineering UC Riverside

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

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

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Computer Graphics 7: Viewing in 3-D

CMPSCI 670: Computer Vision! Image formation. University of Massachusetts, Amherst September 8, 2014 Instructor: Subhransu Maji

CS4670: Computer Vision

Overview. By end of the week:

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

Module 6: Pinhole camera model Lecture 32: Coordinate system conversion, Changing the image/world coordinate system

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Viewing and Projection

Computer Vision CS 776 Fall 2018

Camera Model and Calibration. Lecture-12

Computer Graphics: Viewing in 3-D. Course Website:

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

3D Viewing. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Instance-level recognition I. - Camera geometry and image alignment

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

Two-view geometry Computer Vision Spring 2018, Lecture 10

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

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

Exercise Max. Points Total 80

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Discriminant Functions for the Normal Density

3.1 Viewing and Projection

CSE 167: Lecture #6: Color. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Structure from Motion. Introduction to Computer Vision CSE 152 Lecture 10

CSE 252B: Computer Vision II

Announcement. Project 1 has been posted online and in dropbox. Due: 11:59:59 pm, Friday, October 14

Models and The Viewing Pipeline. Jian Huang CS456

Homework #1. Displays, Alpha Compositing, Image Processing, Affine Transformations, Hierarchical Modeling

Geometric camera models and calibration

3D Geometry and Camera Calibration

The Viewing Pipeline adaptation of Paul Bunn & Kerryn Hugo s notes

Assignment 2 : Projection and Homography

COMP30019 Graphics and Interaction Perspective Geometry

MATRIX REVIEW PROBLEMS: Our matrix test will be on Friday May 23rd. Here are some problems to help you review.

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

Homework 5: Transformations in geometry

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

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

Implementing a virtual camera. Graphics 2. Creating a view of the scene an outline. Virtual camera - definitions

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

3D Viewing. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Scene Modeling for a Single View

Game Architecture. 2/19/16: Rasterization

Camera model and multiple view geometry

Reminder: Affine Transformations. Viewing and Projection. Shear Transformations. Transformation Matrices in OpenGL. Specification via Ratios

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

Computer Graphics: Geometric Transformations

CSE 252B: Computer Vision II

Humanoid Robotics. Projective Geometry, Homogeneous Coordinates. (brief introduction) Maren Bennewitz

Lecture 4. Viewing, Projection and Viewport Transformations

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

Midterm Exam Fundamentals of Computer Graphics (COMP 557) Thurs. Feb. 19, 2015 Professor Michael Langer

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

One or more objects A viewer with a projection surface Projectors that go from the object(s) to the projection surface

CSE 252B: Computer Vision II

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

1 Projective Geometry

Agenda. Perspective projection. Rotations. Camera models

1 OpenGL - column vectors (column-major ordering)

CSE452 Computer Graphics

Scene Modeling for a Single View

Computer Vision I Name : CSE 252A, Fall 2012 Student ID : David Kriegman Assignment #1. (Due date: 10/23/2012) x P. = z

Transcription:

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

Announcements Project 2 due Friday at 1pm Homework 3 discussion on Monday at 4pm 2

Lecture Overview Coordinate Transformation Typical Coordinate Systems Projection 3

Coordinate System Given point p in homogeneous coordinates: Coordinates describe the point s 3D position in a coordinate system with basis vectors x, y, z and origin o: 4

Rectangular and Polar Coordinates 5

Coordinate Transformation Original xyzo coordinate system New uvwq coordinate system Goal: Find coordinates of p xyz in new uvwq coordinate system 6

Coordinate Transformation Express coordinates of xyzo reference frame with respect to uvwq reference frame: 7

Coordinate Transformation Point p expressed in new uvwq reference frame: 8

Coordinate Transformation 9

Coordinate Transformation Inverse transformation Given point P uvw w.r.t. reference frame uvwq: Coordinates P xyz w.r.t. reference frame xyzo are calculated as: 10

Lecture Overview Concatenating Transformations Coordinate Transformation Typical Coordinate Systems Projection 11

Typical Coordinate Systems In computer graphics, we typically use at least three coordinate systems: World coordinate system Camera coordinate system Object coordinate system Camera coordinates Object coordinates World coordinates

World Coordinates Common reference frame for all objects in the scene No standard for coordinate system orientation If there is a ground plane, usually x/y is horizontal and z points up (height) Otherwise, x/y is often screen plane, z points out of the screen Camera coordinates Object coordinates World coordinates 13

Object Coordinates Local coordinates in which points and other object geometry are given Often origin is in geometric center, on the base, or in a corner of the object Depends on how object is generated or used. Camera coordinates Object coordinates Source: http://motivate.maths.org World coordinates 14

Object Transformation The transformation from object to world coordinates is different for each object. Defines placement of object in scene. Given by model matrix (model-to-world transformation) M. Camera coordinates Object coordinates World coordinates 15

Camera Coordinate System Origin defines center of projection of camera x-y plane is parallel to image plane z-axis is perpendicular to image plane Camera coordinates Object coordinates World coordinates 16

Camera Coordinate System The Camera Matrix defines the transformation from camera to world coordinates Placement of camera in world Camera coordinates Object coordinates World coordinates 17

Camera Matrix Construct from center of projection e, look at d, upvector up: Camera coordinates 18 World coordinates

Camera Matrix Construct from center of projection e, look at d, upvector up (up in camera coordinate system): Camera coordinates 19 World coordinates

Camera Matrix z-axis = x-axis = y-axis = = = 0 0 0 1 20

Transforming Object to Camera Coordinates Object to world coordinates: M Camera to world coordinates: C Point to transform: p Resulting transformation equation: p = C -1 M p Camera coordinates Object coordinates World coordinates 21

Tips for Notation Indicate coordinate systems with every point or matrix Point: p object Matrix: M object world Resulting transformation equation: p camera = (C camera world ) -1 M object world p object Helpful hint: in source code use consistent names Point: p_object or p_obj or p_o Matrix: object2world or obj2wld or o2w Resulting transformation equation: wld2cam = inverse(cam2wld); p_cam = p_obj * obj2wld * wld2cam; 22

Inverse of Camera Matrix How to calculate the inverse of the camera matrix C -1? Generic matrix inversion is complex and computeintensive Affine transformation matrices can be inverted more easily Observation: Camera matrix consists of translation and rotation: T x R Inverse of rotation: R -1 = R T Inverse of translation: T(t) -1 = T(-t) Inverse of camera matrix: C -1 = R -1 xt -1 23

Objects in Camera Coordinates We have things lined up the way we like them on screen x to the right y up -z into the screen Objects to look at are in front of us, i.e. have negative z values But objects are still in 3D Next step: project scene to 2D plane 24

Lecture Overview Concatenating Transformations Coordinate Transformation Typical Coordinate Systems Projection 25

Projection Goal: Given 3D points (vertices) in camera coordinates, determine corresponding image coordinates Transforming 3D points into 2D is called Projection OpenGL supports two types of projection: Orthographic Projection (=Parallel Projection) Perspective Projection 26

Orthographic Projection Can be done by ignoring z-coordinate Use camera space xy coordinates as image coordinates Project points to x-y plane along parallel lines Often used in graphical illustrations, architecture, 3D modeling 27

Perspective Projection Most common for computer graphics Simplified model of human eye, or camera lens (pinhole camera) Things farther away appear to be smaller Discovery attributed to Filippo Brunelleschi (Italian architect) in the early 1400 s 28

Pinhole Camera San Diego, May 20 th, 2012 29

Perspective Projection Project along rays that converge in center of projection Center of projection 3D scene 2D image plane 30

Perspective Projection Parallel lines are no longer parallel, converge in one point 31 Earliest example: La Trinitá (1427) by Masaccio

Video Professor Ravi Ramamoorthi on Perspective Projection http://www.youtube.com/watch?v=vpnjbvzhncq 32