Lighting Introduction to Computer Vision CSE 152 Lecture 6 Special light sources Point sources Distant point sources Strip sources Area sources Common to think of lighting at infinity (a function on the sphere, a 2-D space) Completely arbitrary lighting can be represented as a function on the 4-D ray space (radiances) Radiance Irradiance Power traveling at some point How much light is arriving at a in a specified direction, per unit surface? area perpendicular to the Irradiance -- power per unit area: direction of travel, per unit solid angle Units: watts per square meter per steradian : w/(m 2 sr 1 ) θ (θ, φ) dω W/cm 2 Total power arriving at the surface is given by adding irradiance over all incoming angles Camera s sensor Measured pixel intensity is a function of irradiance integrated over pixel s area over a range of wavelengths For some time x da x Bi-directional Reflectance Distribution Function ρ(θ in, φ in ; θ out, φ out ) Function of Incoming light direction: θ in, φ in Outgoing light direction: θ out, φ out Ratio of incident irradiance to emitted radiance BRDF (θ in,φ in ) ^ n (θ out,φ out ) Without shadows Lambertian Surface E(u,v) [ Important: We ll use this a lot ] ^ n At image location (u,v), the intensity of a pixel x(u,v) is: E(u,v) = [a(u,v) ^ n(u,v)] [s 0 ^ s ] where a(u,v) is the albedo of the surface projecting to (u,v). n(u,v) is the direction of the surface normal. s 0 is the light source intensity. ^ s is the direction to the light source. ^ s. a 1
Color Cameras Eye: Three types of Cones Cameras: 1. Prism (with 3 sensors) 2. Filter mosaic 3. Filter wheel The appearance of colors Color appearance is strongly affected by (at least): Spectrum of lighting striking the retina other nearby colors (space) adaptation to previous views (time) state of mind and X3 From Foundations of Vision, Brian Wandell, 1995, via B. Freeman slides 2
Color Afterimage: South African Flag opponent colors Blue -> yellow Red -> green Light Spectrum Color Reflectance Illumination Spectra Measured color spectrum is a function of the spectrum of the illumination and reflectance Blue skylight From Foundations of Vision, Brian Wandell, 1995, via B. Freeman slides Tungsten bulb From Foundations of Vision, Brian Wandell, 1995, via B. Freeman slides 3
Color Matching Not on a computer Screen slide Intro from Computer T. Darrel Vision slide Intro from Computer T. Darrel Vision slide Intro from Computer T. Darrel Vision slide Intro from Computer T. Darrel Vision slide Intro from Computer T. Darrel Vision 4
slideintro from T. Darrel Computer Vision slideintro from T. Darrel Computer Vision slideintro from T. Darrel Computer Vision slideintro from T. Darrel Computer Vision The principle of trichromacy Color receptors Experimental facts: Three primaries will work for most people if we allow subtractive matching Exceptional people can match with two or only one primary. This could be caused by a variety of deficiencies. Most people make the same matches. There are some anomalous trichromats, who use three primaries but make different combinations to match. Red cone Green cone Blue cone Response of k th cone = 5
Color Matching Functions Color spaces Linear color spaces describe colors as linear combinations of primaries Choice of primaries=choice of color matching functions=choice of color space Color matching functions, hence color descriptions, are all within linear transformations RGB: primaries are monochromatic, energies are 645.2nm, 526.3nm, 444.4nm. Color matching functions have negative parts -> some colors can be matched only subtractively. CIE XYZ: Color matching functions are positive everywhere, but primaries are imaginary. Usually draw x, y, where x=x/(x+y+z) y=y/(x+y+z) RGB Color Cube YIQ Model Block of colours for (r, g, b) in the range (0-1). Convenient to have an upper bound on coefficient of each primary. In practice: primaries given by monitor phosphors, lcd filters,etc. (phosphors are the materials on the face of the monitor screen that glow when struck by electrons) CIE xyy (Chromaticity Space) CIE -XYZ and x-y Used by NTSC TV standard Separates Hue & Saturation (I,Q) from Luminance (Y) 6
HSV Hexcone Hue, Saturation, Value AKA: Hue, Saturatation, Intensity (HIS) Metameric Lights (Metamers) Hexagon arises from projection of cube onto plane orthogonal to (R,G,B) = (1,1,1) Blob Tracking for Robot Control Analysis of Binary Images Basic Steps 1. Labeling pixels as foreground/background (0,1). 2. Morphological operators (sometimes) 3. Find pixels corresponding to a region 4. Compute properties of each region Histogram-based Segmentation Select threshold Create binary image: I(x,y) < T O(x,y) = 0 I(x,y) T O(x,y) = 1 [ From Octavia Camps] 7
How do we select a Threshold? Manually determine threshold experimentally. Good when lighting is stable and high contrast. Automatic thresholding P-tile method Mode method Peakiness detection Iterative algorithm P-Tile Method If the size of the object is approx. known, pick T s.t. the area under the histogram corresponds to the size of the object: [ From Octavia Camps] Mode Method Model intensity in each region R i as constant + N(0,σ i ): Example: Image with 3 regions [ From Octavia Camps] [ From Octavia Camps] Finding the peaks and valleys It is a not trivial problem: Peakiness Detection Algorithm Find the two HIGHEST LOCAL MAXIMA at a MINIMUM DISTANCE APART: g i and g j Find lowest point between them: g k Measure peakiness : min(h(g i ),H(g j ))/H(g k ) Find (g i,g j,g k ) with highest peakiness [ From Octavia Camps] [ From Octavia Camps] 8