Camera Calibration. COS 429 Princeton University

Similar documents
3D Geometry and Camera Calibration

Image-Based Rendering

CS6670: Computer Vision

Structure from motion

Noah Snavely Steven M. Seitz. Richard Szeliski. University of Washington. Microsoft Research. Modified from authors slides

Camera Geometry II. COS 429 Princeton University

Photo Tourism: Exploring Photo Collections in 3D

Structure from Motion CSC 767

Camera Model and Calibration

CS6670: Computer Vision

3D Geometry and Camera Calibration

Image correspondences and structure from motion

Structure from motion

Photo Tourism: Exploring Photo Collections in 3D

1 Projective Geometry

Epipolar Geometry and Stereo Vision

Structure from motion

Homographies and RANSAC

More Mosaic Madness. CS194: Image Manipulation & Computational Photography. Steve Seitz and Rick Szeliski. Jeffrey Martin (jeffrey-martin.

Agenda. Rotations. Camera calibration. Homography. Ransac

Epipolar Geometry and Stereo Vision

Camera Model and Calibration. Lecture-12

Vision Review: Image Formation. Course web page:

Mosaics. Today s Readings

Computer Vision Lecture 17

Computer Vision Projective Geometry and Calibration. Pinhole cameras

CS4670: Computer Vision

Computer Vision Lecture 17

Image warping and stitching

Image Warping and Mosacing

Announcements. Mosaics. How to do it? Image Mosaics

Geometric camera models and calibration

Image Formation I Chapter 2 (R. Szelisky)

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

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

Image warping and stitching

Specifying Complex Scenes

3D Sensing and Reconstruction Readings: Ch 12: , Ch 13: ,

N-Views (1) Homographies and Projection

3-D D Euclidean Space - Vectors

Structure from Motion

CV: 3D sensing and calibration

Single-view 3D Reconstruction

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

Agenda. Rotations. Camera models. Camera calibration. Homographies

Outline. ETN-FPI Training School on Plenoptic Sensing

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

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

Structure from Motion

Computer Vision cmput 428/615

calibrated coordinates Linear transformation pixel coordinates

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

Transforms. COMP 575/770 Spring 2013

Image warping and stitching

Visual Recognition: Image Formation

3D Sensing. 3D Shape from X. Perspective Geometry. Camera Model. Camera Calibration. General Stereo Triangulation.

COS429: COMPUTER VISON CAMERAS AND PROJECTIONS (2 lectures)

Image Formation I Chapter 1 (Forsyth&Ponce) Cameras

Miniature faking. In close-up photo, the depth of field is limited.

Reminder: Lecture 20: The Eight-Point Algorithm. Essential/Fundamental Matrix. E/F Matrix Summary. Computing F. Computing F from Point Matches

Epipolar Geometry and Stereo Vision

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

Lecture 14: Basic Multi-View Geometry

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

BIL Computer Vision Apr 16, 2014

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

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

Introduction to Homogeneous coordinates

Advanced Digital Photography and Geometry Capture. Visual Imaging in the Electronic Age Lecture #10 Donald P. Greenberg September 24, 2015

Projective Geometry and Camera Models

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

C280, Computer Vision

CS4670/5670: Computer Vision Kavita Bala. Lec 19: Single- view modeling 2

All human beings desire to know. [...] sight, more than any other senses, gives us knowledge of things and clarifies many differences among them.

Advanced Digital Photography and Geometry Capture. Visual Imaging in the Electronic Age Lecture #10 Donald P. Greenberg September 24, 2015

Advanced Computer Graphics Transformations. Matthias Teschner

Midterm Exam Solutions

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

arxiv: v1 [cs.cv] 28 Sep 2018

Multi-view geometry problems

Image stitching. Digital Visual Effects Yung-Yu Chuang. with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac

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

Scene Modeling for a Single View

Agenda. Perspective projection. Rotations. Camera models

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

Improving Initial Estimations for Structure from Motion Methods

Cameras and Stereo CSE 455. Linda Shapiro

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

arxiv: v1 [cs.cv] 28 Sep 2018

Multi-view stereo. Many slides adapted from S. Seitz

Lecture 8.2 Structure from Motion. Thomas Opsahl

Today. Stereo (two view) reconstruction. Multiview geometry. Today. Multiview geometry. Computational Photography

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

Structure from Motion

Stereo. 11/02/2012 CS129, Brown James Hays. Slides by Kristen Grauman

Geometry: Outline. Projections. Orthographic Perspective

Today s lecture. Image Alignment and Stitching. Readings. Motion models

Project 4 Results. Representation. Data. Learning. Zachary, Hung-I, Paul, Emanuel. SIFT and HoG are popular and successful.

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Transcription:

Camera Calibration COS 429 Princeton University

Point Correspondences What can you figure out from point correspondences? Noah Snavely

Point Correspondences X 1 X 4 X 3 X 2 X 5 X 6 X 7 p 1,1 p 1,2 p 1,3 Camera 1 Camera 3 Camera 2 Noah Snavely

Camera calibration Suppose we know 3D point positions and correspondences to pixels in every image Can we compute the camera parameters? Noah Snavely

Camera triangulation Suppose we know the camera parameters and correspondences between points and pixels in every image? Noah Snavely

Camera calibration & triangulation Need to understand how 3D points project into images Noah Snavely

Outline Camera model Camera calibration Camera triangulation Structure from motion

Outline Camera model Camera calibration Camera triangulation Structure from motion

2D Image Basics Origin at center, for now Y axis is up Will often write (u, v) for image coordinates v u

3D Geometry Basics 3D points = column vectors Transformations = pre-multiplied matrices

3D Geometry Basics Right-handed vs. left-handed coordinate systems x x y z z y

Rotation Rotation about the z axis Rotation about x, y axes similar (cyclically permute x, y, z)

Arbitrary Rotation Any rotation is a composition of rotations about x, y, and z Composition of transformations = matrix multiplication (watch the order!) Result: orthonormal matrix Each row, column has unit length Dot product of rows or columns = 0 Inverse of matrix = transpose

Arbitrary Rotation Rotate around x, y, then z: Don t do this! It s probably buggy! Compute simple matrices and multiply them

Scale in x, y, z: Scale

Shear Shear parallel to xy plane:

Translation Can translation be represented by multiplying by a 33 matrix? No. Proof?

Homogeneous Coordinates Add a fourth dimension to each 3D point: To get real (3D) coordinates, divide by w:

Translation in Homogeneous Coordinates After divide by w, this is just a translation by (t x, t y, t z )

Perspective Projection Map points onto view plane along projectors emanating from center of projection (COP) Center of Projection View Plane Angel Figure 5.9

Perspective Projection Compute 2D coordinates from 3D coordinates with similar triangles -z (x,y,z) -z f y (0,0,0) z What are the coordinates of the point resulting from projection of (x,y,z) onto the view plane? View Plane -y

Perspective Projection Compute 2D coordinates from 3D coordinates with similar triangles -z (x c,y c,z c ) -z f y (0,0,0) z (x c f/z c, y c f/z c ) View Plane -y

Perspective Projection Matrix 4x4 matrix representation: 1 / / s s c c s c c s w f z z f y y z f x x f z w z z y y x x c c c c / ' ' ' ' ' / ' ' / ' ' / ' w z z w y y w x x s s s 1 0 1/ 0 0 0 1 0 0 0 0 1 0 0 0 0 1 c c c s s s s z y x f w z y x

Perspective Projection Properties Points points Lines lines (collinearity preserved) Distances and angles are not preserved Many points along same ray map to same point in image 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. Slide by Kristen Grauman

Perspective Effects Far away objects appear smaller Forsyth and Ponce

Perspective Effects

Perspective Effects Parallel lines in the scene intersect at a point after projection onto image plane Vanishing point Image plane (virtual) Center of projection Scene Slide by Kristen Grauman

Perspective Effects Vanishing Points Any set of parallel lines on a plane define a vanishing point The union of all of these vanishing points is the horizon line also called vanishing line Different planes (can) define different vanishing lines v 1 l v 2 Noah Snavely

A Camera Model Translate to image center Then unwarp radial distortion Scale to pixel size Perspective projection Camera orientation Camera location 3D point (homogeneous coords) Then perform homogeneous divide, and get (u,v) coords

A Camera Model Normalized device coordinates Camera coordinates Image coordinates Pixel coordinates World coordinates

A Camera Model Intrinsics Extrinsics

Camera parameters Extrinsic: how to map world coordinates to camera coordinates (translation and rotation) Intrinsic: how to map camera coordinates to image coordinates (projection, translation, scale)

Camera parameters Extrinsic: how to map world coordinates to camera coordinates (translation and rotation) P c R( P T) w Camera coordinates World coordinates

Camera parameters Intrinsic: how to map camera coordinates to image coordinates (projection, translation, scale) X x ( f o s x) x Z Y y ( f o ) y s y Z Coordinates of projected point in image coordinates Coordinates of image point in camera coordinates Coordinates of image center in pixel units Effective size of a pixel (mm)

Camera parameters Substituting previous eqns describing intrinsic and extrinsic parameters, can relate pixels coordinates to world points: ) ( ) ( ) ( 3 1 T P R T P R w w x x im f s o x ) ( ) ( ) ( 3 2 T P R T P R w w y y im f s o y R i = Row i of rotation matrix

Projection matrix This can be rewritten as a matrix product using homogeneous coordinates: 1 0 0 / 0 0 / int y y x x o s f o s f M T R T R T R M 3 33 32 31 2 23 22 21 1 13 12 11 r r r r r r r r r ext 1 int w w w ext im im Z Y X w wy wx M M where:

Radial Distortion Finally, would like to include transformation to unwarp radial distortion:

Radial Distortion Radial distortion cannot be represented by matrix (c u, c v ) is image center, u * img= u img c u, v * img= v img c v, k is first-order radial distortion coefficient

A Camera Model Translate to image center Then unwarp radial distortion Scale to pixel size Perspective projection Camera orientation Camera location 3D point (homogeneous coords) Then perform homogeneous divide, and get (u,v) coords

Outline Camera model Camera calibration Camera triangulation Structure from motion

Camera Calibration Compute intrinsic and extrinsic parameters using observed camera data Main idea Place calibration object with known geometry in the scene Get correspondences Solve for mapping from scene to image: estimate M=M int M ext

Camera Calibration Chromaglyphs Courtesy of Bruce Culbertson, HP Labs http://www.hpl.hp.com/personal/bruce_culbertson/ibr98/chromagl.htm

Camera Calibration Input: 3D 2D correspondences General perspective camera model (no radial distortion, for now) Output: Camera model parameters

Direct linear calibration

Direct linear calibration Can solve for m ij by linear least squares

Advantage: Direct linear calibration Very simple to formulate and solve Disadvantages: Doesn t tell you the camera parameters Doesn t model radial distortion Hard to impose constraints (e.g., known f) Doesn t minimize the right error function Why?

Nonlinear Camera Calibration Incorporating additional constraints into camera model No shear, no scale (rigid-body motion) Square pixels Radial distortion etc. These impose nonlinear constraints on camera parameters

Application: Sea of Images Aliaga

Application: Sea of Images Off-line: Camera calibration Feature correspondence Real-time: Image warping Image composition Large-scale Dense Capture Interactive Walkthroughs Aliaga

Sea of Images Capture Hemispherical FOV camera focal point mirror m image plane i p camera Paraboloidal Catadioptric Camera [Nayar97] Aliaga

Sea of Images Capture Capture lots of images with hemispherical FOV camera driven on cart Aliaga

Sea of Images Calibration Calibrate camera based on positions of fiducials Aliaga

Sea of Images Calibration Result is a sea of images with known camera viewpoints spaced a few inches apart Aliaga

Sea of Images Correspondence Search for feature correspondences in nearby images A B A B C Captured image viewpoints C Aliaga

Sea of Images Rendering Create image from new viewpoint by warping and compositing three nearest images using triangles of feature correspondences A New viewpoint B A B C Captured image viewpoints C Aliaga

Sea of Images Rendering Neat data management based on hierarchical encoding to enable interactive walkthrough floor plan New viewpoint Captured image viewpoints Aliaga

Bell Labs Museum 900 square ft 9832 images 2.2 inch spacing Princeton Library 120 square ft 1947 images 1.6 inches Personal Office 30 square feet 3475 images 0.7 inches Sea of Images Results Aliaga

Sea of Images Results Aliaga

Sea of Images Results Aliaga

Sea of Images Results Aliaga

Outline Camera model Camera calibration Camera triangulation Structure from motion

Camera calibration summary Suppose we know 3D point positions and correspondences to pixels in every image We can compute the camera parameters Noah Snavely

Camera triangulation Suppose we know the camera parameters and correspondences between points and pixels in every image? Noah Snavely

Camera calibration & triangulation Suppose no camera parameters or point positions And have matches between these points and two images Can we compute them both together? Noah Snavely

Outline Camera model Camera calibration Camera triangulation Structure from motion

Structure from motion Given many images a) figure out where they were all taken from? b) build a 3D model of the scene? Noah Snavely

Structure from motion Feature detection Feature description Feature matching Feature correspondence Camera calibration and triangulation Noah Snavely

Feature detection Detect features using SIFT [Lowe, IJCV 2004] Noah Snavely

Feature detection Detect features using SIFT [Lowe, IJCV 2004] Noah Snavely

Feature matching Match features between each pair of images Noah Snavely

Feature matching Refine matching using RANSAC to correspondences between each pair Noah Snavely

Image connectivity graph (graph layout produced using the Graphviz toolkit: http://www.graphviz.org/) Noah Snavely

Structure from motion X 1 X 4 X 5 X 6 X 2 X 3 X 7 minimize g(r, T, X) non-linear least squares p 1,1 p 1,2 p 1,3 Camera 1 R 1,t 1 R 2,t 2 Camera 2 Camera 3 R 3,t 3 Noah Snavely

Structure from motion Minimize sum of squared reprojection errors: predicted image location indicator variable: is point i visible in image j? Minimizing this function is called bundle adjustment Optimized using non-linear least squares, e.g. Levenberg-Marquardt observed image location Noah Snavely

Problem size What are the variables? How many variables per camera? How many variables per point? Trevi Fountain collection 466 input photos + > 100,000 3D points = very large optimization problem Noah Snavely

Structure from motion Noah Snavely

Incremental structure from motion Noah Snavely

Incremental structure from motion Noah Snavely

Incremental structure from motion Noah Snavely

Incremental structure from motion Noah Snavely

Incremental structure from motion Noah Snavely

Structure from Motion Results For photo sets from the Internet, 20% to 75% of the photos were registered Most unregistered photos belonged to different connected components Running time: < 1 hour for 80 photos > 1 week for 2600 photo Noah Snavely

Structure from Motion Results Noah Snavely

Photo Tourism: Exploring Photo Collections in 3D Noah Snavely Steven M. Seitz University of Washington Richard Szeliski Microsoft Research Noah Snavely

15,464 37,383 76,389 Noah Snavely

Reproduced with permission of Yahoo! Inc. 2005 by Yahoo! Inc. YAHOO! and the YAHOO! logo are trademarks of Yahoo! Inc. Noah Snavely

Example: Prague Old Town Square Noah Snavely

Rendering transitions Noah Snavely

Annotations Noah Snavely

Annotations Noah Snavely

Summary Camera model Camera calibration Camera triangulation Structure from motion Noah Snavely