Create Presentation
Download Presentation

Download Presentation
## Cameras & Projections

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -

**Cameras & Projections**Dan Witzner Hansen**Outline**• Previously??? • Projections • Pinhole cameras**Picture Plane**Objects in World Space What Are Projections? • Our 3-D scenes are all specified in 3-D world coordinates • To display these we need to generate a 2-D image - project objects onto a picture plane • So how do we figure out these projections?**Types Of Projections**• There are two broad classes of projections: • Parallel: Typically used for architectural and engineering drawings • Perspective: Realistic looking and used in computer graphics / Computer vision Parallel Projection Perspective Projection**Examples of Parallel Projections**Orthographic Projection Isometric Projection**Isometric Projections**• Isometric projections have been used in computer games from the very early days of the industry up to today Q*Bert Sim City Virtual Magic Kingdom**Perspective Projections**Perspective projections are much more realistic than parallel projections**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**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**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)**Adding a lens**• A lens focuses light onto the film • There is a specific distance at which objects are “in focus”**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 )**“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**Pinhole size / aperture**How does the size of the aperture affect the image we’d get? Larger Smaller**Lens and defocus**Image of a point light source Lens’ aperture Camera sensor Lens Point spread function Focal plane**Lens and defocus**Image of a defocused point light source Lens’ aperture Camera sensor Object Lens Point spread function Focal plane**Lens and defocus**Image of a defocused point light source Lens’ aperture Camera sensor Object Lens Point spread function Focal plane**Lens and defocus**Image of a defocused point light source Lens’ aperture Camera sensor Object Lens Point spread function Focal plane**Lens and defocus**Image of a defocused point light source Lens’ aperture Camera sensor Object Lens Point spread function Focal plane**Focus and depth of field**• Depth of field: distance between image planes where blur is tolerable 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 • Pinhole -> infinity 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**Is depth of field a blur?**• Depth of field is NOT a convolution of the image • The circle of confusion varies with depth • There are interesting occlusion effects From Macro Photography**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**(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?**vanishing point v**Vanishing points image plane camera center C line on ground plane • Vanishing point • projection of a point at infinity**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 ? • lis 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**line on ground plane**Vanishing points • Properties • Any two parallel lines have the same vanishing point v • The ray from C through v is parallel to the lines • An image may have more than one vanishing point • in fact every pixel is a potential vanishing point image plane vanishing point v camera center C line on ground plane**Ideal points and line at infinity 1**• Intersection of parallel lines l = (a, b, c) and l’ = (a, b, c’) are parallel lxl’ = (c’ – c)( b, -a, 0)T Ignoring scale, it is a point ( b, -a, 0)T with inhomogeneous coordinates (b/0, -a/0)T**(a,b,0)**-y -z image plane x • Ideal line • l (a, b, 0) – parallel to image plane Ideal points and lines -y (sx,sy,0) x -z image plane • Corresponds to a line in the image (finite coordinates) • goes through image origin (principle point) • Ideal point (“point at infinity”) • p (x, y, 0) – parallel to image plane • It has infinite image coordinates**Ideal points and line at infinity 2**• The points with last coordinate x3 = 0 are known as ideal points, or points at infinity. Note that this set lies on a single line , the line at infinity linf =( 0, 0, 1)T as ( 0,0,1) (x1 , x2 , 0) = 0 A line l=( a, b, c)T intersect the line at infinity in the ideal point ( b, -a, 0)T (b, -a) T represent the line’s direction**Overview transformations**Concurrency, collinearity, order of contact (intersection, tangency, inflection, etc.), cross ratio Projective 8dof Parallellism, ratio of areas, ratio of lengths on parallel lines (e.g midpoints), linear combinations of vectors (centroids). The line at infinity l∞ Affine 6dof Ratios of lengths, angles. The circular points I,J Similarity 4dof Euclidean 3dof lengths, areas.**Equal distance ratios on a line to determine the point at**infinity