49
CS 395/495-25: Spring CS 395/495-25: Spring 2003 2003 IBMR: Week 7B IBMR: Week 7B Chapter 6.1, 6.2; Chapter Chapter 6.1, 6.2; Chapter 7: 7: More Single-Camera Details More Single-Camera Details Jack Tumblin Jack Tumblin [email protected] [email protected]

CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin [email protected]

  • View
    215

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

CS 395/495-25: Spring 2003CS 395/495-25: Spring 2003

IBMR: Week 7B IBMR: Week 7B

Chapter 6.1, 6.2; Chapter 7: Chapter 6.1, 6.2; Chapter 7: More Single-Camera DetailsMore Single-Camera Details

Jack TumblinJack Tumblin

[email protected]@cs.northwestern.edu

Page 2: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

IBMR-Related SeminarsIBMR-Related Seminars

3D Scanning for Cultural Heritage Applications3D Scanning for Cultural Heritage Applications Holly Rushmeier, IBM TJ Watson Holly Rushmeier, IBM TJ Watson

FridayFriday May 16 3:00pm, Rm 381, CS Dept. May 16 3:00pm, Rm 381, CS Dept.

Light Scattering Models Light Scattering Models for Rendering Human Hairfor Rendering Human Hair

Steve Marschner, Cornell University Steve Marschner, Cornell University Friday May 23 3:00pm, Rm 381, CS Dept.Friday May 23 3:00pm, Rm 381, CS Dept.

Page 3: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

RemindersReminders

• ProjA graded: Good Job! 90,95, 110ProjA graded: Good Job! 90,95, 110• ProjB graded: Good! minor H confusions...ProjB graded: Good! minor H confusions...• MidTerm graded:MidTerm graded:• ProjC posted, due Friday, May 16ProjC posted, due Friday, May 16• ProjD tomorrow, Friday May 16, due Friday May 30ProjD tomorrow, Friday May 16, due Friday May 30

• Start Watson’s Late PolicyStart Watson’s Late Policy??: Grade -(3: Grade -(3nn) points;) points; n = # of class meetings late n = # of class meetings late

• Take-Home Final Exam: Thurs June 5, due June 11Take-Home Final Exam: Thurs June 5, due June 11

Page 4: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Mirror Spheres: Why? Mirror Spheres: Why?

Traditional CG Rendering: Traditional CG Rendering:

To make an image,To make an image,

Compute radiance arriving at novel camera position:Compute radiance arriving at novel camera position:– Specify: Specify: Incoming light: Irradiance function:Incoming light: Irradiance function:

at each (x,y,z) point from every direction (at each (x,y,z) point from every direction (,,))

– Specify: Specify: Shape, Texture, Reflectance, BRDF, BRSSDFShape, Texture, Reflectance, BRDF, BRSSDFat each surface point (xat each surface point (xss,y,yss,z,zss))

– Compute:Compute: Outgoing light: exitance function: Outgoing light: exitance function: (after incoming light bounces around the scene)(after incoming light bounces around the scene)

at any camera point (x,y,z) from any pixel direction at any camera point (x,y,z) from any pixel direction ((,,))

Page 5: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Mirror Spheres: Why? Mirror Spheres: Why?

• IBMR: IBMR: input is far less defined! input is far less defined!

‘images, ‘images, (usually)(usually) no depth’ only no depth’ only

To make an image, To make an image, Compute radiance arriving at novel camera position:Compute radiance arriving at novel camera position:

– Specify: Specify: Radiance from images, and perhapsRadiance from images, and perhaps– Specify: Specify: Radiance from images Radiance from images – Compute:Compute: Outgoing light: exitance function: Outgoing light: exitance function:

(after incoming light bounces around the scene)(after incoming light bounces around the scene)at any camera point (x,y,z) from any pixel at any camera point (x,y,z) from any pixel

direction (direction (,,))

Page 6: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

‘‘Rendering’ Rendering’ fromfrom a camera image? a camera image?

Conventional:Conventional: external camera reads light field external camera reads light field

(after rendering)(after rendering)

Shape, Shape, Position,Position,Movement,Movement,

BRDF,BRDF,Texture,Texture,ScatteringScattering

Emitted Emitted LightLight

Reflected,Reflected,Scattered,Scattered,Light …Light …

yycc

zzcc xxcc

CameraCamera

Page 7: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

‘‘Rendering’ Rendering’ fromfrom a camera image? a camera image?

IBMR:IBMR: Let camera measure light Let camera measure light insideinside scene scene

Shape, Shape, Position,Position,Movement,Movement,

BRDF,BRDF,Texture,Texture,ScatteringScattering

Emitted Emitted LightLight

Reflected,Reflected,Scattered,Scattered,Light …Light …

xx11

xx22

xx33

CameraCamera

Page 8: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

‘‘Rendering’ Rendering’ fromfrom a camera image? a camera image?

IBMR: Camera measures light inside sceneIBMR: Camera measures light inside scene

Shape, Shape, Position,Position,Movement,Movement,

BRDF,BRDF,Texture,Texture,ScatteringScattering

Emitted Emitted LightLight

Reflected,Reflected,Scattered,Scattered,Light …Light …

xx11

xx22

xx33

CameraCamera

TROUBLE!TROUBLE!Camera is an object; reflects Camera is an object; reflects

light, changes scene.light, changes scene.

WANTED: tiny, point-like WANTED: tiny, point-like panoramic camera:panoramic camera:

a ‘light probe’a ‘light probe’

Page 9: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

One Answer: Light ProbeOne Answer: Light Probe

Photograph a small mirror spherePhotograph a small mirror sphere

Shape, Shape, Position,Position,Movement,Movement,

BRDF,BRDF,Texture,Texture,ScatteringScattering

Emitted Emitted LightLight

Reflected,Reflected,Scattered,Scattered,Light …Light …

Mirror Mirror SphereSphere

zzcc

yycc

xxccCameraCamera

Page 10: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Light Probes: How?Light Probes: How?

• Tele-photo a mirror sphere (narrow FOV)Tele-photo a mirror sphere (narrow FOV)

• warp image to find irradiance .vs. directionwarp image to find irradiance .vs. direction

High contrast?High contrast?

Higher resol.?Higher resol.?

More positions?More positions?

More Pictures!More Pictures!

Paul Debevec, SIGGRAPH2001 course “Image Based Lighting”

Page 11: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

High Contrasts too!High Contrasts too!

..Paul Debevec,

SIGGRAPH2001 short course

“Image Based Lighting”

Page 12: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

One Answer: Light ProbeOne Answer: Light Probe

Light probes can measure irradiance—Light probes can measure irradiance—the incoming light at a point.the incoming light at a point.

• Can use them as panoramic cameras,Can use them as panoramic cameras,--OR—--OR—

as local ‘light maps’;as local ‘light maps’;– they define intensity of incoming light .vs. they define intensity of incoming light .vs.

direction, as if local neighborhood was lit by direction, as if local neighborhood was lit by lights at infinity.lights at infinity.

– Caution! may not be valid at nearby locations!Caution! may not be valid at nearby locations!– Caution! high dynamic range! (>> 1:255)Caution! high dynamic range! (>> 1:255)– Can use them to render synthetic objects...Can use them to render synthetic objects...

Page 13: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

A A ‘light probe’‘light probe’ to measure to measure ALLALL incoming light at a point. incoming light at a point.

How can we use it?How can we use it?

A Mirror Sphere is...A Mirror Sphere is...

Page 14: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Image-Based Actual Re-lightingImage-Based Actual Re-lighting

Page 15: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Image-Based Actual Re-lightingImage-Based Actual Re-lighting

Film the background in Milan,Film the background in Milan,Measure incoming light,Measure incoming light,

Light the actress in Los AngelesLight the actress in Los Angeles

Matte the backgroundMatte the background

Matched LA and Milan lighting.Matched LA and Milan lighting.

Debevec et al., SIGG2001

Page 16: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Measure REAL light in a REAL scene...Measure REAL light in a REAL scene...

Debevec et al.,SIGG1998

Page 17: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Render FAKE objects with REAL light,Render FAKE objects with REAL light,

Debevec et al.,SIGG1998

And combine with REAL image:And combine with REAL image:

Page 18: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

The Grand Challenges:The Grand Challenges:

• Controlled Lights +Controlled Lights +Controlled CamerasControlled Camerassuggest we CAN suggest we CAN recover arbitrary recover arbitrary BRDF/ BSSSDFBRDF/ BSSSDFand ‘enough’ shape.and ‘enough’ shape.

• Is any method PRACTICAL?Is any method PRACTICAL?• Can we avoid/reduce corrupting interreflections?Can we avoid/reduce corrupting interreflections?• Can we understand the shape/texture tradeoff?Can we understand the shape/texture tradeoff?

Page 19: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

The Grand Rewards:The Grand Rewards:

• Controlled Lights +Controlled Lights +Controlled CamerasControlled Camerassuggest we suggest we CANCAN recover arbitrary recover arbitrary BRDF/ BSSSDFBRDF/ BSSSDFand ‘enough’ shape.and ‘enough’ shape.

– Holodeck? CAVE uncorrupted by interreflectionsHolodeck? CAVE uncorrupted by interreflections– Historical Preservation? complete optical recordsHistorical Preservation? complete optical records– ‘‘Fake Materials’? a BRDF/BSSRDF display ... Fake Materials’? a BRDF/BSSRDF display ... – ‘‘Shader Lamps’? exchange reflectance for illuminationShader Lamps’? exchange reflectance for illumination– IBMR invisibility?IBMR invisibility?

Page 20: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Image-Based Synthetic Re-lightingImage-Based Synthetic Re-lighting

Masselus et al., 2002Masselus et al., 2002

Page 21: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Rushmeier, 2001

Fine geometric Details Fine Texture/Normal Details

Image-Based Shape RefinementImage-Based Shape Refinement

Page 22: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Matusik 2002

Matusik 2002

Image-Based Shape ApproximationImage-Based Shape Approximation

Page 23: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Matusik 2002

Image-Based Shape ApproximationImage-Based Shape Approximation

Page 24: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Why all this Projective Tedium?Why all this Projective Tedium?

• So you have the tools to try IBMRSo you have the tools to try IBMR(and because I’m struggling, slowly, to it boil down to the essentials in this course(and because I’m struggling, slowly, to it boil down to the essentials in this course ))

• It’s almost over— last 3 weeks of It’s almost over— last 3 weeks of class will be reading class will be reading good recent good recent research papersresearch papers, and will, and will

• Begin exploring some open research Begin exploring some open research questions...questions...

Page 25: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Camera Matrix P Summary:Camera Matrix P Summary:

• Basic cameraBasic camera: : x = Px = P0 0 X X wherewhere PP00 = [K | 0] = = [K | 0] =

• World-space camera:World-space camera: translate world origin to camera location C, then rotate:translate world origin to camera location C, then rotate:

x = PX = (Px = PX = (P00·R·T) X·R·T) X

• Rewrite as:Rewrite as: P = K [R | -RC]P = K [R | -RC]

• Redundant notation:Redundant notation:P = [M P = [M | p p44]]

M = RKM = RKpp44 = -K R C = -K R C

Output: Output: xx

2D Camera Image2D Camera Image Input:Input: XX

3D World Space3D World Space

zz

yy

xx

XX (world space)(world space)

zz cc

yy cc

xx cc

CC

xx(c

amer

a (c

amer

a sp

ace)

spac

e)

~~

~~

xxff ss ppxx 00

0 0 yyff ppyy 00

0 0 0 0 11 0 0

~~

Page 26: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Chapter 6 Chapter 6 In Just One Slide:In Just One Slide:

Given point correspondence sets Given point correspondence sets (x(xii X Xii)), How , How do you find camera matrix do you find camera matrix P ? P ? (full 11 DOF)(full 11 DOF)

Surprise! You already know how !Surprise! You already know how !• DLT method: DLT method:

-rewrite H x = x’ as Hx -rewrite H x = x’ as Hx x’ = 0 x’ = 0--rewrite rewrite P X = xP X = x as as PX PX x = 0 x = 0-vectorize, stack, solve Ah = 0 for h vector-vectorize, stack, solve Ah = 0 for h vector-vectorize, stack, solve -vectorize, stack, solve Ap = 0Ap = 0 for for pp vector vector

--Normalizing step removes origin dependenceNormalizing step removes origin dependence

• More data More data better results (at least 28 point pairs) better results (at least 28 point pairs)(why so many? rule-of-thumb: #constraints = 5x #DOF = 55 = 27.5 point pairs)(why so many? rule-of-thumb: #constraints = 5x #DOF = 55 = 27.5 point pairs)

• Algebraic & Geometric Error, Sampson Error…Algebraic & Geometric Error, Sampson Error…

Page 27: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?

• PlanesPlanes– Given any point Given any point XX on a plane in on a plane in PP33,,

– Change world’s coord. system: let plane be Change world’s coord. system: let plane be z=0z=0::– Matrix Matrix PP reduces to 3x3 matrix reduces to 3x3 matrix HH in in PP22::

xx = = PP··XX = =

• THUSTHUSPP22 can do any, all Pcan do any, all P22 plane transforms plane transforms

xx

yy

00

tt

xx

yy

tt

hh11 11 h h1212 h h1313

hh2121 h h2222 h h2121

hh3131 h h32 32 h h3333 ==

pp1111 p p1212 p p1313 p p1414

pp2121 p p1212 p p2323 p p2424

pp3131 p p3232 p p3333 p p3434

Page 28: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?

• Points, Directions:Points, Directions:World-space PWorld-space P33 direction direction DD image space point image space point x xd:d:

Recall directionRecall direction D = (x,y,z,0)D = (x,y,z,0) (a point at infinity)(a point at infinity) sets a sets a RR33 finite point finite point d = (x,y,z)d = (x,y,z)..

xxd d = PD = [M | p= PD = [M | p44] D = M] D = M ddpp44 column has no effect, because of D’s zero;column has no effect, because of D’s zero;RRecallecall M = KR M = KR

xxdd = M = M d Md M-1-1xxdd = d = d

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

ff CC

yycc

zzcc

xxcc

pp

xxdd

~~zz

yy xx

XX (world space)(world space)

dd

DD

Page 29: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?

• Lines: Forward Projection:Lines: Forward Projection:

• Line / Ray in Line / Ray in worldworld Line/Ray in Line/Ray in imageimage::– Ray in Ray in PP33 is: is: XX(() = A + ) = A + BB– Camera changes to Camera changes to PP22: : x(x()) = PA + = PA + PB PB

ff CC

yycc

zzcc

xxcc

pp

PAPA

AA

BB

Page 30: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?• Lines: Back Projection:Lines: Back Projection:

Line Line LL in in imageimage Plane Plane LL in in worldworld::

– Recall: Line L in Recall: Line L in PP2 2 (a 3-vector): (a 3-vector): L =L = [x[x1 1 xx22 x x33]]TT

– Plane Plane L L in in PP33 (a 4-vector): (a 4-vector):

LL = P = PTT··L = L =

• (SKIP Plucker Matrix lines…)(SKIP Plucker Matrix lines…)

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

ff CC

yycc

zzcc

xxcc

pp

LL

11

22

33

pp1111 p p2121 p p3131

pp1212 p p2222 p p3232

pp1313 p p2323 p p3333

pp1414 p p2424 p p3434

....

LL

Page 31: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?

Conics 1:Conics 1:• Conic Conic CC in in imageimage Cone Quadric Cone Quadric QQcoco in in worldworld

QQcoco = P = PTT··CC··PP

• (Tip of cone is camera center(Tip of cone is camera center VV))ff VV

yycc

zzcc

xxcc

pp

CC

Page 32: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes? • Conics 2:Conics 2:Dual (line) Quadric Dual (line) Quadric Q*Q* in in world world

Dual (line) Conic Dual (line) Conic C*C* silhouette in silhouette in imageimage

C*C* = P = PTT··Q*Q*··PP

• Works for ANY world quadric!Works for ANY world quadric!sphere, cylinder, ellipsoid,sphere, cylinder, ellipsoid,paraboloid, hyperboloid, line, disk …paraboloid, hyperboloid, line, disk … ff VV

yycc

xxcc

ppzzcc

C*C*

Q*Q*

Page 33: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What does it do to basic 3D world shapes?? What does it do to basic 3D world shapes?

• Conics 3:Conics 3:World-space quadric World-space quadric QQ World-space view cone World-space view cone

QQcoco, a degenerate , a degenerate

quadricquadric

QQcoco = (V = (VTT QV)Q – (QV)(QV) QV)Q – (QV)(QV)TT

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

ff VV

yycc

xxcc

ppzzcc

QQ

QQcoco

Page 34: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What if the ? What if the imageimage plane moves? plane moves? A) Translation: A) Translation: • Given internal camera calibration Given internal camera calibration KK = =

• In (In (xxcc, y, ycc)? changes p)? changes pxx,p,pyy. In . In zzcc? focal length ? focal length f:f:let let k = (f+tk = (f+tzz)/f)/f, then:, then:

K’K’ = =

• Define effect of K’ on image points x,x’;Define effect of K’ on image points x,x’;x = [K x = [K | 0]X; x’ = [K’ | 0]X 0]X; x’ = [K’ | 0]X

x’ = K’ Kx’ = K’ K-1-1 x x

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

ff cc

yycc

xxcc

ppzzcc

xxff ss ppxx

0 0 yyff ppyy

0 0 0 0 11

kk 0 0 0 00 0 kk 0 0

0 0 0 0 11

xxff ss (p(pxx-t-txx))

0 0 yyff (p(pyy-t-tyy))

0 0 0 0 11

Page 35: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

? What if the ? What if the imageimage plane moves? plane moves? B) Rotation: B) Rotation: • Given internal camera calibration Given internal camera calibration KK = = • Rotate basic camera’s output:Rotate basic camera’s output:

about its center about its center CC using 3D rotation matrix using 3D rotation matrix R R (3x3):(3x3):x = [K | 0]X; x = [K | 0]X; x’ = [KR | 0] Xx’ = [KR | 0] Xx’ = [KRx’ = [KR(K(K-1-1K)K) | 0] X = (KRK | 0] X = (KRK-1-1) ) [K|0] X[K|0] X

• Get new points Get new points x’ x’ from old image pts from old image pts xx

(K(K··RR··KK-1-1) x = x) x = x’’• aka ‘conjugate rotation’; use this to construct planar panoramasaka ‘conjugate rotation’; use this to construct planar panoramas

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

ff cc

yycc

xxcc

ppzzcc

xxff ss ppxx

0 0 yyff ppyy

0 0 0 0 11

RR

Page 36: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

(K(K··RR··KK-1-1) x = x) x = x’’

(K’ K(K’ K-1-1) x = x’) x = x’

Full 3x4 camera matrix Full 3x4 camera matrix PP maps maps PP33worldworld to to PP2 2

imageimage

THUS: if the THUS: if the imageimage plane moves: plane moves:

just rearranges the image points:just rearranges the image points:a) Translations:a) Translations:

b) Rotations:b) Rotations:

ALLALL cameras gather the same image content! cameras gather the same image content! Same Center Point? Same image, just rearranged!Same Center Point? Same image, just rearranged!

(just a planar reprojection in P(just a planar reprojection in P33) )

• The camera center The camera center CC must movemust move to change the image content:to change the image content:no zooming, warping, rotation can change this!no zooming, warping, rotation can change this!

Gathering Gathering 3-D3-D image data image data requiresrequires camera movement. camera movement.

Chapter 7: More One-Camera DetailsChapter 7: More One-Camera Details

Page 37: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Movement Detection?Movement Detection?

• Can we do it from images only?Can we do it from images only?– 2D projective transforms often LOOK like 3-D; 2D projective transforms often LOOK like 3-D; – External cam. calib. affects all elements of External cam. calib. affects all elements of PP

• YES. Camera moved if-&-only-ifYES. Camera moved if-&-only-ifCamera-ray points (Camera-ray points (CCxxXX11,X,X22,…,…) will) will

map to LINE (not a point) in the other imagemap to LINE (not a point) in the other image

• ‘‘Epipolar LineEpipolar Line’ ==’ == l’ l’ = image of = image of L L

• ‘‘Parallax’ Parallax’ ==== x x11’’xx22’ ’ vectorvectorC’C’

CC

xx LL

XX11

XX22

xx22’’

xx11’’

l’l’

Page 38: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

• Define world-space direction Define world-space direction dd::– From a From a PP3 3 infinity point infinity point D = D = [x[xdd y ydd z zdd 0] 0]TT

define define d == [xd == [xdd y ydd z zdd]]

• Use Basic Camera PUse Basic Camera P00,,

– (e.g. (e.g. C=(0,0,0,1)C=(0,0,0,1), , R=0, R=0, P = P P = P00))– (Danger! now mixing P2, P3…)(Danger! now mixing P2, P3…)

– Link direction Link direction DD to image-space pt. to image-space pt. xxdd=(x=(xcc,y,ycc,z,zcc):):

PP0 0 XXdd = [K| = [K|II]X]Xdd = = K d = xK d = xdd

• Ray thru image pt. Ray thru image pt. xx has direction has direction d = Kd = K-1-1xxdd

~~

Page 39: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

• Angle between Angle between CC and 2 image points and 2 image points xx11,x,x22

(see book pg 199)(see book pg 199)

coscos = = xx11T T (K(K-T-TKK-1-1)) x x22

(x(x11T T (K(K-T-TKK-1-1)) x x11)(x)(x22

TT (K (K-T-TKK-1-1) ) xx22))

• Image line Image line LL defines a plane defines a plane L L

– (Careful! (Careful! PP33 world = world =PP22 camera axes here!) camera axes here!)

– Plane normal direction:Plane normal direction:

n = Kn = KT T LLCC

xx22

xx11

LL

dd22

dd11

nn

Page 40: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

• Angle between Angle between CC and 2 image points and 2 image points xx11,x,x22

(see book pg 199)(see book pg 199)

coscos = = xx11T T (K(K-T-TKK-1-1)) x x22

(x(x11T T (K(K-T-TKK-1-1)) x x11)(x)(x22

TT (K (K-T-TKK-1-1) ) xx22))

• Image line L defines a plane Image line L defines a plane L L

– (Careful! P(Careful! P33 world =P world =P22 camera axes here!) camera axes here!)

– Plane normal direction:Plane normal direction:

n = Kn = KT T LLCC

xx22

xx11

LL

dd22

dd11

nnSomething Special Something Special here? Yeshere? Yes!!

Page 41: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

What is What is (K(K-T-TKK-1-1) ) ??• Recall Recall PP33 Conic Weirdness: Conic Weirdness:

– Plane at infinity Plane at infinity holds all ‘horizon points’ holds all ‘horizon points’ dd (‘universe wrapper’) (‘universe wrapper’)

– Absolute Conic Absolute Conic is is imaginary outermost circle of imaginary outermost circle of

• for ANY camera,for ANY camera,Translation won’t change ‘Horizon point’ images:Translation won’t change ‘Horizon point’ images:

P P XXdd = x = KR = x = KRdd (pg200)(pg200)

• Absolute conic is inside Absolute conic is inside ; it’s all ‘horizon points’; it’s all ‘horizon points’

• for ANY camera,for ANY camera,P P = = (K(K-T-TKK-1-1) ) = = = = ‘I‘Image ofmage of A Absolutebsolute C Coniconic’’

Page 42: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Why do we care?Why do we care?

P P = = (K(K-T-TKK-1-1) ) = = = = ‘I‘Image ofmage of A Absolutebsolute C Coniconic’’

• IAC is a ‘magic tool’ for camera calibration IAC is a ‘magic tool’ for camera calibration KK

• Recall Recall let us find let us find HH from perp. lines. from perp. lines.

• Much better than ‘vanishing pt.’ methodsMuch better than ‘vanishing pt.’ methods

• With IAC, find With IAC, find PP matrix from an image of matrix from an image of just just 33 (non-coplanar) squares… (non-coplanar) squares…

Page 43: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

• ImageImage Direction: Direction: d = [xd = [xcc, y, ycc, z, zcc, 0], 0]TT

• ImageImage Direction from a point Direction from a point xx: : d = Kd = K-1-1xx

• Angle Angle between between CC and 2 image points and 2 image points xx11,x,x22::

(pg 199)(pg 199)

• Simplify with absolute conic Simplify with absolute conic ::

P P = = (K(K-T-TKK-1-1)) = = = = ‘I‘Image ofmage of A Absolutebsolute C Coniconic’’

CC

xx22

xx11

LL

dd11

dd22

coscos = = xx11T T (K(K-T-TKK-1-1)) x x22

(x(x11T T (K(K-T-TKK-1-1)) x x11)(x)(x22

TT (K (K-T-TKK-1-1) ) xx22))

Page 44: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

P P = = (K(K-T-TKK-1-1). ). OK.OK. Now what was Now what was again?again?

Recall Recall PP33 Conic Weirdness: Conic Weirdness: (pg. 63-67)(pg. 63-67)

– Plane at infinity Plane at infinity holds all ‘horizon points’ holds all ‘horizon points’ dd (‘universe wrapper’) (‘universe wrapper’)

– Absolute Conic Absolute Conic imaginary pointsimaginary points in outermost in outermost circlecircle of of

• Satisfies BOTH Satisfies BOTH xx112 2 + x+ x22

2 2 + x+ x332 2 = 0= 0 AND AND xx44

2 2 = 0= 0

• Can rewrite equations to Can rewrite equations to looklook like a quadric (but isn’t— no x like a quadric (but isn’t— no x44) )

• AHA! ‘points’ on it are AHA! ‘points’ on it are (complex conjugate) (complex conjugate) directions directions dd ! !

– Finds right angles-- if Finds right angles-- if dd11 dd22, then: , then: dd11TT· · ··dd22 = 0= 0

1 0 0 01 0 0 00 1 0 00 1 0 00 0 1 00 0 1 00 0 0 00 0 0 0

== ddTT····dd xx11

xx22

xx33

00

xx1 1 x x22 x x3 3 00

Page 45: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

P P = = (K(K-T-TKK-1-1). ). OK.OK. Now what was Now what was again?again?– DualDual of Absolute Conic of Absolute Conic is is Dual QuadricDual Quadric QQ** (?!?!) (?!?!)

– More compact notation: for More compact notation: for imaginaryimaginary planes planes

– Same matrix, but different use: Same matrix, but different use:

--find a plane --find a plane for every possible direction for every possible direction dd

-- -- is is to to , and tangent to the quadric , and tangent to the quadric Q*Q*

is circle in is circle in where tangent planes where tangent planes are are to to

– Finds right angles-- if Finds right angles-- if 11 22, then: , then: 11TT· · QQ**··22 = 0= 0

1 0 0 01 0 0 00 1 0 00 1 0 00 0 1 00 0 1 00 0 0 00 0 0 0

= = TT··QQ**·· 11

22

33

44

1 1 22 3 3 44

Inconsistent Inconsistent notation!notation!

Page 46: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

P P = = (K(K-T-TKK-1-1)) = = = = ‘I‘Image ofmage of A Absolutebsolute C Coniconic’’

• Just Just as has a dual as has a dual QQ**, , has dual has dual ** : :

* = * = -1-1 = K K = K KTT

• The dual conic The dual conic * * is the image of is the image of QQ** , so, so

* = * = P P QQ** = = P P ==

1 0 0 01 0 0 00 1 0 00 1 0 00 0 1 00 0 1 00 0 0 00 0 0 0

pp1 1 p p2 2 p p3 3 0 0

(first 3 columns of P?)(first 3 columns of P?)

Page 47: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

P P = = (K(K-T-TKK-1-1)) = = = = ‘I‘Image ofmage of A Absolutebsolute C Coniconic’’

• Just Just as has a dual as has a dual QQ**, , has dual has dual ** : : * = * = -1-1 = K K = K KTT

• The dual conic The dual conic * * is the image of is the image of QQ** , so, so* = * = P P QQ** = = P P ==

Vanishing pointsVanishing points v v11,v,v22 of 2 of 2 world-space world-space lineslines::vv11

TT v v22 = 0 = 0

Vanishing linesVanishing lines L L11, L, L22 of 2 of 2 world-space world-space planesplanes::LL11

TT* L* L22 = 0 = 0

1 0 0 0 1 0 0 0 0 1 0 00 1 0 00 0 1 00 0 1 00 0 0 00 0 0 0

pp1 1 p p2 2 p p3 3 0 0

(first 3 columns of (first 3 columns of P)P)

Page 48: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

Cameras as ProtractorsCameras as Protractors

Clever vanishing point trick: Clever vanishing point trick: • Perpendicular lines in image?Perpendicular lines in image?• Find their vanishing pts. by construction:Find their vanishing pts. by construction:• Use Use vv11

TT v v22 = 0 = 0, stack, solve for , stack, solve for = = (K(K-T-TKK-1-1))

vv11

vv22

vv33

Page 49: CS 395/495-25: Spring 2003 IBMR: Week 7B Chapter 6.1, 6.2; Chapter 7: More Single-Camera Details Jack Tumblin jet@cs.northwestern.edu

ENDEND