Single-View Geometry EECS 442 Prof. David Fouhey Winter 2019, - - PowerPoint PPT Presentation

single view geometry
SMART_READER_LITE
LIVE PREVIEW

Single-View Geometry EECS 442 Prof. David Fouhey Winter 2019, - - PowerPoint PPT Presentation

Single-View Geometry EECS 442 Prof. David Fouhey Winter 2019, University of Michigan http://web.eecs.umich.edu/~fouhey/teaching/EECS442_W19/ Application: Single-view modeling A. Criminisi, I. Reid, and A. Zisserman, Single View Metrology,


slide-1
SLIDE 1

Single-View Geometry

EECS 442 – Prof. David Fouhey Winter 2019, University of Michigan

http://web.eecs.umich.edu/~fouhey/teaching/EECS442_W19/

slide-2
SLIDE 2

Application: Single-view modeling

  • A. Criminisi, I. Reid, and A. Zisserman,

Single View Metrology, IJCV 2000

slide-3
SLIDE 3

Application: Measuring Height

slide-4
SLIDE 4

Application: Measuring Height

  • CSI before CSI
  • Covered criminal cases talking to random

scientists (e.g., footwear experts)

  • How do you tell how tall someone is if they’re

not kind enough to stand next to a ruler?

slide-5
SLIDE 5

Application: Camera Calibration

  • Calibration a HUGE pain
slide-6
SLIDE 6

Application: Camera Calibration

Slide from Efros, Photo from Criminisi

  • What if 3D coordinates are unknown?
  • Use scene features such as vanishing points
slide-7
SLIDE 7

Camera calibration revisited

Vanishing point Vanishing line Vanishing point Vertical vanishing point (at infinity)

Slide from Efros, Photo from Criminisi

  • What if 3D coordinates are unknown?
  • Use scene features such as vanishing points
slide-8
SLIDE 8

Recall: Vanishing points

image plane line in the scene vanishing point v

  • All lines having the same direction share

the same vanishing point

camera center

slide-9
SLIDE 9

Calibration from vanishing points

Consider a scene with 3 orthogonal directions v1, v2 are finite vps, v3 infinite vp Want to align world coordinates with directions

v2 v1

.

v3

.

slide-10
SLIDE 10

Calibration from vanishing points

𝑸3𝑦4 ≡ 𝒒1 𝒒2 𝒒𝟒 𝒒4

It turns out that 𝒒𝟐 ≡ 𝑸 1,0,0,0 𝑈 𝒒𝟑 ≡ 𝑸 0,1,0,0 𝑈 𝒒𝟓 ≡ 𝑸 0,0,0,1 𝑈 𝒒𝟒 ≡ 𝑸 0,0,1,0 𝑈 VP in X direction VP in Y direction VP in Z direction Projection of origin Note the usual ≡ (i.e., all of this is up to scale) as well as the 0 for the vps

slide-11
SLIDE 11

Calibration from vanishing points

  • Let’s align the world coordinate system with the

three orthogonal vanishing directions:

𝒇𝟐 = 1 𝒇𝟑 = 1 𝒇𝟒 = 1

𝜇𝒘𝒋 = 𝑳[𝑺, 𝒖] 𝒇𝒋 𝜇𝒘𝒋 = 𝑳𝑺𝒇𝑗 Drop the t 𝑺−𝟐𝑳−𝟐𝜇𝒘𝑗 = 𝒇𝑗 Inverses

slide-12
SLIDE 12

Calibration from vanishing points

So 𝒇𝒋 = 𝑺−𝟐𝑳−𝟐𝜇𝒘𝑗, but who cares? What are some properties of axes? Know 𝒇𝒋

𝑼𝒇𝒌 = 0 for 𝑗 ≠ 𝑘 , so K, R have to satisfy

𝑺−𝟐𝑳−𝟐𝜇𝑘𝒘𝒌

𝑼 𝑺−𝟐𝑳−𝟐𝜇𝑗𝒘𝑗 = 𝟏

𝜇𝑗𝜇𝑘 𝑺𝑼𝑳−𝟐𝒘𝒌

𝑼 𝑺𝑼𝑳−𝟐𝒘𝑗 = 𝟏

𝑆−1 = 𝑆𝑈 𝒘𝒌𝑳−𝑼𝑺𝑺𝑼𝑳−𝟐𝒘𝒋 = 𝟏 𝑺𝑼𝑳−𝟐𝜇𝑘𝒘𝒌

𝑼 𝑺𝑼𝑳−𝟐𝜇𝑗𝒘𝑗 = 𝟏

Move scalars Clean up 𝒘𝒌𝑳−𝑼𝑳−𝟐𝒘𝒋 = 𝟏 𝑆𝑆𝑈 = 𝐽

slide-13
SLIDE 13
  • Intrinsics (focal length f, principal point u0,v0)

have to ensure that the rays corresponding to supposedly orthogonal vanishing points are

  • rthogonal

Calibration from vanishing points

𝒘𝒌𝑳−𝑼𝑳−𝟐𝒘𝒋 = 𝟏

slide-14
SLIDE 14

Calibration from vanishing points

Cannot recover focal length, principal point is the third vanishing point

Can solve for focal length, principal point

slide-15
SLIDE 15

Directions and vanishing points

Given vanishing point 𝒘 camera calibration 𝑳: 𝑳−𝟐𝒘 is direction corresponding to that vanishing point.

v2 v1

.

v3

.

𝑔 𝑔 1

−1

1010 1 1/𝑔 1/𝑔 1 1010 1 = 1010/𝑔 1 𝑔 𝑔 1

−1

𝒘𝟒 106/𝑔 1 →≈ 1

slide-16
SLIDE 16

Directions and vanishing points

slide-17
SLIDE 17

Directions and vanishing points

v1 v2 v3

slide-18
SLIDE 18

Directions and vanishing points

v1 v2 v3 [-f,0] [f,0] [0,∞] If 𝒘 vanishing point, and 𝑳 the camera intrinsics, 𝑳−𝟐𝒘 is the corresponding direction. Set 𝑣0, 𝑤0 = 0,0 𝐿−1 =

𝑔 𝑔 1

−1

= 1/𝑔 1/𝑔 1

slide-19
SLIDE 19

Directions and vanishing points

v1 v2 v3 [-f,0] [f,0] [0,∞] If 𝒘 vanishing point, and 𝑳 the camera intrinsics, 𝑳−𝟐𝒘 is the corresponding direction.

𝐿−1 = 1/𝑔 1/𝑔 1

K-1v1 = [-1,0,1] K-1v2 = [1,0,1] K-1v3 = [0,∞,1]

slide-20
SLIDE 20

Rotation from vanishing points

Know that 𝜇𝑗𝒘𝒋 = 𝑳𝑺𝒇𝒋 and have K, but want R 𝑺𝒇𝟐 = 𝒔𝟐 𝒔𝟑 𝒔𝟒 1 = 𝒔𝟐 𝒔𝒋 = 𝜇𝑳−𝟐𝒘𝒋 What does 𝑺𝒇𝒋 look like? So: 𝜇𝑳−𝟐𝒘𝑗 = 𝑺𝒇𝒋 The ith column of R is a scaled version of

slide-21
SLIDE 21

Calibration from vanishing points

  • Solve for K (focal length, principal point) using

3 orthogonal vanishing points

  • Get rotation directly from vanishing points once

calibration matrix known

  • Pros:
  • Could be totally automatic!
  • Cons:
  • Need 3 vanishing points, estimated accurately, but

with at least two finite!

slide-22
SLIDE 22

Finding Vanishing Points

What might go wrong with the circled points?

slide-23
SLIDE 23

Finding Vanishing Points

  • Find edges 𝐹 = {𝑓1, … , 𝑓𝑜}
  • All 𝑜

2 intersections of edges 𝑤𝑗𝑘 = 𝑓𝑗 × 𝑓 𝑘 are

potential vanishing points

  • Try all triplets of popular vanishing points,

check if the camera’s focal length, principal point “make sense”

  • What are some options for this?
slide-24
SLIDE 24

Finding Vanishing Points

slide-25
SLIDE 25

Measuring height

Slide by Steve Seitz

slide-26
SLIDE 26

Measuring height

Slide by Steve Seitz

slide-27
SLIDE 27

Measuring height

1 2 3 4 5 5.3 2.8 3.3

Camera height

slide-28
SLIDE 28

O

Measuring height without a ruler

ground plane

Compute Z from image measurements

  • Need more than vanishing points to do this

Z

slide-29
SLIDE 29

Projective invariant

  • We need to use a projective invariant: a quantity that

does not change under projective transformations (including perspective projection)

slide-30
SLIDE 30

Projective invariant

  • We need to use a projective invariant: a quantity that

does not change under projective transformations (including perspective projection)

  • The cross-ratio of four points:

P1 P2 P3 P4

1 4 2 3 2 4 1 3

P P P P P P P P − − − −

This is one of the cross-ratios (can reorder arbitrarily)

slide-31
SLIDE 31

vZ r t b

t v b r r v b t − − − −

Z Z

image cross ratio

Measuring height

B (bottom of object) T (top of object) R (reference point) ground plane H C

T B R R B T −  − −  −

scene cross ratio

R H = R H =

R

slide-32
SLIDE 32

Measuring height without a ruler

slide-33
SLIDE 33

R H vz r b t

R H

Z Z

= − − − − t v b r r v b t

image cross ratio

H b0 t0 v vx vy

vanishing line (horizon)

slide-34
SLIDE 34

Remember This?

  • Line equation: 𝑏𝑦 + 𝑐𝑧 + 𝑑 = 0
  • Vector form: 𝒎𝑈𝒒 = 0, 𝒎 = [𝑏, 𝑐, 𝑑], 𝐪 = [𝑦, 𝑧, 1]
  • Line through two points?
  • 𝒎 = 𝒒𝟐 × 𝒒𝟑
  • Intersection of two lines?
  • 𝒒 = 𝒎𝟐 × 𝒎𝟑
  • Intersection of two parallel lines is at infinity
slide-35
SLIDE 35

R H vz r b t

R H

Z Z

= − − − − t v b r r v b t

image cross ratio

H b0 t0 v vx vy

vanishing line (horizon)

slide-36
SLIDE 36

Examples

  • A. Criminisi, I. Reid, and A. Zisserman, Single View Metrology, IJCV 2000

Figure from UPenn CIS580 slides

slide-37
SLIDE 37

Another example

  • Are the heights of the two groups of people

consistent with one another?

Piero della Francesca, Flagellation, ca. 1455

  • A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the

analysis of paintings,

  • Proc. Computers and the History of Art, 2002
slide-38
SLIDE 38

Measurements on planes

1 2 3 4 1 2 3 4

slide-39
SLIDE 39

Measurements on planes

1 2 3 4 1 2 3 4

p p′

slide-40
SLIDE 40

Image rectification: example

Piero della Francesca, Flagellation, ca. 1455

slide-41
SLIDE 41

Application: 3D modeling from a single image

  • A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the

analysis of paintings,

  • Proc. Computers and the History of Art, 2002
slide-42
SLIDE 42

Application: 3D modeling from a single image

  • J. Vermeer, Music Lesson, 1662
  • A. Criminisi, M. Kemp, and A. Zisserman,Bringing Pictorial Space to Life: computer techniques for the

analysis of paintings,

  • Proc. Computers and the History of Art, 2002
slide-43
SLIDE 43

Application: Object Detection

v0 h v “Reasonable” approximation:

(0,0) (1,1)

𝑧𝑝𝑐𝑘𝑓𝑑𝑢 ≈ ℎ𝑧𝑑𝑏𝑛𝑓𝑠𝑏 𝑤0 − 𝑤

slide-44
SLIDE 44

Application: Object detection

slide-45
SLIDE 45

Application: Object detection

slide-46
SLIDE 46

Application: Image Editing

  • K. Karsch and V. Hedau and D. Forsyth and D. Hoiem, Rendering Synthetic Objects into

Legacy Photographs, SIGGRAPH Asia 2011

slide-47
SLIDE 47

Application: Estimating Layout

  • V. Hedau, D. Hoiem, D. Forsyth

Recovering the spatial layout of cluttered rooms ICCV 2009

slide-48
SLIDE 48

Unsupervised Learning

Can we learn 3D simply from regularities? …

Image Collection

D.F. Fouhey, W. Hussain, A. Gupta, M. Hebert. Single Image 3D without a Single 3D Image. ICCV 2015.

slide-49
SLIDE 49

Unsupervised Learning

Image Collection

+

Tools From Geometry

Vanishing Points

D.F. Fouhey, W. Hussain, A. Gupta, M. Hebert. Single Image 3D without a Single 3D Image. ICCV 2015.

Can we learn 3D simply from regularities?

slide-50
SLIDE 50

Unsupervised Learning

Image Collection

+

Tools From Geometry

Fronto-Parallel Image

D.F. Fouhey, W. Hussain, A. Gupta, M. Hebert. Single Image 3D without a Single 3D Image. ICCV 2015.

Can we learn 3D simply from regularities?

slide-51
SLIDE 51

Factorization

slide-52
SLIDE 52

Factorization

3D Structure

slide-53
SLIDE 53

Factorization

Style 3D Structure

slide-54
SLIDE 54

Factorization

Style Image

slide-55
SLIDE 55

Style Elements

Styl e Image

slide-56
SLIDE 56

Factorization

3D Structure

=

Image Style

x

slide-57
SLIDE 57

Solving for Style

Vanishing Points

Image

Fronto-Parallel Image

Style

slide-58
SLIDE 58

Solving for 3D Structure

Style Element Input Image

HOG, Dalal and Triggs ’05; ELDA from Hariharan et al. ‘12

slide-59
SLIDE 59

Solving for 3D Structure

Style Element Input Image

slide-60
SLIDE 60

Solving for 3D Structure

Style Element Input Image

slide-61
SLIDE 61

Solving for 3D Structure

Style Element Input Image

slide-62
SLIDE 62

Solving for 3D Structure

Style Element Input Image

slide-63
SLIDE 63

Solving for 3D Structure

Style Element Input Image

slide-64
SLIDE 64

Rectified Images

Solving for 3D Structure

Style Element Input Image Detection + Orientation

slide-65
SLIDE 65

Solving for 3D over a Dataset

… Set of Images Style Element

Detection + Orientation

slide-66
SLIDE 66

Factorization

3D Structure

=

Image Style

x

slide-67
SLIDE 67

Prior

On average: 3D structure is a camera inside a box, rotated uniformly

slide-68
SLIDE 68

Discovered Style Elements

Element Detections Element Detections Vertical Horizontal

slide-69
SLIDE 69

Results

Input GT Output

slide-70
SLIDE 70

Results

Input GT Output

slide-71
SLIDE 71

Scaling Up To The World

RGBD Datasets What about?

Places-205, Zhou et al. NIPS 2014

slide-72
SLIDE 72

Style Learned from Internet

Supermarket Museum Laundromat Locker Room Automatically Discovered Style Elements

Places-205, Zhou et al. NIPS 2014

slide-73
SLIDE 73

Learning from the Internet