Camera model Relation between pixels and rays in space ? Pinhole camera Pinhole camera model Camera is a mapping between 3D world (object space) and 2D image; Camera model: matrix representing camera mapping; interested in central projection Plane through camera Center C, parallel to image Plane is called principle Plane of the camera P = Intersection of principle axis With image plane Focal plane Z=f Line from camera Center perp. To image plane T ( X , Y , Z ) ( fX / Z , fY / Z ) X fX f Y Z fY Z 1 f T X 0 Y 0 Z 1 0 1 linear projection in homogeneous coordinates! Pinhole camera model X X fX f 10 0 Y Y 0 1 0 fY x PX f Z Z Z 1 0 1 0 1 1 P diag ( f , f ,1)I | 0 Principal point offset So far, assumed the origin of the coordinate in the image plane is the Same as the principal point T T ( X , Y , Z ) ( fX / Z + px , fY / Z + p y ) ( px , p y ) T principal point X fX Zp x f Y Z fY Zp x Z 1 f px py 1 X 0 Y 0 Z 0 1 Principal point offset px fX Zp x f py fY Zp x x KI | 0fXcam Z 1 f K f X 0 Y 0 Z 0 1 px p y calibration matrix 1 Camera rotation and translation Points in space are usually expressed in terms of world coordinate frame, i.e. Euclidean ~ X Inhomogeneous vector in world coordinate ~ C Coordinates of camera center in world coord X camInhomogeneous 3 vector in camera coord. Xcam ~ ~ R X-C X ~ ~ R - RC Y R - RC X cam X 1 1 Z 0 0 General mapping for pinhole camera 1 ~ x KI | 0Xcam x KR I | -C X ~ x = PX P KR | t t -RC 9 deg of freedom: f, px,py,3 rot, 3 trans CCD camera Pinhole camera model assumes image coordinates are Euclidean coordinates with equal scales in both axial directions; CCD cameras does not have square pixels p x f mx x KK my y p y 11 f px py 1 mx is the number of pixels per unit distance in image coordinates in the x direction my 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 directions 10 degrees of freedom for CCD camera When is skew non-zero? x s K x px p y 1 arctan(1/s) 1 g for CCD/CMOS, always s=0 Example of skew: negative enlarging General projective camera x s K x ~ P KR I | C px p y 1 11 dof (5+3+3) non-singular P KR | t intrinsic camera parameters extrinsic camera parameters Camera parameters A 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” X Y ΠX Z 1 The projection matrix models the cumulative effect of all parameters Useful to decompose into a series of operations Projection equation • • sx * * * * x sy * * * * s * * * * identity matrix fsx 0 0 0 fsy 0 intrinsics • x'c 1 0 0 0 R y'c 0 1 0 0 3x 3 0 0 0 1 0 1 1x 3 projection rotation 0 3x1I 3x 3 1 01x 3 1 T 3x1 translation The definitions of these parameters are not completely standardized – especially intrinsics—varies from one book to another Projection matrices for Orhographic and scaled orthographic projections Orthographic projection r1T t1 P r1T t 2 (5dof) 0 1 Scaled orthographic projection r1T t1 P r1T t 2 0 1 / k (6dof) Radial distortion • Due to spherical lenses (cheap) • Model: R R x ( x, y ) (1 K1 ( x 2 y 2 ) K 2 ( x 4 y 4 ) ...) y straight lines are not straight anymore http://foto.hut.fi/opetus/260/luennot/11/atkinson_6-11_radial_distortion_zoom_lenses.jpg Camera model Relation between pixels and rays in space ? Projector model Relation between pixels and rays in space (dual of camera) ? Affine cameras Track back while zooming in Keep object of interest same size