3-D Computer Vision CSc 83020 Image Formation and Optics Image Formation & Optics Image: 2D projection of a 3D scene. We need to understand Geometric & Radiometric relations between the scene and its image. Topics: • • • • • Pinhole & Perspective Projection. Image Formation using Lenses. Lens Related Issues. Image Formation in the Eye. Our Visual World. Pinhole & the Perspective Projection (x,y) SCENE Is there an image being formed on the screen? SCREEN Pinhole Camera • “Camera obscura” – known since antiquity Image plane Image Pinhole Object Pinhole camera Perspective Camera From Trucco & Verri r (x,y,z) r’ (X,Y,Z) Center of Projection r =[x,y,z]T r’=[X,Y,Z]T r/f=r’/Z f: effective focal length: distance of image plane from O. x=f * X/Z y=f * Y/Z z=f Magnification From Trucco & Verri (x,y) Center of Projection x/f=X/Z y/f=Y/Z (X,Y,Z) d (x+dx,y+dy) (x+dx)/f=(X+dX)/Z (y+dy)/z=(Y+dY)/Z d’ (X+dX,Y+dY,Z) => dx/f=dX/Z dy/f=dY/Z Magnification From Trucco & Verri (x,y) Center of Projection (X,Y,Z) d d’ (x+dx,y+dy) (X+dX,Y+dY,Z) Magnification: |m|=||d’||/||d||=|f/Z| or m=f/Z m is negative when image is inverted… Magnification • Area(image)/Area(scene)=? • m can be assumed to be CONSTANT if range of scene depth (ΔZ) is much smaller than average scene depth (Z). Implications For Perception* Same size things get smaller, we hardly notice… Parallel lines meet at a point… * A Cartoon Epistemology: http://cns-alumni.bu.edu/~slehar/cartoonepist/cartoonepist.html Vanishing Points (from NALWA) Consequences: Parallel lines meet • There exist vanishing points Marc Pollefeys Vanishing points H VPL VPR VP2 VP1 Different directions correspond to different vanishing points VP3 Marc Pollefeys Question • How many vanishing points are there in an image? 1 2 3 6 100 ∞ Approximations • Linear approximation to perspective equations. • Orthographic: (m=1 => x=X, y=Y). Approximations • Linear approximation to perspective equations. • Weak-Perspective: m is CONSTANT. x=f*X/Z f*X/Zavg (Zavg average distance of points from camera) y=f*Y/Z f*Y/Zavg • Possible when Zavg is much smaller than ΔZ (relative distance of points along the optical axis). Weak-Perspective Cont. From Trucco & Verri OBJECT POINTS Zavg Zavg: average distance of points along the optical axis. Weak Perspective Approximations Para Perspective Ioannis Stamos – CSc 83020 Spring 2007 Pictorial Comparison Weak perspective Perspective Marc Pollefeys Problems with Pinholes • Pinhole size (aperture) must be small. • The smaller the size, the less light goes through. • If pinhole is comparable to wavelength λ of light DIFFRACTION effects blur image. • Pinhole diameter d=2*sqrt(f*λ) for sharp images: If f=50mm and λ=600nm (red light) then d=0.36mm. Pinhole cameras Lenses Used to avoid problems associated with pinholes. Ideal Lens: Same projection, but gathers more light! From Trucco & Verri f: point of convergence of rays that come from infinity. Image plane Thin Lens: Projection optical axis f z Spherical lense surface: Parallel rays are refracted to single point Image plane Thin Lens: Projection optical axis f f z Spherical lense surface: Parallel rays are refracted to single point Thin Lens: Properties 1. Any ray entering a thin lens parallel to the optical axis must go through the focus on other side 2. Any ray entering through the focus on one side will be parallel to the optical axis on the other side Lenses Used to avoid problems associated with pinholes. Ideal Lens: Same projection, but gathers more light! Ray of light From Trucco & Verri Optical Axis Ioannis Stamos – CSc 83020 Spring 2007 Lenses Gaussian Lens Formula for thin lenses: 1/Ž + 1/ž = 1/f Ž=Z+f, ž=z+f f: focal length of lens: ability to bend light Ray of light Optical Axis From Trucco & Verri Example: if f=50mm, Ž=300mm, then image distance ž =60mm. Blur Circle (Defocus) IMAGE PLANE APERTURE Blur Circle w/ diameter b P p d (aperture) OPTICAL AXIS Ž ž ž’ Ž’ Blur Circle (Defocus) IMAGE PLANE APERTURE Blur Circle w/ diameter b P p d OPTICAL AXIS 3D SCENE ž’ Ž’ Blur Circle (Defocus) IMAGE PLANE APERTURE Blur Circle w/ diameter b OPTICAL AXIS 3D SCENE Ž ž ž’ Ž’ Blur Circle (Defocus) IMAGE PLANE APERTURE Blur Circle w/ diameter b P p d (aperture) OPTICAL AXIS Ž ž ž’ Ž’ b=? 1/ ž+1/ Ž=1/f 1/ ž’+1/ Ž’=1/f ž=Ž*f/(Ž-f) ž’=Ž’*f/(Ž’-f) (ž’- ž)=[f/(Ž’-f)]*[f/(Ž-f)]*(Ž- Ž’) Blur Circle Diameter b= | ž’-ž | d / ž’ (from similar triangles) --------------------------------------------------------------------------Depth of Field Range of object distances (Ž- Ž’) over which image is “sufficiently well” focused. i.e. b is less than resolution of imaging sensor. Note that b is proportional to d (aperture). Aperture & DOF d= (From KODAK) Ioannis Stamos – CSc 83020 Spring 2007 Blur Circle (Defocus) IMAGE PLANE APERTURE Blur Circle w/ diameter b P p d (aperture) OPTICAL AXIS Ž ž ž’ Ž’ Ioannis Stamos – CSc 83020 Spring 2007 Focusing • Defocused image can be made focused by: –Moving image plane. –Moving the lens. –Both as a single unit. Ioannis Stamos – CSc 83020 Spring 2007 Two Lens System From Shree Nayar’s notes Ž2 Ž1 ž1 ž2 Magnification: m=x’’/x=(i2/o2)*(i1/o1) Zooming: Varying magnification without moving object or image plane. Example: Move LENS2 to change m and then move LENS1 and LENS2 together to re-focus. ZOOMING=CHANGING EFFECTIVE FOCAL LENGTH Thick Lens From Horn Ioannis Stamos – CSc 83020 Spring 2007 Vignetting From Horn Vignetting Effect: Darkens pixels near the image boundary From Shree Nayar’s notes Ioannis Stamos – CSc 83020 Spring 2007 Distortion magnification/focal length different for different angles of inclination pincushion (tele-photo) barrel (wide-angle) Can be corrected! (if parameters are know) Marc Pollefeys Chromatic Aberration rays of different wavelengths focused in different planes cannot be removed completely Marc Pollefeys Image Formation in the Eye • Optics in the Eye: Iris, Lens, Retina… • Defects in the Eye’s Lens: – Myopia (Near-Sighted) – Hyperopia (Far-Sighted) • Accomodation (Focusing) Ioannis Stamos – CSc 83020 Spring 2007 THE HUMAN EYE! Ioannis Stamos – CSc 83020 Spring 2007 Ioannis Stamos – CSc 83020 Spring 2007 Ioannis Stamos – CSc 83020 Spring 2007 Our Visual World • Image Formation: 3D => 2D – Can we recover 3D Scene from 2D Image? • We live in a special world! – Medium (Air): Transparent & Homogeneous. – Objects: Opaque & Reflective. • We need to recover surfaces, not volumes. • Is one image enough?