Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from...

72
Camera Projection Model

Transcript of Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from...

Page 1: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Camera Projection Model

Page 2: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

3D Point Projection (Pixel Space)

O

Projection plane ( , , )X Y Z

Z

img x

Xu f p

Z

img y

Yv f p

Z

CCD sensor (mm) Image (pixel)

u vccd ccd( , )

u vimg img( , )

ccdw

ccdh

(0,0)

(0,0) imgw

imgh

x yp p( , )

img imgu v( , )

f

img xZu fX p Z

img yZv fY p Z

img

img

11

x

y

u f p X

v f p Y

Z

K

+

Camera intrinsic parameter : metric space to pixel space

Metric space Pixel space

Page 3: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

2D Inverse Projection

O

Projection plane

img

img

11

x

y

u f p X

v f p Y

Z

K

Metric space

f

img imgu v( , )

Pixel space

u X

v Y

Z

K

img

-1img

1

u

vK

img

-1img

1

( , , )X Y Z

2D point == 3D ray

3D ray

The 3D point must lie in the 3D ray passing through the origin and 2D image point.

Page 4: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

= ( , , )X x y z

Camera

C C C C= ( , , )X x y z

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

Degree of freedom?

Page 5: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

= ( , , )X x y z

Camera

C C C C= ( , , )X x y z

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

• Right hand rule

rX

Yr

Zr

rX

Yr

Z X Y= r r r

Page 6: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

• Right hand rule

rX

Yr

Zr

rX

Yr

Z X Y= r r r

rX : camera x axis seen from the world coord.

Page 7: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

• Right hand rule

rX

Yr

Zr

rX

Yr

Z X Y= r r r

rX : camera x axis seen from the world coord.

Yr : camera y axis seen from the world coord. Zr

Page 8: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

• Right hand rule

1r

2r

3 1 2= r r r1r : world x axis seen from

the camera coord.

r1 2r 3r

Page 9: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Coordinate Transform (Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

RCW SO(3)

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

T

C C CW W 3 W, det 1 R R I R• Orthogonal matrix

• Right hand rule

1r

2r

3 1 2= r r r1r : world x axis seen from

the camera coord.

r1 2r 3r

2r : world y axis seen from the camera coord.

3r

Page 10: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

x1 x2 x3

y1 y2 y3

z1 z2

C

z3

C

C1 1

1

x

y

x

y

u f p

v f p

f p r r r

f p r r r

r

X

Y

Zr r

X

Y

Z

Ground plane

Camera

3D world

Origin at world coordinate

Camera Projection (Pure Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

1r : world x axis seen from the camera coord.

r1 2r 3r

2r : world y axis seen from the camera coord.

K

Camera projection of world point:

3r

Page 11: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

x1 x2 x3

y1 y2 y3

z1 z2

C

z3

C

C1 1

1

x

y

x

y

u f p

v f p

f p r r r

f p r r r

r

X

Y

Zr r

X

Y

Z

Ground plane

Camera

3D world

Origin at world coordinate

Camera Projection (Pure Rotation)

X

1C

WR

Coordinate transformation from world to camera:

Camera

World

x1 x2 x3

Cy1 y2 y3 W

z1 z

C

2 z3

= =

X XRX

r r r

r r r

r r r

1r : world x axis seen from the camera coord.

r1 2r 3r

2r : world y axis seen from the camera coord.

K

Camera projection of world point:

K

3r

Page 12: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Euclidean Transform=Rotation+Translation

X

C CW ,R t

World

= ( , , )X x y z

Page 13: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

X

Camera

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

Euclidean Transform=Rotation+Translation

Page 14: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

X

Camera

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

Euclidean Transform=Rotation+Translation

Page 15: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

X

Coordinate transformation from world to camera:

Camera

x1 x2 x3 x

C CW y1 y2 y3 y

z1 z2 z3 z

C = =1

RX

XX t

r r r t

r r r t

r r r t

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

Euclidean Transform=Rotation+Translation

C t

C twhere is the world orgin seen from camera.

Page 16: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

X

Coordinate transformation from world to camera:

Camera

x1 x2 x3 x

C CW y1 y2 y3 y

z1 z2 z3 z

C = =1

RX

XX t

r r r t

r r r t

r r r t

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

Euclidean Transform=Rotation+Translation

C t

C twhere is the world orgin seen from camera.

Page 17: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Geometric Interpretation

X

Coordinate transformation from world to camera:

Camera

x1 x2 x3 x

C CW y1 y2 y3 y

z1 z2 z3 z

C = =1

RX

XX t

r r r t

r r r t

r r r t

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

C t

Rotate and then, translate.

C twhere is the world orgin seen from camera.

Page 18: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera

3D world

Origin at world coordinate

Geometric Interpretation

X

Coordinate transformation from world to camera:

Camera

x1 x2 x3 x

C CW y1 y2 y3 y

z1 z2 z3 z

C = =1

RX

XX t

r r r t

r r r t

r r r t

World

= ( , , )X x y zC C C C= ( , , )X x y z

C CW ,R t

Rotate and then, translate.

x1 x2 x3 x

CW y1 y2 y3 y

z1 z2 z3 z

C

1

= = 11

1

XXR CX

r r r -C

r r r -C

r r r -C

cf) Translate and then, rotate.

where is the camera location seen from world. C

C

C twhere is the world orgin seen from camera.

Page 19: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Projective Line

Page 20: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Point-Point in Image

1 1 0 au bv c

1 1( , )u v

1xx2

2 2( , )u v

2 2 0 au bv c

x lT1 0 x lT

2 0

1

1 1

1

x

u

v2

2 2

1

x

u

v

a

b

c

lwhere

A 2D line passing through two 2D points:

xl 0

x

T1

T2

0 0 A

null A l x x1 2=or

2x3

Page 21: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Two 2D lines in an image intersect at a 2D point:

Line-Line in Image

l xT1 0 l xT

2 0

lx 0

l

T1

T2

1 2= x l l

1

1 1

1

l

a

b

c

( , )u vx

2

2 2

2

l

a

b

c

1 1 1 0 a u b v c2 2 2 0 a u b v c

1

x

u

v1

1 1

1

l

a

b

c

where

2

2 2

2

l

a

b

c

2x3

0 0 A

null A

or

(1804,934)

Page 22: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing Point

11l

1l 2

Ground plane

1u

2u3u

4u

Parallel lines:

11 4 3 l u u 12 1 2 l u u

Page 23: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing Point

11l

Ground plane

4u

Parallel lines:

11 4 3 l u u 12 1 2 l u u

21 4 1 l u u 22 3 4 l u u

2l 1

l221l 2

1u

2u3u

Page 24: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing Point

11l

x1

Ground plane

4u

Parallel lines:

11 4 3 l u u 12 1 2 l u u

21 4 1 l u u 22 3 4 l u u

2l 1

l221l 2

1u

2u3u

x l l1 11 12

Vanishing points:

x l l2 21 22

x2

Page 25: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing Point

11l

1v

Ground plane

4u

Parallel lines:

11 4 3 l u u 12 1 2 l u u

21 4 1 l u u 22 3 4 l u u

2l 1

l221l 2

1u

2u3u

1 11 12 v l l

Vanishing points:

2 21 22 v l l

2v Vanishing line:

1 2 l v vl

Page 26: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Where was I (how high)?

Taken from my hotel room (6th floor) Taken from beach

Page 27: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing point

Vanishing point

Multiple vanishing point

Page 28: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Vanishing point

Vanishing point

Vanishing line: Horizon

Vanishing line for horizon

Page 29: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Keller Hall

Vanishing point

Vanishing point

What can vanishing line tell us about me? • Horizon • Camera pitch angle (looking down) • Camera roll angle (tilted toward right)

Vanishing line for horizon

Page 30: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Single Vanishing Point Camera

3D world

r1

r2

r3

v

0 0

0 0

1

1 0

Z

C1 2 3 W

0

0

1

0

v K r r r t

-13

K v r

3v Kr

Page 31: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Single Vanishing Point Camera

3D world

r1

r2

r3

v

0 0

0 0

1

1 0

Z

C1 2 3 W

0

0

1

0

v K r r r t

-13

K v r

3v Kr

K v

rK v

-1

3 -1 because r3 is a unit vector.

Z vanishing point tells us about the surface normal of the ground plane

Page 32: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Single Vanishing Point Camera

3D world

r1

r2

r3

v

0 0

0 0

1

1 0

Z

C1 2 3 W

0

0

1

0

v K r r r t

-13

K v r

3v Kr

K v

rK v

-1

3 -1 because r3 is a unit vector.

Z vanishing point tells us about the surface normal of the ground plane

Ground plane

Rotation ambiguity

Page 33: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Two Vanishing Points Camera

X

1

0

0

0

v K r r r t X

Kr

CX 1 2 3 W

1

0

1

0

0

Y

3D world

r1

r2

r3

Yv

vX

3D world

Page 34: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Two Vanishing Points Camera

X

1

0

0

0

CY 1 2 3 W

2

v K r r r t Y

Kr

v K r r r t X

Kr

CX 1 2 3 W

1

0

1

0

0

Y

3D world

r1

r2

r3

Yv

vX

3D world

Page 35: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Two Vanishing Points Camera

X

1

0

0

0

-1 -1

X Y1 2-1 -1

X Y

,

K v K v

r rK v K v

3 1 2 r r r : Orthogonality constraint

CY 1 2 3 W

2

v K r r r t Y

Kr0

1

0

0

Y

3D world

r1

r2

r3

v K r r r t X

Kr

C

X 1 2 3 W

1

Yv

vX

3D world

Page 36: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Single View Metrology

Page 37: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Cross Ratio

Ground plane

A B

C D

Reference points

Target points

AC ac a c

BC bc

BD bd b d

AD ad a db c

a b

c

d a' b' c'

d'

Cross ratio (perspective transformation invariant)

Page 38: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

v

sh_f

jp_f

jp_h p2

p3

p1

p4

h_prime = norm(p1-p2); h_R = norm(p1-p3); h_prime_inf = norm(p4-p2); h_inf = norm(p4-p3); H = H_R * h_prime * h_prime_inf / h_R / h_inf

ComputeHeightFromCrossRatio.m

h

Rh

vZ

h

h

R

R

h

hH

h

hH

H = 1.6779 Ground truth: 1.7m

Page 39: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography

Page 40: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Perspective Transform (Homography)

I1 I2

x 11 12 13 x x

y 21 22 23 y y

31 32 11 1 1

H

v h h h u u

v h h h u u

h h

: General form of plane to plane linear mapping

Page 41: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Ground plane

Camera plane

u

Perspective Transform (Homography)

u K R t X

0

1

X =

X

Y

uGround plane Camera plane

1 2 30

1

u K r r r t

X

Y

1 2

1

u K r r t

X

Y

x

y

11

H

u X

u Y

Page 42: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Perspective Transform (Homography)

I1 I2Invariant properties

• Cross ratio

• Concurrency

• Colinearity

x 11 12 13 x x

y 21 22 23 y y

31 32 11 1 1

H

v h h h u u

v h h h u u

h h

Degree of freedom

8 (9 variables 1 scale)

Page 43: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Hierarchy of Transformations

Euclidean (3 dof) Similarity (4 dof) Affine (6 dof) Projective (8 dof)

• Length • Angle • Area

• Length ratio • Angle

• Parallelism • Ratio of area • Ratio of length

• Cross ratio • Concurrency • Colinearity

x

y

cos sin

sin cos

1

t

t

θ θ

θ θ

x

y

cos sin

sin cos

1

t

t

θ θ

θ θ

11 12 13

21 22 23

0 0 1

a a a

a a a11 12 13

21 22 23

31 32 1

h h h

h h h

h h

Page 44: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Image Transform via Plane

Keller entrance left Keller entrance right

Page 45: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Plane

Image Transform via 3D Plane

X

YX =

0

1

1 2

1 2

=

1

=

1

u K r r t

v K r r t

X

Y

X

Y

u

u K R t X

v

How are two image coordinates (u,v) related?

-1-1 -1 -1

1 2 1 2

-1 -11 2 1 2

= =

1

=

=

r r t K u r r t K v

v K r r t r r t K u

v Hu

X

Y

Page 46: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Camera

Image Transform by Pure 3D Rotation

X

Page 47: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Camera

Image Transform by Pure 3D Rotation

X

2 = v KRX

1 = u KX

-1 T -11 2= = X K u R K v

-1=v KRK u

-1=H KRK-1=R K HK

Page 48: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

Page 49: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

11 12 13

31 32 33

21 22 23

31 3

x y

x

x y

x y

y

x y2 33

+

+ +

+

+ +

u uv

u u

u uv

h h h

h h h

h

h u

h

h hu

h

Page 50: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

11 12 13

31 32 33

21 22 23

31 3

x y

x

x y

x y

y

x y2 33

+

+ +

+

+ +

u uv

u u

u uv

h h h

h h h

h

h u

h

h hu

h

x y x x y x x

x y

11 12 13 31 32 33

21 22 23 31 32 3x y y y y3

+ + + 0

+ + + + 0

h h h h h h

h

u u u v u v v

u u u v u vh h vh h h

Unknowns: 11 33, ,h h

Equations: 2 per correspondence

Page 51: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

11 12 13

31 32 33

21 22 23

31 3

x y

x

x y

x y

y

x y2 33

+

+ +

+

+ +

u uv

u u

u uv

h h h

h h h

h

h u

h

h hu

h

11 12 13 31 3x y x x y x x

x y x

2 33

21 22 23 31 32 33y y y y

+ 0

+ 0

h h h h h h

h

u u u v u v v

u u u v u vh h vh h h

11

12

13

21

22

x y x x y x x

x y x y y y y23

31

32

33

1 0

1 0

h

h

h

h

h

h

u u -u v -u v -v

u u -u v -u v

h

-v

h

h

Page 52: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

11 12 13

31 32 33

21 22 23

31 3

x y

x

x y

x y

y

x y2 33

+

+ +

+

+ +

u uv

u u

u uv

h h h

h h h

h

h u

h

h hu

h

11 12 13 31 3x y x x y x x

x y x

2 33

21 22 23 31 32 33y y y y

+ 0

+ 0

h h h h h h

h

u u u v u v v

u u u v u vh h vh h h

11

12

13

21

22

x y x x y x x

x y x y y y y23

31

32

33

1 0

1 0

h

h

h

h

h

h

u u -u v -u v -v

u u -u v -u v

h

-v

h

h

A x 02x9

Page 53: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

11

12

13

21

22

x y x x y x x

x y x y y y y23

31

32

33

1 0

1 0

h

h

h

h

h

h

u u -u v -u v -v

u u -u v -u v

h

-v

h

h

A x 02x9

How many correspondences are needed?

Page 54: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Homography Computation

x 11 12 13 x

y 21 22 23 y

31 32 33

=

1 1

v h h h u

v h h h u

h h h

How many correspondences are needed? 4

11

12

13

21

22

x y x x y x x

x y x y y y y23

31

32

33

1 0

1 0

h

h

h

h

h

h

u u -u v -u v -v

u u -u v -u v

h

-v

h

h

A x 08x9

:end= nullx V A

Page 55: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Epipolar Geometry

Page 56: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

X

u

Bob Alice

v

u v

Properties of Fundamental Matrix

Fundamental Matrix

P K I 0bob 3 3 1

P K R talice

• Transpose: if F is for Pbob, Palice, then FT is for Palice, Pbob.

• Epipolar line:

• Epipole:

• rank(F)=2: degree of freedom 9 (3x3 matrix)-1 (scale)-1 (rank)=7

ealiceebob

ul Fu vl F vT

ealiceebob

-T -1

F K t RK

rank 2 matrix

Fe 0bob = F e 0Talice =

Page 57: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

u v

Bob Alice

Essential Matrix

Essential Matrix:

-T -1 -T -1

=

=

F F(R,t)

K t RK K EK

T=E K FKCalibrated fundamental matrix

=

E t Rwhere

Property of essential matrix:

T T

1

= 1

0

E UDV = U V

Page 58: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

HW #4 RANSAC Fundamental matrix

Page 59: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

v

Bob Alice

X

bobP aliceP

u

Baseline

Triangulation General camera pose

1 bob=1 1

u XP

Two 3D vectors are parallel.

bob1 1

u XP 0

bob1 1

u XP 0 : Knowns

: Unknowns

alice1

vP

mikeP

mike1

wP

Page 60: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

PnP

u

X

3D-2D correspondence: u X

= P K R t (3)R SOwhere

11

12

13

14x x x x1 1 1 1 1 1 1

21y y y y1 1 1 1 1 1 1

22

23x x x x

24y y y y

31

32

33

34

1

1

1

1

m m m m m m m

m m m m m m m

p

p

p

pX Y Z -u X -u Y -u Z -u

pX Y Z -u X -u Y -u Z -u

p

pX Y Z -u X -u Y -u Z -u

pX Y Z -u X -u Y -u Z -u

p

p

p

p

0

0

0

0

x 11 12 13 14

31 32 33 34

+ +

+ +

p X p Y p Z pu

p X p Y p Z py 21 22 23 24

31 32 33 34

+ +

+ +

p X p Y p Z pu

p X p Y p Z p

2mx12

Page 61: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Bundle Adjustment

Page 62: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

Nonlinear System

E

x

T T( ) ( )( )

x xx b

x x

f ff

Find x such that the following equation is satisfied:

How?

Strategy: Given x, move such that x

x x x

( ) ( ) x x xE E

Taylor expansion:

T T( ) ( ) ( )( )

x x xx x b

x x x

f f ff

T T( ) ( ) ( )

( )

x x xx b x

x x x

f f ff

= x TA bTA A-1

Cf.)

( )( ) ( ) H.O.T.

xx x x x

x

ff f

Page 63: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

X

bobP

uu

Point Jacobian

-1

T T( ) ( ) ( )( )

x x xx b x

x x x

f f ff

X

Black: given variables Red: unknowns

XKR -C

u

v

w

where

( )

Xf

u

w

v

w

2 2

geom

Ev

wx y

u

w

2

2

( )

X XX

X X

X X

u ww u

u

w w

v u wv v

ww

f

KR

X

u

v

w

Page 64: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

-1

T T( ) ( ) ( )( )

x x xx b x

x x x

f f ff

2

2

( )

X XX

X X

X X

u ww u

u

w w

v u wv v

ww

f

Damping factor (Levenberg-Marquardt algorithm)

-1

T T( ) ( ) ( )( )

x x xx I b x

x x x

f f ff

Page 65: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

X

bobP

uu

Camera Jacobian

p

-1

T T( ) ( ) ( )( )

p p pp b p

p p p

f f ff

Black: given variables Red: unknowns

X CK -R

u

v

w

where

2 2

geom

Ev

wx y

u

w

-KC

R

u

v

w

11 1 3 13

1 3 22 23

1 3 1 3

- -

- -

-

K X C 0 K X C

0 K X C K X CR

0 0 X C

u

v

w

1

2

3

=

C

rp

r

r

3+9 parameters

Page 66: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

X

bobP

uu

Camera Jacobian

p

Black: given variables Red: unknowns

X CK -R

u

v

w

where

2 2

geom

Ev

wx y

u

w

-KC

R

u

v

w

11 1 3 13

1 3 22 23

1 3 1 3

- -

- -

-

K X C 0 K X C

0 K X C K X CR

0 0 X C

u

v

w

=

Cp

q

3+4 parameters

R

q R q

u u

v v

w w

: Chain rule

Quaternion jacobian

Page 67: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

v

Bob Alice

1X

bobP aliceP

u

pp

X

Black: given variables Red: unknowns

Camera & Point Jacobian ( ) ( )

p X

p ,X p ,XJ J J

p Xj i j i

ij ij ij

j i

f f

J1,bobpJ 2 70 1,bobXJ

1,aliceXJ1,alicepJ2 70

Page 68: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

v

Bob Alice

1X

bobP aliceP

u

pp

X

Black: given variables Red: unknowns

Camera & Point Jacobian ( ) ( )

p X

p ,X p ,XJ J J

p Xj i j i

ij ij ij

j i

f f

J1,bobpJ 2 70 1,bobXJ

1,aliceXJ1,alicepJ2 70

2X

2,bobpJ 2 70 2,bobXJ

2,aliceXJ2,alicepJ2 70

2 30

2 30

2 30

2 30

Page 69: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

J =

Cam 1 Pt 1 Pt 4

# of unknowns: 3x7+4x3 # of projections: 3x4

Cam 2 Cam 3 Pt 2 Pt 3

Pt 1

Pt 2

Pt 3

Pt 4

Camera 1

Camera 2 Camera 3

Page 70: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

J =

Cam 1 Pt 1 Pt 4

# of unknowns: 3x7+4x3 # of projections: 9 (not all points are visible from cameras)

Cam 2 Cam 3 Pt 2 Pt 3

Pt 1

Pt 2

Pt 3

Pt 4

Camera 1

Camera 2 Camera 3

Page 71: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

J =

Cam 1 Pt 1 Pt 4

# of unknowns: 3x7+4x3 # of projections: 9 (not all points are visible from cameras)

J JTsize of : 24x24

x J J J b f(x)-1T T

Cam 2 Cam 3 Pt 2 Pt 3

Pt 1

Pt 2

Pt 3

Pt 4

Camera 1

Camera 2 Camera 3

Page 72: Camera Projection Modelhspark/CSci5980/Final_Review.pdf · where is the camera location seen from world. C C Ct where is the world orgin seen from camera. Projective Line . Point-Point

J =

Cam 1 Pt 1 Pt 4

# of unknowns: 3x7+4x3 # of projections: 9 (not all points are visible from cameras)

J JTsize of : 24x24

x J J J b f(x)-1T T

Main computational bottle neck

Cam 2 Cam 3 Pt 2 Pt 3

Pt 1

Pt 2

Pt 3

Pt 4

Camera 1

Camera 2 Camera 3