Professional Documents
Culture Documents
Color Discrimination By Computer where [A,,A,] is the visible wavelength range. From (l), the
normalized color at ( x , y ) is given by
GLENN HENLEY
L(A)M(g)C(A) - L(A)C( A)
Abstract-A color space metric that is useful for computer vision is f(x,y,A) =
developed. While there is no shortage of proposed methods for quantifying f 2 L ( A ) M( g ) C ( A ) dA l h 2 L (A)C( A ) dA
how the human eye perceives color differences, it is difficult to apply ti~ese 1 A1
perceptual metrics directly to the color images sensed by a computer vision (3)
system. The metric developed can be applied to images sensed using color
filters (e.g., R . G . B ) as is often done in computer vision. This metric is and we see that f ( x , y, A) does not depend on the geometry g.
defined in terms of the spectral characteristics of the filters and camera In this correspondence, I develop a color metric for computer
and accounts for their noise properties. Ihe metric is designed to respond vision. This metric is intended to quantify the significance of a
to material changes while remaining insensitive to geometric variation in color change in an image. Some work in computer vision has
the scene. The color distance function is derived as an estimate of the been done on developing color metrics for the purpose of detect-
distance between normalized spectral power distributions. Components of ing color edges [16], [17], [19]. None of these proposed metrics,
this distance are weighted to account for sensor noise properties. A color however, consider the underlying properties of the sensors being
metric has several possible uses in a computer vision system. A color used. Similarly all of these techniques are sensitive to geometrical
metric is useful for detecting color edges, classifying intensity edges, and variations in the scene. The most significant advancement of this
estimating color variation within image regions. Ihe usefulness of this correspondence is the development of a color metric that ac-
color metric is demonstrated by evaluating its performance on real images. counts for the spectral properties of the camera and filters and
their noise characteristics and that also is insensitive to geometric
I. INTRODUCTION variations in the scene unless they are accompanied by material
Until recently most work in computer vision has dealt exclu- changes.
sively with images obtained using a single sensor. It is perhaps Based on previous work, it does not seem likely that color edge
for this reason that many of the available algorithms for color detection is a particularly useful step to be taken in computer
images are multidimensional generalizations of algorithms origi- vision. The experiments of Novak and Shafer [17] and Nevatia
nally intended for intensity images, e.g., [I], [7], [HI, [21]. Many [16] have demonstrated that a large majority of detected color
of these generalized algorithms have been effectively applied to edges are also detected as irradiance edges. Interestingly human
real images. It is reasonable to expect, however, that better uses subjects have been unable to bring color edges into focus when
for color information can be obtained by first examining the the color edge does not coincide with a brightness edge [24].
physics that is specific to the formation of color images. In this The color metric of this correspondence is intended to be
spirit, computer vision researchers have recently started develop- applied to regions of an image following the detection of image
ing algorithms that are based on the physics of color image irradiance edges. This is useful for grouping regions correspond-
formation, e.g., [22]. It is only by examining the relevant physics ing to the same material in the scene and for classifying irradi-
that it is possible to say whether color images contain useful ance edges. For example, given an object of a single material that
information that is not present in intensity images and, if so, how is illuminated by a single spectral-power distribution, there will
this information can be reliably extracted. be an irradiance edge, but not a normalized color edge across a
Perhaps the most important advantage of having color infor- surface orientation discontinuity. Similarly a specular irradiance
mation in addition to image irradiance information is that the edge in an image will indicate the presence of an inhomogeneous
normalized color of a surface of one material is more stable dielectric if there is a corresponding normalized color edge [8].
under changes in geometry than the corresponding image irradi- On the other hand a specular irradiance edge without a normal-
ance values. It is shown in [8] that if we are not viewing a ized color edge indicates the presence of a homogeneous material.
high-light on an inhomogeneous dielectric, or if an algorithm is The color metric is also useful for estimating the color variation
used to first remove such highlights [ll], then the spectral power within image regions of continuous image irradiance. This varia-
distribution Z ( x , y , A) of the light incident on the imaging sensor tion has a strong relationship to the material composition of an
can be approximated by object’s surface and may therefore be useful for recognition.
11. COLORSENSING
Z(X,Y,X) =L(A)M(g)C(A) (1)
The properties of light impinging on a sensor plane can be
where x and y indicate coordinates in the image plane, A is characterized by the function Z ( x , y , A) where Z is irradiance, x
wavelength, L(A) is the spectral power distribution of the light and y are spatial coordinates in the image plane, and A is
incident on the imaged surface, and M( g) and C( A) are deter- wavelength. Information about the spectral properties of the
mined by the optical properties of the imaged surface. The incident light can be obtained by using several sensors (e.g., color
parameter g indicates dependence on the photometric geometry. filters) with differing wavelength responses. For the remainder of
Define the normalized color at an image point (x, y ) by this section, I consider a fixed image location ( x o , y o ) and
abbreviate Z( x o , yo, A ) by Z( A).
It has been standard in computer vision to digitize an image of
RGB values using “red,” “green,” and “blue” filters and to refer
to theses RGB values as if they represent something fundamental
about the scene. In reality there are an infinite number of
combinations of filters and cameras that might be used to obtain
RGB values. In general different “red” filters placed in front of
Manuscript received September 20,1988; revised March 30,1989. This work different CCD cameras will give us different R values for the
was supported by AFOSR contract F33615-85-C-5106 and KBV Contract same incident light. In this work, I transform the sensor measure-
AIADS SlO93-S-l(Phase 11). ments into an approximation to the spectral power distribution
The author is with the Robotics Laboratory, Computer Science Dept.,
Stanford University, Stanford. CA 94305. of the light entering the camera. This approximation attempts to
IEEE Log Number 8930338. capture a physical property of the light entering the camera.
Therefore this approximation is somewhat less dependent on the In summary, is the unique approximation to I ( A ) that
actual sensors used than the sensor measurements themselves. lies in the space spanned by the n basis functions b,(A),
Following [lo] and [23], I approximate I(A) as a linear combi- b,( A), . . .,b, - ,( A) and that also satisfies the n c o n s t r a z o f (4).
nation of basis functions. This color recovery method is similar to There are two sources of error in the approximation I(A). The
techniques that express surface reflectance as a linear combina- first source of error is noisy sensor measurements S. The second
tion of basis functions. I believe that expressing surface re- source of error is the possibility that I ( A ) cannot be exactly
flectance using such a linear model was first done bysallstrom represented in the space spanned by the basis functions
[20] and subsequently used by many others, e.g., [3], [4], [12]. In b,(A), b,(A); . -,b,-,(A). The effects of sensor noise are dis-
this correspondence, I consider only approximations to I(A) and cussed in Section V. A discussion of approximation error is not
not approximations to surface spectral reflectance. central to the development of this work, but is included for
Consider approximating the function I ( A ) at a point in an completeness in an appendix.
image. At each image point, we measure the outputs s, of n
sensors. Each sensor has a certain spectral response denoted by 111. A METRIC SPACE FOR NORMALIZED COLOR
the function f; (A). In a typical system, each function f,(A) will
correspond to the product of a color filter transmission function This section develops a normalization procedure for color. The
with the spectral response of the camera. Therefore at each image analysis of this section assumes the recovery of a continuous
function I ( X ) using noiseless sensors. In Section IV, I specialize
point we have the measured values s, (0 < i < n - 1) given by
the analysis to finite dimensional approximations like those re-
covered using the technique of Section 11.
(4) The total power of I ( A ) is given by the L'[A,,A,] norm
d ( m , l 2 ( x ) )= \ / / A 2 [ m - 1 2 ( x ) ] 2 d A .
A1 (13)
, denote the integral in (7). Then k,, is a constant that depends
only on the ith filter function and the j t h basis function. Let S The L2[A,,A,] distance of (13) is used rather than the distance
be the n dimensional vector defined by S = [so, sl; . .,snP1IT. defined by
Let K be the n X rn constant matrix defined by K(i, j)= k,,.
Let A be the rn dimensional vector defined by A =
[U,, a , , . . ., a,,,- ,IT. Then we have the linear system of n equa-
hons because inaccuracies over a small range of A can cause large
deviations of dmm.On the other hand the distance d of (13)
S=KA. (9) depends on the distance between the functions integrated over
If we choose our filters f;(A) and basis functions b,(A) such that the entire spectrum. Therefore the L2[X,,A,] distance will usu-
K has maximal rank, then the n sensor outputs so, s,; . -,s , - ~ ally give a more reliable characterization of the distance between
uniquely determine n components a,, a,, . . ,a, - of I( A). two measured functions than the distance dmm.
Therefore by letting m = n in (9) we can recover an approxima- Although we have not motivated our decision to compute
tion to the function I ( A ) given by distances between functions normalized in L'[A,,A,] using the
_1
L2[A1,h2]metric, functions treated in this way have several
I ( A ) = BT( A) A useful properties. These properties are discussed in [9].
color recovery method of Section 11, however, is only able to The color space distance between Il ( A ) and I,( A ) is given
recover finite-dimensional approximations to these functions.
This section specializes the analysis of Section I11 to finite-di-
mensional approximations that can be recovered using the method
of Section 11.
In general we begin by restricting ourselves to some n dimen- which simplifies because of orthogonality to
sional subset S of C [ A , ,A,]. If S is specified by a set of basis
functions, then the Gram-Schmidt process [5] can be used to
construct an orthonormal basis for S. This orthonormal basis
={-.
d(m,m) O<r<n-l
(24)
From (20) we see that all normalized physical colors have 6,)=
I/&. We can write
- 1
where P , ( A ) is the Legendre polynomial of degree i. The func- I(A)=-+ ci,p,(A).
tions p , (A) are orthonormal in the sense that l<i</1-1
where the t and it are computed as in (20). where L is the n x n covariance matrix of S.
1616 IEEE TRANSACTIONS ON SYSTEMS, MAN, AND CYBERNETICS, VOL. 19, NO. 6,NOVEMBER/DECEMBER 1989
For most real sensors it is reasonable to assume that A has the TABLE I
multivariate normal density given by EXPERIMENTAL RESULTS
Patches d( x lo-')
21-23 0.05
22-23 0.06
Contours of constant density are hyperellipsoids satisfying 21-22 0.09
19-20 0.13
( A - X) k,'( A X)= C
-
20-21
19-21
0.33
0.21
where C is a constant. Thus, from E A we can determine the 19-23 0.47
scatter of the data in any direction. It follows that, in general, 19-22 0.58
'
points in C"- will tend to exhibit greater dispersion in certain 20-23
20-22
0.64
0.16
directions than in others. Thus the euclidean metric for C"-' 1-2 1.30
that is appropriate for noiseless measurements (see Section IV) 9-15 2.82
will be inappropriate for real sensor measurements. This is be- 8-13 3.19
cause directions in C"-' along which sensor noise is amplified
can dominate the euclidean distance of (24). It is desirable to
develop a color metric that can take into account this anisotropic Based on the properties of the Mahalanobis distance, any pair
property of C - ' and thereby produce a distance between two of patches separated by a distance less than D = 1 . 5 X l O - ' is
normalized physical colors that is relatively independent of scat- taken to correspond to patches of the same material. Any pair of
ter due to noise. Define as a color metric the Mahalanobis patches separated by a distance of D or more is taken to
distance [6] given by correspond to patches of different materials. Thus the metric
assigns all pairs of neutral patches (19-23) to the same material
class and also assigns patches 1 (dark skin) and 2 (light skin) to
the same material class. Assigning patches 1 and 2 to the same
where 2, and 2, are normalized colors in C-'. The metric of class is not unreasonable since the corresponding spectral re-
(37) has the effect of normalizing by the variance in each direc- flectance functions differ by only a scalar multiple if one ignores
tion, thus giving a more representative estimate of the physical a small wiggle in the spectral reflectance of patch 2. Such small
distance between, A, and A, than the euclidean distance. We differences are difficult to distinguish" from noise when using
observe that if Z, is unitary, then C"-' is isotropic. As expected broad-band color filters like those used in these experiments.
for this case (37) simplifies to the scaled Euclidean distance. From Table I, we see that the color metric is able to assign to
different material classes patch 9 (moderate red) and patch 15
VI. EXPERIMENTS (red) and also patch 8 (purplish blue) and patch 13 (blue). All
This section gives some experimental results obtained using the other pairs of patches are easily distinguished by the color
metric of (37). The metric has been applied to an image of a color distance function.
chart [14] illuminated by a lamp intended to simulate daylight.
APPENDIX
Four color filters (25,47A,57A,96) are used to obtain informa-
tion over different regions of the visible spectrum. A CCD Given the recovery technique described in Section 11, I exam-
camera having a linear response and equipped with an infrared ine how the choice of the sensors h(A) and the basis functions
blocking filter is used. A set of orthonormal basis b,(A) can affect the quality of the recovered approximation to
functions that span the same space as the sensor functions Z(A). One result is that given an orthonormal system of n basis
fo(X),fi(X),fr(X),f;(X) are used. These basis functions proved functions, it is p o s s i K o choose n sensors such that the recov-
to be the most effective in color discrimination experiments. ered approximation I ( A) is the best least squares approximation
Some theoretical justification for this choice of basis functions is to Z(A) in the space spanned by the n basis functions. By itself
given in the appendix. The matrix Zs is estimated from images of this result is not of great use in practice since given an arbitrary
uniform regions. The filter transmission functions and camera orthonormal system of basis functions it is unlikely that the
response function are taken from manufacturer's specifications. theoretically optimal sensors will be among those that are readily
The chart is made up of 24 matte patches characterized by available. This result however does lead to some insight into the
different spectral reflectance functions. Patches 19-24 are differ- problem of selecting sensors and basis functions in practical
ent neutral grays; the spectral reflectance functions of these situations.
patches differ only by a scalar multiple. From (l),these patches Let q$,(?),$ (A);.-,+,,-'(A) be an orthonormal set of basis
might correspond to a single material illuminated by a single functions in L'[A,, A,]. Then given n sensor measurements S ,
source but viewed under different geometric conditions. We the procedure of Section 11 allows us to recover an approxima-
would like a color metric to identify these patches as correspond- tion I ( A) of the form
ing to the same material. Ideally the color metric should distin-
guish the other 18 patches from each other and from the neutral - c
Z(A)= d,+,(A). (38)
patches. Odidn-1
Average sensor values so, sl, s2,s3 for each patch are computed
CZI
from the image and the distance (37) between each pair of The best approximation I( A) in the least-squares sense is the
patches is evaluated. Patch 24 (the darkest of the neutral grays) is choice of the dj that minimizes
not considered because the signal-to-noise ratio is too low for the
metric to be reliable. Table I lists distances between those pairs
of patches for which distance is smallest. All pairs of patches not
listed have distances exceeding 5.0X lo-,. It is inappropriate to
compare the metric of this correspondence with any of the
previously mentioned metrics because each of the other tech- Equation (4) may be written
niques respond to intensity variation and therefore do not inter-
pret the neutral patches as instances of a single material.
IEEE TRANSACTIONS O N SYSTEMS, MAN, A N D CYBERNETICS, VOL. 19, NO. 6 , NOVEMBER/DECEMBER 1989 1617
where ( - ,.) denotes the L2[A,, A,] inner product. Thus if we I61 R. Duda and P. Hart. Puttern Clussificution and Scene Analysis. New
define York: Wilcy, 1973.
[71 R. Haralick and Ci. Kelly, “Pattern recognition with measurement space
i ( A ) =+((A) i=O,I;.., n-1 (41) and spatial clustering for multiple images,” Proc. IEEE, vol. 57, Apr.,
1969. pp. 654-665.
then we will have G. Healey, “Using color for geometry insensitive segmentation,” J. Opt.
s, = ( + i 9 0. Soc. Amer. A , pp. 920-937. June 1989.
G. Healcy and T. 0. Binford, “The role and use of color in a general
Since the +,( A ) are orthonormal functions, K will be the identity vision system.” Proc. A RPA Imuge Understunding Workshop, Univ. of
matrix. From ( a t h e technique of Section I1 will recover the Southern California, Los Angeles, Feb. 1987, pp. 599-613.
B. K. P. Horn. “Exact reproduction of colored images,” Comput. Vision
- c
approximation I( A)* given by