Structured Lighting - Scientific Computing and Imaging...

49
Structured Lighting Guido Gerig CS 6320, 3D Computer Vision Spring 2015 (credits: slides S. Narasimhan CMU, Marc Pollefeys UNC) http://mesh.brown.edu/byo3d http://www.cs.cmu.edu/afs/cs/academic/class/15385- s06/lectures/ppts/lec-17.ppt

Transcript of Structured Lighting - Scientific Computing and Imaging...

Page 1: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Structured LightingGuido Gerig

CS 6320, 3D Computer VisionSpring 2015

(credits: slides S. Narasimhan CMU, Marc Pollefeys UNC)

http://mesh.brown.edu/byo3dhttp://www.cs.cmu.edu/afs/cs/academic/class/15385-

s06/lectures/ppts/lec-17.ppt

Page 2: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Passive triangulation: Stereo vision

• Correspondence problem

• Geometric constraints

search along epipolarlines

• 3D reconstruction of matched pairs by triangulation

Page 3: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Real-Time 3D Model Acquisition

Link: http://graphics.stanford.edu/papers/rt_model/

http://graphics.stanford.edu/papers/rt_model/

The SIGGRAPH Paper: Full paper as PDF. One-page abstract and Figure 1as PDF. Two-page abstract and Figure 1as PDF. A 5-minute video describing the system: AVI file, 640 x 480 pixels(19MB) RealVideo stream, 640 x 480 pixels, 1536 kbsRealVideo stream, 320 x 240, 56 - 904 kbsSIGGRAPH 2002 talk: Talk as PPTEmbedded video clip: sig02_begin_m.aviEmbedded video clip: sig02_recap.aviEmbedded video clip: turtle2.avi

Page 4: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Structured Light

Page 5: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Structured Light

Page 6: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Basic Principle

Page 7: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Special Case: Light Spot Stereo

Calibrated Cameras: Detection of spot in left and right cameras fully determines its 3D location. Spot to be scanned across scene.

Page 8: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Variant

Page 9: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Line Projection

Page 10: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

But we can do better

Page 11: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Calibrated Projection

Page 12: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Concept: Active Vision

Active manipulation of scene: Project light pattern on object. Observe geometry of pattern via camera → 3D geometry

Page 13: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

3D Scanning

Courtesy S. Narasimhan, CMU

Page 14: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Typical Application

Page 15: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 16: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Active triangulation: Structured light

• One of the cameras is replaced by a light emitter

• Correspondence problem is solved by searching the pattern in the camera image (pattern decoding)

• No geometric constraints

Page 17: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Overview

• Background • General Setup• Light Point Projection 2D and 3D• Light Stripe Projection• Static Light Pattern Projection

– Binary Encoded Light Stripes– Segmenting Stripes

• 3D Photography on Your Desk

Page 18: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

General Setup

• one camera• one light source

– types• slide projector• laser

– projection• spot• stripe• pattern

Page 19: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 2D

imageplane

Assume point-wise illumination by laser beam, only 2D

Reinhard Klette, Computer Vision

Page 20: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 2D

Reinhard Klette, Computer Vision

Page 21: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 2D• Coordinates found by triangulation:

– can be found by projection geometry – d = b*sin()/sin( + )– P = (X0, Z0)– X0 = d*cos()– Z0 = h = d*sin()

• Calculating Location of P:– known b and defined by projection geometry/calibrat.- Given image coordinate u and focal length f ->

calculate - Given b, , -> calculate d

Page 22: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 3D

Z

Page 23: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 3D

Page 24: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Spot Projection 3D

– X0 = (tan()*b*x)/(f + x*tan())– Y0 = (tan()*b*y)/(f+x*tan())– Z0 = (tan()*b*f)/(f+x*tan())

OBSERVATION????

Angle gamma γ not used !!!! (Exercise)

Page 25: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Stripe Scanning – Single Stripe

Camera

Source

Surface

Light plane

• Optical triangulation– Project a single stripe of laser light– Scan it across the surface of the object– This is a very precise version of structured light scanning– Good for high resolution 3D, but needs many images and takes time

Courtesy S. Narasimhan, CMU

Page 26: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Stripe Projection

Page 27: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Triangulation

• Project laser stripe onto object

Object

Laser

Camera

Light Plane0 DCzByAx

Courtesy S. Narasimhan, CMU

Page 28: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Camera

Triangulation

• Depth from ray-plane triangulation:– Intersect camera ray with light plane

Laser

Object

Light Plane

(distance) 0

dDDCZBYAX

)','( yxImage Point

'/''/'

fZyYfZxX

''''CfByAx

DfZ

Courtesy S. Narasimhan, CMU

Use perspective projection eq’s,plug X, Y into plane equation to get Z

'f

Page 29: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Stripe Projection: Calibration

P

• Put calibration object into scene

• Shift object along light plane

Page 30: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Light Stripe

Projection: Calibration

Page 31: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Straightforward: Single light stripe and rotating Object

Object on turntable:• Create P(X,Y,Z) profile for each rotation and fixed light slit• Rotate object in discrete intervals and repeat• Reconstruct 3D object by cylindric assembly of profiles → 3D

mesh

Page 32: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Example: Laser scanner

Cyberware® face and head scanner

+ very accurate < 0.01 mm − more than 10sec per scan

Page 33: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Portable 3D laser scanner (this one by Minolta)

Page 34: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Direction of travel

Object

CCD

CCD image plane

LaserCylindrical lens

Laser sheet

Digital Michelangelo Projecthttp://graphics.stanford.edu/projects/mich/

Example: Laser scanner

Page 35: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Can we do it without expensive equipment?

Page 36: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

3D Acquisition from Shadows

Bouguet-Perona, ICCV 98

Page 37: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

3D Photography on Your Desk• “Cheap” method that uses very common

tools to do 3D photography• Requirements: PC, camera, stick, lamp,

and a checker board• Uses “weak structured light” approach

Page 38: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 39: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 40: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Lamp Calibration

Page 41: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 42: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 43: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 44: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe
Page 45: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Low-Cost 3D Scanner for Everyonehttp://www.david-laserscanner.com/

Page 46: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Low-Cost 3D Scanner for Everyonehttp://www.david-laserscanner.com/wiki/user_manual/3d_laser_scanning

Page 47: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Cheap Scanner

• http://www.igp.ethz.ch/photogrammetry/education/lehrveranstaltungen/MachineVisionFS2011/coursematerial/MV-SS2011-structured.pdf

• Cheap Scanner: http://www.david-laserscanner.com/

Page 48: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Build your own 3D scanner

• Course notes: http://mesh.brown.edu/byo3d/notes/byo3D.pdf• Slides: http://mesh.brown.edu/byo3d/slides.html• Source code: http://mesh.brown.edu/byo3d/source.html

Page 49: Structured Lighting - Scientific Computing and Imaging ...gerig/CS6320-S2015/Materials/CS6320-CV-S201… · Surface Light plane • Optical triangulation – Project a single stripe

Next Lecture: Encoded Patterns

• Any spatio-temporal pattern of light projected on a surface (or volume).

• Cleverly illuminate the scene to extract scene properties (eg., 3D).• Avoids problems of 3D estimation in scenes with complex

texture/BRDFs.• Very popular in vision and successful in industrial applications

(parts assembly, inspection, etc).