More Mosaic Madness 15-463: Computational Photography Alexei Efros, CMU, Fall 2011 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.

Slides:



Advertisements
Similar presentations
Computer Vision, Robert Pless
Advertisements

Last 4 lectures Camera Structure HDR Image Filtering Image Transform.
The Camera : Computational Photography Alexei Efros, CMU, Fall 2006.
RANSAC and mosaic wrap-up cs129: Computational Photography James Hays, Brown, Fall 2012 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve Seitz,
CS 691 Computational Photography Instructor: Gianfranco Doretto 3D to 2D Projections.
RANSAC and mosaic wrap-up cs195g: Computational Photography James Hays, Brown, Spring 2010 © Jeffrey Martin (jeffrey-martin.com) most slides from Steve.
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
Mosaics con’t CSE 455, Winter 2010 February 10, 2010.
Computational Photography: Image Mosaicing Jinxiang Chai.
Announcements Project 2 Out today Sign up for a panorama kit ASAP! –best slots (weekend) go quickly...
Announcements. Projection Today’s Readings Nalwa 2.1.
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
Lecture 5: Projection CS6670: Computer Vision Noah Snavely.
Announcements Project 2 questions Midterm out on Thursday
Lecture 7: Image Alignment and Panoramas CS6670: Computer Vision Noah Snavely What’s inside your fridge?
Announcements Mailing list (you should have received messages) Project 1 additional test sequences online Talk today on “Lightfield photography” by Ren.
Lecture 6: Image transformations and alignment CS6670: Computer Vision Noah Snavely.
Announcements Mailing list Project 1 test the turnin procedure *this week* (make sure it works) vote on best artifacts in next week’s class Project 2 groups.
Lecture 13: Projection, Part 2
Announcements Project 1 artifact voting Project 2 out today panorama signup help session at end of class Guest lectures next week: Li Zhang, Jiwon Kim.
Panorama signups Panorama project issues? Nalwa handout Announcements.
1Jana Kosecka, CS 223b Cylindrical panoramas Cylindrical panoramas with some slides from R. Szeliski, S. Seitz, D. Lowe, A. Efros,
Lecture 6: Image Warping and Projection CS6670: Computer Vision Noah Snavely.
CSCE 641 Computer Graphics: Image Mosaicing Jinxiang Chai.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2005 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
Panoramas and Calibration : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Image Warping and Mosacing : Rendering and Image Processing Alexei Efros …with a lot of slides stolen from Steve Seitz and Rick Szeliski.
Announcements Project 1 Grading session this afternoon Artifacts due Friday (voting TBA) Project 2 out (online) Signup for panorama kits ASAP (weekend.
More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from.
CSE 576, Spring 2008Projective Geometry1 Lecture slides by Steve Seitz (mostly) Lecture presented by Rick Szeliski.
The Camera : Computational Photography Alexei Efros, CMU, Fall 2008.
Global Alignment and Structure from Motion Computer Vision CSE455, Winter 2008 Noah Snavely.
Announcements Project 1 artifact voting Project 2 out today (help session at end of class)
Cameras, lenses, and calibration
Today: Calibration What are the camera parameters?
Announcements Midterm due Friday, beginning of lecture Guest lecture on Friday: Antonio Criminisi, Microsoft Research.
Mosaics CSE 455, Winter 2010 February 8, 2010 Neel Joshi, CSE 455, Winter Announcements  The Midterm went out Friday  See to the class.
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.
Image Stitching Ali Farhadi CSE 455
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Last Lecture (optical center) origin principal point P (X,Y,Z) p (x,y) x y.
Camera calibration Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz,, Fred Pighin and Marc Pollefyes.
Mosaics Today’s Readings Szeliski, Ch 5.1, 8.1 StreetView.
Image stitching Digital Visual Effects Yung-Yu Chuang with slides by Richard Szeliski, Steve Seitz, Matthew Brown and Vaclav Hlavac.
Geometric Camera Models
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.
CS-498 Computer Vision Week 7, Day 2 Camera Parameters Intrinsic Calibration  Linear  Radial Distortion (Extrinsic Calibration?) 1.
Project 1 Due NOW Project 2 out today –Help session at end of class Announcements.
Project 2 went out on Tuesday You should have a partner You should have signed up for a panorama kit Announcements.
Lecture 14: Projection CS4670 / 5670: Computer Vision Noah Snavely “The School of Athens,” Raphael.
Lecture 18: Cameras CS4670 / 5670: Computer Vision KavitaBala Source: S. Lazebnik.
Homographies and Mosaics : Computational Photography Alexei Efros, CMU, Fall 2006 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen.
Prof. Adriana Kovashka University of Pittsburgh October 3, 2016
CS4670 / 5670: Computer Vision Kavita Bala Lecture 20: Panoramas.
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Digital Visual Effects, Spring 2007 Yung-Yu Chuang 2007/4/17
Digital Visual Effects, Spring 2008 Yung-Yu Chuang 2008/4/15
RANSAC and mosaic wrap-up
More Mosaic Madness : Computational Photography
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Idea: projecting images onto a common plane
Announcements Project 2 out today (help session at end of class)
More Mosaic Madness : Computational Photography
Digital Visual Effects Yung-Yu Chuang
Image Stitching Computer Vision CS 678
Projective geometry Readings
More Mosaic Madness © Jeffrey Martin (jeffrey-martin.com)
Announcements Project 1 artifact voting Project 2 out today
Presentation transcript:

More Mosaic Madness : Computational Photography Alexei Efros, CMU, Fall 2011 © Jeffrey Martin (jeffrey-martin.com) with a lot of slides stolen from Steve Seitz and Rick Szeliski

Homography A: Projective – mapping between any two PPs with the same center of projection rectangle should map to arbitrary quadrilateral parallel lines aren’t but must preserve straight lines same as: project, rotate, reproject called Homography PP2 PP1 Hpp’ To apply a homography H Compute p’ = Hp (regular matrix multiply) Convert p’ from homogeneous to image coordinates

Rotational Mosaics Can we say something more about rotational mosaics? i.e. can we further constrain our H?

3D → 2D Perspective Projection u (X c,Y c,Z c ) ucuc f K

3D Rotation Model Projection equations 1.Project from image to 3D ray (x 0,y 0,z 0 ) = (u 0 -u c,v 0 -v c,f) 2.Rotate the ray by camera motion (x 1,y 1,z 1 ) = R 01 (x 0,y 0,z 0 ) 3.Project back into new (source) image (u 1,v 1 )= (fx 1 /z 1 +u c,fy 1 /z 1 +v c ) Therefore: Our homography has only 3,4 or 5 DOF, depending if focal length is known, same, or different. This makes image registration much better behaved (u,v,f)(x,y,z) f (u,v,f) R

Pairwise alignment Procrustes Algorithm [Golub & VanLoan] Given two sets of matching points, compute R p i ’ = R p i with 3D rays p i = N(x i,y i,z i ) = N(u i -u c,v i -v c,f) A = Σ i p i p i ’ T = Σ i p i p i T R T = U S V T = (U S U T ) R T V T = U T R T R = V U T

Rotation about vertical axis What if our camera rotates on a tripod? What’s the structure of H?

mosaic PP Do we have to project onto a plane?

Full Panoramas What if you want a 360  field of view? mosaic Projection Cylinder

Map 3D point (X,Y,Z) onto cylinder Cylindrical projection X Y Z unit cylinder unwrapped cylinder Convert to cylindrical coordinates cylindrical image Convert to cylindrical image coordinates

Cylindrical Projection Y X

Inverse Cylindrical projection X Y Z (X,Y,Z)(X,Y,Z) (sin ,h,cos  )

Cylindrical panoramas Steps Reproject each image onto a cylinder Blend Output the resulting mosaic

Cylindrical image stitching What if you don’t know the camera rotation? Solve for the camera rotations –Note that a rotation of the camera is a translation of the cylinder!

Assembling the panorama Stitch pairs together, blend, then crop

Problem: Drift Vertical Error accumulation small (vertical) errors accumulate over time apply correction so that sum = 0 (for 360° pan.) Horizontal Error accumulation can reuse first/last image to find the right panorama radius

Full-view (360°) panoramas

Spherical projection unwrapped sphere Convert to spherical coordinates spherical image Convert to spherical image coordinates X Y Z Map 3D point (X,Y,Z) onto sphere 

Spherical Projection Y X

Inverse Spherical projection X Y Z (x,y,z) (sinθcosφ,cosθcosφ,sinφ) cos φ φ cos θ cos φ sin φ

3D rotation Rotate image before placing on unrolled sphere X Y Z (x,y,z) (sinθcosφ,cosθcosφ,sinφ) cos φ φ cos θ cos φ sin φ _ p = R p

Full-view Panorama

Other projections are possible You can stitch on the plane and then warp the resulting panorama What’s the limitation here? Or, you can use these as stitching surfaces But there is a catch…

f = 180 (pixels) Cylindrical reprojection f = 380f = 280 Image 384x300 top-down view Focal length – the dirty secret…

What’s your focal length, buddy? Focal length is (highly!) camera dependant Can get a rough estimate by measuring FOV: Can use the EXIF data tag (might not give the right thing) Can use several images together and try to find f that would make them match Can use a known 3D object and its projection to solve for f Etc. There are other camera parameters too: Optical center, non-square pixels, lens distortion, etc.

Distortion Radial distortion of the image Caused by imperfect lenses Deviations are most noticeable for rays that pass through the edge of the lens No distortionPin cushionBarrel

Radial distortion Correct for “bending” in wide field of view lenses Use this instead of normal projection

Polar Projection Extreme “bending” in ultra-wide fields of view

Camera calibration Determine camera parameters from known 3D points or calibration object(s) 1.internal or intrinsic parameters such as focal length, optical center, aspect ratio: what kind of camera? 2.external or extrinsic (pose) parameters: where is the camera in the world coordinates? World coordinates make sense for multiple cameras / multiple images How can we do this?

Approach 1: solve for projection matrix Place a known object in the scene identify correspondence between image and scene compute mapping from scene to image

Direct linear calibration Solve for Projection Matrix  using least-squares (just like in homework) Advantages: 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

Projection equation The projection matrix models the cumulative effect of all parameters Useful to decompose into a series of operations projectionintrinsicsrotationtranslation identity matrix Approach 2: solve for parameters A camera is described by several parameters Translation T of the optical center from the origin of world coords Rotation R of the image plane focal length f, principle point (x’ c, y’ c ), pixel size (s x, s y ) blue parameters are called “extrinsics,” red are “intrinsics” Solve using non-linear optimization

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: –Matlab version by Jean-Yves Bouget: –Zhengyou Zhang’s web site: