Docsity

Computing Camera Parameters: Estimating Camera Matrix and Translation, Study notes of Computer Science

Partial preview of the text

Download Computing Camera Parameters: Estimating Camera Matrix and Translation and more Study notes Computer Science in PDF only on Docsity!

Lecture-

Computing Camera Parameters

Computing Camera Parameters

  • Using known 3-D points and corresponding

image points, estimate camera matrix employing

pseudo inverse method of section 1.

(Fundamental of Computer Vision).

  • Compute camera parameters by relating camera

matrix with estimated camera matrix.

  • Extrinsic
    • Translation
    • Rotation
  • Intrinsic
    • Horizontal and vertical focal lengths
    • Translation o x and o y

Comparison

31 32 33 34

21 22 23 24

11 12 13 14

m m m m
m m m m
m m m m
M

z

y y y y y y y y z y

x x x x x x x x z x

r r r T

fr ro fr ro fr ro fT To

fr ro fr ro fr ro fT To

M

31 32 33

21 31 22 32 23 33

11 31 12 32 13 33

Computing Camera Parameters:

Estimating scale

M ˆ = γ M

2 33

2 32

2 31

2 33

2 32

2

m 31 + m + m = γ r + r + r = γ

Since M is defined up to a scale factor

estimated

z

y y y y y y yy z y

x x x x x x xx z x

r r r T

fr ro fr ro fr ro fT To

fr ro fr ro fr ro fT To

m m m m

m m m m

m m m m

31 32 33

21 31 22 32 23 33

11 31 12 32 13 33

31 32 33 34

21 22 23 24

11 12 13 14

γ

Divide each entry of M ˆ^ by. | γ |

Computing Camera Parameters:

origin of image

( ) ( )

( ) ( )

( ) ( )

( ) ( )

x

T

x

x x x

x x x

x x x

x x x

x x x x x x

T

qq o

o r r r

r o r o r o

ro ro ro r r r

ro ro ro r r r

fr fr fr r r r

fr ro fr ro fr ro r r r

m m mm mm

qq mm m m m m

=

= + +

= + +

=

=− − − +

− + − + − +

    • =

= + +

( )

( )

.

.

.

.

ˆ ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ ˆ ˆ ˆ

1 3

2 33

2 32

2 31

2 33

2 32

2 31

31 32 32 31 32 33

31 32 32 31 32 33

11 12 13 31 32 33

11 31 12 32 13 33 31 32 33

11 31 12 32 13 33

1 3 11 31 12 32 13 33

2 3

1 3

o q q

o q q

T y

T x

=

=

Therefore:

Computing Camera Parameters:

vertical and horizontal focal

lengths

x x

T

x x

T

x x

x x

x x x x x x

x x x x x x

x x x x x x x x x x x x

T

qq o f

qq f o

f o

f r r r o r r r

f r r o f r r o f r r o

fr ro fr ro fr ro

fr ro fr ro fr ro fr ro fr ro fr ro

mm mm mm

qq mm mm mm

=

= +

= +

= + + + + +

= + + + + +

=− + +− + +− +

− + − + − + − + − + − +

    • =

= + +

( ) ( )

( ) ( ) ( )

( ) ( ) ( )

.

ˆ ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ ˆ ˆ ˆ

2 11

2 2 11

2 2

2 33

2 32

2 31

2 2 13

2 12

2 11

2

2 2 33

2 13

2 2 2 32

2 12

2 2 2 31

2 11

2

2 13 33

2 12 32

2 11 31

11 31 12 32 13 33 11 31 12 32 13 33

1111 1212 1313

11 1111 1212 1313

2 2 2

2 1 1

y

T y

x

T x

f qq o
f qq o

Therefore: = −

Computing Camera Parameters:

remaining rotation and translation

parameters

y y z y

x x z x

i y i i y

i x i i x

T T m f

T T m f

r m m f i

r m m f i

24

14

2 3 2

1 3 1

σ

σ

σ

σ

z

y y y y y y y y z y

x x x x x x x x z x

r r r T

fr ro fr ro fr ro fT To

fr ro fr ro fr ro fT To

M

31 32 33

21 31 22 32 23 33

11 31 12 32 13 33

Application

M

Camera location: intersection of California

And Mason streets, at an elevation of 435 feet

Above sea level. The camera was oriented

At an angle of 8 0 above the horizon. fsx=495,

fsy=560.

Pose Estimation

Z

Y

Z

X

Z T
fY T
Z T
f X T
x y
( , ) , Y ( X , Y )

Z

X Z

D fXc D fYc D
Z D
fY
D
Z D
fX
x y = + +
′ ′= Z DZ

c

Z Z

Y Y

X X

Z Z

Y Y

X X

x

x x x D D

x D D

x D D

x E φ φ

φ φ

φ φ

( X ′, Y ′, Z ′ ) ( X , Y , Z ) (^ X^ +^ TX , Y + TY , Z + TZ ) ( x ′, y ′)

Rotation trans perspect

Image displacements instead of

3-D translations

Error in x coordinates:

Pose Estimation

Y Y Z Z Y

Y Y Y

X

Z
Z D
fX
Z D
x X f
Z
Z
X x
X
x x
D
x

2

Y X Y Z

X Z

D fXc D fYc D
Z D
fY
D
Z D
fX
x y = + +

Derivatives

Chain rule

Pose Estimation

−

β

sin 0 cos
cos 0 sin

Y

R

Y

Z u’

v W’

β

β X

Y Y

Y Y Y Y

R

φ

sin 0 cos
cos 0 sin

Y Y

Y Y

Z X Z
Y Y
X X Z
sin cos
cos sin
X Z X
Z
Y
X Z Z
X

Y Y Y

Y

Y Y Y

cos sin
sin cos

Pose Estimation

Z Z

Y Y

X X

Z Z

Y Y

X X

x

x x x D D

x D D

x D D

x E φ

φ

φ φ

φ φ

′

Z Z

Y Y

X X

Z Z

Y Y

X X

y

y y y D D

y D D

y D D

y E φ φ

φ φ

φ φ

′

=

∆

∆

∆

∆

∆

∆

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

∂

∂′

′

′

y

x

Z

Y

X

Z

Y

X

X X X X X X

X Y Z X Y Z

E

E

D

D

D

D

y

D

y

D

y

D

y

D

y

D

y

x x x

D

x

D

x

D

x

φ

φ

φ

φ φ φ

M

M

AA A E

A E

T 1 T ( )

− ∆ =

∆=

Least squares fit

Derivative

x x

f x f

x

f x f x x

dx

df

= ′ =

∆

− −∆

= ∆ →

( )

( ) ( )

lim 0

dt

dv

a

dt

ds

v

=

= speed

acceleration

Examples

2 x 4 x

dx

dy

y x x

= +

= +

x
x

x e

dx

dy

y x e

= + −

= +

cos ( 1 )

sin

Second Derivative

xx

x f x f

dx

df

= ′′( )=

2 12

2 4

x

dx

d y

x x

dx

dy

y x x

= +

= +

= +

Discrete Derivative

( )

( ) ( )

lim 0

f x

x

f x f x x

dx

df

x

= ′

∆

− −∆

= ∆→

( )

1

( ) ( 1 )

f x

f x f x

dx

df

= ′

− −

=

f ( x ) f ( x 1 ) f ( x )

dx

df

= − − = ′

(Finite Difference)

Derivatives in Two Dimensions

y

f x y f x y y

f

y

f

x

f x y f x x y

f

x

f

f x y

y y

x x

∆ →

∆→

lim

lim

0

0

x

y

x y

x y

f
f
f f
f f

1

2 2

direction tan
magnitude ( )
( , )GradientVector

−

Laplacian

2

xx yy

f f f

(partial

Derivatives)

Derivatives of an Image

x

f

y

f

I ( x , y )

x

I

Derivative

& average

Prewit

Derivatives of an Image

y

I

I ( x , y )

Average

n

I

n

I I I

I

n
i
i
n

K

Gaussian

  • Most natural phenomenon can be modeled

by Gaussian.

  • Take a bunch of random variables of any

distribution, find the mean, the mean will

approach to Gaussian distribution.

  • Gaussian is very smooth function, it has

infinite no of derivatives.

Gaussian

  • Fourier Transform of Gaussian is Gaussian.
  • If you convolve Gaussian with itself, it is

again Gaussian.

  • There are cells in human brain which

perform Gaussian filtering.

  • Laplacian of Gaussian edge detector

Carl F. Gauss

  • Born to a peasant family in a small town in

Germany.

  • Learned counting before he could talk.
  • Contributed to Physics, Mathematics,

Astronomy,…

  • Discovered most methods in modern

mathematics, when he was a teenager.

Example

F(x)=10 10 10 10 20 20 20

n(x)= 0 5 0 0 3 0 0

F~(x)=10 15 10 10 23 20 20

H(x)= 10 12 12 14 17 21 20

Edge Detection

  • Find edges in the image
  • Edges are locations where intensity changes

the most

  • Edges can be used to represent a shape of an

object

Edge Detection

  • Images contain noise, need to remove noise by

averaging, or weighted averaging

  • To detect edged compute derivative of an image

(gradient)

  • If gradient magnitude is high at pixel, intensity

change is maximum, that is an edge pixel

  • If Laplacian (second derivative) is zero then at that

point the first derivative is maximum, that point is

an edge pixel.

Edge Detectors

  • Prewit
  • Sobel
  • Roberts
  • Marr-Hildreth (Laplacian of Gaussian)
  • Canny (Gradient of Gaussian)