Top Banner
Image Formation I Chapter 1 (Forsyth&Ponce) Cameras Guido Gerig CS 6320 Spring 2013 Acknowledgements: Slides used from Prof. Trevor Darrell, (http://www.eecs.berkeley.edu/~trevor/CS280.html) Some slides modified from Marc Pollefeys, UNC Chapel Hill. Other slides and illustrations from J. Ponce, addendum to course book.
39

Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Apr 29, 2018

Download

Documents

hoanghanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Image Formation I Chapter 1 (Forsyth&Ponce)

Cameras

Guido Gerig

CS 6320 Spring 2013

Acknowledgements:

• Slides used from Prof. Trevor Darrell,

(http://www.eecs.berkeley.edu/~trevor/CS280.html)

• Some slides modified from Marc Pollefeys, UNC Chapel Hill. Other

slides and illustrations from J. Ponce, addendum to course book.

Page 2: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

GEOMETRIC CAMERA MODELS

• The Intrinsic Parameters of a Camera

• The Extrinsic Parameters of a Camera

• The General Form of the Perspective Projection

Equation

• Line Geometry

Reading: Chapter 1.

Page 3: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Images are two-dimensional patterns of brightness values.

They are formed by the projection of 3D objects.

Figure from US Navy Manual of Basic Optics and Optical Instruments, prepared by Bureau of

Naval Personnel. Reprinted by Dover Publications, Inc., 1969.

Page 4: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Animal eye:

a looonnng time ago.

Pinhole perspective projection: Brunelleschi, XVth Century.

Camera obscura: XVIth Century.

Photographic camera:

Niepce, 1816.

Page 5: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Camera model

Relation between pixels and rays in space

?

Page 6: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Camera obscura + lens

The camera obscura (Latin for 'dark room') is an

optical device that projects an image of its

surroundings on a screen (source Wikipedia).

Page 7: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Limits for pinhole cameras

Page 8: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Physical parameters of image formation

• Geometric – Type of projection – Camera pose

• Photometric – Type, direction, intensity of

light reaching sensor – Surfaces’ reflectance

properties • Optical

– Sensor’s lens type – focal length, field of view,

aperture • Sensor

– sampling, etc.

Page 9: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Physical parameters of image formation

• Geometric – Type of projection – Camera pose

• Optical – Sensor’s lens type – focal length, field of view, aperture

• Photometric – Type, direction, intensity of light reaching sensor – Surfaces’ reflectance properties

• Sensor – sampling, etc.

Page 10: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective and art

• Use of correct perspective projection indicated in 1st century B.C. frescoes

• Skill resurfaces in Renaissance: artists develop systematic methods to determine perspective projection (around 1480-1515)

Durer, 1525 Raphael K. Grauman

Page 11: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective projection equations

• 3d world mapped to 2d projection in image plane

Forsyth and Ponce

Camera frame

Image plane

Optical axis

Focal length

Scene / world points

Scene point Image coordinates

‘’ ‘ ’

Page 12: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Affine projection models: Weak perspective projection

0

'where

'

'

z

fm

myy

mxx

is the magnification.

When the scene relief is small compared to its distance from the

Camera, m can be taken constant: weak perspective projection.

Page 13: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Affine projection models: Orthographic projection

yy

xx

'

' When the camera is at a

(roughly constant) distance

from the scene, take m=1.

Page 14: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Homogeneous coordinates

Is this a linear transformation?

Trick: add one more coordinate:

homogeneous image coordinates

homogeneous scene coordinates

Converting from homogeneous coordinates

• no—division by z is nonlinear

Slide by Steve Seitz

Page 15: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective Projection Matrix

divide by the third coordinate to convert back to non-homogeneous coordinates

• Projection is a matrix multiplication using homogeneous coordinates:

'/1

0'/100

0010

0001

fz

y

x

z

y

x

f

),()','( '' yxz

yf

z

xf

Slide by Steve Seitz

Complete mapping from world points to image pixel positions?

Page 16: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Points at infinity, vanishing points

Points from infinity represent

rays into camera which are

close to the optical axis.

Image source: wikipedia

Page 17: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective projection & calibration

• Perspective equations so far in terms of camera’s reference frame….

• Camera’s intrinsic and extrinsic parameters needed to calibrate geometry.

Camera frame

K. Grauman

Page 18: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

The CCD camera

Page 19: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective projection & calibration

Camera frame

Intrinsic: Image coordinates relative to camera Pixel coordinates

Extrinsic: Camera frame World frame

World frame

World to camera coord. trans. matrix

(4x4)

Perspective projection matrix

(3x4)

Camera to pixel coord.

trans. matrix (3x3)

= 2D

point (3x1)

3D point (4x1)

K. Grauman

Page 20: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Intrinsic parameters: from idealized world coordinates to pixel values

Forsyth&Ponce

z

yfy

z

xfx

'

'Perspective projection: Worls point and pixels in camera coordinates

W. Freeman

Page 21: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Intrinsic parameters

ion magnificat represents

* with ,

* with ,

kfz

yv

kfz

xu

But “pixels” are in some arbitrary spatial units, which can be described by #pixels per mm.

W. Freeman

Pixel dimensions: 1/k*1/k

k: cells/mm, units [mm-1]

Page 22: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Intrinsic parameters

ionsmagnificatrepresent ,

*with ,

*with ,

lfz

yv

kfz

xu

Maybe pixels are not square and have different horizontal and vertical dimensions. (u,v): pixel numbers, x,y,z): World point in camera coordinates.

W. Freeman

Pixel dimensions: 1/k*1/l

k,l: cells/mm, units [mm-1]

Page 23: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Intrinsic parameters

0

0

vz

yv

uz

xu

We don’t know the origin of our camera pixel coordinates: (u0,v0) represent intersection of optical axis with image plane: (u0, v0): image center in pixel coordinates.

W. Freeman

Page 24: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Intrinsic parameters

0

0

)sin(

)cot(

vz

yv

uz

y

z

xu

May be skew between camera pixel axes due to manufacturing errors and eventually line-by-line readouts.

v

u

v

u

vuvuu

vvvv

)cot()cos(

)sin( )sin(

W. Freeman

Page 25: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

pz

p C (K)

1

Intrinsic parameters, homogeneous coordinates

0

0

)sin(

)cot(

vz

yv

uz

y

z

xu

10

0

0

100

)sin(0

)cot(

1

1

0

0

z

y

x

v

u

zv

u

Using homogenous coordinates, we can write this as:

or:

World point in camera-based coordinates

In pixels

W. Freeman

Page 26: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Perspective projection & calibration

Camera frame

Intrinsic: Image coordinates relative to camera Pixel coordinates

Extrinsic: Camera frame World frame

World frame

World to camera coord. trans. matrix

(4x4)

Perspective projection matrix

(3x4)

Camera to pixel coord.

trans. matrix (3x3)

= 2D

point (3x1)

3D point (4x1)

K. Grauman

Page 27: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Coordinate Changes: Pure Translations

OBP = OBOA + OAP , BP = AP + BOA

Page 28: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Coordinate Changes: Pure Rotations

),,(

...

...

...

A

B

A

B

A

B

BABABA

BABABA

BABABA

B

A R kji

kkkjki

jkjjji

ikijii

A

B

A

B

A

Bkji

T

B

A

T

B

A

T

B

A

k

j

i

Page 29: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Coordinate Changes: Rotations about the k Axis

100

0cossin

0sincos

RB

A

Page 30: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

A rotation matrix is characterized by the following properties:

• Its inverse is equal to its transpose, and

• its determinant is equal to 1.

Or equivalently:

• Its rows (or columns) form a right-handed

orthonormal coordinate system.

Page 31: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Coordinate Changes:

Pure Rotations

PRP

z

y

x

z

y

x

OP

AB

A

B

B

B

B

BBB

A

A

A

AAA

kjikji

Page 32: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Coordinate Changes: Rigid Transformations

A

BAB

A

B OPRP

Page 33: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Block Matrix Multiplication

2221

1211

2221

1211

BB

BBB

AA

AAA

What is AB ?

2222122121221121

2212121121121111

BABABABA

BABABABAAB

Homogeneous Representation of Rigid Transformations

11111

PT

OPRPORP A

B

A

A

BAB

A

A

T

A

BB

A

B

0

Page 34: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Extrinsic parameters: translation and rotation of camera frame

tpRp C

W

WC

W

C

Non-homogeneous coordinates

Homogeneous coordinates

ptRp WC

W

C

W

C

1000

|

|

W. Freeman

Page 35: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Combining extrinsic and intrinsic calibration parameters, in homogeneous coordinates

Forsyth&Ponce

ptR

Kp W

C

W

C

W

10,0,0z

1

pp CK

z

1

pMp W

z

1

Intrinsic

Extrinsic

ptRp WC

W

C

W

C

1000

|

|

World coordinates

Camera coordinates

pixels

W. Freeman

pixels (u,v,1)

World coordinates (x,y,z,1)

Page 36: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Other ways to write the same equation

1...

...

...1

1 3

2

1

z

W

y

W

x

W

T

T

T

p

p

p

m

m

m

zv

u

pMz

p W

1

pixel coordinates

world coordinates

Conversion back from homogeneous coordinates leads to (note that z = mT

3*P) :

Pm

Pmv

Pm

Pmu

3

2

3

1

W. Freeman

Page 37: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Extrinsic Parameters

Page 38: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Explicit Form of the Projection Matrix

Note:

M is only defined up to scale in this setting!!

Page 39: Image Formation I Chapter 1 (Forsyth&Ponce) Camerasgerig/CS6320-S2013/Materials/CS... · Chapter 1 (Forsyth&Ponce) Cameras ... Affine projection models: Orthographic projection ...

Calibration target

http://www.kinetic.bc.ca/CompVision/opti-CAL.html

Find the position, ui and vi, in pixels, of each calibration object feature point.