A METHOD OF, AND APPARATUS FOR, DETERMINING COLOUR

Abstract: A method is disclosed to separate the effect of the ambient lighting from the effects of surface reflectance to better ana­ lyse the surface properties of materials. The method uses the data sensed by a plurality of sensor classes to define a finite dimensional approximation of a surface reflectance function at each image point, and a finite dimensional approximation of the ambient light.

Description: This invention relates to a method of, and apparatus for, determining the spectral reflectance of the surface of an object and the relative spectral power of the ambient light. Consider viewing a scene first in daylight and then under tungsten light. Despite a marked change in the spectral composition of the illuminating light, the human eye sees little change in the colours of objects in the scene. Man's perceptual ability to discount spectral variation of the illuminant and thereby maintain the appearance of object colours is called "colour constancy". The mechanism by which colour constancy is achieved remains the outstanding problem in the analysis of human colour vision. Much work has been performed on modelling human colour preception. In a paper by P. Sallstrom entitled "Colour and Physics Aspects of Human Colour Vision" Institute of Physics Rep. 73-09 (University of Stockholm, Stockholm 1973), the basic features of the physical aspects of human colour vision are outlined. A model for object colour perception is described by G. Buchsbaum in a paper entitled "A Spatial Processor Model for Object Colour Perception" J. Franklin Inst. Vol 310, No. 1 (July 1980). In this paper a model is proposed to determine the surface spectral reflectance of the surface of an illuminated object. To enable this to be done an estimation of the relative spectral power of the ambient light is made. In the calculations for a trichromatic system the ambient light and the spectral reflectance are represented as third order basis sets, in which the ambient light and spectral reflectance are approximated as the weighted sums of three fixed basis functions. Signals from sensors provide an array of sensor responses in which each location in the array contains sensor responses from three independent classes of sensors. The sensor responses at each location in the array are represented by a vector and the spectral reflectance is calculated according to an equation relating the vector of weights of the surface reflectance and the vector of the sensor responses, by a matrix whose entries depend on the ambient light. The matrix entries are then calculated by assuming a fixed internal standard reflectance vector, to enable calculation of the surface spectral reflectance of the object. According to this invention there is provided a method according to claim 1 and an apparatus according to claim 7. In the method and apparatus of the present invention the light reflected from an object under study is sensed and the spectral composition of the ambient light illuminating the object is separately calculated, the surface reflectance of the object then being determined from the sensed and calculated values. The ability to separate the effect of the ambient lighting from the effects of surface reflectance permits the construction of a number of devices that are of value in many different areas, including robotics (computer vision), photography, colour measurement and matching, television, video cameras, video recorders and colour image processing and correction systems. For example, robotics visual systems that wish to use surface spectral reflectance (i.e. colour) to aid in object recognition and identification must be able to effectively discount any variation in the ambient light. In particular, if a robot is to be trained to sort fruit, it must be able to study the fruit under full daylight, cloudy or artificial lighting conditions or a combination of the above, and accurately sort the fruit according to its surface properties such as colour, gloss etc. The present invention provides a method and apparatus which allows a robot a capability for accurately estimating the surface reflectance properties of objects under study, despite incomplete knowledge of the ambient light. A common problem in photography is that different types of film must be used for photography under different lighting conditions. The present invention provides a method of acquiring and/or processing colour images, so that images photographed under one type of ambient light can be reconstructed as though they were shot under a different ambient light, thereby eliminating the need to use different films for different ambient light conditions. Another problem in photography is that different filters must be used by photographers to accommodate different ambient lighting conditions. The present invention provides a method which enables the building of a light meter that can estimate the spectral properties of the ambient light, and use the results to advise photographers what type of colour filter should be used on the camera to properly correct for the film loaded in their camera, or automatically to provide the appropriate colour filter. From this it is possible to incorporate sensors into optical cameras so that proper acquisition, recording, processing, correction and transmission of colour images for television displays, video displays, video recording, and other outputs or displays can be carried out. Another problem involving the perception of surface properties of materials has to do with the use of textile dyes, automobile paints, and the like. It is a common occurrence that different batches of dyes are used to colour textiles, and objects such as car parts are painted using different batches of paint. One aspect of the present invention provides a method and apparatus for analyzing the spectral reflectance properties of different batches of paints and dyes to determine whether they will appear to match well under different ambient lighting conditions. These and other applications depend on the ability to separate the effect of the ambient lighting from the effects of surface reflectance. The method described in the detailed description which follows uses the data sensed by N+1 sensor classes to define a finite dimensional approximation of a surface reflectance function at each image point, and a finite dimensional approximation of the ambient light. The algorithm is able to recover the coefficients that specify these approximations. The fundamental physical components that play a significant role in the surface reflectance sensing method are (a) the ambient light, (b) the surface reflectances, (c) the sensors, and (d) the sensor responses. We describe the ambient light in terms of how much energy is present at each wavelength. We call this function E(λ), where λ represents wavelength of light. We assume the light is uniform across the scene, for the moment, but we show how to relax this assumption later. We describe the surface reflectance in terms of the fraction of the incident light the surface reflects at each wavelength. We call this function S x (λ); where λ represents wavelength of light and x refers to spatial position. We assume that the objects under study are opaque and perfectly diffusing (matte). There are P independent classes (kinds) of sensors in a two-dimensional array. An image of the scene is formed on this array. We refer to the locations of lights, surface reflectances and sensor responses by the position, x, in the sensor array at which each has its effect, and not by their physical location in the scene. Each class is present in sufficient density in the sensor array to adequately recover the image from the samples taken by the sensors. We describe the sensor spectral sensitivity in terms of the fraction of incident light at each wavelength that is absorbed by the sensor. We call this function R k (λ) for the k th class of sensor. The ambient light reflected from a surface will cause a strength of response in the k th class of sensor, at position x, according to We assume that there are P classes of sensor, and we represent the responses of all the sensors at location x by a vector, We use two approximating formulas as used by Buchsbaum, one to simplify the description of the ambient light and a second to simplify the description of the surface reflectance. These are These approximating formulas permit us to characterize the light by the vector of weights ε = (ε l . . . ε M ) and the surface reflectance at a point, x in the sensor array, by the vector of weights The relationship between the characterization of the surface reflectance, σ x , and the sensor responses, ρ x = (ρ x / l . . . ρ x / p) can be described by a matrix equation of the form ρ x = Λ ε σ x where ρ x and σ x are vectors, and Λ ε is a matrix whose entries depend only on the ambient light. Our algorithm describes a method for recovering the surface reflectance vectors, σ x , and the lighting matrix, Λ ε , given only the sensor data information, ρ x . By recovery we mean specifically that in each region of the scene over which the ambient light is approximately uniform, we recover the light vector, ε, except for an unknown multiplier, a, and correspondingly we recover estimates of the surface reflectance vectors up to the inverse of this unknown multiplier, l / aσ x . Our recovery procedure specifies the relative spectral energy distribution of the ambient light, aE(λ) and a corresponding set of reflectance functions l / aS x (λ). We require that there be at least as many sensor classes P, as there are degrees of freedom in the ambient light approximation (M). We require that there be more classes of sensors, P, than there are degrees of freedom in the surface reflectance approximation (N). The invention will now be described by way of example with reference to the drawings, in which: Figure 1 illustrates the energy spectrum of light radiated from a known light source; Figure 2 illustrates the surface reflectance of a material at different wavelengths; and Figure 3 comprises a block diagram of the elements of an exemplary system incorporating the present invention. A description of the physical environment and its relation to the perception of color gives insight into the problem and the novel method disclosed herein to solve it. The objective of the method is to independently determine the ambient light in the scene under examination, then the surface reflectance of the objects. Figure 1 is a plot of the relative spectral energy distribution of a typical daylight, E(λ). Figure 2 is a plot of the spectral reflectance (i.e., [S(λ)] tendency to reflect light at different wavelengths) of a particular substance, gold. The light reaching the eye from each object in the scene is then simply E(λ)S x (λ) where the superscript x refers to the location on the sensor array, and the values are derived from the curves of Figures 1 and 2. The initial stage of color vision is the absorption of light by photoreceptors in the eye or optical sensor. Each kind of photoreceptor or sensor has a spectral sensitivity R to each wavelength of light and behaves essentially as a linear system. Different sensors will have a tendency to absorb different wavelengths at different parts of the physical spectrum. The excitation recorded by a photoreceptor of the k'th class is then For example, it is generally accepted that the human eye contains four distinct photoreceptors, three of which are active in daylight (photopic) vision. At each location x, then, the information concerning color is reduced to three numbers, the excitations or "quantum catches" of the three photoreceptor classes at each location. These three numbers are determined by both the spectral distribution of the ambient light E(λ) and the spectral reflectance S x (λ) of objects at each location. The problem of the surface spectral reflectance estimation may be put as follows. The spectral reflectance at each location S x (λ) is unknown. At each location, we measure the P quantum catches ρ x / k. We must develop a procedure that estimates the surface reflectance at each sensor array location, x, when the ambient light is unknown. If the ambient light E(λ) never varied, then the quantum catches at each location (or some function of the quantum catches) could serve as an estimate. But the same surface may give rise to very different quantum catches under different ambient lights. Intuitively the gist of our procedure can be understood as follows. After sampling s surfaces, sP values are known from the left hand side of the matrix equation. But sN+M values are unknown on the right hand side of the equation. The number of unknowns always exceeds the number of knowns when P is less than or equal to N. The underdeterminancy can be resolved if one uses at least P=N+1 linearly independent sensors to spectrally sample the image at each location. In this case, s(N+1) values are obtained on the left hand side of the equation so that after sampling at M independent locations or more, the equations become overdetermined and can be solved for both ε and σ x . Therefore, N+1 sensor classes will permit recovery of both the lighting parameters, ε, and the surface reflectance parameters, σ x , at each location. The algorithm to accomplish the solution may be implemented as follows: Step 1: Input the sensor data, ρ x , from N+1 or more sensors at each spatial location. The possible set of data values are completely described by these P-dimensional vectors. Step 2: If the finite-dimensional approximating formulas are precisely correct, then the observed data will fall within an N-dimensional subspace of the P-dimensional sensor space. An example of a subspace is the following: suppose there are P=3 sensors and N=2 terms used to describe the surface reflectance function. Then the sensor data will cluster about a plane passing through the origin in the 3-space. We compute the N-dimensional subspace that best contains all of the observed data. The best-fitting N-dimensional subspace can be obtained in many ways. We use a variant on a principal components decomposition of the sensor data. The first N principal components determine subspace desired. Step 3: Knowledge of the axes that define the subspace defines a set of linear equations from which it is possible to compute the vector ε that describes the light that would generate data restricted to the best-fitting subspace, based on the approximation Step 4: Use the estimated ambient light vector to compute the values of the matrix Λ ε that maps the vector representation of surfaces (σ x ) into sensor data (ρ x ), using the approximation Step 5: Given the values of the matrix, Λ ε , solve the linear equations in Step 4 to recover the surface reflectance σ x from the sensor data ρ x at each location, i.e., ρ x = Λ ε σ x Actual software written to implement this invention is incorporated herein as Appendix A. The software is written to run under the S software system. S is a software system that runs under Bell Laboratories UNIX operating system on a variety of hardware configurations. S runs primarily on VAX computers made by the Digital Equipment Corporation; the code in Appendix A is written for such a computer, specifically a DEC VAX/780, running the 4.2BSD UNIX operating system. S is available through AT&T Technology. The number of parameters required to have adequate models of ambient lights and surfaces may often be rather small. What data is available concerning spectral reflectances suggests that only a small number of parameters are needed to model most naturally occurring spectral reflectances. Recall that the number of sensors needed to capture N components of reflectance is at least N+1. We take the fact that biological systems have evolved with a rather small number of sensors as an indication that the number of degrees of freedom required to adequately represent spectral reflectance functions may also be quite small. In many natural images, the spectral composition of the illuminant varies with spatial location. The computation above can be extended in a straightforward manner to the problem of estimating and discounting a slowly-varying (spatial lowpass) ambient light. For such images, in each local region the ambient light is approximately constant. The algorithm may thus be applied to each such local region of the image. The new formulation also specifies how to construct automatic sensor systems capable of discounting spectral fluctuations in the ambient lighting. Using the analysis provided here the design of such systems can be specially tailored to working environments where the range of surfaces and lights may be measured before sensing begins. A block diagram of an illustrative system incorporating the present invention appears in Figure 3. An array of sensors 10 is provided facing the object surfaces to be examined. At least one more sensor class need be provided than there are degrees of freedom in the surface reflectance elements to be examined. As discussed above, sensors might include a camera with N+1 sensors responsive to every point of interest on the object; N+1 emulsions on film; or other types of (N+1) sensor arrays. The collected data (ρ x ) is processed 12 to develop the values of σ x (surface reflectance) and ε x (ambient light) needed to define every point on the surface in terms of both the surface spectral reflectance and the ambient light at each point on the object surface. With this information it is then possible, using the conventional techniques of color science, to compute 14 the CIE (Committee Internationale d'Eclairage) color tri-stimulus coordinates that should be output on the display device 16 at each point. From the knowledge of these values, we may compute exactly what should be displayed on a wide variety of color display media or printing devices or systems. The method of converting from our parameter estimates to display coordinates has two steps: first, we describe how to compute the standard CIE color coordinates. Then we describe the relationship between these coordinates and various common displays. The values of the surface reflectance vector σ x permit us to estimate the surface spectral reflectance at an array point x by Similarly the vector ε defines an estimate of the ambient light, To compute the value of X in the CIE tri-stimulus color coordinate system, often called the X, Y, Z system, we need only to perform the following numerical integration: A precisely parallel computation, substituting y(λ) and z(λ), be made to compute Y and Z. The functions E and S are estimated by our procedure. The functions x(λ), y(λ), z(λ) are defined by the CIE and their values are widely available. Table 3.2 in Wyszecki and Stiles (1967, Color Science published by John Wiley & Sons), incorporated herein by reference, contains the values of these functions. The values X, Y, Z precisely determine the desired output color for any particular device in terms of an agreed upon international color standard devised by the CIE. In order to specify the exact values required for some particular display device, it is only necessary to translate CIE color coordinates into device dependent coordinates. For example, the color coordinate system defined by the United States National Television Standards Committee (NTSC) is called the Y,I,Q system. In order to drive a color television monitor 16 one can use a simple set of linear formulas, equivalent to a matrix multiplication, that converts X,Y,Z to Y,I,Q: given these values, it is well known in the art how to make the necessary conversions 14 to drive the television guns to display each point x on the television screen 16. The relationship between the values of Y,I,Q and X,Y,Z are specified by the matrix equation Y=0.0X + 1.0Y + 0.0Z I=1.407X - 0.842Y - 0.451Z Q =0.932X + 1.189Y + 0.233Z A table of conversions that are common between various color representations, including the values to convert from X,Y,Z coordinate system to Y,I,Q we have just described, from Pratt's widely used book entitled, Digital Image Processing , (John Wiley & Sons, 1978) is incorporated herein by reference. Procedures exist for converting from X,Y,Z specifications to any conventional device used in color display technology, such as film, video recorders, etc. Because our algorithm estimates both the surface spectral reflectance and the ambient light, it allows the user great flexibility during image display in any of these media. The user may represent the results veridically, by using only the actually estimated values to determine the actual display values. Alternatively, the user may wish to display the results as if they were measured under conditions that did not exist at the time of image acquisition. To accomplish this the user may display the colors using a light, E(λ), that is different from the actually obtained estimate of ε. The resulting display will have the appearance of being acquired under the assumed ambient light conditions, which may be quite different from the conditions under which the image was actually obtained. For example, if the image was acquired under diffuse tungsten light, the procedure permits a reconstruction of the image as if the image had been acquired under diffuse fluorescent light, sunlight, or any other desired ambient light.

Claims: A method of processing with a computer the image of an illuminated object, comprising the steps of receiving signals from a plurality P of independent kinds of sensors to provide an array of sensor responses, each location x in said array containing sensor responses from the plurality P of independent kinds of sensors, wherein all the sensor responses at an array location x are represented by a vector ρ x ; approximating the surface spectral reflectance S(λ) of the surface of said object and the relative spectral energy E(λ) of the ambient light by respective weight vectors σ x , ε having N and M components respectively denoting degrees of freedom of the respective approximations; and calculating the surface reflectance S x (λ) measured at each array location x according to an equation relating the vector σ x of weights of the surface reflectance for each array location x, and the vector ρ x of the sensor responses for each array location x, by a matrix Λε whose entries depend on the ambient light; characterized in that said array contains responses from at least M and at least N+1 independent kinds of sensors, such that said equation becomes overdetermined allowing an estimation of said matrix entries. A method as claimed in Claim 1, wherein the surface spectral reflectance S x (λ) at an array location x is calculated from the sensor response by the equation the responses of all said sensors (P = 1 to N+1) being represented by said vector ρ x where ρ x =(ρ x ₁ . . . ρ x p ) the term E(λ) representing the energy at each wavelength λ illuminating the object; the term S x (λ) representing said surface spectral reflectance at each wavelength λ for a spatial location x in said sensor array; the term R k (λ) representing spectral sensitivity of each of said sensor kinds k in terms of the fraction of light incident upon each said sensor that is absorbed by the sensor at each wavelength λ; the term ρ x / k representing the response of the sensor kind k at an array location x. A method as claimed in Claim 1 or Claim 2 wherein the energy of ambient light E(λ) is expressed in terms of a weighted sum of fixed basis illuminants E i (λ), wherein and ε = (ε ₁....ε M ). A method as claimed in any preceding claim, wherein the surface reflectance S x (λ) of the object at an array location x is expressed as a weighted sum of basis spectral reflectance functions S i (λ) and A method as claimed in any preceding claim wherein an N dimensional subspace of a P dimensional sensor space is calculated that best fits the observed data ρ x , and a vector ε of weights of the ambient light E(λ) is calculated using the co-ordinates of the axes of said N dimensional subspace. A method as claimed in any preceding claim wherein co-ordinates X, Y and Z of a desired tricolour image are generated from the calculated surface spectral reflectance according to the equation where the Y and Z co-ordinates are similarly calculated by substituting y(λ) and z(λ) respectively for x(λ) and the functions x(λ), and y(λ) and z(λ) are CIE defined. Apparatus for processing with a computer the image of an illuminated object comprising means to approximate the surface spectral reflectance S(λ) of said object and the relative spectral energy E(λ) of the ambient light by respective weight vectors σ x , ε having N and M components respectively denoting degrees of freedom of the respective approximations; a plurality P of independent kinds of sensors providing an array of signals, each location x in said array containing signals from the plurality P of independent kinds of sensors, wherein all the signals at an array location are represented by a vector ρ x ; and means for calculating the surface reflectance S x (λ) measured at each array location x according to an equation relating the vector σ x of weights of the surface reflectance for each array location x, and the vector ρ x of the sensor responses at each array location x, by a matrix Λε whose entries depend on the ambient light; characterised by at least M and at least N+1 independent kinds of sensors providing signals for each location x of said array; and means to estimate said matrix entries using said array signals. Apparatus as claimed in Claim 7, wherein said plurality P of independent kinds of sensors are arranged at each location in a sensor array. Apparatus as claimed in Claim 7 or Claim 8, wherein the means for calculating comprising means for analyzing the sensor response at a location x according to the equation the responses of all said sensors (P = 1 to N+1) being represented by said vector ρ x where ρ x = (ρ x ₁ . . . ρ x p ) the term E(λ) representing the energy at each wavelength λ illuminating the object; the term S x (λ) representing said surface spectral reflectance at each wavelength λ for a spatial location x in said sensor array; the term R k (λ) representing spectral sensitivity of each of said sensor kinds k in terms of the fraction of light incident upon each said sensor that is absorbed by the sensor at each wavelength λ; the term ρ x / k representing the response of the sensor kind k at an array location x. Apparatus as claimed in any of Claims 7 to 9, wherein the means for approximating the energy of ambient light E(λ) in terms of the weighted sum of fixed basis functions is operative to approximate the ambient light E(λ) according to where ε = (ε₁ ....ε M ) and E i (λ) represents the fixed basis illuminance and ε i the weighting function. Apparatus as claimed in any of Claims 7 to 10, wherein the means for approximating the surface reflectance of the object at an array location x as a weighted sum of fixed basis functions is operative to approximate the spectral reflectance S x (λ) at an array point x according to where and S x / i (λ) represents the basis spectral reflectance function and σ x / i the weighting function. Apparatus as claimed in any of Claims 7 to 11 wherein said means to estimate said matrix entries is operative to calculate an N dimensional subspace of a P dimensional sensor space to best fit the observed data ρ x , and operative to calculate a vector ε of weights of the ambient light using the co-ordinates of the axes of said N dimensional subspace. An apparatus as in any of Claims 7 to 12 including means for operating on said calculated surface spectral reflectance and said estimated ambient light to generate a co-ordinates X, Y and Z of a desired tricolour image for output to a display device according to the relation the Y and Z co-ordinates being calculated by the same relationship, substituting y(λ) and z(λ) respectively for x(λ) and the function x(λ) y(λ) and y(λ) are CIE defined.

Inventors: MALONEY, LAURENCE T., WANDELL, BRIAN A.
Applicants: THE BOARD OF TRUSTEES OF THE LELAND STANFORD JUNIOR UNIVERSITY
Application year: 1985
Main classification: G01J3
IPC codes: G03F3, G01J3