brown universitymesh.brown.edu/3dp-2018/files/lecture-07-2.pdfstep 2: build the point light source...

18
Spring 2016 ENGN2502 --- 3D Photography Lecture 7 Gabriel Taubin Brown University Desktop 3D Photography http://www.vision.caltech.edu/bouguetj/ICCV98/.index.html

Upload: others

Post on 09-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Spring2016ENGN2502---3DPhotography

Lecture7

GabrielTaubinBrownUniversity

Desktop3DPhotography

•  http://www.vision.caltech.edu/bouguetj/ICCV98/.index.html

Page 2: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

3Dtriangulation:ray-planeIntersection

ray

plane

intersectionpoint

projector/

coordinate

systemsworld

coordinate system

3DTriangulationbyRay-Planeintersection

object being

scanned

pq n

projected light plane

p

illuminated

point on object

camera ray

v

intersection

of light plane

with object

world coordinate

system

image plane

center of projection

ray

direction

vector

Page 3: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Ifcameraandprojectorarecalibrated

object being

scanned

pq n

projected light plane

p

illuminated

point on object

camera ray

vintersection

of light plane

with object

common

world

coordinate

systemcenter of projection

ray direction

vector from

detected pixel

Lq

3DTriangulationbyRay-RayIntersection

object being

scanned

camera ray2v

projected

light ray

p

lines may not intersect !

Page 4: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Implicitequationoftheplane

pq n

}0)(:{ =−= pt qpnpP

v

world coordinate

system Plane normal vector

(unit length)

A fixed point

on the plane

p

Parametricequationoftheray

pq n

L = {p = qL +λv :λ > 0}

camera ray

Lq

v

world coordinate

system

ray direction

vector

(unit length)

p

v

Page 5: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

TriangulationbyLine-PlaneIntersection

world coordinate

system

}{ vqpL L λ+==

camera ray

Lqv

Compose implicit and

parametric equations

p

pq n

}0)(:{ =−= pt qpnpP

projected light plane

TriangulationbyLine-PlaneIntersection

world coordinate

system

}{ vqpL L λ+==

camera ray

Lqv

Replace computed λ

in parametric equation

p

pq n

}0)(:{ =−= pt qpnpP

projected light plane

Page 6: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

TriangulationbyLine-PlaneIntersection

world coordinate

system

}{ vqpL L λ+==

camera ray

Lqv

Eliminate parameter λ

p

pq n

}0)(:{ =−= pt qpnpP

projected light plane

TriangulationbyLine-LineIntersection

object being

scanned

}{ 2222 vqpL λ+==camera ray

2q

2v

projected light ray

1q1v

}{ 1111 vqpL λ+==

p

lines may not intersect !

Page 7: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

TriangulationbyLine-LineIntersection

L2 = {p2 = q2 +λ2v2}

2q2v1q

1v

L1 = {p1 = q1 +λ1v1}

p1 = q1 +λ1v1

p2 = q2 +λ2v2

p1 − p2

v1t (p1 − p2 ) = 0v2t (p2 − p1) = 0

E(λ1,λ2 ) = dist(p2 − p1)2

Minimize

Necessary conditions

p = (p1 + p2 ) / 2

p

Approximate Line-Line Intersection

1q1v

2q

2v

1111 vqp λ+=

2222 vqp λ+=

),( 2112 λλp

Midpoint of segment joining

arbitrary points in the two lines

1q1v

2q

2v

),( 2112 λλp

Least-squares approach

Find parameters which minimize

Page 8: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Approximate Line-Line Intersection

1111 vqp λ+=

2222 vqp λ+=

3DLaserScanner

Whatistheequationoftheplane

inthecameracoordinatesystem?

Cameraandlaserareattached:

usecameracoordinatesystem

Page 9: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Plane defined by image line and center of projection

center of projection

qn

image plane

}0)(:{ =−= qpnpP t

}0:{ == uluL tImplicit equation of line in image coordinates

Triangulation by Laser Striping

M. J. Leotta, A. Vandergon, and G. Taubin. 3D Slit Scanning With Planar Constraints. Computer Graphics Forum, 2008

§  Manuallyormechanicallytranslatedlaserstripe

§  Per-pixeldepthbyray-planetriangulation

§  Requiresaccuratecameraandlaserplanecalibration

§  PopularsolutionforcommercialandDIY3Dscanners

Page 10: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

3D Photography on Your Desk: Bouguet and Perona [ICCV 1998]

J.-Y. Bouguet and P. Perona. 3D photography on your desk. Intl. Conf. Comp. Vision, 1998

§  DIYscannerusingonlyacamera,ahalogenlamp,andastick

§  Per-pixeldepthbyray-planetriangulation

§  Requiresaccuratecameraandshadowplanecalibration

3D Photography on Your Desk: Bouguet and Perona [ICCV 1998]

J.-Y. Bouguet and P. Perona. 3D photography on your desk. Intl. Conf. Comp. Vision, 1998

Page 11: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Assembling Your Own Scanner

§  Parts:camera(QuickCam9000),lamp,stick,twoplanarobjects[~$100]

§  Step1:Buildthecalibrationboards(includefiducialsandchessboard)

§  Step2:Buildthepointlightsource(removereflectorandplaceinscene)

§  Step3:Arrangethecamera,lightsource,andcalibrationboards

Assembling Your Own Scanner

§  Parts:camera(QuickCam9000),lamp,stick,twoplanarobjects[~$100]

§  Step1:Buildthecalibrationboards(includefiducialsandchessboard)

§  Step2:Buildthepointlightsource(removereflectorandplaceinscene)

§  Step3:Arrangethecamera,lightsource,andcalibrationboards

Page 12: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Assembling Your Own Scanner

§  Parts:camera(QuickCam9000),lamp,stick,twoplanarobjects[~$100]

§  Step1:Buildthecalibrationboards(includefiducialsandchessboard)

§  Step2:Buildthepointlightsource(removereflectorandplaceinscene)

§  Step3:Arrangethecamera,lightsource,andcalibrationboards

Assembling Your Own Scanner

§  Parts:camera(QuickCam9000),lamp,stick,twoplanarobjects[~$100]

§  Step1:Buildthecalibrationboards(includefiducialsandchessboard)

§  Step2:Buildthepointlightsource(removereflectorandplaceinscene)

§  Step3:Arrangethecamera,lightsource,andcalibrationboards

Page 13: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Swept-Plane Reconstruction Geometry

CΧ1

2

3

)(tlΠ

),( yxCΛ

)(),( tyxP lC Π∩Λ=

P

p

)(tlΠ),( yxCΛ

Demo: Data Capture

Page 14: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Imax (x, y) = maxtI(x, y, t)

§  ConvertfromRGBtograyscale(forluminance-domainprocessing)

§  Determineper-pixelminimumandmaximumvalueoversequence

Video Processing: Assigning Per-Pixel Shadow Thresholds

Imin(x, y) = mintI(x, y, t)

Ishadow(x, y) =I m a x ( x ;y ) + I m i n ( x ;y )

2

§  ConvertfromRGBtograyscale(forluminance-domainprocessing)

§  Determineper-pixelminimumandmaximumvalueoversequence

§  Evaluateper-pixel�shadowthreshold�asaverageofmin.andmax.

Video Processing: Assigning Per-Pixel Shadow Thresholds

Page 15: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

400 600 800

-60

-40

-20

0

20

40

60

column index

I 60(x

,y) -

I sha

dow(x

,y)

Video Processing: Spatial Shadow Edge Localization

§  Selectregionofinterestoneachcalibrationplane(occlusion-free)

§  Estimatezero-crossingstofindleadingandtrailingshadowboundaries

§  Fitalinetothesetofpointsalongeachshadowboundary

èResult:Best-fit2Dlinesforeachshadowedge(inimagecoordinates)

540 550 560 570 580

-60

-40

-20

0

20

40

column index

I 60(x

,y) -

I sha

dow(x

,y)

Video Processing: Temporal Shadow Edge Localization

80 100 120 140-40

-20

0

20

40

frame index

I(x,y

,t) -

I sha

dow(x

,y)

§  Tabulateper-pixeltemporalsequence(minusshadowthreshold)

§  Estimatezero-crossingstofindshadow-crossingtimes

èResult:Useshadow-crossingtimetolookupcorresponding3Dplane

crossing frame index for leading shadow crossing frame index for trailing shadow

fram

e in

dex

80

100

120

140

Page 16: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Intrinsic Camera Calibration

1 12

23

3

4

Estimated Camera Lens Distortion Map Camera Calibration Input

§  Howtoestimateintrinsicparametersanddistortionmodel?(unknowns:

focallength,skew,scale,principalpoint,anddistortioncoeffs.)

§  Popularsolution:Observeaknowncalibrationobject(Zhang[2000])

§  Each2Dchessboardcorneryieldstwoconstraintsonthe6-11unknowns

§  But,mustalsofind6extrinsicparametersperimage(rotation/translation)

§  èResult:Twoormoreimagesofachessboardaresufficient

camera coordinate system

12 3 u

world coordinate system

1 2

3p

TRXWC +=Χ

intrinsic parameters extrinsic parameters

Demo: Camera Calibration in Matlab

J.-Y. Bouguet. Camera Calibration Toolbox for Matlab. http://www.vision.caltech.edu/bouguetj/calib_doc/

Page 17: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Extrinsic Camera Calibration

CΧ1

2

3

WΧ 12

3

?},{ TRTRXWC +=Χ

vΠvΧ 1

2

3

vvvC TXR +=Χ

hΧ1

23

hhhC TXR +=Χ

w h

Demo: Mapping Pixels to Optical Rays

CΧ 12

3

),( yxCΛ

p

)( TRPKp +=λ

P

n

§  Howtomapanimagepixeltoanopticalray?

§  Solution:Invertthecalibratedcameraprojectionmodel

§  But,alsorequiresinversionofdistortionmodel(whichisnon-linear)

§  MappingimplementedinCameraCalibrationToolboxwithnormalize.m

èResult:Aftercalibration,pixelscanbeconvertedtoopticalrays

Page 18: Brown Universitymesh.brown.edu/3DP-2018/files/lecture-07-2.pdfStep 2: Build the point light source (remove reflector and place in scene) Step 3: Arrange the camera, light source, and

Shadow Plane Calibration

CΧ1

2

3

)(tlΠ

)(tvΛ

)(thλ

)(tvλ

)(tn

)()()( tttn vh Λ⊗Λ=)(thλ

)(tvλ

)(thΛ

)(tlΠ

)()()( tttP vh Λ∩Λ=

)(tP

Alternatives for Shadow Plane Calibration

J.-Y. Bouguet and P. Perona. 3D photography on your desk. Intl. Conf. Comp. Vision, 1998

CΧ1

2

3b st

B

h

sT

TL