21
Introduction to pinhole cameras Lesson given by ebastien Pi´ erard in the course “Introduction aux techniques audio et vid´ eo” (ULg, Pr. J.J. Embrechts) INTELSIG, Montefiore Institute, University of Li` ege, Belgium October 30, 2013 1 / 21

Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Introduction to pinhole cameras

Lesson given by Sebastien Pierard in the course“Introduction aux techniques audio et video”

(ULg, Pr. J.J. Embrechts)

INTELSIG, Montefiore Institute, University of Liege, Belgium

October 30, 2013

1 / 21

Page 2: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Optics : the light travels along straight line segments

The light travels along straight lines if one assumes a singlematerial (air, glass, etc.) and a single frequency. Otherwise . . .

2 / 21

Page 3: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Optics : behavior of a lens

Assuming the Gauss’ assumptions, all light rays coming from thesame direction converge to a unique point on the focal plane.

3 / 21

Page 4: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Optics : an aperture

4 / 21

Page 5: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Optics : a pinhole camera

A pinhole camera is a camera with a very small aperture. The lensbecomes completely useless. The camera is just a small hole. Highexposure durations are needed due to the limited amount of lightreceived.

5 / 21

Page 6: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

What is a camera ?

A camera is a function:

point in the 3D world → pixel(x y z

)→(

u v)

(x y z

)→(

x y z)(c)→(

u v)(f )→(

u v)

I(x y z

)in the world 3D Cartesian coordinate system

I(x y z

)(c)in the 3D Cartesian coordinate system located

at the camera’s optical center (the hole), with the axis z(c)

along its optical axis, and the axis y (c) pointing upperwards.

I(u v

)(f )in the 2D Cartesian coordinate system locate in the

focal plane

I(u v

)in the 2D coordinate system screen or image

6 / 21

Page 7: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(x y z)→ (x y z)(c)

6

y (c)

�z(c)@@@R

x (c)

����

����

����

����

��1

−→t

�����

x

@@

@@I

y

@@@R

z

@@

��

x (c)

y (c)

z(c)

= R3×3

xyz

+

txtytz

7 / 21

Page 8: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(x y z)→ (x y z)(c)

x (c)

y (c)

z(c)

= R3×3

xyz

+

txtytz

R is a matrix that gives the rotation from the world coordinatesystem to the camera coordinate system. The columns of R arethe base vectors of the world coordinate system expressed in thecamera coordinate system. In the following, we will assume thatthe two coordinate systems are orthonormal. In this case, we haveRTR = I ⇔ R−1 = RT .

8 / 21

Page 9: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(x y z)(c) → (u v)(f )

6

y (c)

�z(c)@@R

x (c)

6

v (f )

@@R

u(f )

f@@@@@@@@@

@@@@@@@@@

s

����

���

���

���

���

���

@@@@

@@@

s

9 / 21

Page 10: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(x y z)(c) → (u v)(f )

We suppose that the image plane is orthogonal to the optical axis.We have :

u(f ) = x (c) f

z(c)

v (f ) = y (c) f

z(c)

10 / 21

Page 11: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(u v)(f ) → (u v)

-

6

v (f )

u(f )����

v

��������������

��������

��������

������

�����

������

u-������������

u0

v0

θ

-�1ku

6?

1kv

11 / 21

Page 12: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

(u v)(f ) → (u v)

We have :

u = (u(f ) − v (f )

tan θ)ku + u0 v = v (f )kv + v0

The parameters ku and kv are scaling factors and (u0, v0) are thecoordinates of the point where the optical axis crosses the imageplane. We pose suv = − ku

tan θ and obtain:susvs

=

ku suv u0

0 kv v0

0 0 1

su(f )

sv (f )

s

Often, the grid of photosensitive cells can be considered as nearlyrectangular. The parameter suv is then neglected and is consideredas 0.

12 / 21

Page 13: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

The complete pinhole camera model

With homogeneous coordinates the pinhole model can be writtenas a linear relation:susv

s

=

ku suv u0

0 kv v0

0 0 1

f 0 0 0

0 f 0 00 0 1 0

txR3×3 ty

tz0 0 0 1

xyz1

susvs

=

αu Suv u0 00 αv v0 00 0 1 0

txR3×3 ty

tz0 0 0 1

xyz1

susvs

=

m11 m12 m13 m14

m21 m22 m23 m24

m31 m32 m33 m34

xyz1

with αu = f ku, αv = f kv , and Suv = f suv .

13 / 21

Page 14: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Questions

Question

What is the physical meaning of the homogeneous coordinates ?

Think about all concurrent lines intersection at the origin and thethree first elements of the homogeneous coordinates with (x y z)on a sphere . . .

Question

How many degrees of freedom has M3×4 ?

(m31m32m33) is a unit vector since (m31m32m33) = (r31r32r33).

14 / 21

Page 15: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

The calibration step: finding the matrix M3×4

15 / 21

Page 16: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

The calibration step: finding the matrix M3×4

susvs

=

m11 m12 m13 m14

m21 m22 m23 m24

m31 m32 m33 m34

xyz1

therefore

u =m11 x + m12 y + m13 z + m14

m31 x + m32 y + m33 z + m34

v =m21 x + m22 y + m23 z + m24

m31 x + m32 y + m33 z + m34

and

(m31 u −m11)x + (m32 u −m12)y + (m33 u −m13)z + (m34 u −m14) = 0

(m31 v −m21)x + (m32 v −m22)y + (m33 v −m23)z + (m34 v −m24) = 0

16 / 21

Page 17: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

The calibration step: finding the matrix M3×4

x1 y1 z1 1 0 0 0 0 −u1x1 −u1y1 −u1z1 −u1

x2 y2 z2 1 0 0 0 0 −u2x2 −u2y2 −u2z2 −u2

......

......

......

......

......

......

xn yn zn 1 0 0 0 0 −unxn −unyn −unzn −un0 0 0 0 x1 y1 z1 1 −v1x1 −v1y1 −v1z1 −v1

0 0 0 0 x2 y2 z2 1 −v2x2 −v2y2 −v2z2 −v2

......

......

......

......

......

......

0 0 0 0 xn yn zn 1 −vnxn −vnyn −vnzn −vn

m11

m12

m13

m14

m21

m22

m23

m24

m31

m32

m33

m34

= 0

17 / 21

Page 18: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Questions

Question

What is the minimum value for n ?

5.5

Question

How can we solve the homogeneous system of the previous slide ?

Apply a SVD and use the vector of the matrix V corresponding thesmallest singular value.

Question

Is there a conditions on the set of 3D points used for calibratingthe camera ?

Yes, they should not be coplanar.

18 / 21

Page 19: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Intrinsic and extrinsic parameters

m11 m12 m13 m14

m21 m22 m23 m24

m31 m32 m33 m34

=

αu Suv u0

0 αv v0

0 0 1

︸ ︷︷ ︸intrinsic parameters

txR3×3 ty

tz

︸ ︷︷ ︸extrinsic parameters

The decomposition can be achieved via the orthonormalisingtheorem of Graham-Schmidt, or via a QR decomposition since

m11 m12 m13

m21 m22 m23

m31 m32 m33

=

αu Suv u0

0 αv v0

0 0 1

r11 r12 r13

r21 r22 r23

r31 r32 r33

m33 m23 m13

m32 m22 m12

m31 m21 m11

=

r33 r23 r13

r32 r22 r12

r31 r21 r11

1 v0 u0

0 αv Suv0 0 αu

19 / 21

Page 20: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Questions

Question

What is the minimum of points to use for recalibrating a camerathat has moved ?

3 since there are 6 degrees of freedom in the extrinsic parameters.

Question

What is this ?

20 / 21

Page 21: Introduction to pinhole cameras - Montefiore Institutepierard/slides-pinhole.pdfIntroduction to pinhole cameras Lesson given by S ebastien Pi erard in the course \Introduction aux

Bibliography

D. Forsyth and J. Ponce, Computer Vision: a ModernApproach. Prentice Hall, 2003.

R. Hartley and A. Zisserman, Multiple View Geometry inComputer Vision, 2nd ed. Cambridge University Press, 2004.

Z. Zhang, “A flexible new technique for camera calibration,”IEEE Transactions on Pattern Analysis and MachineIntelligence, vol. 22, no. 11, pp. 1330–1334, 2000.

21 / 21