Chapter 9 Shading
Total Page:16
File Type:pdf, Size:1020Kb
Chapter 9 Shading This chapter covers the physics of how light reflects from surfaces and de- scribes a method called photometric stereo for estimating the shape of sur- faces using the reflectance properties. Before covering PAhotometricstereo and shape from shading, we must explain the physics of image formation. Imaging is the process that maps light intensities from points in a scene onto an image plane. The presentation followsthe pioneering work of Horn [109]. 9.1 Image Irradiance The projections explained in Section 1.4 determine the location on the image plane of a scene point, but do not determine the image intensity of the point. Image intensity is determined by the physics of imaging, covered in this section. The proper term for image intensity is image irradiance, but terms such as intensity, brightness, or gray value are so common that they have been used as synonyms for image irradiance throughout this text. The image irradiance of a point in the image plane is defined to be the power per unit area of radiant energy falling on the image plane. Radiance is outgoing energy; irradiance is incoming energy. The irradiance at a point in the image plane E(x', y') is determined by the amount of energy radiated by the corresponding point in the scene L(x, y, z) in the direction of the image point: E(x', y') = L(x, y, z). (9.1) The scene point (x, y, z) lies on the ray from the center of projection through 257 258 CHAPTER 9. SHADING image point (x', y'). To find the source of image irradiance, we have to trace the ray back to the surface patch from which the ray was emitted and understand how the light from scene illumination is reflected by a surface patch. Two factors determine the radiance reflected by a patch of scene surface: . The illumination falling on the patch of scene surface . The fraction of the incident illumination that is reflected by the surface patch. The amount of illumination falling on a particular surface patch is deter- mined by the position of the surface patch relative to the distribution of the light sources in the scene. The fraction of the incident illumination that is reflected by the surface patch in a particular direction depends on the optical properties of the surface material. Consider an infinitesimal patch of surface in a scene that is illuminated with a single point light source. Establish a coordinate system on the surface patch as shown in Figure 9.1. The coordinate system represents the hemi- sphere of possible directions from which energy can arrive or depart from the surface. Let ((}i,(Pi)denote the direction, in polar coordinates relative to the surface patch, of the point source of scene illumination and let ((}e,<Pe)denote the direction in which energy from the surface patch is emitted. The energy arriving at the surface patch from a particular direction is E((}i, <Pi)and the energy radiated in a particular direction from the surface patch is L((}e,<Pe). The ratio of the amount of energy radiated from the surface patch in some direction to the amount of energy arriving at the surface patch from some direction is the bidirectional reflectance distribution function. The radiance is determined from the irradiance by (9.2) where f( (}i, <Pi,(}e,<Pe) is the bidirectional reflectance distribution function, called the BRDF for short. The BRDF depends on the optical properties of the surface material. This is the general formulation and can be very complicated, but in most cases of interest in machine vision, the effects are fairly simple. For most materials, the BRDF depends only on the difference between the incident and emitted angles: (9.3) 9.1. IMAGE IRRADIANCE 259 n Figure 9.1: A polar coordinate system is established on an infinitesimal patch of surface to describe the directions of illumination and radiance in the hemi- sphere of directions visible from the surface patch. 9.1.1 Illumination The radiance emitted from a surface patch can be calculated given the bidi- rectional reflectance distribution function (BRDF) for the surface material and the distribution of light sources. Two types of illumination will be cov- ered: . Point light source . Uniform light source First, the general formula for computing the total irradiance on a surface patch from a general distribution of light sources will be presented. The co- ordinate system is the polar coordinate system for the hemisphere of possible directions as diagrammed in Figure 9.1. The total irradiance on a surface patch is the sum of the contributions arriving at the surface patch from all of the directions in the hemisphere. Each small contribution of irradiance pass- ing through a patch of the unit hemisphere must be counted in such a way that the total area of the hemisphere is used. A given section of the hemi- sphere with angular increments Deiand 8(h covers an area of the hemisphere 8w called the solid angle: (9.4) 260 CHAPTER 9. SHADING The sin fJiterm accounts for the effect that the area of the portion of the hemisphere 8fJi84>iis smaller near the top of the hemisphere. The area of a sphere of radius r is 471"r2,so the area of a hemisphere with unit radius is 271". The area S of the hemisphere can be obtained by adding up the solid angles that comprise the hemisphere: (9.5) S = 120 dw (9.6) - 1/2120 0 sin fJdfJd4> - 271"1/20 sin fJdfJ (9.7) - 271"[- cosfJ]/2 (9.8) - 271". (9.9) Without the sin fJfactor in Equation 9.4, the individual infinitesimal pieces of hemisphere would not add up to the correct total area. The total radiance passing through the sphere is the sum of the infinitesimal patches of sphere weighted by the amount of radiance per unit solid angle passing through each patch. Let I(fJi, 4>i)be the radiance per unit solid anglepassing through the hemisphere from the direction (fJi,4>i)' The total irradiance of the surface patch is r2~ r/2 10= 10 10 I(fJi,4>i)sinfJicosfJidfJid4>i, (9.10) where the additional cosfJiterm is needed because the surface patch appears smaller from the direction of illumination due to foreshortening. The amount of radiance reflected from the surface patch is (9.11) With the assumption that scene radiance is equal to image irradiance, the image irradiance at position (x', y') in the image plane is equal to the radiance from the corresponding surface patch in the scene: E(x', y') = L(x, y,z) (9.12) - L(fJe,4>e), (9.13) 9.1. IMAGE IRRADIANCE 261 where the angles of emittance of the scene radiance are determined from the geometry of the scene surfaces. Note that for each image position (x', y/), the corresponding scene position (x, y, z) can be calculated, as well as the surface normal f1for the surface patch and the angle (Oe,<Pe)of the ray from the surface patch to the point (x', y/) in the image plane, in polar coordinates relative to the surface normal or the surface patch. To determine the irradiance of the entire image from the geometry of surfaces in the scene and the arrangement of light sources, it is necessary to know the BRDF for the scene surfaces. This is the subject of the next section. 9.1.2 Reflectance Several different types of reflectance will be covered: . Lambertian reflectance (also called diffuse reflectance) . Specular reflectance . Combinations of Lambertian and specular reflectance . Reflectance in scanning electron microscopy Lambertian Reflectance A Lambertian surface appears equally bright from all viewing directions for a fixed distribution of illumination and a Lambertian surface does not ab- sorb any incident illumination. Lambertian reflectance is also called diffuse reflectance since a Lambertian surface takes the incident illumination, what- ever the distribution of illumination may be, and distributes all of the incident illumination in all surface directions such that the same amount of energy is seen from any direction. Note that this is not the same as saying that the surface emits energy equally in all directions, as will be explained in Sec- tion 9.3.2. Many matte surfaces are approximately Lambertian, and many surfaces, with the exceptions noted below, are qualitatively Lambertian. The BRDF for a Lambertian surface is a constant: (9.14) 262 CHAPTER 9. SHADING The radiance is independent of the emitted direction and is obtained by summing the effect of the BRDF on the incident illumination coming from the hemisphere of possible directions: (9.15) (9.16) (9.17) where 10 is the total incident illumination on the surface patch. What is the perceived brightness of a Lambertian surface that is illumi- nated by a distant point source? The illumination from a point surface in a direction (Os,<Ps)relative to the normalof a surface patch is describedby (9.18) where 10is the total illumination. Essentially, the D-functions merely restrict the directions from which illumination arrives at the surface patch to the single direction (Os,<Ps).Equation 9.18 has a sine term in the denominator so that when it is plugged into Equation 9.10, the total illumination comes out to be 10. Now plug the illumination function from Equation 9.18 and the BRDF from Equation 9.14 into Equation 9.11 for the radiance from the surface patch to get the equation for the perceived brightness: This is the Lambert cosine law, which says that the perceived brightness of a surface patch illuminated by a point source varies with the incident angle relative to the surface normal of the patch.