camera model relation between pixels and rays in space ?

16
Camera model Relation between pixels and rays in space ?

Post on 21-Dec-2015

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Camera model Relation between pixels and rays in space ?

Camera model

Relation between pixels and rays in space

?

Page 2: Camera model Relation between pixels and rays in space ?

Pinhole camera

Page 3: Camera model Relation between pixels and rays in space ?

Pinhole camera model

TT ZfYZfXZYX )/,/(),,(

101

0

0

1

Z

Y

X

f

f

Z

fY

fX

Z

Y

X

linear projection in homogeneous coordinates!

Camera is a mapping between 3D world (object space) and 2D image;Camera model: matrix representing camera mapping; interested in central projection

P = Intersection of principle axisWith image plane

Line from cameraCenter perp. To imageplane

Focal plane Z=f

Plane through cameraCenter C, parallel to imagePlane is called principlePlane of the camera

Page 4: Camera model Relation between pixels and rays in space ?

Pinhole camera model

101

0

0

Z

Y

X

f

f

Z

fY

fX

101

01

01

1Z

Y

X

f

f

Z

fY

fX

PXx

0|I)1,,(diagP ff

Page 5: Camera model Relation between pixels and rays in space ?

Principal point offset

Tyx

T pZfYpZfXZYX )+/,+/(),,(

principal pointT

yx pp ),(

101

0

0

1

Z

Y

X

pf

pf

Z

ZpfY

ZpfX

Z

Y

X

y

x

x

x

So far, assumed the origin of the coordinate in the image plane is the Same as the principal point

Page 6: Camera model Relation between pixels and rays in space ?

Principal point offset

101

0

0

Z

Y

X

pf

pf

Z

ZpfY

ZpfX

y

x

x

x

camX0|IKx

1y

x

pf

pf

K calibration matrix

Page 7: Camera model Relation between pixels and rays in space ?

Camera rotation and translation

C~

-X~

RXcam

X10

RC-R

1

10

C~

R-RXcam

Z

Y

X

camX0|IKx XC~

-|IKRx t|RKP C

~R-t PX=x

~

Points in space are usually expressed in terms of world coordinate frame, i.e. Euclidean

X~

Inhomogeneous vector in world coordinateCoordinates of camera center in world coordInhomogeneous 3 vector in camera coord.

C~

camX

General mapping for pinhole camera

9 deg of freedom: f, px,py,3 rot, 3 trans

Page 8: Camera model Relation between pixels and rays in space ?

CCD camera

1yy

xx

p

p

K

11y

x

y

x

pf

pf

m

m

K

Pinhole camera model assumes image coordinates are Euclidean coordinates with equal scales in both axial directions; CCD cameras does not have square pixels

mx is the number of pixels per unit distance in image coordinates in the x directionmy is the number of pixels per unit distance in image coordinates in the y directionαx = f mx and αy = f my : focal length of the camera in terms of the pixel dimensions in x and y directions10 degrees of freedom for CCD camera

Page 9: Camera model Relation between pixels and rays in space ?

When is skew non-zero?

1yx

xx

p

ps

K

1 g

arctan(1/s)

for CCD/CMOS, always s=0Example of skew: negative enlarging

Page 10: Camera model Relation between pixels and rays in space ?

General projective camera

1yx

xx

p

ps

K

1yx

xx

p

p

K

C~

|IKRP

non-singular

11 dof (5+3+3)

t|RKP

intrinsic camera parametersextrinsic camera parameters

Page 11: Camera model Relation between pixels and rays in space ?

Projection equation

• The projection matrix models the cumulative effect of all parameters• Useful to decompose into a series of operations

ΠXx

1****

****

****

Z

Y

X

s

sy

sx

fsx 0 x 'c

0 fsy y 'c0 0 1

1 0 0 0

0 1 0 0

0 0 1 0

R3x3

03x1

01x3 1

I

3x3T3x1

01x3 1

projectionintrinsics rotation translation

identity matrix

Camera parametersA camera is described by several parameters

• Translation T of the optical center from the origin of world coords• Rotation R of the image plane• focal length f, principle point (x’c, y’c), pixel size (sx, sy)

• blue parameters are called “extrinsics,” red are “intrinsics”

• The definitions of these parameters are not completely standardized– especially intrinsics—varies from one book to another

Page 12: Camera model Relation between pixels and rays in space ?

Projection matrices for Orhographic and scaled orthographic projections

Orthographic projection

Scaled orthographic projection

10rr

P 21T

11T

tt

ktt

/10rr

P 21T

11T

(5dof)

(6dof)

Page 13: Camera model Relation between pixels and rays in space ?

Radial distortion

• Due to spherical lenses (cheap)• Model:

R

y

xyxKyxKyx ...))()(1(),( 44

222

1R

http://foto.hut.fi/opetus/260/luennot/11/atkinson_6-11_radial_distortion_zoom_lenses.jpgstraight lines are not straight anymore

Page 14: Camera model Relation between pixels and rays in space ?

Camera model

Relation between pixels and rays in space

?

Page 15: Camera model Relation between pixels and rays in space ?

Projector model

Relation between pixels and rays in space

(dual of camera)

?

Page 16: Camera model Relation between pixels and rays in space ?

Affine cameras

Track back while zooming inKeep object of interest same size