MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

Similar documents
Image Formation I Chapter 2 (R. Szelisky)

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

Image formation - About the course. Grading & Project. Tentative Schedule. Course Content. Students introduction

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

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

Geometric Model of Camera

Computer Vision CS 776 Fall 2018

Recall: Imaging Geometry. Lecture 13: Camera Projection II. Imaging Geometry. Imaging Geometry. Imaging Geometry. Imaging Geometry

Perspective projection. A. Mantegna, Martyrdom of St. Christopher, c. 1450

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

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

3D Geometry and Camera Calibration

CS 2770: Intro to Computer Vision. Multiple Views. Prof. Adriana Kovashka University of Pittsburgh March 14, 2017

Geometry of image formation

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

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

Modeling Transformations

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

Computer Vision cmput 428/615

Modeling Transformations

Geometry of a single camera. Odilon Redon, Cyclops, 1914

Robotics - Projective Geometry and Camera model. Marcello Restelli

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

Projective Geometry and Camera Models

Announcements. The equation of projection. Image Formation and Cameras

How to achieve this goal? (1) Cameras

Image formation. Thanks to Peter Corke and Chuck Dyer for the use of some slides

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Image Warping. Some slides from Steve Seitz

3D Sensing. Translation and Scaling in 3D. Rotation about Arbitrary Axis. Rotation in 3D is about an axis

COS429: COMPUTER VISON CAMERAS AND PROJECTIONS (2 lectures)

Jorge Salvador Marques, geometric camera model

Perspective Projection Transformation

Projective Geometry and Camera Models

3-Dimensional Viewing

Affine and Projective Transformations

Geometric camera models and calibration

Perception II: Pinhole camera and Stereo Vision

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Image Warping CSE399b, Spring 07 Computer Vision

Vision Review: Image Formation. Course web page:

CS6670: Computer Vision

Image Formation. Antonino Furnari. Image Processing Lab Dipartimento di Matematica e Informatica Università degli Studi di Catania

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Image Warping, mesh, and triangulation CSE399b, Spring 07 Computer Vision

Cameras and Stereo CSE 455. Linda Shapiro

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

Lecture 8: Camera Models

CS231M Mobile Computer Vision Structure from motion

Modeling Light. On Simulating the Visual Experience

Camera model and multiple view geometry

Viewing Transformations I Comp 535

Image Warping (Szeliski Sec 2.1.2)

Structure from motion

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Computer Graphics. Geometric Transformations

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

Computer Graphics. Geometric Transformations

Image Warping. Some slides from Steve Seitz

Uses of Transformations. 2D transformations Homogeneous coordinates. Transformations. Transformations. Transformations. Transformations and matrices

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

Pinhole Camera Model 10/05/17. Computational Photography Derek Hoiem, University of Illinois

Last Lecture. Edge Detection. Filtering Pyramid

Introduction to Computer Vision

Transformations. Examples of transformations: shear. scaling

Warping, Morphing and Mosaics

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

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Computer Vision Lecture 20

What and Why Transformations?

Structure from Motion

Vector Algebra Transformations. Lecture 4

3-D D Euclidean Space - Vectors

Image warping. image filtering: change range of image. image warping: change domain of image g(x) = f(h(x)) h(y)=0.5y+0.5. h([x,y])=[x,y/2] f h

CS4670: Computer Vision

CV: 3D to 2D mathematics. Perspective transformation; camera calibration; stereo computation; and more

ECE Digital Image Processing and Introduction to Computer Vision. Outline

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

Agenda. Perspective projection. Rotations. Camera models

How is project #1 going?

Camera Model and Calibration

Outline. ETN-FPI Training School on Plenoptic Sensing

Camera Model and Calibration. Lecture-12

[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]

3D Viewing. CS 4620 Lecture 8

Epipolar Constraint. Epipolar Lines. Epipolar Geometry. Another look (with math).

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

Lecture 11 MRF s (conbnued), cameras and lenses.

3D Geometry and Camera Calibration

Camera Calibration. COS 429 Princeton University

Viewing. Part II (The Synthetic Camera) CS123 INTRODUCTION TO COMPUTER GRAPHICS. Andries van Dam 10/10/2017 1/31

CS559: Computer Graphics

Camera Models and Image Formation. Srikumar Ramalingam School of Computing University of Utah

Image warping/morphing

D-Calib: Calibration Software for Multiple Cameras System

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

Transcription:

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

Image formation How are objects in the world captured in an image?

Phsical parameters of image formation Geometric Tpe of projection Camera pose Optical Sensor s lens tpe focal length, field of view, aperture Photometric Tpe, direction, intensit of light reaching sensor Surfaces reflectance properties

Image formation Let s design a camera Idea : put a piece of film in front of an object Do we get a reasonable image? Slide b Steve Seitz

Pinhole camera Add a barrier to block off most of the ras This reduces blurring The opening is known as the aperture How does this transform the image? Slide b Steve Seitz

Pinhole camera Pinhole camera is a simple model to approimate imaging process, perspective projection. Image plane Virtual image pinhole If we treat pinhole as a point, onl one ra from an given point can enter the camera. Fig from Forsth and Ponce

Camera obscura In Latin, means dark room "Reinerus Gemma-Frisius, observed an eclipse of the sun at Louvain on Januar 24, 544, and later he used this illustration of the event in his book De Radio Astronomica et Geometrica, 545. It is thought to be the first published illustration of a camera obscura..." Hammond, John H., The Camera Obscura, A Chronicle http://www.acmi.net.au/aic/camera_obscura.html

Camera obscura Jett at Margate England, 898. An attraction in the late 9 th centur Around 87s http://brightbtes.com/cosite/collection2.html Adapted from R. Duraiswami

Camera obscura at home Sketch from http://www.funsci.com/fun3_en/sk/sk.htm http://blog.makezine.com/archive/26/2/how_to_room_ sized_camera_obscu.html

Perspective effects

Perspective effects Far awa objects appear smaller Forsth and Ponce

Perspective effects

Perspective effects Parallel lines in the scene intersect in the image Converge in image on horizon line Image plane (virtual) pinhole Scene

Projection properties Man-to-one: an points along same ra map to same point in image Points points Lines lines (collinearit preserved) Distances and angles are not preserved Degenerate cases: Line through focal point projects to a point. Plane through focal point projects to line Plane perpendicular to image plane projects to part of the image.

Perspective and art Use of correct perspective projection indicated in st centur B.C. frescoes Skill resurfaces in Renaissance: artists develop sstematic methods to determine perspective projection (around 48-55) Raphael Durer, 525

Perspective projection equations 3d world mapped to 2d projection in image plane Image plane Focal length Camera frame Optical ais Scene / world points Scene point Image coordinates Forsth and Ponce

Homogeneous coordinates Is this a linear transformation? no division b z is nonlinear Trick: add one more coordinate: homogeneous image coordinates homogeneous scene coordinates Converting from homogeneous coordinates Slide b Steve Seitz

Perspective Projection Matri divide b the third coordinate to convert back to non-homogeneous coordinates Projection is a matri multiplication using homogeneous coordinates: ' / ' / f z z f ) ', ' ( z f z f Slide b Steve Seitz Complete mapping from world points to image piel positions?

Perspective projection & calibration Perspective equations so far in terms of camera s reference frame. Camera s intrinsic and etrinsic parameters needed to calibrate geometr. Camera frame

Perspective projection & calibration World frame Etrinsic: Camera frame World frame Camera frame Intrinsic: Image coordinates relative to camera Piel coordinates 2D point (3) = Camera to piel coord. trans. matri (33) Perspective projection matri (34) World to camera coord. trans. matri (44) 3D point (4)

Weak perspective Approimation: treat magnification as constant Assumes scene depth << average distance to camera Image plane World points:

Orthographic projection Given camera at constant distance from scene World points projected along ras parallel to optical access

Pinhole size / aperture How does the size of the aperture affect the image we d get? Larger Smaller

Adding a lens focal point f A lens focuses light onto the film Ras passing through the center are not deviated All parallel ras converge to one point on a plane located at the focal length f Slide b Steve Seitz

Pinhole vs. lens

Cameras with lenses F optical center (Center Of Projection) focal point A lens focuses parallel ras onto a single focal point Gather more light, while keeping focus; make pinhole perspective projection practical

Camera Parameters

Imaging Geometr Object of Interest in World Coordinate Sstem (U,V,W) W U V

Imaging Geometr Camera Coordinate Sstem (,,). f is optic ais Image plane located f units out along optic ais f is called focal length

Imaging Geometr W U V Forward Projection onto image plane. 3D (,,) projected to 2D (,)

Imaging Geometr W u U V v Our image gets digitized into piel coordinates (u,v)

Camera Coordinates Imaging Geometr Image (film) Coordinates World Coordinates W u U V v Piel Coordinates

Forward Projection World Coords Camera Coords Film Coords Piel Coords U V W u v We want a mathematical model to describe how 3D World points get projected into 2D Piel coordinates. Our goal: describe this sequence of transformations b a big matri equation!

Backward Projection World Coords Camera Coords Film Coords Piel Coords U V W u v Note, much of vision concerns tring to derive backward projection equations to recover 3D scene structure from images (via stereo or motion) But first, we have to understand forward projection

Forward Projection World Coords Camera Coords Film Coords Piel Coords U V W u v 3D-to-2D Projection perspective projection We will start here in the middle, since we ve alread talked about this when discussing stereo.

Basic Perspective Projection Image Point Scene Point p = (,,f) O P = (,,) f Perspective Projection Eqns f f O.Camps, PSU

Basic Perspective Projection Image Point Scene Point p = (,,f) O P = (,,) f Perspective Projection Eqns f f derived via similar triangles rule O.Camps, PSU f

Basic Perspective Projection Image Point Scene Point p = (,,f) O P = (,,) f Perspective Projection Eqns f f derived via similar triangles rule O.Camps, PSU f f

Basic Perspective Projection Image Point Scene Point p = (,,f) O P = (,,) f Perspective Projection Eqns f f So how do we represent this as a matri equation? We need to introduce homogeneous coordinates. O.Camps, PSU

Homogeneous Coordinates Represent a 2D point (,) b a 3D point (,,z ) b adding a fictitious third coordinate. B convention, we specif that given (,,z ) we can recover the 2D point (,) as ' z' ' z' Note: (,) = (,,) = (2, 2, 2) = (k, k, k) for an nonzero k (can be negative as well as positive)

Perspective Matri Equation (in Camera Coordinates) ' ' ' f f z f f

Forward Projection World Coords Camera Coords Film Coords Piel Coords U V W u v Rigid Transformation (rotation+translation) between world and camera coordinate sstems

World to Camera Transformation P C P W W U V Avoid confusion: Pw and Pc are not two different points. The are the same phsical point, described in two different coordinate sstems.

World to Camera Transformation P C P W W R Rotate to align aes C U Translate b - C (align origins) V P C = R ( P W - C )

Matri Form, Homogeneous Coords P C = R ( P W - C ) r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 c c c z U V W

left camera located at (,,) Eample: Simple Stereo Sstem T z (, ) Left camera located at world origin (,,) and camera aes aligned with world coord aes. (, ) (,,) z right camera located at (T,,)

Simple Stereo, Left Camera r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 c c c z U V W camera aes aligned with world aes located at world position (,,) =

Simple Stereo Projection Equations Left camera

left camera located at (,,) Eample: Simple Stereo Sstem T z (, ) Right camera located at world location (T,,) and camera aes aligned with world coord aes. (, ) (,,) z right camera located at (T,,)

Simple Stereo, Right Camera r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 c c c -T z U V W camera aes aligned with world aes located at world position (T,,) =

Simple Stereo Projection Equations Left camera Right camera

Bob s sure-fire wa(s) to figure out the rotation r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 c c c forget about this while thinking about rotations z U V W P C = R P W This equation sas how vectors in the world coordinate sstem (including the coordinate aes) get transformed into the camera coordinate sstem.

Figuring out Rotations r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 U V W P C = R P W what if world ais (,,) corresponds to camera ais (a,b,c)? a r r 2 r 3 U a ra r 2 r 3 U b r 2 r 22 r 23 V b rb 2 r 22 r 23 V c r 3 r 32 r 33 W c rc 3 r 32 r 33 W we can immediatel write down the first column of R!

Figuring out Rotations and likewise with world ais and world ais... same ais in camera coords r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 ais is world coords U V W world ais (,,) in camera coords world ais (,,) in camera coords world ais (,,) in camera coords

Figuring out Rotations Alternative approach: sometimes it is easier to specif what camera,,or ais is in world coordinates. Then do rearrange the equation as follows. P C = R P W R - P C = P W R T P C = P W r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 U V W

Figuring out Rotations r 2 r 3 r r 2 r 22 r 32 r 3 r 23 r 33 U V W R T P C = P W what if camera ais (,,) corresponds to world ais (a,b,c)? r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 Ua Vb Wc a rb 2 r 22 r 32 rc 3 r 23 r 33 Ua Vb Wc we can immediatel write down the first column of R T, (which is the first row of R). r r 2 r 3

Figuring out Rotations and likewise with camera ais and camera ais... same ais in camera coords camera ais (,,) in world coords r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 ais is world coords U V W camera ais (,,) in world coords camera ais (,,) in world coords

Eample z - R train - R fl -

Note: Eternal Parameters also often written as R,T r r 2 r 3 r 2 r 22 r 32 r 3 r 23 r 33 c c c z U V W R ( P W - C ) = R P W - R C = R P W + T r 2 r 3 r 2 r 23 r 22 r r 3 r 32 r 33 t t t z

Summar World Coords Camera Coords Film Coords Piel Coords U V W u v We now know how to transform 3D world coordinate points into camera coords, and then do perspective project to get 2D points in the film plane. Net time: piel coordinates

Recall: Imaging Geometr Object of Interest in World Coordinate Sstem (U,V,W) W U V

Imaging Geometr Camera Coordinate Sstem (,,). f is optic ais Image plane located f units out along optic ais f is called focal length

Imaging Geometr W U V Forward Projection onto image plane. 3D (,,) projected to 2D (,)

Imaging Geometr W u U V v Our image gets digitized into piel coordinates (u,v)

Camera Coordinates Imaging Geometr Image (film) Coordinates World Coordinates W u U V v Piel Coordinates

Forward Projection World Coords Camera Coords Film Coords Piel Coords U V W u v We want a mathematical model to describe how 3D World points get projected into 2D Piel coordinates. Our goal: describe this sequence of transformations b a big matri equation!

Intrinsic Camera Parameters World Coords Camera Coords Film Coords Piel Coords U V W u v Affine Transformation

Intrinsic parameters Describes coordinate transformation between film coordinates (projected image) and piel arra Film cameras: scanning/digitization CCD cameras: grid of photosensors still in T&V section 2.4

Intrinsic parameters (offsets) film plane (projected image) o (,) piel arra u (col) o (,) v (row) u f o o and o called image center or principle point v f o

film plane Intrinsic parameters sometimes one or more coordinate aes are flipped (e.g. T&V section 2.4) piel arra o o (,) (,) v (row) u (col) u f o v f o

Intrinsic parameters (scales) sampling determines how man rows/cols in the image film scanning resolution piel arra CCD analog C cols R rows resample

Effective Scales: s and s u f o v s s f o Note, since we have different scale factors in and, we don t necessaril have square piels! Aspect ratio is s / s O.Camps, PSU

Perspective projection matri / / ' ' ' o o s f s f z O.Camps, PSU Adding the intrinsic parameters into the perspective projection matri: o u f s o v f s u z v z To verif:

Note: Sometimes, the image and the camera coordinate sstems Sometimes, the image and the camera coordinate sstems have opposite orientations: [the book does it this wa] have opposite orientations: [the book does it this wa] / / ' ' ' o o s f s f z s o v f s o u f ) ( ) (

u v w Note 2 In general, I like to think of the conversion as a separate 2D affine transformation from film coords (,) to piel coordinates (u,v): a' 3 ' z' a a 2 a 2 a 22 a 23 M aff f f M proj u = M int P C = M aff M proj P C

Huh? Did he just sa it was a fine transformation? No, it was affine transformation, a tpe of 2D to 2D mapping defined b 6 parameters. More on this in a moment...

Summar : Forward Projection World Coords U V W Camera Coords Film Coords M et M proj M aff Piel Coords u v U V W M et M int u v U V W m m m 2 3 m m m 2 22 3 M m m m 3 23 33 m m m 4 24 34 u v

Summar: Projection Equation Film plane to piels Perspective projection World to camera M aff M proj M et M int M

Intro to Image Mappings

Image Mappings Overview from R.Szeliski

Geometric Image Mappings image Geometric transformation transformed image (,) (, ) = f(,, {parameters}) = g(,, {parameters})

Linear Transformations (Can be written as matrices) image Geometric transformation transformed image (,) (, ) = M(params)

Translation transform t t equations matri form

Scale transform S S equations matri form

Rotation transform ) equations matri form

Euclidean (Rigid) transform ) t t equations matri form

Partitioned Matrices http://planetmath.org/encclopedia/partitionedmatri.html

Partitioned Matrices 2 22 2 2 2 matri form equation form

Another Eample (from last time) r 2 r 3 r 2 r 23 r 22 r r 3 r 32 r 33 t t t z U V W 3 P C 33 3 = R T 3 P W 3 P C = R P W + T

Similarit (scaled Euclidean) transform ) S t t equations matri form

Affine transform equations matri form

Projective transform Note! equations matri form

Summar of 2D Transformations

Euclidean Summar of 2D Transformations

Similarit Summar of 2D Transformations

Affine Summar of 2D Transformations

Projective Summar of 2D Transformations

from R.Szeliski Summar of 2D Transformations