860 likes | 1.09k Views
Cameras & Projections. Dan Witzner Hansen. Outline. Previously??? Projections Pinhole cameras Perspective projection Camera matrix Camera calibration matrix Ortographic projection. Projection and perspective effects. Camera obscura.
E N D
Cameras & Projections Dan Witzner Hansen
Outline • Previously??? • Projections • Pinhole cameras • Perspective projection • Camera matrix • Camera calibration matrix • Ortographic projection
Camera obscura "Reinerus Gemma-Frisius, observed an eclipse of the sun at Louvain on January 24, 1544, and later he used this illustration of the event in his book De Radio Astronomica et Geometrica, 1545. It is thought to be the first published illustration of a camera obscura..." Hammond, John H., The Camera Obscura, A Chronicle http://www.acmi.net.au/AIC/CAMERA_OBSCURA.html
Pinhole camera Pinhole camera is a simple model to approximate imaging process, perspective projection. Virtual image pinhole If we treat pinhole as a point, only one ray from any given point can enter the camera. Fig from Forsyth and Ponce
Pinhole size / aperture How does the size of the aperture affect the image we’d get? Larger Smaller
Camera obscura Jetty at Margate England, 1898. An attraction in the late 19th century Around 1870s http://brightbytes.com/cosite/collection2.html Adapted from R. Duraiswami
Camera obscura at home http://room-camera-obscura.blogspot.com/ Sketch from http://www.funsci.com/fun3_en/sky/sky.htm
Digital cameras • Film sensor array • Often an array of charged coupled devices • Each CCD is light sensitive diode that converts photons (light energy) to electrons camera CCD array frame grabber optics computer
Color sensing in digital cameras Bayer grid Estimate missing components from neighboring values(demosaicing) Source: Steve Seitz
Lenses • A lens focuses parallel rays onto a single focal point • focal point at a distance f beyond the plane of the lens • f is a function of the shape and index of refraction of the lens • Aperture of diameter D restricts the range of rays • aperture may be on either side of the lens • Lenses are typically spherical (easier to produce) F focal point optical center (Center Of Projection)
“circle of confusion” Adding a lens • A lens focuses light onto the film • There is a specific distance at which objects are “in focus” • other points project to a “circle of confusion” in the image • Changing the shape of the lens changes this distance
Thin lenses • Thin lens equation: • Any object point satisfying this equation is in focus • Thin lens applet: http://www.phy.ntnu.edu.tw/java/Lens/lens_e.html (by Fu-Kwun Hwang )
Focus and depth of field • Depth of field: distance between image planes where blur is tolerable Thin lens: scene points at distinct depths come in focus at different image planes. (Real camera lens systems have greater depth of field.) “circles of confusion” Shapiro and Stockman
Depth of field • Changing the aperture size affects depth of field • A smaller aperture increases the range in which the object is approximately in focus f / 5.6 f / 32 Flower images from Wikipedia http://en.wikipedia.org/wiki/Depth_of_field
Focus and depth of field Image credit: cambridgeincolour.com
Depth from focus Images from same point of view, different camera parameters 3d shape / depth estimates [figs from H. Jin and P. Favaro, 2002]
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) Raphael Durer, 1525
Perspective effects Far away objects appear smaller Forsyth and Ponce
Perspective effects Parallel lines in the scene intersect in the image Converge in image on horizon line Image plane (virtual) pinhole Scene
Field of view Angular measure of portion of 3D space seen by the camera Depends on focal length Images from http://en.wikipedia.org/wiki/Angle_of_view
Principal point offset principal point calibration matrix:
When is skew non-zero? arctan(1/s) g 1 for CCD/CMOS, always s=0 Image from image, s≠0 possible (non coinciding principal axis) resulting camera:
Projection equation • The projection matrix models the cumulative effect of all parameters • Useful to decompose into a series of operations identity matrix intrinsics projection rotation translation 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” • The definitions of these parameters are not completely standardized • especially intrinsics—varies from one book to another
Projection properties • Many-to-one: any points along same ray map to same point in image • Points points • Lines lines (collinearity preserved) • Distances and angles are not preserved • Degenerate cases: – Line through focal point projects to a point. – Plane through focal point projects to line – Plane perpendicular to image plane projects to part of the image.
Example: Homography between world plane Z=0 and image implies Action of projective camera on planes The most general transformation that can occur between a scene plane and an image plane under perspective imaging is a plane projective transformation
Cameras? • We will see more about what information can be gathered from the images using knowledge of planes and calibrated cameras
(x,y,1) image plane The projective plane • Why do we need homogeneous coordinates? • represent points at infinity, homographies, perspective projection, multi-view relationships • What is the geometric intuition? • a point in the image is a ray in projective space -y (sx,sy,s) (0,0,0) x -z • Each point(x,y) on the plane is represented by a ray(sx,sy,s) • all points on the ray are equivalent: (x, y, 1) (sx, sy, s)
A line is a plane of rays through origin • all rays (x,y,z) satisfying: ax + by + cz = 0 l p • A line is also represented as a homogeneous 3-vector l Projective lines What does a line in the image correspond to in projective space?
l1 p l l2 Point and line duality • A line l is a homogeneous 3-vector • It is to every point (ray) p on the line: lp=0 p2 p1 • What is the line l spanned by rays p1 and p2 ? • l is to p1 and p2 l = p1p2 • l is the plane normal • What is the intersection of two lines l1 and l2 ? • p is to l1 and l2 p = l1l2 • Points and lines are dual in projective space • given any formula, can switch the meanings of points and lines to get another formula
(a,b,0) -y -z image plane x • Ideal line • l (a, b, 0) – parallel to image plane Ideal points and lines • Ideal point (“point at infinity”) • p (x, y, 0) – parallel to image plane • It has infinite image coordinates -y (sx,sy,0) x -z image plane • Corresponds to a line in the image (finite coordinates) • goes through image origin (principle point)
Interpreting the Camera matrix Column Vectors p1, p2 p3 are the vanishing points along the X,Y,Z axis P4 is the camera center in world coordinates
Interpreting the Camera matrix Row Vectors P3 is the principal plane containing the camera center is parallel to image plane. P1, P2 are axes planes formed by Y and X axes and camera center.
Moving the camera center motion parallax epipolar line
A 3D Scene • Notice the presence ofthe camera, theprojection plane, and the worldcoordinate axes • Viewing transformations define how to acquire the image on the projection plane
x or y x or y -z -z Canonical View Volume • A standardized viewing volume representation • Parallel (Orthogonal) Perspective x or y = +/- z BackPlane BackPlane 1 FrontPlane FrontPlane -1 -1
Viewing Transformations • Goal: To create a camera-centered view • Camera is at origin • Camera is looking along negative z-axis • Camera’s ‘up’ is aligned with y-axis (what does this mean?)
2 Basic Steps • Step 1: Align the world’s coordinate frame with camera’s by rotation
2 Basic Steps • Step 2: Translate to align world and camera origins
Creating Camera Coordinate Space • Specify a point where the camera is located in world space, the eye point (View Reference Point = VRP) • Specify a point in world space that we wish to become the center of view, the lookat point • Specify a vector in worldspace that we wish to point up in camera image, the up vector (VUP) • Intuitive camera movement
Constructing Viewing Transformation, V • Create a vector from eye-point to lookat-point • Normalize the vector • Desired rotation matrix should map this vector to [0, 0, -1]T Why?
Constructing Viewing Transformation, V • Construct another important vector from the cross product of the lookat-vector and the vup-vector • This vector, when normalized, should align with [1, 0, 0]TWhy?
Constructing Viewing Transformation, V • One more vector to define… • This vector, when normalized, should align with [0, 1, 0]T • Now let’s compose the results