Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/19

Slides:



Advertisements
Similar presentations
Zhengyou Zhang Vision Technology Group Microsoft Research
Advertisements

Single-view geometry Odilon Redon, Cyclops, 1914.
The fundamental matrix F
Last 4 lectures Camera Structure HDR Image Filtering Image Transform.
CS 691 Computational Photography Instructor: Gianfranco Doretto 3D to 2D Projections.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2011 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
RANSAC and mosaic wrap-up cs195g: Computational Photography James Hays, Brown, Spring 2010 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve.
MASKS © 2004 Invitation to 3D vision Lecture 7 Step-by-Step Model Buidling.
Computer vision: models, learning and inference
Self-calibration.
Chapter 6 Feature-based alignment Advanced Computer Vision.
Camera calibration and epipolar geometry
Structure from motion.
CS6670: Computer Vision Noah Snavely Lecture 17: Stereo
Motion Analysis (contd.) Slides are from RPI Registration Class.
Epipolar geometry. (i)Correspondence geometry: Given an image point x in the first view, how does this constrain the position of the corresponding point.
Structure from motion. Multiple-view geometry questions Scene geometry (structure): Given 2D point matches in two or more images, where are the corresponding.
Uncalibrated Geometry & Stratification Sastry and Yang
Announcements Project 2 questions Midterm out on Thursday
Uncalibrated Epipolar - Calibration
Lecture 11: Structure from motion CS6670: Computer Vision Noah Snavely.
Lecture 20: Light, color, and reflectance CS6670: Computer Vision Noah Snavely.
Panorama signups Panorama project issues? Nalwa handout Announcements.
Sebastian Thrun and Jana Kosecha CS223B Computer Vision, Winter 2007 Stanford CS223B Computer Vision, Winter 2007 Lecture 4 Camera Calibration Professors.
Lecture 16: Single-view modeling, Part 2 CS6670: Computer Vision Noah Snavely.
Single-view geometry Odilon Redon, Cyclops, 1914.
Panoramas and Calibration : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
CSCE 641 Computer Graphics: Image-based Modeling (Cont.) Jinxiang Chai.
CSE 576, Spring 2008Projective Geometry1 Lecture slides by Steve Seitz (mostly) Lecture presented by Rick Szeliski.
Camera parameters Extrinisic parameters define location and orientation of camera reference frame with respect to world frame Intrinsic parameters define.
Lecture 12: Structure from motion CS6670: Computer Vision Noah Snavely.
Today: Calibration What are the camera parameters?
Projective Geometry and Single View Modeling CSE 455, Winter 2010 January 29, 2010 Ames Room.
Single-view modeling, Part 2 CS4670/5670: Computer Vision Noah Snavely.
776 Computer Vision Jan-Michael Frahm, Enrique Dunn Spring 2013.
CSC 589 Lecture 22 Image Alignment and least square methods Bei Xiao American University April 13.
Last Lecture (optical center) origin principal point P (X,Y,Z) p (x,y) x y.
Geometric Models & Camera Calibration
Camera calibration Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz,, Fred Pighin and Marc Pollefyes.
CSCE 643 Computer Vision: Structure from Motion
Vision Review: Image Formation Course web page: September 10, 2002.
Project 2 –contact your partner to coordinate ASAP –more work than the last project (> 1 week) –you should have signed up for panorama kitssigned up –sign.
Peripheral drift illusion. Multiple views Hartley and Zisserman Lowe stereo vision structure from motion optical flow.
Single-view geometry Odilon Redon, Cyclops, 1914.
Ch. 3: Geometric Camera Calibration
EECS 274 Computer Vision Geometric Camera Calibration.
Bundle Adjustment A Modern Synthesis Bill Triggs, Philip McLauchlan, Richard Hartley and Andrew Fitzgibbon Presentation by Marios Xanthidis 5 th of No.
Single-view geometry Odilon Redon, Cyclops, 1914.
Project 1 Due NOW Project 2 out today –Help session at end of class Announcements.
Example: warping triangles Given two triangles: ABC and A’B’C’ in 2D (12 numbers) Need to find transform T to transfer all pixels from one to the other.
Project 2 went out on Tuesday You should have a partner You should have signed up for a panorama kit Announcements.
Camera Calibration Course web page: vision.cis.udel.edu/cv March 24, 2003  Lecture 17.
Calibrating a single camera
Geometric Camera Calibration
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Depth from disparity (x´,y´)=(x+D(x,y), y)
Digital Visual Effects, Spring 2007 Yung-Yu Chuang 2007/4/17
Digital Visual Effects, Spring 2008 Yung-Yu Chuang 2008/4/15
Epipolar geometry.
More Mosaic Madness : Computational Photography
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Digital Visual Effects Yung-Yu Chuang
2D transformations (a.k.a. warping)
Projective geometry Readings
Noah Snavely.
Video Compass Jana Kosecka and Wei Zhang George Mason University
Single-view geometry Odilon Redon, Cyclops, 1914.
Calibration and homographies
Announcements Project 2 extension: Friday, Feb 8
Presentation transcript:

Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/19 Camera calibration Digital Visual Effects, Spring 2006 Yung-Yu Chuang 2005/4/19 with slides by Richard Szeliski, Steve Seitz, and Marc Pollefyes

Announcements Artifacts for assignment #1 voting http://www.csie.ntu.edu.tw/~cyy/vfx/assignments/proj1/artifacts/index.html

Outline Camera projection models Camera calibration Nonlinear least square methods Bundle adjustment

Camera projection models

Pinhole camera

Pinhole camera model origin principal point (optical center)

Pinhole camera model

Pinhole camera model

Principal point offset intrinsic matrix

Is this form of K good enough? Intrinsic matrix Is this form of K good enough? non-square pixels (digital video) skew radial distortion

Radial distortion

Camera rotation and translation extrinsic matrix

Two kinds of parameters internal or intrinsic parameters such as focal length, optical center, aspect ratio: what kind of camera? external or extrinsic (pose) parameters including rotation and translation: where is the camera?

Other projection models

Orthographic projection Special case of perspective projection Distance from the COP to the PP is infinite Also called “parallel projection”: (x, y, z) → (x, y) Image World

Other types of projections Scaled orthographic Also called “weak perspective” Affine projection Also called “paraperspective”

Fun with perspective

Perspective cues

Perspective cues

Fun with perspective Ames room

Forced perspective in LOTR LOTR I Disc 4 -> Visual effects -> scale 0:00-10:00 or 15:00

Camera calibration

Camera calibration Estimate both intrinsic and extrinsic parameters Mainly, two categories: Photometric calibration: uses reference objects with known geometry Self calibration: only assumes static scene, e.g. structure from motion

Camera calibration approaches linear regression (least squares) nonlinear optinization multiple planar patterns

Chromaglyphs (HP research)

Linear regression

Linear regression Directly estimate 11 unknowns in the M matrix using known 3D points (Xi,Yi,Zi) and measured feature positions (ui,vi)

Linear regression

Linear regression

Linear regression Solve for Projection Matrix M using least-square techniques

Normal equation Given an overdetermined system the normal equation is that which minimizes the sum of the square differences between left and right sides Why?

nxm, n equations, m variables Normal equation nxm, n equations, m variables

Normal equation

Normal equation →

Linear regression Advantages: Disadvantages: All specifics of the camera summarized in one matrix Can predict where any world point will map to in the image Disadvantages: Doesn’t tell us about particular parameters Mixes up internal and external parameters pose specific: move the camera and everything breaks

Nonlinear optimization Feature measurement equations Likelihood of M given {(ui,vi)}

Optimal estimation Log likelihood of M given {(ui,vi)} How do we minimize C? Non-linear regression (least squares), because ûi and vi are non-linear functions of M We can use Levenberg-Marquardt method to minimize it

Multi-plane calibration Images courtesy Jean-Yves Bouguet, Intel Corp. Advantage Only requires a plane Don’t have to know positions/orientations Good code available online! Intel’s OpenCV library: http://www.intel.com/research/mrl/research/opencv/ Matlab version by Jean-Yves Bouget: http://www.vision.caltech.edu/bouguetj/calib_doc/index.html Zhengyou Zhang’s web site: http://research.microsoft.com/~zhang/Calib/

Step 1: data acquisition

Step 2: specify corner order

Step 3: corner extraction

Step 3: corner extraction

Step 4: minimize projection error

Step 4: camera calibration

Step 4: camera calibration

Step 5: refinement

Nonlinear least square methods

Least square fitting number of data points number of parameters

Linear least square fitting y t prediction residual is linear, too.

Nonlinear least square fitting

Function minimization Least square is related to function minimization. It is very hard to solve in general. Here, we only consider a simpler problem of finding local minimum.

Function minimization

Quadratic functions Approximate the function with a quadratic function within a small neighborhood

Quadratic functions A is positive definite. All eigenvalues are positive. Fall all x, xTAx>0. negative definite A is singular A is indefinite

Function minimization

Descent methods

Descent direction

Steepest descent method the decrease of F(x) per unit along h direction → hsd is a descent direction because hTsd F’(x)=- F’(x)2<0 It has good performance in the initial stage of the iterative process. Converge very slow with a linear rate.

Steepest descent method isocontour gradient

Line search

Line search

Steepest descent method

Newton’s method → → → → It has good performance in the final stage of the iterative process, where x is close to x*.

Hybrid method This needs to calculate second-order derivative which might not be available.

Levenberg-Marquardt method LM can be thought of as a combination of steepest descent and the Newton method. When the current solution is far from the correct one, the algorithm behaves like a steepest descent method: slow, but guaranteed to converge. When the current solution is close to the correct solution, it becomes a Newton’s method.

Nonlinear least square

Levenberg-Marquardt method

Levenberg-Marquardt method μ=0 → Newton’s method μ→∞ → steepest descent method Strategy for choosing μ Start with some small μ If F is not reduced, keep trying larger μ until it does If F is reduced, accept it and reduce μ for the next iteration

Bundle adjustment

Bundle adjustment Bundle adjustment (BA) is a technique for simultaneously refining the 3D structure and camera parameters It is capable of obtaining an optimal reconstruction under certain assumptions on image error models. For zero-mean Gaussian image errors, BA is the maximum likelihood estimator.

Bundle adjustment n 3D points are seen in m views xij is the projection of the i-th point on image j aj is the parameters for the j-th camera bi is the parameters for the i-th point BA attempts to minimize the projection error predicted projection Euclidean distance

Bundle adjustment

Bundle adjustment 3 views and 4 points

Typical Jacobian

Block structure of normal equation

Bundle adjustment

Bundle adjustment Multiplied by

Reference Manolis Lourakis and Antonis Argyros, The Design and Implementation of a Generic Sparse Bundle Adjustment Software Package Based on the Levenberg-Marquardt Algorithm, FORTH-ICS/TR-320 2004. K. Madsen, H.B. Nielsen, O. Timgleff, Methods for Non-Linear Least Squares Problems, 2004. Zhengyou Zhang, A Flexible New Techniques for Camera Calibration, MSR-TR-98-71, 1998. Bill Triggs, Philip McLauchlan, Richard Hartley and Andrew Fitzgibbon, Bundle Adjustment - A Modern Symthesis, Proceedings of the International Workshop on Vision Algorithms: Theory and Practice, pp298-372, 1999.