Computer Vision Lecture 17

Similar documents
Computer Vision Lecture 17

Recap: Features and filters. Recap: Grouping & fitting. Now: Multiple views 10/29/2008. Epipolar geometry & stereo vision. Why multiple views?

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

Stereo. Outline. Multiple views 3/29/2017. Thurs Mar 30 Kristen Grauman UT Austin. Multi-view geometry, matching, invariant features, stereo vision

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

Epipolar Geometry and Stereo Vision

Stereo: Disparity and Matching

Multiple View Geometry

Stereo vision. Many slides adapted from Steve Seitz

Think-Pair-Share. What visual or physiological cues help us to perceive 3D shape and depth?

Image Rectification (Stereo) (New book: 7.2.1, old book: 11.1)

CS 4495 Computer Vision A. Bobick. Motion and Optic Flow. Stereo Matching

Epipolar Geometry and Stereo Vision

Mosaics wrapup & Stereo

Last time: Disparity. Lecture 11: Stereo II. Last time: Triangulation. Last time: Multi-view geometry. Last time: Epipolar geometry

Epipolar Geometry and Stereo Vision

Lecture 9 & 10: Stereo Vision

Lecture 14: Computer Vision

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

Multiple View Geometry

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

Chaplin, Modern Times, 1936

CS 4495 Computer Vision A. Bobick. Motion and Optic Flow. Stereo Matching

CS4495/6495 Introduction to Computer Vision. 3B-L3 Stereo correspondence

CS5670: Computer Vision

Final project bits and pieces

Binocular stereo. Given a calibrated binocular stereo pair, fuse it to produce a depth image. Where does the depth information come from?

Epipolar Geometry and Stereo Vision

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

Cameras and Stereo CSE 455. Linda Shapiro

Project 3 code & artifact due Tuesday Final project proposals due noon Wed (by ) Readings Szeliski, Chapter 10 (through 10.5)

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

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

Camera Geometry II. COS 429 Princeton University

Stereo Vision A simple system. Dr. Gerhard Roth Winter 2012

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

Computer Vision I. Announcement. Stereo Vision Outline. Stereo II. CSE252A Lecture 15

Project 2 due today Project 3 out today. Readings Szeliski, Chapter 10 (through 10.5)

Multi-View Geometry (Ch7 New book. Ch 10/11 old book)

What have we leaned so far?

Dense 3D Reconstruction. Christiano Gava

Recap from Previous Lecture

Announcements. Stereo

Stereo. Many slides adapted from Steve Seitz

BIL Computer Vision Apr 16, 2014

Lecture 14: Basic Multi-View Geometry

Fundamental matrix. Let p be a point in left image, p in right image. Epipolar relation. Epipolar mapping described by a 3x3 matrix F

Dense 3D Reconstruction. Christiano Gava

Announcements. Stereo

Stereo Vision. MAN-522 Computer Vision

Stereo and Epipolar geometry

Computer Vision Lecture 20

Recovering structure from a single view Pinhole perspective projection

Computer Vision Lecture 20

Passive 3D Photography

Lecture'9'&'10:'' Stereo'Vision'

Two-view geometry Computer Vision Spring 2018, Lecture 10

Rectification and Disparity

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

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

Lecture 6 Stereo Systems Multi-view geometry

Epipolar Geometry Prof. D. Stricker. With slides from A. Zisserman, S. Lazebnik, Seitz

Passive 3D Photography

Lecture 9: Epipolar Geometry

Correspondence and Stereopsis. Original notes by W. Correa. Figures from [Forsyth & Ponce] and [Trucco & Verri]

CEng Computational Vision

Step-by-Step Model Buidling

Fundamentals of Stereo Vision Michael Bleyer LVA Stereo Vision

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

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

Structure from Motion. Introduction to Computer Vision CSE 152 Lecture 10

calibrated coordinates Linear transformation pixel coordinates

Lecture 6 Stereo Systems Multi- view geometry Professor Silvio Savarese Computational Vision and Geometry Lab Silvio Savarese Lecture 6-24-Jan-15

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Public Library, Stereoscopic Looking Room, Chicago, by Phillips, 1923

Image Based Reconstruction II

Unit 3 Multiple View Geometry

But First: Multi-View Projective Geometry

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

EE795: Computer Vision and Intelligent Systems

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

Machine vision. Summary # 11: Stereo vision and epipolar geometry. u l = λx. v l = λy

Stereo and structured light

Structure from motion

EE795: Computer Vision and Intelligent Systems

Depth from two cameras: stereopsis

Stereo Image Rectification for Simple Panoramic Image Generation

Computer Vision Lecture 20

EECS 442 Computer vision. Stereo systems. Stereo vision Rectification Correspondence problem Active stereo vision systems

Local features: detection and description. Local invariant features

Depth. Common Classification Tasks. Example: AlexNet. Another Example: Inception. Another Example: Inception. Depth

Computer Vision I. Announcements. Random Dot Stereograms. Stereo III. CSE252A Lecture 16

Lecture 10: Multi-view geometry

Computer Vision I. Announcement

Depth from two cameras: stereopsis

Perception II: Pinhole camera and Stereo Vision

Multi-stable Perception. Necker Cube

CS201 Computer Vision Camera Geometry

Undergrad HTAs / TAs. Help me make the course better! HTA deadline today (! sorry) TA deadline March 21 st, opens March 15th

Image Transfer Methods. Satya Prakash Mallick Jan 28 th, 2003

Transcription:

Computer Vision Lecture 17 Epipolar Geometry & Stereo Basics 13.01.2015 Bastian Leibe RWTH Aachen http://www.vision.rwth-aachen.de leibe@vision.rwth-aachen.de

Announcements Seminar in the summer semester Current Topics in Computer Vision and Machine Learning Block seminar, presentations in 1 st week of semester break Registration period: 14.01.2015 28.01.2015 http://web-info8.informatik.rwth-aachen.de/apse Quick poll: Who would be interested in that? 3

Course Outline Image Processing Basics Segmentation & Grouping Object Recognition Local Features & Matching Object Categorization 3D Reconstruction Epipolar Geometry and Stereo Basics Camera calibration & Uncalibrated Reconstruction Multi-view Stereo Optical Flow 4

Topics of This Lecture Geometric vision Visual cues Stereo vision Epipolar geometry Depth with stereo Geometry for a simple stereo system Case example with parallel optical axes General case with calibrated cameras Stereopsis & 3D Reconstruction Correspondence search Additional correspondence constraints Possible sources of error Applications 5

Slide credit: Svetlana Lazebnik Geometric vision Goal: Recovery of 3D structure What cues in the image allow us to do this?

Visual Cues Shading Merle Norman Cosmetics, Los Angeles Slide credit: Steve Seitz 7

Visual Cues Shading Texture The Visual Cliff, by William Vandivert, 1960 Slide credit: Steve Seitz 8

Visual Cues Shading Texture Focus From The Art of Photography, Canon Slide credit: Steve Seitz 9

Visual Cues Shading Texture Focus Perspective Slide credit: Steve Seitz 10

Visual Cues Shading Texture Focus Perspective Figures from L. Zhang Motion Slide credit: Steve Seitz, Kristen Grauman http://www.brainconnection.com/teasers/?main=illusion/motion-shape 11

Our Goal: Recovery of 3D Structure We will focus on perspective and motion We need multi-view geometry because recovery of structure from one image is inherently ambiguous X? X? X? x Slide credit: Svetlana Lazebnik 12

To Illustrate This Point Structure and depth are inherently ambiguous from single views. Slide credit: Svetlana Lazebnik, Kristen Grauman 13

Slide credit: Kristen Grauman Stereo Vision http://www.well.com/~jimg/stereo/stereo_list.html

What Is Stereo Vision? Generic problem formulation: given several images of the same object or scene, compute a representation of its 3D shape Slide credit: Svetlana Lazebnik, Steve Seitz 15

What Is Stereo Vision? Generic problem formulation: given several images of the same object or scene, compute a representation of its 3D shape Slide credit: Svetlana Lazebnik, Steve Seitz 16

What Is Stereo Vision? Narrower formulation: given a calibrated binocular stereo pair, fuse it to produce a depth image Image 1 Image 2 Dense depth map Slide credit: Svetlana Lazebnik, Steve Seitz 17

What Is Stereo Vision? Narrower formulation: given a calibrated binocular stereo pair, fuse it to produce a depth image. Humans can do it Stereograms: Invented by Sir Charles Wheatstone, 1838 Slide credit: Svetlana Lazebnik, Steve Seitz 18

What Is Stereo Vision? Narrower formulation: given a calibrated binocular stereo pair, fuse it to produce a depth image. Humans can do it Autostereograms: http://www.magiceye.com Slide credit: Svetlana Lazebnik, Steve Seitz 19

What Is Stereo Vision? Narrower formulation: given a calibrated binocular stereo pair, fuse it to produce a depth image. Humans can do it Autostereograms: http://www.magiceye.com Slide credit: Svetlana Lazebnik, Steve Seitz 20

Application of Stereo: Robotic Exploration Nomad robot searches for meteorites in Antartica Real-time stereo on Mars 21 Slide credit: Steve Seitz

Topics of This Lecture Geometric vision Visual cues Stereo vision Epipolar geometry Depth with stereo Geometry for a simple stereo system Case example with parallel optical axes General case with calibrated cameras Stereopsis & 3D Reconstruction Correspondence search Additional correspondence constraints Possible sources of error Applications 22

Depth with Stereo: Basic Idea Basic Principle: Triangulation Gives reconstruction as intersection of two rays Requires Camera pose (calibration) Point correspondence Slide credit: Steve Seitz 23

Camera Calibration World frame Extrinsic parameters: Camera frame Reference frame Camera frame Intrinsic parameters: Image coordinates relative to camera Pixel coordinates Parameters Extrinsic: rotation matrix and translation vector Intrinsic: focal length, pixel sizes (mm), image center point, radial distortion parameters We ll assume for now that these parameters are given and fixed. Slide credit: Kristen Grauman 24

Geometry for a Simple Stereo System First, assuming parallel optical axes, known camera parameters (i.e., calibrated cameras): Slide credit: Kristen Grauman 25

World point image point (left) Depth of p image point (right) Focal length optical center (left) Slide credit: Kristen Grauman baseline optical center (right) 26

Geometry for a Simple Stereo System Assume parallel optical axes, known camera parameters (i.e., calibrated cameras). We can triangulate via: Similar triangles (p l, P, p r ) and (O l, P, O r ): Slide credit: Kristen Grauman disparity 27

Depth From Disparity Image I(x,y) Disparity map D(x,y) Image I (x,y ) 28

General Case With Calibrated Cameras The two cameras need not have parallel optical axes. vs. Slide credit: Kristen Grauman, Steve Seitz 29

Stereo Correspondence Constraints Given p in the left image, where can the corresponding point p in the right image be? Slide credit: Kristen Grauman 30

Stereo Correspondence Constraints Given p in the left image, where can the corresponding point p in the right image be? Slide credit: Kristen Grauman 31

Stereo Correspondence Constraints Slide credit: Kristen Grauman 32

Stereo Correspondence Constraints Geometry of two views allows us to constrain where the corresponding pixel for some image point in the first view must occur in the second view. epipolar line epipolar plane epipolar line Epipolar constraint: Why is this useful? Reduces correspondence problem to 1D search along conjugate epipolar lines. Slide adapted from Steve Seitz 33

Epipolar Geometry Epipolar Plane Epipoles Baseline Epipolar Lines Slide adapted from Marc Pollefeys 34

Epipolar Geometry: Terms Baseline Line joining the camera centers Epipole Point of intersection of baseline with the image plane Epipolar plane Plane containing baseline and world point Epipolar line Intersection of epipolar plane with the image plane Properties All epipolar lines intersect at the epipole. An epipolar plane intersects the left and right image planes in epipolar lines. Slide credit: Marc Pollefeys 35

Epipolar Constraint Potential matches for p have to lie on the corresponding epipolar line l. Potential matches for p have to lie on the corresponding epipolar line l. http://www.ai.sri.com/~luong/research/meta3dviewer/epipolargeo.html Slide credit: Marc Pollefeys 36

Example Slide credit: Kristen Grauman 37

Example: Converging Cameras As position of 3D point varies, epipolar lines rotate about the baseline Slide credit: Kristen Grauman 38 Figure from Hartley & Zisserman

Example: Motion Parallel With Image Plane Slide credit: Kristen Grauman 39 Figure from Hartley & Zisserman

Example: Forward Motion e e Epipole has same coordinates in both images. Points move along lines radiating from e: Focus of expansion Slide credit: Kristen Grauman 40 Figure from Hartley & Zisserman

Let s Formalize This! For a given stereo rig, how do we express the epipolar constraints algebraically? For this, we will need some linear algebra. But don t worry! We ll go through it step by step 41

Rotation: 3 x 3 matrix; translation: 3 vector. 42 Slide credit: Kristen Grauman, Steve Seitz Stereo Geometry With Calibrated Cameras If the rig is calibrated, we know: How to rotate and translate camera reference frame 1 to get to camera reference frame 2.

Rotation Matrix R x ( ) = R y ( ) = R z ( ) = 2 1 0 0 3 40 cos sin 5 0 sin cos 2 3 cos 0 sin 4 0 1 0 5 sin 0 cos 2 cos sin 3 0 4sin cos 05 0 0 1 Express 3D rotation as series of rotations around coordinate axes by angles,, Overall rotation is product of these elementary rotations: Slide credit: Kristen Grauman 43

3D Rigid Transformation 2 4 X0 Y 0 Z 0 3 5 = 2 4 r 3 11 r 12 r 13 r 21 r 22 r 23 5 r 31 r 32 r 33 2 4 X Y Z 3 5 + 2 4 T 3 x T y 5 T z Slide credit: Kristen Grauman 44

Stereo Geometry With Calibrated Cameras Camera-centered coordinate systems are related by known rotation R and translation T: Slide credit: Kristen Grauman 45

Excursion: Cross Product Vector cross product takes two vectors and returns a third vector that s perpendicular to both inputs. So here, c is perpendicular to both a and b, which means the dot product is 0. Slide credit: Kristen Grauman 46

From Geometry to Algebra T X Normal to the plane X' RX T T RX T RX T T X T X X T RX 0 X T RX 47 Slide credit: Kristen Grauman

Matrix Form of Cross Product ~a ~ b = 2 3 0 a z a y 4 a z 0 a x 5 a y a x 0 2 4 b x b y b z 3 5 = ~c skew symmetric matrix [a ] = 2 4 0 a 3 z a y a z 0 a x a y a x 0 5 ~a ~ b = [a ] ~ b Slide credit: Kristen Grauman 48

From Geometry to Algebra T X Normal to the plane X' RX T T RX T RX T T X T X X T RX 0 X T RX 49 Slide credit: Kristen Grauman

Essential Matrix X T RX 0 X T x RX 0 Let E T x R X T EX 0 This holds for the rays p and p that are parallel to the camera-centered position vectors X and X, so we have: p' T Ep 0 E is called the essential matrix, which relates corresponding image points [Longuet-Higgins 1981] Slide credit: Kristen Grauman 50

Essential Matrix and Epipolar Lines p Ep 0 Epipolar constraint: if we observe point p in one image, then its position p in second image must satisfy this equation. l ' Ep is the coordinate vector representing the epipolar line for point p (i.e., the line is given by: l > x = 0) l T E p is the coordinate vector representing the epipolar line for point p Slide credit: Kristen Grauman 51

Essential Matrix: Properties Relates image of corresponding points in both cameras, given rotation and translation. Assuming intrinsic parameters are known E TxR Slide credit: Kristen Grauman 52

Essential Matrix Example: Parallel Cameras R T E [ d,0,0] I [T x]r 0 0 0 0 0 d 0 d 0 p Ep 0 For the parallel cameras, image of any point must lie on same horizontal line in each image plane. 53 Slide credit: Kristen Grauman

Essential Matrix Example: Parallel Cameras R T E [ d,0,0] I [T x]r 0 0 0 0 0 d 0 d 0 p Ep 0 For the parallel cameras, image of any point must lie on same horizontal line in each image plane. 54 Slide credit: Kristen Grauman

More General Case Image I(x,y) Disparity map D(x,y) Image I (x,y ) What about when cameras optical axes are not parallel? Slide credit: Kristen Grauman 55

Stereo Image Rectification In practice, it is convenient if image scanlines are the epipolar lines. Algorithm Reproject image planes onto a common plane parallel to the line between optical centers Pixel motion is horizontal after this transformation Two homographies (3 3 transforms), one for each input image reprojection Slide adapted from Li Zhang 56 C. Loop & Z. Zhang, Computing Rectifying Homographies for Stereo Vision. CVPR 99

Stereo Image Rectification: Example 57 Source: Alyosha Efros

Topics of This Lecture Geometric vision Visual cues Stereo vision Epipolar geometry Depth with stereo Geometry for a simple stereo system Case example with parallel optical axes General case with calibrated cameras Stereopsis & 3D Reconstruction Correspondence search Additional correspondence constraints Possible sources of error Applications 58

Stereo Reconstruction Main Steps Calibrate cameras Rectify images Compute disparity Estimate depth Slide credit: Kristen Grauman 59

Correspondence Problem Multiple match hypotheses satisfy epipolar constraint, but which is correct? Slide credit: Kristen Grauman 60 Figure from Gee & Cipolla 1999

Correspondence Problem To find matches in the image pair, we will assume Most scene points visible from both views Image regions for the matches are similar in appearance Slide credit: Kristen Grauman 61

Dense Correspondence Search For each pixel in the first image Find corresponding epipolar line in the right image Examine all pixels on the epipolar line and pick the best match (e.g. SSD, correlation) Triangulate the matches to get depth information This is easiest when epipolar lines are scanlines Rectify images first adapted from Svetlana Lazebnik, Li Zhang 62

Example: Window Search Data from University of Tsukuba Slide credit: Kristen Grauman 63

Example: Window Search Data from University of Tsukuba Slide credit: Kristen Grauman 64

Effect of Window Size W = 3 W = 20 Want window large enough to have sufficient intensity variation, yet small enough to contain only pixels with about the same disparity. Slide credit: Kristen Grauman 65 Figures from Li Zhang

Alternative: Sparse Correspondence Search Idea: Restrict search to sparse set of detected features Rather than pixel values (or lists of pixel values) use feature descriptor and an associated feature distance Still narrow search further by epipolar geometry What would make good features? Slide credit: Kristen Grauman 66

Dense vs. Sparse Sparse Efficiency Can have more reliable feature matches, less sensitive to illumination than raw pixels But Have to know enough to pick good features Sparse information Dense Simple process More depth estimates, can be useful for surface reconstruction But Breaks down in textureless regions anyway Raw pixel distances can be brittle Not good with very different viewpoints 67 Slide credit: Kristen Grauman

Difficulties in Similarity Constraint???? Untextured surfaces Slide credit: Kristen Grauman Occlusions 68

Possible Sources of Error? Low-contrast / textureless image regions Occlusions Camera calibration errors Violations of brightness constancy (e.g., specular reflections) Large motions Slide credit: Kristen Grauman 69

Slide credit: Svetlana Lazebnik Application: View Interpolation Right Image

Slide credit: Svetlana Lazebnik Application: View Interpolation Left Image

Slide credit: Svetlana Lazebnik Application: View Interpolation Disparity

Slide credit: Svetlana Lazebnik Application: View Interpolation

Application: Free-Viewpoint Video http://www.liberovision.com 74

Summary: Stereo Reconstruction Main Steps Calibrate cameras Rectify images Compute disparity Estimate depth So far, we have only considered calibrated cameras Next lecture Uncalibrated cameras Camera parameters Revisiting epipolar geometry Robust fitting Slide credit: Kristen Grauman 75

References and Further Reading Background information on epipolar geometry and stereopsis can be found in Chapters 10.1-10.2 and 11.1-11.3 of D. Forsyth, J. Ponce, Computer Vision A Modern Approach. Prentice Hall, 2003 More detailed information (if you really want to implement 3D reconstruction algorithms) can be found in Chapters 9 and 10 of R. Hartley, A. Zisserman Multiple View Geometry in Computer Vision 2nd Ed., Cambridge Univ. Press, 2004 76