3D Vision Andreas Geiger, Torsten Sattler Spring 2017 Schedule - - PowerPoint PPT Presentation

3d vision
SMART_READER_LITE
LIVE PREVIEW

3D Vision Andreas Geiger, Torsten Sattler Spring 2017 Schedule - - PowerPoint PPT Presentation

3D Vision Andreas Geiger, Torsten Sattler Spring 2017 Schedule Feb 20 Introduction Feb 27 Geometry, Camera Model, Calibration Mar 6 Features, Tracking / Matching Mar 13 Project Proposals by Students Mar 20 Structure from Motion (SfM) +


slide-1
SLIDE 1

3D Vision

Andreas Geiger, Torsten Sattler

Spring 2017

slide-2
SLIDE 2

Feb 20 Introduction Feb 27 Geometry, Camera Model, Calibration Mar 6 Features, Tracking / Matching Mar 13 Project Proposals by Students Mar 20 Structure from Motion (SfM) + papers Mar 27 Dense Correspondence (stereo / optical flow) + papers Apr 3 Bundle Adjustment & SLAM + papers Apr 10 Student Midterm Presentations Apr 17 Easter Break Apr 24 Multi-View Stereo & Volumetric Modeling + papers May 1 Labor Day May 8 3D Modeling with Depth Sensors + papers May 15 3D Scene Understanding + papers May 22 4D Video & Dynamic Scenes + papers May 29 Student Project Demo Day = Final Presentations

Schedule

slide-3
SLIDE 3

Projective Geometry and Camera model

points, lines, planes conics and quadrics transformations camera model Read tutorial chapter 2 and 3.1 http://www.cs.unc.edu/~marc/tutorial/ Chapters 1, 2 and 5 in Hartley and Zisserman 1st edition Or Chapters 2, 3 and 6 in 2nd edition

3D Vision– Class 2

slide-4
SLIDE 4

Overview

  • 2D Projective Geometry
  • 3D Projective Geometry
  • Camera Models & Calibration
slide-5
SLIDE 5

2D Projective Geometry?

Projections of planar surfaces

  • A. Criminisi. Accurate Visual Metrology from Single and

Multiple Uncalibrated Images. PhD Thesis 1999.

slide-6
SLIDE 6

2D Projective Geometry?

Measure distances

  • A. Criminisi. Accurate Visual Metrology from Single and

Multiple Uncalibrated Images. PhD Thesis 1999.

slide-7
SLIDE 7

2D Projective Geometry?

Discovering details

  • A. Criminisi. Accurate Visual Metrology from Single and

Multiple Uncalibrated Images. PhD Thesis 1999. Piero della Francesca, La Flagellazione di Cristo (1460)

slide-8
SLIDE 8

2D Projective Geometry?

Image Stitching

slide-9
SLIDE 9

2D Projective Geometry?

Image Stitching

slide-10
SLIDE 10

2D Euclidean Transformations

slide-11
SLIDE 11

Homogeneous Coordinates

slide-12
SLIDE 12

Homogeneous Coordinates

slide-13
SLIDE 13

Point – Line Duality

slide-14
SLIDE 14

Lines to Points, Points to Lines

Intersections of lines Line through two points

slide-15
SLIDE 15

Ideal Points and the Line at Infinity

  • Intersections of parallel lines?
  • Parallel lines intersect in Ideal Points

x1,x2,0

( )

T

slide-16
SLIDE 16

Ideal Points and the Line at Infinity

  • Ideal points correspond to directions
  • Unaffected by translation
slide-17
SLIDE 17

Ideal Points and the Line at Infinity

  • Lines through two ideal points?
  • Line at infinity intersects all ideal points

( )

T

1 , , l 

 

  l

2 2

R P

Note that in P2 there is no distinction between ideal points and others

slide-18
SLIDE 18

Conics

  • Curve described by 2nd-degree equation in the plane
  • r homogenized
  • r in matrix form

a :b :c : d :e : f

{ }

  • 5DOF (degrees of freedom): (defined up to scale)
slide-19
SLIDE 19

Five Points Define a Conic

For each point the conic passes through axi

2 + bxiyi + cyi 2 + dxi + eyi + f  0

  • r

( )

1 , , , , ,

2 2

 c

i i i i i i

y x y y x x

c  a,b,c,d,e, f

( )

T

x1

2

x1y1 y1

2

x1 y1 1 x2

2

x2y2 y2

2

x2 y2 1 x3

2

x3y3 y3

2

x3 y3 1 x4

2

x4y4 y4

2

x4 y4 1 x5

2

x5y5 y5

2

x5 y5 1                 c  0 stacking constraints yields

slide-20
SLIDE 20

Tangent Lines to Conics

The line l tangent to C at point x on C is given by l=Cx l x C

slide-21
SLIDE 21

Dual Conics

lT C* l  0

  • A line tangent to the conic C satisfies
  • Dual conics = line conics = conic envelopes

C*  C-1

  • In general (C full rank):
slide-22
SLIDE 22

Degenerate Conics

  • A conic is degenerate if matrix C is not of full rank

C  lmT+ mlT

e.g. two lines (rank 2)

l m

  • Degenerate line conics: 2 points (rank 2), double point (rank1)

C*

( )

*  C

  • Note that for degenerate conics

e.g. repeated line (rank 1)

l C  llT

slide-23
SLIDE 23

2D Projective Transformations

A projectivity is an invertible mapping h from P2 to itself such that three points x1, x2, x3 lie on the same line if and only if h(x1), h(x2), h(x3) do. Definition: A mapping h : P2P2 is a projectivity if and only if there exist a non-singular 3x3 matrix H such that for any point in P2 represented by a vector x it is true that h(x)=Hx Theorem: Definition: Projective transformation

x'1 x'2 x'3            h11 h12 h13 h21 h22 h23 h31 h32 h33           x1 x2 x3           x' H x

  • r

8DOF

projectivity = collineation = proj. transformation = homography

slide-24
SLIDE 24

Hierarchy of 2D Transformations

          1

22 21 12 11 y x

t r r t r r          

33 32 31 23 22 21 13 12 11

h h h h h h h h h

Projective 8dof

          1

22 21 12 11 y x

t a a t a a

Affine 6dof

          1

22 21 12 11 y x

t sr sr t sr sr

Similarity 4dof Euclidean 3dof

Concurrency, collinearity,

  • rder of contact (intersection,

tangency, inflection, etc.), cross ratio Parallellism, ratio of areas, ratio of lengths on parallel lines (e.g. midpoints), linear combinations of vectors (centroids), The line at infinity l∞ Ratios of lengths, angles, The circular points I,J Absolute lengths, angles, areas

invariants transformed squares

slide-25
SLIDE 25

Transformation of 2D Points, Lines and Conics

  • Transformation for lines

l' H-T l

  • Transformation for conics

C' H-TCH-1

  • Transformation for dual conics

C'*  HC*HT x' Hx

  • For a point transformation
slide-26
SLIDE 26

Application: Removing Perspective

Two stages:

  • From perspective to affine transformation via the line at infinitiy
  • From affine to similarity transformation via the circular points
slide-27
SLIDE 27

The Line at Infinity

l l l t 1 1

A      

                  A H A

T T T T

The line at infinity l=(0,0,1)T is a fixed line under a projective transformation H if and only if H is an affinity (affine transformation) Note: not fixed pointwise

slide-28
SLIDE 28

Affine Properties from Images

projection affine rectification

l  l

1

l2 l3

 

T,l3  0

affine transform

slide-29
SLIDE 29

Affine Rectification

v1 v2 l1 l2 l4 l3 l∞

l  v1  v2 v1  l1  l2 v2  l3  l4 1 1 l

1

l2 l3          

slide-30
SLIDE 30

The Circular Points

I 1 1 1 cos sin sin cos I I                                    

i se i t s s t s s

i y x S 

    H

The circular points I, J are fixed points under the projective transformation H iff H is a similarity

slide-31
SLIDE 31

The Circular Points

  • every circle intersects l∞ at the “circular points”

x1

2 + x2 2 + dx1x3 + ex2x3 + fx3 2  0

x1

2 + x2 2  0

l∞

I  1,i,0

( )

T

J  1,-i,0

( )

T

I  1,0,0

( )

T + i 0,1,0

( )

T

  • Algebraically, encodes orthogonal directions

x3  0

slide-32
SLIDE 32

Conic Dual to the Circular Points

T T

JI IJ

*

+  C

           1 1

*

C

T S S

H C H C

*

*

∞ 

The dual conic is fixed conic under the projective transformation H iff H is a similarity

*

C

Note: has 4DOF (det = 0) l∞ is the nullvector

*

C

l∞

I J

slide-33
SLIDE 33

Measuring Angles via the Dual Conic

cos  l

1m1 + l2m2

l

1 2 + l2 2

( ) m1

2 + m2 2

( )

l  l

1,l2,l3

( )

T

m  m1,m2,m3

( )

T

  • Euclidean:
  • Projective:

cos  lT C

* m

lT C

* l

( ) mT C

* m

( )

lT C

* m  0 (orthogonal)

  • Once we know dual conic on projective

plane, we can measure Euclidean angles!

slide-34
SLIDE 34

Metric Rectification

  • Dual conic under affinity

C

*  A

t 0T 1       I 0T       AT tT 1       AAT 0T      

  • S=AA-T symmetric, estimate from two pairs of
  • rthogonal lines (due to )

Note: Result defined up to similarity A-1

lT C

* m  0

slide-35
SLIDE 35

Update to Euclidean Space

  • Metric space: Measure ratios of distances
  • Euclidean space: Measure absolute distances
  • Can we update metric to Euclidean space?
  • Not without additional information
slide-36
SLIDE 36

Overview

  • 2D Projective Geometry
  • 3D Projective Geometry
  • Camera Models & Calibration
slide-37
SLIDE 37

3D Points and Planes

  • Homogeneous representation of 3D points and planes

= π + π + π + π

4 4 3 3 2 2 1 1

X X X X

  • The point X lies on the plane π if and only if

= X πT

  • The plane π goes through the point X if and only if

= X πT

  • 2D: duality point - line, 3D: duality point - plane
slide-38
SLIDE 38

Planes from Points

π X X X

3 2 1

          

T T T

= π X = π X 0, = π X π

3 2 1 T T T

and from Solve

(solve as right nullspace of )

π

X1

T

X2

T

X3

T

         

slide-39
SLIDE 39

Points from Planes

X π π π

3 2 1

          

T T T

x = X M M  X1 X2 X3

  R43

= π M

T

= X π = X π 0, = X π X

3 2 1 T T T

and from Solve (solve as right nullspace of )

X          

T T T 3 2 1

π π π

Representing a plane by its span

slide-40
SLIDE 40

Quadrics and Dual Quadrics

(Q : 4x4 symmetric matrix)

XTQX  0

  • 9 DOF (up to scale)
  • In general, 9 points define quadric
  • det(Q)=0 ↔ degenerate quadric
  • tangent plane
  • Dual quartic: ( adjoint)
  • relation to quadric (non-degenerate)

p  QX

pTQ*p  0 Q*  Q-1 Q*

slide-41
SLIDE 41

Transformation of 3D points, planes and quadrics

x' Hx

( )

  • Transformation for points

X' HX

  • Transformation for planes

l' H-T l

( ) p' H-Tp

  • Transformation for quadrics

C' H-TCH-1

( )

Q' H-TQH-1

  • Transformation for dual quadrics

C'*  HC*HT

( )

Q'*  HQ*HT

(2D equivalent)

slide-42
SLIDE 42

Hierarchy of 3D Transformations

Projective 15dof Affine 12dof Similarity 7dof Euclidean 6dof

Intersection and tangency Parallellism of planes, Volume ratios, centroids, The plane at infinity π∞ Angles, ratios of length The absolute conic Ω∞ Volume

R t 0T 1        

slide-43
SLIDE 43

Hierarchy of 3D Transformations

projective affine similarity Plane at infinity Absolute conic

slide-44
SLIDE 44

The Plane at Infinity

π π π

  • t

1 1

A      

                   A H A

T T T T

The plane at infinity π=(0, 0, 0, 1)T is a fixed plane under a projective transformation H iff H is an affinity

1. canonical position 2. contains all directions 3. two planes are parallel  line of intersection in π∞ 4. line || line (or plane)  point of intersection in π∞ 5. 2D equivalent: line at infinity

p  0,0,0,1

( )

T

D  X1,X2,X3,0

( )

T

slide-45
SLIDE 45

The Absolute Conic

The absolute conic Ω∞ is a fixed conic under the projective transformation H iff H is a similarity

  • The absolute conic Ω∞ is a (point) conic on π
  • In a metric frame:

X1,X2,X3

( )I X1,X2,X3 ( )

T

  • r conic for directions:

(with no real points) 1. Ω∞ is only fixed as a set 2. Circles intersect Ω∞ in two circular points 3. Spheres intersect π∞ in Ω∞

slide-46
SLIDE 46

The Absolute Dual Quadric

The absolute dual quadric Ω*

∞ is a fixed quadric under

the projective transformation H iff H is a similarity

1. 8 dof 2. plane at infinity π∞ is the nullvector of Ω∞ 3. angles:

slide-47
SLIDE 47

Overview

  • 2D Projective Geometry
  • 3D Projective Geometry
  • Camera Models & Calibration
slide-48
SLIDE 48

Camera Model

Relation between pixels and rays in space ?

slide-49
SLIDE 49

Pinhole Camera

slide-50
SLIDE 50

Pinhole Camera Model

slide-51
SLIDE 51

Pinhole Camera Model

slide-52
SLIDE 52

Principal Point Offset

slide-53
SLIDE 53

˜ C

Camera Rotation and Translation

slide-54
SLIDE 54

CCD Camera

slide-55
SLIDE 55

P  KR I |- ˜ C

 

non-singular 11 dof (5+3+3)

P  K R |t

 

intrinsic camera parameters extrinsic camera parameters In practice:

ax  ay, s  0

px, py

( ) = image

center

General Projective Camera

slide-56
SLIDE 56

Camera Model

Relation between pixels and rays in space ?

slide-57
SLIDE 57

Projector Model

Relation between pixels and rays in space (dual of camera)

(main geometric difference is vertical principal point offset to reduce keystone effect)

?

slide-58
SLIDE 58

Projector-Camera Systems

IR projector IR camera

slide-59
SLIDE 59
  • forward projection of line (not point-wise!)

X m

( )  P(A + mB)  PA + mPB  a + mb

  • back-projection of line

P  PTl PTX  lTPX

lTx  0; x  PX

( )

x  PX

  • forward projection of point
  • image point back-projects to line / ray

lX  RTK 1x

Projections of Points and Lines

slide-60
SLIDE 60
  • back-projection of conic to cone

Qco  PTCP xTCx  XTPTCPX  0

x  PX

( )

  • forward projection of quadric

C*  PQ*PT PTQ*P  lTPQ*PTl  0

P  PTl

( )

Projections of Conics and Quadrics

slide-61
SLIDE 61

Image of Absolute Conic

slide-62
SLIDE 62

(i) compute H for each square (corners @ (0,0),(1,0),(0,1),(1,1)) (ii) compute the imaged circular points H(1,±i,0)T (iii) Imaged circular points lie on w fit a conic to 6 circular points to obtain w (iv) compute K from w through Cholesky factorization (≈ Zhang’s calibration method)

A Simple Calibration Device

slide-63
SLIDE 63

Practical Camera Calibration

Unknown: constant camera intrinsics K (varying) camera poses R,t Known: 3D coordinates of chessboard corners => Define to be the z=0 plane (X=[X1 X2 0 1]T) Point is mapped as λx = K (r1 r2 r3 t) X λx = K (r1 r2 t) [X1 X2 1]’ Homography H between image and chess coordinates, estimate from known Xi and measured xi

Method and Pictures from Zhang (ICCV’99): “Flexible Camera Calibration By Viewing a Plane From Unknown Orientations”

slide-64
SLIDE 64

Direct Linear Transformation (DLT)

slide-65
SLIDE 65

(only drop third row if wi’≠0)

Direct Linear Transformation (DLT)

  • Equations are linear in h: A ih  0
  • Only 2 out of 3 are linearly independent

(2 equations per point)

  • Holds for any homogeneous

representation, e.g. (xi’,yi’,1)

slide-66
SLIDE 66
  • Solving for homography H

Ah  0

size A is 8x9 (2eq.) or 12x9 (3eq.), but rank 8

  • Trivial solution is h=09

T is not interesting

  • 1D null-space yields solution of interest

pick for example the one with h 1

Direct Linear Transformation (DLT)

slide-67
SLIDE 67
  • Over-determined solution
  • No exact solution because of inexact measurement,

i.e., “noise”

Ah  0

  • Find approximate solution
  • Additional constraint needed to avoid 0, e.g.,
  • not possible, so minimize

h 1 Ah Ah  0

Direct Linear Transformation (DLT)

slide-68
SLIDE 68

DLT Algorithm

Objective Given n≥4 2D to 2D point correspondences {xi↔xi’}, determine the 2D homography matrix H such that xi’=Hxi Algorithm (i) For each correspondence xi ↔xi’ compute Ai. Usually

  • nly two first rows needed.

(ii) Assemble n 2x9 matrices Ai into a single 2nx9 matrix A (iii) Obtain SVD of A. Solution for h is last column of V (iv) Determine H from h

slide-69
SLIDE 69

Importance of Normalization

~102 ~102 ~102 ~102 ~104 ~104 ~102 1 1

  • rders of magnitude difference!

Monte Carlo simulation for identity computation based on 5 points (not normalized ↔ normalized)

slide-70
SLIDE 70

Normalized DLT Algorithm

Objective Given n≥4 2D to 2D point correspondences {xi↔xi’}, determine the 2D homography matrix H such that xi’=Hxi Algorithm (i) Normalize points (ii) Apply DLT algorithm to (iii) Denormalize solution Normalization (independently per image):

  • Translate points such that centroid is at origin
  • Isotropic scaling such that mean distance to origin is

2

slide-71
SLIDE 71

Geometric Distance

measured coordinates estimated coordinates true coordinates

x x ˆ x

Error in one image

e.g. calibration pattern

Symmetric transfer error d(.,.) Euclidean distance (in image)

x'

Reprojection error subject to

slide-72
SLIDE 72

Reprojection Error

slide-73
SLIDE 73

Statistical Cost Function and Maximum Likelihood Estimation

  • Optimal cost function related to noise model
  • Assume zero-mean isotropic Gaussian noise

(assume outliers removed)

( )

( ) (

)

2 2

2 / x x, 2

2 1

x Pr

p

d

e  Error in one image Maximum Likelihood Estimate: min d  x

i,Hx i

( )

2

slide-74
SLIDE 74

Statistical Cost Function and Maximum Likelihood Estimation

  • Optimal cost function related to noise model
  • Assume zero-mean isotropic Gaussian noise

(assume outliers removed)

( )

( ) (

)

2 2

2 / x x, 2

2 1

x Pr

p

d

e  Error in both images Maximum Likelihood Estimate min d xi, ˆ x

i

( )

2

+ d  x

i, ˆ

 x

i

( )

2

slide-75
SLIDE 75
  • Gold Standard Algorithm

Objective Given n≥4 2D to 2D point correspondences {xi↔xi’}, determine the Maximum Likelihood Estimation of H (this also implies computing optimal xi’=Hxi) Algorithm (i) Initialization: compute an initial estimate using normalized DLT or RANSAC (ii) Geometric minimization of symmetric transfer error:

  • Minimize using Levenberg-Marquardt over 9 entries of h
  • r reprojection error:
  • compute initial estimate for optimal {xi}
  • minimize cost over {H,x1,x2,…,xn}
  • if many points, use sparse method
slide-76
SLIDE 76

Radial Distortion

  • Due to spherical lenses (cheap)
  • (One possible) model:

R

2 2 2 2 2 1 2

( , ) (1 ( ) ( ) ...) x x y K x y K x y y    + + + + +    

R:

straight lines are not straight anymore

slide-77
SLIDE 77

Calibration with Radial Distortion

  • Low radial distortion:
  • Ignore radial distortion during initial calibration
  • Estimate distortion parameters, refine full calibration
  • High radial distortion: Simultaneous estimation
  • Fitzgibbon, “Simultaneous linear estimation of multiple view

geometry and lens distortion”, CVPR 2001

  • Kukelova et al., “Real-Time Solution to the Absolute Pose Problem

with Unknown Radial Distortion and Focal Length”, ICCV 2013

slide-78
SLIDE 78

Bouguet Toolbox

http://www.vision.caltech.edu/bouguetj/calib_doc/

slide-79
SLIDE 79

Rolling Shutter Cameras

  • Image build row by row
  • Distortions based on depth and speed
  • Many mobile phone cameras have rolling shutter

Video credit: Olivier Saurer

slide-80
SLIDE 80

Rolling Shutter Cameras

  • Calibration more complex:
  • Internal calibration + shutter speed
  • Oth et al., “Rolling Shutter Camera Calibration”, CVPR 2013
  • Non-central projection under motion

30 cm

฀ 3m

Google StreetView Camera Setup Klinger et al., “Street View Motion-from-Structure- from-Motion”, ICCV 2013

slide-81
SLIDE 81

Event Cameras

Kim et al., “Real-Time 3D Reconstruction and 6-DoF Tracking with an Event Camera”, ECCV 2016

slide-82
SLIDE 82

Feb 20 Introduction Feb 27 Geometry, Camera Model, Calibration Mar 6 Features, Tracking / Matching Mar 13 Project Proposals by Students Mar 20 Structure from Motion (SfM) + papers Mar 27 Dense Correspondence (stereo / optical flow) + papers Apr 3 Bundle Adjustment & SLAM + papers Apr 10 Student Midterm Presentations Apr 17 Easter Break Apr 24 Multi-View Stereo & Volumetric Modeling + papers May 1 Labor Day May 8 3D Modeling with Depth Sensors + papers May 15 3D Scene Understanding + papers May 22 4D Video & Dynamic Scenes + papers May 29 Student Project Demo Day = Final Presentations

Schedule

slide-83
SLIDE 83

Reminder

  • Project presentation in 2 weeks
  • Form team & decide project topic
  • By March 3rd
  • Talk with supervisor, submit proposal
  • By March 10th
slide-84
SLIDE 84

Next class: Features, Tracking / Matching