eecs 442 computer vision single view · pdf fileeecs 442 – computer vision single view...

47
EECS 442 Computer vision Single view metrology Review calibration Lines and planes at infinity Absolute conic Estimating geometry from a single image Extensions Reading: [HZ] Chapters 2,3,8

Upload: vuongnhi

Post on 31-Jan-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

EECS 442 – Computer vision

Single view metrology

• Review calibration

• Lines and planes at infinity

• Absolute conic

• Estimating geometry from a single image

• Extensions

Reading: [HZ] Chapters 2,3,8

Page 2: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Calibration Problem

jC

ii PMP

i

i

iv

up

In pixels

TRKM

100

0

cot

sino

o

v

u

K

World ref. system

Page 3: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Calibration Problem

jC

ii PMP

i

i

iv

up

Need at least 6 correspondences

11 unknown

TRKM

In pixels World ref. system

Page 4: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Pinhole perspective projection Once the camera is calibrated...

TRKM

C

Ow

-Internal parameters K are known

-R, T are known – but these can only relate C to the calibration rig

P p

Can I estimate P from the measurement p from a single image?

No - in general [P can be anywhere along the line defined by C and p]

Page 5: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Pinhole perspective projection Recovering structure from a single view

C

Ow

P p

unknown known Known/

Partially known/

unknown

Page 6: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

http://www.robots.ox.ac.uk/~vgg/projects/SingleView/models/hut/hutme.wrl

Recovering structure from a single view

Page 7: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

• Review calibration

• Lines and planes at infinity

• Absolute conic

• Estimating geometry from a single image

• Examples

Page 8: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Lines in a 2D plane

0cbyax

-c/b

-a/b

c

b

a

l

If x = [ x1, x2]T l 0

c

b

a

1

x

xT

2

1

l

x

y

Page 9: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Lines in a 2D plane

Intersecting lines

llx l

l

Proof

lll

lll

0l)ll(

0l)ll(

lx

x

lx

x is the intersecting point

x

y

x

Page 10: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Points and planes in 3D

1

x

x

x

x3

2

1

d

c

b

a

0dczbyax

x

y

z

0xx T

How about lines in 3D? • Lines have 4 degrees of freedom - hard to represent in 3D-space

• Can be defined as intersection of 2 planes

Page 11: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

2D Points at infinity (ideal points)

0x,

x

x

x

x 3

3

2

1

c

b

a

l

c

b

a

l '

'

0

1

/

)(

ab

ccllLet’s intersect two parallel lines:

Agree with the general idea of two lines intersecting at infinity

l

l

0

2

1

x

x

x

'/'/ baba

Page 12: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Lines infinity l

Set of ideal points lies on a line called the line at infinity

How does it look like?

l

1

0

0

l

T

2

1

0

x

x

0

1

0

0

Indeed:

Page 13: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Projective transformation of a point at infinity

pHp '

bv

tAH

?pH

z

y

x

p

p

p

bv

tA

'

'

'

0

1

1

is it a point at infinity?

…no!

?pH A

0

'

'

0

1

1

0y

x

p

p

b

tA

An affine

transformation

of a point

at infinity is

still a point at

infinity

Page 14: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Projective transformation of a line (in 2D)

lHl T

bv

tAH

?lH T

b

t

t

1

0

0

bv

tAy

xT

is it a line at infinity?

…no!

?lH T

A

1

0

0

1

0

0

1

0

1

0

0

10 TT

TT

At

AtA

Page 15: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

The horizon line

horizon

- Recognize the horizon line

- Measure if the 2 lines meet

at the horizon

- if yes, these 2 lines are // in 3D •Recognition helps reconstruction!

•Humans have learnt this

Are these two lines parallel or not?

lHl T

hor

Page 16: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Vanishing points (= ideal points in 2D)

Points where parallel lines

intersect in 3D

Page 17: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Vanishing points and their image

TRKM dv K

d=direction of the line

d

C

v

Page 18: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Vanishing points - example

C2

v2

C1

v1

R,T

star

1

1

1

1

1K

K

v

vd

2

1

2

1

2K

K

v

vd

21 R dd R

v1, v2: measurements

K = known and constant

Can I compute R?

1d2d

In 2D

Page 19: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

1

1

1

1

1K

K

v

vd

2

1

2

1

2K

K

v

vd

R

Page 20: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Planes at infinity & vanishing lines

1

0

0

0

x

y

z

• Parallel planes intersect at the plane at infinity

• 2 planes are parallel iff their intersections

is a line that belongs to

• Parallel planes intersect the plane at infinity in a

common line – the vanishing line (horizon)

Page 21: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Vanishing lines and their images

C

n

Parallel planes intersect the plane at infinity

in a common line – the vanishing line (horizon)

horiz

TK ln

horizl

Page 22: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

• Review calibration

• Lines and planes at infinity

• Absolute conic

• Estimating geometry from a single image

• Examples

Page 23: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Conics in 2D

- If a point x C

0feydxcybxyax 22

In homogeneous coordinates:

0xCxT

f2/e2/d

2/ec2/b

2/d2/ba

C

1

x

x

x 2

1

0xCxT

- If a line l is tangent to a conic in x xCl

1T PCPC - Projective transformation of conics:

Page 24: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Circular points

l

0

i

1

pi

0

i

1

p j

Circular points (point at infinity)

Circular points are fixed under

similarity transformation

0

i

1

0

i

1

100

tcosssins

tsinscoss

pH y

x

is

i2=-1

Page 25: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Conic C

Circular points define a degenerate

conic called ; any C

0x

0xx

3

2

2

2

1

Cx

000

010

001

C0xCxT

l

0

i

1

pi

0

i

1

p j

Circular points (point at infinity)

is fixed under similarity transformation

C

Page 26: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

In 3D: absolute conic

Cis a

Any x satisfies:

0

1

1

1

0xxT

0x

0xxx

4

2

3

2

2

2

1

is fixed under similarity transformation

Page 27: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Projective transformation of

1T )KK(

It is not function of R, T

654

532

421

symmetric

02 zero-skew 31

square pixel 02

1.

2.

3. 4.

TRKP

Page 28: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Projective transformation of

1T )KK(

Why this is useful?

Page 29: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

• Review calibration

• Lines and planes at infinity

• Absolute conic

• Estimating geometry from a single image

• Examples

Page 30: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Angle between 2 vanishing points

2

T

21

T

1

2

T

1

vvvv

vvcos

C

d1 v1

dv Kv2

d2

If 90 0vv 2

T

1

Page 31: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Angle between 2 scene lines

90

0vv 2

T

1

v1 v2

1T )KK(

Constraint on K

Page 32: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Single view calibration - example

v2

v3

0vv 2

T

1

0vv 3

T

1

0vv 3

T

2

654

532

421

31

02

Compute :6 unknown

5 constraints

known up to scale

1T )KK( K(Cholesky factorization; HZ pag 582)

v2

Once is calculated, we get K:

Page 33: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Single view reconstruction - example

lh

known Khoriz

TK ln = Scene plane orientation in

the camera reference system

Select orientation discontinuities

Page 34: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Single view reconstruction - example

Recover the structure within the camera reference system

Notice: the actual scale of the scene is NOT recovered

C

- Recognize the horizon line

- Measure if the 2 lines meet

at the horizon

- if yes, these 2 lines are // in 3D

•Recognition helps reconstruction!

•Humans have learnt this

Are these two lines parallel or not?

Page 35: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Criminisi & Zisserman, 99

http://www.robots.ox.ac.uk/~vgg/projects/SingleView/models/merton/merton.wrl

Page 36: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Criminisi & Zisserman, 99

http://www.robots.ox.ac.uk/~vgg/projects/SingleView/models/merton/merton.wrl

Page 37: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

La Trinita' (1426)

Firenze, Santa Maria

Novella; by Masaccio

(1401-1428)

Page 38: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

La Trinita' (1426)

Firenze, Santa Maria

Novella; by Masaccio

(1401-1428)

Page 39: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

http://www.robots.ox.ac.uk/~vgg/projects/SingleView/models/hut/hutme.wrl

Page 40: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Manually select: • Vanishing points and lines;

• Planar surfaces;

• Occluding boundaries;

• Etc..

Single view reconstruction - drawbacks

Page 41: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Automatic Photo Pop-up

Hoiem et al, 05

Page 42: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Automatic Photo Pop-up

Hoiem et al, 05…

Page 43: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Automatic Photo Pop-up

Hoiem et al, 05…

http://www.cs.uiuc.edu/homes/dhoiem/projects/software.html

Software:

Page 44: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Training

Image Depth

Prediction

Planar Surface

Segmentation

Plane Parameter MRF

Connectivity Co-Planarity

Make3D

youtube

Saxena, Sun, Ng, 05…

Page 45: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

A software: Make3D

“Convert your image into 3d model”

Single Image Depth Reconstruction Saxena, Sun, Ng, 05…

http://make3d.stanford.edu/

http://make3d.stanford.edu/images/view3D/185

http://make3d.stanford.edu/images/view3D/931?noforward=true

http://make3d.stanford.edu/images/view3D/108

Page 46: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Coherent object detection and scene

layout estimation from a single image Y. Bao, M. Sun, S. Savarese, CVPR 2010,

BMVC 2010

Y. Bao M. Sun

Page 47: EECS 442 Computer vision Single view · PDF fileEECS 442 – Computer vision Single view metrology • Review calibration • Lines and planes at infinity • Absolute conic • Estimating

Next lecture:

Multi-view geometry (epipolar geometry)