Sie sind auf Seite 1von 6

Journal of Food Engineering 61 (2004) 137–142

www.elsevier.com/locate/jfoodeng

A simple digital imaging method for measuring and analyzing


color of food surfaces
a,* b
Kit L. Yam , Spyridon E. Papadakis
a
Department of Food Science, Rutgers University, 65 Dudley Road, New Brunswick, NJ 08901-8520, USA
b
Department of Food Technology, TEI of Athens, Ag. Spyridonos Strasse, 122 10 Egaleo, Athens, Greece
Received 7 May 2002; accepted 14 May 2003

Abstract
This paper presents a simple method that uses a combination of digital camera, computer, and graphics software to measure and
analyze the surface color of food products. The method has also the advantages of being versatile and affordable. The images of the
food products can be displayed on computer screen or printed on paper for qualitative analysis of color and structure. Quantitative
information such as color distribution and averages (in terms of L , a and b values) can also be determined readily.
 2003 Elsevier Ltd. All rights reserved.

Keywords: Color measurement; Color analysis; Adobe Photoshop; Digital camera

1. Introduction poses. Commercial microscopy imaging systems with


sophisticated image and color analysis capabilities are
In food engineering research, it is often necessary to also available, but they are not suitable for analyzing the
analyze the surface color of food samples both qualita- color of larger food objects such as pizza and bread.
tively and quantitatively. Qualitative analysis may in- In university research laboratories, computer vision
volve visual inspection and comparison of the food systems have been developed for product quality in-
samples. Quantitative analysis may involve obtaining spection and grading. Studies were carried out to ana-
color distribution and averages. An attempt may also be lyze visual characteristics of products ranging from
made to correlate color distribution with other data fruits and vegetables (for example color inspection of
such as temperature and moisture content distributions. apples and potatoes, Tao, Heinemann, Varghese, Mor-
The correlation is not presented here since the main row, & Sommer, 1995; sorting of bell peppers based on
purpose of this paper is to describe a color measurement color, Shearer & Payne, 1990), nuts, grains, meats (for
method, and exploring the correlation is a complicated example degree of marbling and color of steaks, Gerr-
task that is better dealt in another paper. ard, Gao, & Tan, 1996) and shellfish to prepared foods
Most commercial color measurement instruments are like cheese, bakery products (for example color of
not well suited for food engineering research, because muffins, Zaid Abdullah, Abdul Aziz, & Dos-Mohamed,
they are designed mainly for quality control. Since those 2000), pasta and rice dishes for component composition
instruments can only provide average values, it would be (Locht, Thomsen, & Mikkelsen, 1997), confectionery
rather difficult and time-consuming if they were used for and beer. The use of computer vision technology for
point-by-point measurement at many locations to ob- food analysis was reviewed by Gunasekaran (1996) and
tain color distribution. Moreover, some of these in- Brosnan and Sun (2002). Most of the computer vision
struments require the food sample to be homogenized systems described in the literature employed specialized
using a blender or grinder to achieve uniform color. The equipment or algorithms that are not easily accessible to
blending or grinding not only takes time, but also ren- most researchers.
ders the food sample no longer useable for other pur- This paper presents a simple method that uses a
digital camera to measure color, and the graphics soft-
*
Corresponding author. Tel.: +1-732-932-9611x241; fax: +1-732-
ware Photoshop (Adobe Systems Incorporated, San
932-6776. Jose, CA) to analyze color. The term ‘‘measure’’ means
E-mail address: yam@aesop.rutgers.edu (K.L. Yam). that the digital camera is used to obtain the color values
0260-8774/$ - see front matter  2003 Elsevier Ltd. All rights reserved.
doi:10.1016/S0260-8774(03)00195-X
138 K.L. Yam, S.E. Papadakis / Journal of Food Engineering 61 (2004) 137–142

of the pixels on the food surface. The term ‘‘analyze’’ ponent (from green to red) and the b component (from
means that Photoshop is used to manipulate those color blue to yellow). The L a b color is device independent,
values to obtain color distribution, averages, and so on. providing consistent color regardless of the input or
In this digital imaging method, the required equipment output device such as digital camera, scanner, monitor,
and software costs are low, the experimental setup and and printer. The L a b values are often used in food
operating are simple, and the measurements and ana- research studies.
lysis are often adequately sophisticated for food engi- It is important to reiterate that the RGB and CMYK
neering research. The application of the method to models are device dependent. For example, the food
analyze the color of microwaved pizza is illustrated. The image appears darker on a Windows system than on a
principles of color measurement can be found elsewhere Mac OS computer, because the standard RGB color
(Clydesdale, 1978; Francis, 1994; Francis & Clydesdale, space is darker in Windows than in Mac OS (Adobe
1975; Hunt, 1991). Systems, 2002). Also, the RGB and CMYK gamuts are
smaller than the L a b gamut, and thus there are out-of-
gamut colors that cannot be display on-screen or printed.
2. Color models

Three color models are used to define color in this 3. Measuring color
paper: the RGB (red, green, and blue) model, the
CMYK (cyan, magenta, yellow, black) model, and the A high-resolution digital camera (2 mega-pixel or
L a b model. Among them, the L a b model has above) is used to measure color by capturing the color
the largest gamut encompassing all colors in the RGB image of the food sample under proper lighting. The
and CMYK gamuts (Adobe Systems, 2002). While those captured image is a bitmap image consisting of many
color models are useful, their limitations should also be pixels; each pixel is assigned a specific location and color
observed. For example, the spectrum of colors seen by value. Although a flatbed scanner can capture color
the human eye is wider than the gamut (the range of images, it can also distort the food sample through
colors that a color system can display or print) available physical contact, and its light source cannot be con-
in any color model. trolled easily.
The RGB model is an additive color model that uses
transmitted light to display colors. Various proportions 3.1. Lighting system
and intensities of three primary colors (red, green, and
blue) are used to create cyan, magenta, yellow, and white. When capturing color images, proper light source
The model is used for television and computer screens, in is important since the color of the food sample depends
which colored pixels are produced by firing red, green, on the part of spectrum reflected from it (Francis &
and blue electron guns at phosphors on the screens. The Clydesdale, 1975). Hence, the spectral power distribu-
model relates closely to the way human perceives color in tion of the illumination must be standardized. The CIE
the retina. The model is device dependent, since its range has defined several standard illuminants, which are
of colors varies with the display device. specified by their color temperatures. The standard illu-
The CMYK is a color model based on the light- minants commonly used in food research are A (2856
absorbing quality of ink printed on paper (Adobe Systems, K), C (6774 K), D65 (6500 K), and D (7500 K). The light
2002). As white light strikes translucent inks, certain sources C, D65 , and D are designed to mimic variations
visible wavelengths are absorbed while others are re- of daylight (Lawless & Heymann, 1998).
flected to the eyes. Three primary ink colors (cyan, The angle between the camera lens axis and the
magenta, and yellow) are used to create other colors. In lighting source axis should be around 45, because the
theory, these three primary colors should combine to diffuse reflection responsible for the color occurs at 45
absorb all light and produce black; however, a muddy from the incident light (Francis & Clydesdale, 1975).
brown is produced instead because all printing inks Furthermore, the light intensity over the food sample
contain some impurities. Thus, the fourth primary ink should be uniform. This can be achieved through ex-
color (black) is needed to produce a true black. The perimenting with various lighting arrangements (such as
CMYK model is also device dependent and is used in varying the distance between the light source and the
four-color process printing. food sample, taking the pictures in a dark room) and
The L a b model is an international standard for checking the results with a light meter.
color measurement developed by the Commission In-
ternationale dÕEclairage (CIE) in 1976. The L a b color 3.2. Digital camera
consists of a luminance or lightness component (L
value, ranging from 0 to 100), along with two chromatic Digital camera records images on an electric light
components (ranging from )120 to +120): the a com- sensor that is made up of millions of tiny points or
K.L. Yam, S.E. Papadakis / Journal of Food Engineering 61 (2004) 137–142 139

pixels. There are two major factors that affect the quality food sample plane. A 2.1 megapixel digital camera
of the image––resolution and file compression. Resolu- (Olympus, model C-2000Z) was held securely on a tri-
tion is related to the number of pixels on the light sen- pod and the lens faced downwards towards the pizza
sor: the more pixels, the higher the resolution, and the sample. The distance from the bottom of the camera
better the image quality. File compression reduces the lens to the food sample plane was 30.5 cm. Images of the
amount of memory taken up by the image and allows bottom surface of the pizza were taken under the fol-
more images to be stored. The trade-off for compressing lowing camera settings: aperture priority mode with the
the file is loss of image quality. For research purpose, lens aperture at f11, no flash, daylight conditions, macro
non-compressed file (TIFF format) is preferred to mode on, remote mode on, sound on, resolution
compressed file (JPEG format). 1600 · 1200 pixels, and the images saved in memory card
A digital camera with a minimum resolution of as TIFF files. After zooming the lens (so that the pizza
1600 · 1200 pixels is recommended, which is equivalent covered the whole field of view) and focusing, the pic-
to a 2.1 megapixel or higher camera. The camera should ture was taken with the remote control. The pictures
also have macro and zoom feature. A memory card of at were downloaded to the PC via a USB digital film reader
least 32 Mb and a digital film reader are also useful for (CameraMate, SCM Microsystems, Connecticut, USA).
storing the image files and transferring them to the
computer.
It is important to regularly ensure that the lighting 4. Analyzing color
system and camera are working properly and consis-
tently. Hence, at least two standard colored chips should Once the color images of the pizza samples were
be used to calibrate or verify the experimental settings captured, the color was analyzed qualitatively and
prior to actual measurements, and those colored chips quantitatively using Photoshop.
should cover the color range of the specific food sam-
ples. Standard colored chips can be obtained from the 4.1. Adobe Photoshop
Munsell Book of Color (GretagMacbeth, New Windsor,
New York). A free software is also available on the Photoshop is standard software used primarily by
company website, which allows the conversion between graphics producers and photographers for photo re-
the Munsell values and the L , a , b values. touching and image editing (Adobe Systems, 2002).
However, the software also has several features that may
3.3. Color measurements of microwaved pizza be adopted for analyzing color of food samples. A
computer (Pentium III, 128 MB RAM, 20 GB hard disk
As an illustration, the method was used to measure or higher recommended) is needed to run the software.
and analyze the color of microwaved pizza. The color of There are several reasons for choosing Photoshop for
the bottom surface of cooked pizza is not only impor- this method. The software is rich in image editing fea-
tant to visual perception, but is also related to crispness. tures, and its color analysis capability is comparable to
It is well known that microwave cooking does not pro- the more expensive color analysis software. The soft-
duce crisp and brown pizza. A solution to this problem ware provides more sophisticated capability for man-
is to microwave the pizza in contact with a susceptor, aging color and producing consistent color than other
which is usually made of a metallized polyethylene graphics software. The software is also available in
terephthalate (PET) film laminated to paperboard. The many laboratories, and it is strongly supported by the
susceptor absorbs microwave energy, heats up rapidly to manufacturer and users.
high temperatures, and causes browning of the con-
tacting food surfaces (Buffler, 1993; Zuckerman & Miltz, 4.2. Qualitative analysis
1997).
Commercial ready-to-cook frozen pizzas, 17.8 cm in Here the term ‘‘qualitative’’ refers to those aspects
diameter and 1.5 cm thick, of the same brand were used. that are not easily quantified. For example, there were
The pizzas were microwaved either on a plain paper- scattered dark spots in the pizza samples, and their ap-
board or on two different types of susceptor (referred to pearance was not easily quantified with parameters such
as Susceptor-A and Susceptor-B). The pizzas were mi- as L , a , b . In qualitative analysis, subjective terms
crowaved at 100% power for 3.5 min. After microwa- such as ‘‘lighter’’, ‘‘darker’’, and ‘‘more appealing’’ were
ving, they were cooled to room temperature and then used to describe or compare the pizza samples.
flipped over. Both qualitative and quantitative analyses were used
The lighting system consisted of two CIE source D65 to provide accurate descriptions of the color of the pizza
lamps (Bulb Direct, www.bulbdirect.com), 45.0 cm long, samples. In many other research studies, only quanti-
mounted on two sides of a frame, on either side of the tative information (such as the average color) was re-
food sample, 30.5 cm above and at an angle of 45 to the ported. While the average color provided a simple
140 K.L. Yam, S.E. Papadakis / Journal of Food Engineering 61 (2004) 137–142

description, some important details were not included. tion of the x-axis or y-axis (not shown) obtained in this
In some cases, the use of average color alone (i.e., way had a high level of noise. The noise was due to the
without visually inspecting the food sample) even re- small dark spots in the pizza sample and the selection of
sulted in misleading conclusions. a single pixel in the determination of the L a b values.
Photoshop was used to browse and sort the pizza It is worth mentioning that the Info Palette can also
images, display the images on a computer screen, and be used to identify out-of-gamut colors. The CMYK
print the images using a color printer. The images were values are normally displayed in percentage (see Fig. 1).
examined and compared, and the effects of susceptor on When the computer pointer is placed at a pixel whose
color were observed. Although those functions could color value is outside the CMYK gamut, the percentage
also be performed using other less expensive graphics is replaced with an exclamation mark. However, over
software, Photoshop provided more sophisticated color 99% of color values of the pizza samples were within the
management capability that was necessary for research. CMYK gamut.
Since the RGB model (used for screen display) and The second method used the Histogram Window to
CYMK model (used for printing) are device dependent, determine the color distributions along the x-axis and
the pizza images were always examined or compared y-axis. In Fig. 2, the Histogram Window displays the
using the same computer screen or the same printer. statistics (mean, standard deviation, median, percent-
Also out-of-gamut colors were identified using the Info age, and so on) of the color value, Lightness, for a se-
Palette in Photoshop (discussed later). lected area in the pizza image. The Histogram Window
Photoshop was also used to provide close-up exami- can also display the statistics for two other color values
nation of the dark spots scattered on the bottom of the (a and b), which is done by selecting a and b under the
pizza samples. Those dark spots were too small to ex- Channel drop-down menu. Hence, the average color of
amine with the naked eye. Under magnification, they a pizza sample or any portion of it can be obtained
were observed to have elliptical shapes, and the L , a , b easily using the Histogram Window.
values were also obtained. The use of Photoshop to The Lightness, a, and b in the Histogram Window are
examine food structure was also reported by Stanley and not standard color values. However, they can be con-
Baker (2002). verted to L , a , b values using the formulas
Lightness
L ¼  100 ð1Þ
4.3. Quantitative analysis 255
240a
In quantitative analysis, L a b values were used be- a ¼  120 ð2Þ
255
cause they are device independent and cover a larger
gamut than RGB and CMYK. Photoshop can display 240b
b ¼  120 ð3Þ
L a b values (also RGB and CMYK values) in the Info 255
Palette and Histogram Window. Three different meth- To determine the color distribution using the second
ods were used to determine the L a b distribution of the method, average values for multiple pixels were used to
pizza samples. reduce the noise in the plots. Again a grid was super-
The first method (Fig. 1) used the Info Palette to imposed on the pizza sample as before. Instead of the
determine the color distributions along the x-axis and y- grid points, the small squares (Fig. 1) along the x-axis
axis, where the origin was located at the center of the and y-axis were selected. The length of each square was
pizza sample. By turning on the Grid feature in Photo- 18 pixels, while the diameter of the pizza sample was
shop, a grid was superimposed on the pizza sample. As
the computer pointer was placed at a grid point along
the x-axis or y-axis, the L a b values corresponding the
pixel of that grid point were obtained from the Info
Palette. However, the plots of L a b values as a func-

Fig. 1. Image of bottom of microwaved pizza (left) and Info Palette in


Photoshop (right). Fig. 2. Histogram Window in Photoshop.
K.L. Yam, S.E. Papadakis / Journal of Food Engineering 61 (2004) 137–142 141

x-axis y-axis Paper Susceptor-A Susceptor-B


75.0
75.0
70.0
70.0

65.0
65.0

L*
60.0 60.0
L*

55.0 55.0
50.0 50.0
45.0 0 0.2 0.4 0.6 0.8 1
Dimensionless radius
40.0
-1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 Paper Susceptor-A Susceptor-B
Dimensionless radius, r/R 10.0

Fig. 3. L values along the x-axis and y-axis obtained using the second 5.0
method.

a*
0.0

1075 pixels. The Histogram Window was used to pro- -5.0


vide the average values for the squares (18 · 18 ¼ 324
pixels each). Fig. 3 shows the L value as a function of -10.0
the dimensionless radius for pizza microwaved on Sus- 0 0.2 0.4 0.6 0.8 1
ceptor-B, where r is any radius and R is the radius of the Dimensionless radius

pizza sample. The distributions for the a and b values Paper Susceptor-A Susceptor-B
were also obtained (not shown). 50.0
The plots in Fig. 3 were also used to determine the 45.0
color symmetry. Ideally, the color should be distributed
symmetrically along the radial direction. In this case, the 40.0
b*

plots should show mirror images across the middle plane 35.0
(r=R ¼ 0), and the plots for the x-axis and y-axis should 30.0
overlap each other. Fig. 3 shows that the L values are
25.0
distributed quite symmetrically.
0 0.2 0.4 0.6 0.8 1
The advantage of the second method is that it pro-
Dimensionless radius
vides detailed description of the color distribution of
individual samples. The disadvantage is that it is not Fig. 4. Comparison of L , a , b values between paper and susceptors.
suitable for comparing two or more samples due to the
waviness of the plots.
The third method was designed for comparing mul- toward the outside due to the edge effect (Buffler, 1993).
tiple pizza samples. Instead of small squares, much lar- Susceptor-A produced slightly darker color than Sus-
ger circular areas were selected. Photoshop was used to ceptor-B. The a value is also a good indicator of the
separate each pizza sample into ten circular sections. differences between plain paper and susceptors. The b
The first section was created by removing a circle of value is less indicative because its range is smaller and its
dimensionless radius r=R ¼ 0:9 from the pizza sample trends are less clear.
(the remaining annulus was the first section). The second
section was created by removing a circle of r=R ¼ 0:8
from the circle that was removed from the previous step 5. Conclusions
(the remaining annulus was the second section). The
detailed procedures for using Photoshop to remove the The digital imaging method allows measurements
circles were described by Papadakis, Abdul-Malek, and analyses of the color of food surfaces that are ad-
Kamden, and Yam (2000). For each circular section, the equate for food engineering research. While it is not yet
average L , a , b values were obtained using the Histo- a replacement for sophisticated color measurement in-
gram Window. The method made the assumption that struments, it is an attractive alternative due to its sim-
the color distribution was symmetrical along the radial plicity, versatility, and low cost. Photoshop is shown to
direction. be able to analyze the color for food samples, although
Fig. 4 shows the L , a , b values obtained by the the software was not originally designed for this pur-
third method. As expected, the L for the pizza micro- pose. However, it is already one of the most powerful
waved with plain paper is higher than those with sus- software for color analysis, and the manufacturer and
ceptors. The darkening achieved was more noticeable users are regularly making enhancements.
142 K.L. Yam, S.E. Papadakis / Journal of Food Engineering 61 (2004) 137–142

References Lawless, H. T., & Heymann, H. (1998). Sensory evaluation of food:


principles and practices. New York: Chapman & Hall, pp. 406–429.
Adobe Systems (2002). Adobe PhotoShop 7.0 User Guide. San Jose, Locht, P., Thomsen, K., & Mikkelsen, P. (1997). Full color image anal-
CA: Adobe Systems Inc. ysis as a tool for quality control and process development in the food
Brosnan, T., & Sun, D.-W. (2002). Inspection and grading of industry. Paper no. 9733006, ASAE, 2950 Niles Road, St. Joseph,
agricultural and food products by computer vision systems––a MI 49085-9659, USA.
review. Computers and Electronics in Agriculture, 36, 193–213. Papadakis, S. E., Abdul-Malek, S., Kamden, R. E., & Yam, K. L.
Buffler, C. R. (1993). Microwave cooking and processing: engineering (2000). A versatile and inexpensive technique for measuring color
fundamentals for the food scientist. New York: Van Nostrand of foods. Food Technology, 54(12), 48–51.
Reinhold. Shearer, S. A., & Payne, F. A. (1990). Color and defect sorting of bell
Clydesdale, F. M. (1978). Colorimetry: methodology and applications. peppers using machine vision. Transactions of the ASAE, 33(6),
CRC Critical Reviews in Food Science and Nutrition, 10(3), 243–301. 2045–2050.
Francis, F. J. (1994). Colorimetric properties of foods. In M. A. Rao, Stanley, D. W., & Baker, K. W. (2002). A simple laboratory exercise in
& S. S. H. Rizvi (Eds.), Engineering properties of foods (2nd ed., pp. food structure/texture relationships using a flatbed scanner. Journal
495–523). New York: Marcel Dekker, Inc. of Food Science Education, 1, 6–9.
Francis, F. J., & Clydesdale, F. M. (1975). Food colorimetry: theory Tao, Y., Heinemann, P. H., Varghese, Z., Morrow, C. T., & Sommer,
and applications. Westport, CT: AVI Publishing. H. J. (1995). Machine vision for color inspection of potatoes and
Gerrard, D. E., Gao, X., & Tan, J. (1996). Beef marbling and color apples. Transactions of the ASAE, 38(5), 1555–1561.
score determination by image processing. Journal of Food Science, Zaid Abdullah, M., Abdul Aziz, S., & Dos-Mohamed, A. M. (2000).
61(1), 145–148. Quality inspection of bakery products using a color-based machine
Gunasekaran, S. (1996). Computer vision technology for food quality vision system. Journal of Food Quality, 23(1), 39–50.
assurance. Trends in Food Science and Technology, 7, 245–256. Zuckerman, H., & Miltz, J. (1997). Prediction of dough browning in
Hunt, R. W. G. (1991). Measuring colour (2nd ed.). New York: Ellis the microwave oven from temperatures at susceptor/product
Horwood. interface. Food Science and Technology, 30, 519–524.