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

Similar documents
6.098 Digital and Computational Photography Advanced Computational Photography. Panoramas. Bill Freeman Frédo Durand MIT - EECS

Panoramas. Why Mosaic? Why Mosaic? Mosaics: stitching images together. Why Mosaic? Olivier Gondry. Bill Freeman Frédo Durand MIT - EECS

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

CS4670: Computer Vision

CS6670: Computer Vision

Announcements. Mosaics. How to do it? Image Mosaics

Mosaics. Today s Readings

Image Warping and Mosacing

CS6670: Computer Vision

N-Views (1) Homographies and Projection

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

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

Image stitching. Announcements. Outline. Image stitching

Image warping and stitching

Geometric camera models and calibration

Announcements. Mosaics. Image Mosaics. How to do it? Basic Procedure Take a sequence of images from the same position =

Image warping and stitching

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

Camera Calibration. COS 429 Princeton University

Homographies and RANSAC

Image warping and stitching

Image Stitching. Slides from Rick Szeliski, Steve Seitz, Derek Hoiem, Ira Kemelmacher, Ali Farhadi

Vision Review: Image Formation. Course web page:

Cameras and Stereo CSE 455. Linda Shapiro

Scene Modeling for a Single View

Agenda. Rotations. Camera calibration. Homography. Ransac

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

Camera Model and Calibration

Pin Hole Cameras & Warp Functions

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

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

Image-based Modeling and Rendering: 8. Image Transformation and Panorama

Recap. DoF Constraint Solver. translation. affine. homography. 3D rotation

3D Geometry and Camera Calibration

Epipolar Geometry and Stereo Vision

CSE 527: Introduction to Computer Vision

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

Visual Recognition: Image Formation

2D Image Transforms Computer Vision (Kris Kitani) Carnegie Mellon University

Homographies and Mosaics

Introduction to Image Processing and Computer Vision. -- Panoramas and Blending --

Image Based Rendering. D.A. Forsyth, with slides from John Hart

Image warping , , Computational Photography Fall 2017, Lecture 10

Computer Vision cmput 428/615

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

Pin Hole Cameras & Warp Functions

Automatic Image Alignment

Agenda. Rotations. Camera models. Camera calibration. Homographies

Scene Modeling for a Single View

Camera Model and Calibration. Lecture-12

Projective Geometry and Camera Models

Stitching and Blending

Geometric Transformations and Image Warping

Stereo CSE 576. Ali Farhadi. Several slides from Larry Zitnick and Steve Seitz

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

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

Midterm Examination CS 534: Computational Photography

Computer Vision Projective Geometry and Calibration. Pinhole cameras

Modeling Light. On Simulating the Visual Experience

Introduction to Homogeneous coordinates

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

Cameras and Radiometry. Last lecture in a nutshell. Conversion Euclidean -> Homogenous -> Euclidean. Affine Camera Model. Simplified Camera Models

There are many cues in monocular vision which suggests that vision in stereo starts very early from two similar 2D images. Lets see a few...

Computer Vision. Coordinates. Prof. Flávio Cardeal DECOM / CEFET- MG.

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

Feature Matching and RANSAC

Projective Geometry and Camera Models

EE795: Computer Vision and Intelligent Systems

Chapter 3 Image Registration. Chapter 3 Image Registration

1 Projective Geometry

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

calibrated coordinates Linear transformation pixel coordinates

Targil 10 : Why Mosaic? Why is this a challenge? Exposure differences Scene illumination Miss-registration Moving objects

Epipolar Geometry and Stereo Vision

Epipolar Geometry and Stereo Vision

Recap from Monday. Frequency domain analytical tool computational shortcut compression tool

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

Warping, Morphing and Mosaics

Rectification and Distortion Correction

Perspective Projection [2 pts]

Hartley - Zisserman reading club. Part I: Hartley and Zisserman Appendix 6: Part II: Zhengyou Zhang: Presented by Daniel Fontijne

6.819 / 6.869: Advances in Computer Vision Antonio Torralba and Bill Freeman. Lecture 11 Geometry, Camera Calibration, and Stereo.

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

Camera Projection Models We will introduce different camera projection models that relate the location of an image point to the coordinates of the

Single-view 3D Reconstruction

COMP 558 lecture 19 Nov. 17, 2010

CSE 252B: Computer Vision II

EE795: Computer Vision and Intelligent Systems

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

Image Warping. Some slides from Steve Seitz

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

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

But First: Multi-View Projective Geometry

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

Image Formation I Chapter 2 (R. Szelisky)

Automatic Image Alignment (direct) with a lot of slides stolen from Steve Seitz and Rick Szeliski

CS664 Lecture #19: Layers, RANSAC, panoramas, epipolar geometry

Camera Calibration for Video See-Through Head-Mounted Display. Abstract. 1.0 Introduction. Mike Bajura July 7, 1993

Multiple View Geometry

Short on camera geometry and camera calibration

Transcription:

More Mosaic Madness Jeffrey Martin (jeffrey-martin.com) CS194: Image Manipulation & Computational Photography with a lot of slides stolen from Alexei Efros, UC Berkeley, Fall 2018 Steve Seitz and Rick Szeliski

Spherical Panoramas See also: Time Square New Years Eve http://www.panoramas.dk/fullscreen3/f1.html All light rays through a point form a ponorama Totally captured in a 2D array -- P(θ,φ) Where is the geometry???

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 wx' wy' w p = * * * * * * H * x * y * 1 To apply a homography H p Compute p = Hp (regular matrix multiply) Convert p from homogeneous to image coordinates PP1

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

3D 2D Perspective Projection (X c,y c,z c ) f u c u 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: (x,y,z) R (x,y,z) f (u,v,f) (u,v,f) H = K 1 0R01K1 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

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 it 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?

Do we have to project onto a plane? mosaic PP

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

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

Cylindrical Projection Y X

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

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 Y Z X Map 3D point (X,Y,Z) onto sphere ( xˆ, yˆ, zˆ) = X ( X, Y, Z) Convert to spherical coordinates Convert to spherical image coordinates 2 1 + Y 2 + Z (sinθ cosφ, sinφ, cosθ cosφ) = (xˆ, yˆ, zˆ) 2 φ unwrapped sphere spherical image

Spherical Projection Y X

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

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

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

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

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 No distortion Pin cushion Barrel Radial distortion of the image Caused by imperfect lenses Deviations are most noticeable for rays that pass through the edge of the lens

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 x = ΠX = = 1 * * * * * * * * * * * * Z Y X s sy sx = 1 1 0 1 0 0 0 0 1 0 0 0 0 1 1 0 0 ' 0 ' 0 3 1 1 3 3 3 3 1 1 3 3 3 x x x x x x c y c x y fs x fs 0 0 0 T I R Π projection intrinsics rotation translation 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 Advantage Images courtesy Jean-Yves Bouguet, Intel Corp. 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/

Setting alpha: simple averaging Alpha =.5 in overlap region

Setting alpha: center seam Distance Transform bwdist Alpha = logical(dtrans1>dtrans2)

Setting alpha: blurred seam Distance transform Alpha = blurred

Simplification: Two-band Blending Brown & Lowe, 2003 Only use two bands: high freq. and low freq. Blends low freq. smoothly Blend high freq. with no smoothing: use binary alpha

High frequency (λ < 2 pixels) 2-band Laplacian Stack Blending Low frequency (λ > 2 pixels)

Linear Blending

2-band Blending