Single-view 3D Reconstruction

Similar documents
Scene Modeling for a Single View

Scene Modeling for a Single View

Scene Modeling for a Single View

Scene Modeling for a Single View

Projective Geometry and Camera Models

Camera Geometry II. COS 429 Princeton University

Contexts and 3D Scenes

Single-view metrology

Automatic Photo Popup

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

Image Warping and Mosacing

More Single View Geometry

calibrated coordinates Linear transformation pixel coordinates

More Single View Geometry

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

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

Image warping and stitching

Contexts and 3D Scenes

Image warping and stitching

CS6670: Computer Vision

1 Projective Geometry

CSCI 5980: Assignment #3 Homography

CIS 580, Machine Perception, Spring 2015 Homework 1 Due: :59AM

N-Views (1) Homographies and Projection

Projective Geometry and Camera Models

More Single View Geometry

Homographies and RANSAC

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

Image warping and stitching

More Single View Geometry

Camera Calibration. COS 429 Princeton University

Geometric camera models and calibration

Feature Tracking and Optical Flow

Epipolar Geometry and Stereo Vision

11/28/17. Midterm Review. Magritte, Homesickness. Computational Photography Derek Hoiem, University of Illinois

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

Three-Dimensional Viewing Hearn & Baker Chapter 7

Epipolar Geometry and Stereo Vision

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

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

Epipolar Geometry and Stereo Vision

Structure from Motion

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...

Mosaics. Today s Readings

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

Feature Tracking and Optical Flow

Computer Vision Projective Geometry and Calibration. Pinhole cameras

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

CS 558: Computer Vision 13 th Set of Notes

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

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

CS201 Computer Vision Camera Geometry

55:148 Digital Image Processing Chapter 11 3D Vision, Geometry

Robotics - Projective Geometry and Camera model. Marcello Restelli

CS4670: Computer Vision

Single-view 3D reasoning

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Computer Vision cmput 428/615

Agenda. Rotations. Camera models. Camera calibration. Homographies

CSE328 Fundamentals of Computer Graphics

CS223b Midterm Exam, Computer Vision. Monday February 25th, Winter 2008, Prof. Jana Kosecka

Midterm Examination CS 534: Computational Photography

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

A simple method for interactive 3D reconstruction and camera calibration from a single view

Overview. By end of the week:

ECE-161C Cameras. Nuno Vasconcelos ECE Department, UCSD

Structure from Motion. Prof. Marco Marcon

Vision Review: Image Formation. Course web page:

Viewing. Reading: Angel Ch.5

EE795: Computer Vision and Intelligent Systems

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

Compositing a bird's eye view mosaic

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

COMPARATIVE STUDY OF DIFFERENT APPROACHES FOR EFFICIENT RECTIFICATION UNDER GENERAL MOTION

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

Two-view geometry Computer Vision Spring 2018, Lecture 10

Modeling Light. On Simulating the Visual Experience

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

Context. CS 554 Computer Vision Pinar Duygulu Bilkent University. (Source:Antonio Torralba, James Hays)

Computer Vision Lecture 17

Computer Vision CS 776 Fall 2018

Computer Vision Lecture 17

CS 4204 Computer Graphics

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

DD2429 Computational Photography :00-19:00

CIS 580, Machine Perception, Spring 2014: Assignment 4 Due: Wednesday, April 10th, 10:30am (use turnin)

Chapter 3 Image Registration. Chapter 3 Image Registration

Introduction to Computer Vision. Week 3, Fall 2010 Instructor: Prof. Ko Nishino

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

ECE 470: Homework 5. Due Tuesday, October 27 in Seth Hutchinson. Luke A. Wendt

Computer Vision Project-1

Structure from Motion

Topics and things to know about them:

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

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

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

Lecture 9: Epipolar Geometry

Raycasting. Chapter Raycasting foundations. When you look at an object, like the ball in the picture to the left, what do

COMP 175 COMPUTER GRAPHICS. Ray Casting. COMP 175: Computer Graphics April 26, Erik Anderson 09 Ray Casting

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

Transcription:

Single-view 3D Reconstruction 10/12/17 Computational Photography Derek Hoiem, University of Illinois Some slides from Alyosha Efros, Steve Seitz

Notes about Project 4 (Image-based Lighting) You can work with a partner and submit a joint project You will need a mirrored sphere (see Piazza post) I have a few which I will be able to loan out for a couple days at a time, but I d like to reserve them for emergencies

Take-home question Suppose you have estimated finite three vanishing points corresponding to orthogonal directions: 1) How to solve for intrinsic matrix? (assume K has three parameters) The transpose of the rotation matrix is its inverse Use the fact that the 3D directions are orthogonal 2) How to recover the rotation matrix that is aligned with the 3D axes defined by these points? In homogeneous coordinates, 3d point at infinity is (X, Y, Z, 0) VP y VP x. VP z Photo from online Tate collection

Take-home question Assume that the man is 6 ft tall. What is the height of the front of the building? What is the height of the camera?

Take-home question Assume that the man is 6 ft tall. What is the height of the front of the building? What is the height of the camera? (0.92+1.55)/1.55*6=9.56 ~5 7 0.92 1.55

Focal length, aperture, depth of field F optical center (Center Of Projection) focal point Increase in focal length zooms in, decreasing field of view (and light per pixel), increasing depth of field (less blur) Increase in aperture lets more light in but decreases depth of field Slide source: Seitz

Large aperture = small DOF Small aperture = large DOF Varying the aperture Slide from Efros

Shrinking the aperture Why not make the aperture as small as possible? Less light gets through Diffraction effects Slide by Steve Seitz

Shrinking the aperture Slide by Steve Seitz

The Photographer s Great Compromise What we want More spatial resolution Broader field of view More depth of field How we get it Increase focal length Decrease focal length Decrease aperture Increase aperture Cost Light, FOV DOF Light DOF More temporal resolution Shorten exposure Lengthen exposure Light Temporal Res More light

Difficulty in macro (close-up) photography For close objects, we have a small relative DOF Can only shrink aperture so far How to get both bugs in focus?

Solution: Focus stacking 1. Take pictures with varying focal length Example from http://www.wonderfulphotos.com/articles/macro/focus_stacking/

Solution: Focus stacking 1. Take pictures with varying focal length 2. Combine

Focus stacking http://www.wonderfulphotos.com/articles/macro/focus_stacking/

Focus stacking How to combine? 1. Align images (e.g., using corresponding points) 2. Two ideas a) Mask regions by hand and combine with pyramid blend b) Gradient domain fusion (mixed gradient) without masking Automatic solution would make a good final project Recommended Reading: http://www.digital-photographyschool.com/an-introduction-to-focusstacking http://www.zen20934.zen.co.uk/photograph y/workflow.htm#focus%20stacking

Relation between field of view and focal length Field of view (angle width) fov 2tan 1 d 2 f Film/Sensor Width Focal length

Dolly Zoom or Vertigo Effect http://www.youtube.com/watch?v=nb4bikrnzmk How is this done? Zoom in while moving away http://en.wikipedia.org/wiki/focal_length

Dolly zoom (or Vertigo effect ) Field of view (angle width) fov 2 tan 1 d 2 f Film/Sensor Width Focal length 2 tan 2 fov width distance width of object Distance between object and camera

Today s class: 3D Reconstruction

The challenge One 2D image could be generated by an infinite number of 3D geometries???

The solution Make simplifying assumptions about 3D geometry Unlikely Likely

Today s class: Two Models Box + frontal billboards Ground plane + non-frontal billboards

Tour into the Picture (Horry et al. SIGGRAPH 97) Create a 3D theatre stage of five billboards Specify foreground objects through bounding polygons Use camera transformations to navigate through the scene Following slides modified from Efros

The idea Many scenes can be represented as an axis-aligned box volume (i.e. a stage) Key assumptions All walls are orthogonal Camera view plane is parallel to back of volume How many vanishing points does the box have? Three, but two at infinity Single-point perspective Can use the vanishing point to fit the box to the particular scene

Step 1: specify scene geometry User controls the inner box and the vanishing point placement (# of DOF?) Q: What s the significance of the vanishing point location? A: It s at eye (camera) level: ray from center of projection to VP is perpendicular to image plane Under single-point perspective assumptions, the VP should be the principal point of the image

Example of user input: vanishing point and back face of view volume are defined High Camera

Example of user input: vanishing point and back face of view volume are defined Low Camera

Comparison of how image is subdivided based on two different camera positions. You should see how moving the box corresponds to moving the eyepoint in the 3D world. High Camera Low Camera

Another example of user input: vanishing point and back face of view volume are defined Left Camera

Another example of user input: vanishing point and back face of view volume are defined Right Camera

Comparison of two camera placements left and right. Corresponding subdivisions match view you would see if you looked down a hallway. Left Camera Right Camera

Question Think about the camera center and image plane What happens when we move the box? What happens when we move the vanishing point?

2D to 3D conversion First, we can get ratios left right top vanishing point back plane bottom

2D to 3D conversion Size of user-defined back plane determines width/height throughout box (orthogonal sides) Use top versus side ratio to determine relative height and width dimensions of box left right top Left/right and top/bot ratios determine part of 3D camera placement camera pos bottom

Depth of the box Can compute by similar triangles (CVA vs. CV A ) Need to know focal length f (or FOV) Note: can compute position on any object on the ground Simple unprojection What about things off the ground?

Step 2: map image textures into frontal view A 2d coordinates 3d plane coordinates C A B D B C D

Image rectification p p To unwarp (rectify) an image solve for homography H given p and p : wp =Hp

Computing homography Assume we have four matched points: How do we compute homography H? Direct Linear Transformation (DLT) p Hp ' h 0 v vv uv v u u vu uu v u 1 0 0 0 0 0 0 1 ' ' ' ' ' ' w w v w u p 9 8 7 6 5 4 3 2 1 h h h h h h h h h H 9 8 7 6 5 4 3 2 1 h h h h h h h h h h

Computing homography Direct Linear Transform Apply SVD: USV T = A h = V smallest (column of V T corr. to smallest singular value) 9 8 7 6 5 4 3 2 1 9 2 1 h h h h h h h h h h h h H h 0 Ah 0 h n n n n n n n v v v v u v u v v v v u v u u u v u u v u 1 0 0 0 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Matlab [U, S, V] = svd(a); h = V(:, end); Explanation of SVD, solving systems of linear equations, derivation of solution here

Solving for homographies (more detail) note: (x,y) is used in place of (u,v) here Defines a least squares problem: A h 0 2n 9 9 2n Since h is only defined up to scale, solve for unit vector ĥ Solution: ĥ = eigenvector of A T A with smallest eigenvalue Can derive using Lagrange multipliers method Works with 4 or more points

Tour into the picture algorithm 1. Set the box corners

Tour into the picture algorithm 1. Set the box corners 2. Set the VP 3. Get 3D coordinates Compute height, width, and depth of box 4. Get texture maps homographies for each face 5. Create file to store plane coordinates and texture maps x

Result Render from new views http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15463-f08/www/proj5/www/dmillett/

Foreground Objects Use separate billboard for each For this to work, three separate images used: Original image. Mask to isolate desired foreground images. Background with objects removed

Foreground Objects Add vertical rectangles for each foreground object Can compute 3D coordinates P0, P1 since they are on known plane. P2, P3 can be computed as before (similar triangles)

Foreground Result Video from CMU class: http://www.youtube.com/watch?v=duatd mgwcum

Automatic Photo Pop-up Input Image Geometric Labels Cut n Fold 3D Model Ground Vertical Learned Models Sky Hoiem et al. 2005

Cutting and Folding Fit ground-vertical boundary Iterative Hough transform

Cutting and Folding Form polylines from boundary segments Join segments that intersect at slight angles Remove small overlapping polylines Estimate horizon position from perspective cues

Cutting and Folding ``Fold along polylines and at corners ``Cut at ends of polylines and along vertical-sky boundary

Cutting and Folding Construct 3D model Texture map

Results http://www.cs.illinois.edu/homes/dhoiem/projects/popup/ Input Image Cut and Fold Automatic Photo Pop-up

Results Input Image Automatic Photo Pop-up

Automatic Photo Pop-up (15 sec)! Comparison with Manual Method [Liebowitz et al. 1999] Input Image

Failures Labeling Errors

Failures Foreground Objects

Adding Foreground Labels Recovered Surface Labels + Ground-Vertical Boundary Fit Object Boundaries + Horizon

Fitting boxes to indoor scenes Wall Sofa Table Floor

Box Layout Algorithm Hedau et al. 2010 1. Detect edges 2. Estimate 3 orthogonal vanishing points + 3. Apply region classifier to label pixels with visible surfaces Boosted decision trees on region based on color, texture, edges, position 4. Generate box candidates by sampling pairs of rays from VPs 5. Score each box based on edges and pixel labels Learn score via structured learning 6. Jointly refine box layout and pixel labels to get final estimate

Experimental results Detected Edges Surface Labels Box Layout Detected Edges Surface Labels Box Layout

Experimental results Detected Edges Surface Labels Box Layout Detected Edges Surface Labels Box Layout

Complete 3D from RGBD

Complete 3D from RGBD RGB-D Input Layout Proposals Composing Object Proposals Exemplar Region Retrieval 3D Model Fitting Annotated Scene... Retrieved Region Source 3D Model Transferred Model Retrieved Region Source 3D Model Transferred Model

Complete 3D from RGBD

Final project ideas If a one-person project: Interactive program to make 3D model from an image (e.g., output in VRML, or draw path for animation) If a two-person team, 2 nd person: Add tools for cutting out foreground objects and automatic hole-filling

Summary 2D3D is mathematically impossible (but we do it without even thinking) Need right assumptions about the world geometry Important tools Vanishing points Camera matrix Homography

Next Week Project 3 is due Monday Next three classes: image-based lighting How to model light Recover HDR image from multiple LDR images Recover lighting model from an image Render object into a scene with correct lighting and geometry