8Color Image Processing

Perception of color is the inherent ability of the human visual system (HVS). Although color vision is subjective, and it cannot be fully explained with the results from theoretical research and practice, much knowledge about the physical nature of color has already been gathered. For example, a lot of attributes of color vision, such as wavelength resolution, color saturation, its relationship with brightness, and the rules of color mixing, have been clearly known. On the other hand, with the progress of technology in recent years, many devices for color image acquisition and processing are widely spread and used in a large number of applications. Therefore, the color image becomes also the subject of image processing.

Compared to black-and-white images, color images contain more information. In order to effectively represent and manipulate color information, it is necessary to establish the corresponding color representation models, and to study the corresponding color image processing technology.

Color image processing technologies can be divided into two categories. First, because people’s ability to distinguish different colors and sensitivity to color would be stronger than gray scale, converting a gray-level image to a color image should increase the efficiency in observing the image content. Such an image processing technique is often referred to as pseudo-color processing technology. Second, the color image can also be directly subjected to various treatments to achieve the desired effects. The image processing technology related to pure color images is the true color processing technology.

The sections of this chapter are arranged as follows:

Section 8.1 introduces the principles of color vision and expresses the methods for color description. It includes the fundamentals of color vision, the three primary colors and color matching, as well as an explanation for color chromaticity diagram.

Section 8.2 presents several basic and common color models, including the device-oriented RGB and CMY models; I1, I2, I3 model; a normalized model; a color TV model; a video model; and some color models suitable for visual perception (such as HSI, HSV, HSB models, and L*a*b* model). The relationships among these models are also discussed.

Section 8.3 describes several basic pseudo-color image enhancement techniques, including both the spatial domain and frequency domain techniques.

Section 8.4 discusses the strategy for true color image processing, and introduces the transform enhancing methods by separately treating each color component and the filter enhancing methods by considering all color components simultaneously (including both linear and nonlinear methods).

8.1Color Vision and Chromaticity Diagram

To carry out the color image processing, it is required first to understand the sensing principle and expression of color.

8.1.1Color Vision Fundamentals

Color vision is related to the physical essence of color and human vision system. The essence of color was systematically studied and discovered first by Newton. In the 17th century, Newton found, by using prism to study white light refraction, that the white light can be decomposed into a series of continuous spectrum ranged from purple to red. It is proved that the white light is made up of different color lights (and these colors cannot be further decomposed). In other words, white light is mixed and composed of different color lights. These different color lights are electromagnetic waves of different frequencies. Not only can human vision perceive the light stimulus, but it can also perceive the electromagnetic wave of different frequencies as different colors. In the physical world, the power distribution of radiation energy is objective, but color exists only in the human eye and brain. Newton once said: “Indeed rays, properly expressed, are not colored” (Poynton, 1996).

When color refers to different hues or pigments, noncolor refers to white and black as well as various grays that are different degree of shades between white and black. The surface that can absorb all wavelengths of light (no selective reflection spectrum) looks gray. If it reflects more light it looks as light gray, while it reflects less light it looks dark gray. In general, if the reflected light is less than 4% of the incident light, the surface looks black, while if more than 80–90% of the incident light is reflected, the surface looks white.

The physical basis of color vision is that the human retina has three types of color photoreceptor cone cells, which respond to incident radiation with somewhat different spectral response curves. In other words, these cone cells are sensitive to different wavelengths of radiation. There is a fourth type of photoreceptor called rod cell in the retina. Rods are effective only at extremely low light levels. Because there is only one type of rod cell, “night vision” cannot perceive color.

Physiological basis of color vision and visual perception is related to chemical processes and neural processes in the brain nervous system. Overall, the human color vision has a series of elements, corresponding to a complex process. First, the creation of color vision needs a light source. The light from source is transmitted through the reflection or transmission mode to attend the eye, and to cause nerve signals to be received by retinal cells, the human brain finally explains this to produce color vision.

The human feeling of the object color depends on the characteristics of the reflected light. If the reflection of object has a more or less balanced spectrum, the human perception of object is white or gray. If the reflection of object has more spectral reflectance in certain frequencies, the human perception of object would be corresponding to related colors.

8.1.2Three Primary Colors and Color Matching

Three primary colors are the basic units of color production, which can produce a number of color combinations. The combination colors would be different than the colors in the combination. This is process is also called color matching.

8.1.2.1Three Primary Colors

The three colors corresponding to cone cells with different retinal color feelings are called three primary colors (the mixing of either two colors does not produce a third color). The three primary colors are red (R), green (G), and blue (B). These colors correspond to the three kinds of cone cells, which have different wavelength response curves to external radiation, as shown in Figure 8.1.

It is noted that the three response curves in Figure 8.1 are distributions with wider ranges and there are certain overlaps. In other words, a particular wavelength of light can stimulate two to three kinds of cells to make them excite. Therefore, even if the incident light has a single wavelength, the reaction of the human visual system is not simple. Human’s color vision is the result of a combined response to different types of cells. In order to establish a standard, the International Commission on Illumination (CIE), as early as in 1931, has specified the wavelength of the three primary colors, red, green, and blue (R, G, B) to be 700 nm, 546.1 nm, and 435.8 nm.

8.1.2.2Color Matching

When mixing the red, green, and blue colors, the obtained combination color C may be regarded as a weighted sum of the strength proportion of the three color

CrR+gG+bB(8.1)

Figure 8.1: Wavelength response curves of three cone cells.

where ≡ represents matching, r, g, b represents ratio coefficients for R, G, B, and there is r + g + b = 1.

Considering that the human vision and display equipment have different sensitivities for different colors, the values of each ratio coefficient are different in the color matching. The green coefficient is quite big, the red coefficient is in middle, and the blue coefficient is minimum (Poynton, 1996). International standard Rec ITU-R BT.709 has standardized the corresponding CRT display coefficients for red, green, and blue. A linear combination formula of red, green, and blue is used to calculate the true brightness for the modern cameras and display devices:

Y709=0.2125R+0.7154G+0.0721B(8.2)

Although the contribution of blue to brightness is the smallest, the human vision has a particularly good ability to distinguish blue color. If the number of bits assigned to the blue color is less than the number of bits assigned to the red color or green color, the blue region in the image may have a false contour effect.

In some color matching cases, adding only R, G, B together may not always produce the required color feeling. In this situation, add one of the three primary colors to the side of matched color (i. e., written negative), in order to achieve equal color matching, such as

CrR+gGbB(8.3)

bB+CrR+gG(8.4)

In the above discussion, the color matching refers to the same visual perception of the color. It is also known as color matching with “the same appearance heterogeneity” (metameric). In this case, there is no constrain for the spectral energy distribution of color.

8.1.3Chroma and Chromaticity Diagram

In order to express the color, the concept of chroma is used. In order to represent the chroma, the representation method with chromaticity diagram is introduced.

8.1.3.1Chroma and Chromatic Coefficient

People often use brightness, hue, and saturation to represent color properties. Brightness corresponds to the brilliance of the color. Hue is related to the wavelength of the main light in the spectrum, or it represents the main color that the viewer feels. Saturation is related to the purity of a certain hue, the pure spectral color is completely saturated, and the saturation is gradually reduced with the adding of the white light.

Hue and saturation together are called chroma. Color can be represented with both brightness and chroma. Let X, Y, and Z represent the three stimuli used to compose a certain color C, then the three stimulus values and CIE’s R, G, and B have the following relationship:

[XYZ]=[0.49020.30990.19990.17700.81230.01070.00000.01010.9899][RGB](8.5)

On the other side, according to the X, Y, Z stimulus values, three primary colors can also be obtained:

[RGB]=[2.36350.89580.46770.51511.42640.08870.00520.01451.0093][XYZ](8.6)

For white light, it has X = 1, Y = 1, Z = 1. Let the amount of stimulation of each scale factor be x, y, z, there is C = xX + yY + zZ. Scale factor x, y, z are also known as chromatic coefficients,

x=XX+Y+Zy=YX+Y+Zz=ZX+Y+Z(8.7)

From eq. (8.7), it can be seen that

x+y+z=1(8.8)

8.1.3.2Chromaticity Diagram

Simultaneously using three primary colors to represent a particular color needs to use 3-D space, so it will cause certain difficulty in mapping and display. To solve the problem, CIE developed a chromaticity diagram of tongue form (also called shark fin shape) in 1931, to project the three primary colors onto a 2-D chroma plane. By means of a chromaticity diagram, the proportion of the three primary colors to form a color may conveniently be presented by a 2-D composition.

A chromaticity diagram is shown in Figure 8.2 where the unit for wavelength is nm, the horizontal axis corresponds to red coefficient, the vertical axis corresponds to green coefficient, the blue coefficient value can be obtained by z = 1 – (x + y), whose direction corresponds to come out from the inside of paper. The points on the tongue-shaped contour provide chromaticity coordinates corresponding to saturated colors. the spectrum corresponding to blue-violet is at the lower-left portion of chromaticity diagram, the spectrum corresponding to green is at the upper-left portion of chromaticity diagram, and the spectrum corresponding to red is at the lower-right portion of chromaticity diagram. The tongue-shaped contour could be considered as the trajectory of a narrow spectrum, containing only a single wavelength of energy, passing through the range of 380 ~ 780 nm wavelength.

Figure 8.2: Illustration of a chromaticity diagram.

It should be noted that the straight line connecting 380 nm and 780 nm at the boundary of the chromaticity diagram corresponding to the purple series from blue to red, which is not available in the light spectrum. From the point of view of human vision, the feeling to purple does not generate only by a single wavelength, it requires the mixing of a shorter wavelength light and a longer wavelength light. In the chromaticity diagram, the line corresponding to the purple series connects the extreme blue (comprising only short-wavelength energy) and the extreme red (containing only long-wavelength energy).

8.1.3.3Discussion on Chromaticity Diagram

By observing and analyzing chromaticity diagram, the following are noted:

(1)Each point in the chromaticity diagram corresponds to a visual perceived color. Conversely, any visible color occupies a determined position in the chromaticity diagram. For example, the chromaticity coordinates of the point A in Figure 8.2 are x = 0.48, y = 0.40. The point inside the triangle taking (0, 0), (0, 1), (1, 0) as the vertices, but outside the tongue-shaped contour, corresponds to invisible color.

(2)The points on the tongue-shaped contour represent pure colors. When the points move toward the center, the mixed white light increases while the purity decreases. At the center point C, various spectral energies become equal. The combination of all three primary colors with one-third proportion will produce white, where the purity is zero. The color purity is generally referred to as the saturation of the color. In Figure 8.2, the point A is located in 66% of the distance from the point C to point of pure orange, so the saturation at point A is 66%.

(3)In the chromaticity diagram, the two colors at the two endpoints of a straight line passing through the point C are complementary colors. For example, a non-spectral color in the purple section can be represented by the complementary color (C) at the other end of the line passing through the point C, and can be expressed as 510 C.

(4)The points on the chromaticity diagram border have different hues. All points on the line connecting the center point C and a boundary point have the same hue. In Figure 8.2, a straight line is drawn from point C through point A to point O on the boundary (orange, about 590 nm), the dominant wavelength of point A is then 590 nm, the hue of point A is equal to that of point O.

(5)In chromaticity diagram, all points on any line connecting two endpoints represent a new color that can be obtained by adding the colors represented by the two endpoints. To determine the color range that three colors can composite, connect the three points corresponding to the three colors into a triangle. For example, in Figure 8.2, any color whose corresponding point is located in the triangle with red, green, and blue points as vertex can be obtained by the three-color composition, and all colors outside the triangle cannot be obtained by the three-color composition. As the triangle formed by any given three points (corresponding to three fixed colors) cannot enclose all colors inside chromaticity diagram, it is not possible to use only three primary colors (single wavelength) to obtain all visible colors.

Example 8.1 Chromaticity triangles of PAL and NTSC systems

It is required for a variety of color display systems to select the appropriate R, G, B as the basic colors. For example, the chromaticity triangles of PAL and NTSC television systems in use are shown in Figure 8.3. Factors influencing the selection of three basic colors R, G, B for a system are:

(1)From the technical point of view, it is difficult to produce highly saturated colors, so these basic colors are not fully saturated color;

(2)It is better to make a bigger triangle with R, G, B as the vertices to include a larger area, that is, in containing more different colors;

(3)The saturated cyan color is not commonly used. Therefore, in the chromaticity triangle, the red vertex is closest to fully saturation (spectrum border), while the green vertex and blue vertex have bigger distances from a totally saturated points (the NTSC system has more blue-green than that of the PAL system).

Figure 8.3: Chromaticity triangles of PAL and NTSC systems.

Back to the discussion of “metameric” in color match, it may be considered in the chromaticity diagram that the chromaticity coordinates of a color can only express its appearance but cannot express its spectral energy distribution.

8.2Color Models

A color model, also called a color space, is a specification of a coordinate system in which each color is represented by a single point. To effectively express the color information, establishing and selecting suitable color representation models are needed. When creating a color model, since a color can be represented by three basic colors, it is required to build a 3-D spatial coordinate system, in which each point represents a particular kind of color. Various color models have been proposed.

From the application point of view, the proposed color models can be divided into two categories: one is for hardware devices, such as color printer or color display monitors; the other is for application-oriented visual perception or color processing and analysis, such as a variety of image techniques and the animation of color graphics. Some typical models from these two categories are introduced below.

Figure 8.4: The RGB color cube.

8.2.1Hardware-Orientated Models

The hardware-orientated models are suitable for image acquisition as well as image output and display applications.

8.2.1.1RGB Model

This model is a popularly used color model, which is based on a Cartesian coordinate system, where the color space is represented by a cube as shown in Figure 8.4. The origin of coordinate system corresponds to black, the vertices being farthest from the origin correspond to white. In this model, the gray values from black to white are distributed along the line connecting these two vertices, while the remaining points within the cube corresponds to other different colors that can be represented by vectors. For convenience, the cube is generally normalized to unit cube so that all R, G, B values in RGB color model are in the interval of [0, 1].

According to this model, each color image includes three independent color planes, or each color image can be decomposed into three plane. On the contrary, if one image can be represented by three planes, then using this model is quite convenient.

Example 8.2 Safe RGB color

True color RGB images are represented with 24-bits, that is, each R, G, B has 8 bits. The values of R, G, B are each quantized to 256 levels, the combination thereof may constitute more than 1,600 million colors. Actually, it is not needed to distinguish so many colors. Furthermore, this often makes too high requirements for display system. So a subset of color is devised and can be reliably displayed on various systems. This subset is called safe RGB colors, or the set of all-system-safe colors.

Figure 8.5: Safe RGB colors.

There are totally 256 colors in this subset. It is obtained by taking six values each from R, G, B. These six values are 0, 51, 102, 153, 204, and 255. If these values are expressed in hexagonal number system, they are 00, 33, 66, 99, CC, and FF. An illustration for this subset is shown in Figure 8.5.

8.2.1.2CMY Model

In the RGB model, each color appears in its primary spectral components of red (R), green (G), and blue (B). The CMY color model is based on the combination of RGB to produce the primary colors of cyan (C), magenta (M), and yellow (Y):

C=1R(8.9)

M=1G(8.10)

Y=1B(8.11)

8.2.1.3I1, I2, I3 Model

This model is named according to its three components. The I1, I2, I3 model is based on the experiments with natural image processing (for the purpose of segmentation). It is obtained by a linear transform of RGB, given by

I1=R+G+B3(8.12)

I2=RB2(8.13)

I3=2GRB4(8.14)

A variation of the I1, I2, I3 model is the I1,I2,I3 model (Bimbo, 1999), in which

I2=RB(8.15)

I3=(2GRB)/2(8.16)

8.2.1.4Normalized Model

A normalized color model is derived from the RGB model (Gevers and Smeulders, 1999), given by

l1(R,G,B)=(RG)2(RG)2+(RB)2+(GB)2(8.17)

l2(R,G,B)=(RB)2(RG)2+(RB)2+(GB)2(8.18)

l3(R,G,B)=(GB)2(RG)2+(RB)2+(GB)2(8.19)

This model is invariant to the viewing direction, the object orientation, the lighting direction, and the brightness variation.

8.2.1.5Color Model for Television

The color model for TV is also based on the combination of RGB. In the PAL system, the color model used is the YUV model, where Y denotes the brightness component and U and V are called chroma components and are proportional to color differences BY and RY, respectively. YUV can be obtained from the normalized R′, G′, B′ (R′ = G′ = B′ = 1 corresponding to white) in the PAL system, given by

Y=0.299R+0.587G+0.114B(8.20)

U=0.147R0.289G+0.436B(8.21)

V=0.615R0.515G0.100B(8.22)

Reversely, R′, G′, B′ can also be obtained from Y,U, V as

R=1.000Y+0.000U+1.140V(8.23)

G=1.000Y0.395U+0.581V(8.24)

B=1.000Y+2.032U+0.001V(8.25)

In the NTSC system, the color model used is the YIQ model, where Y denotes the brightness component, and I and Q are the results rotating the U and V by 33°. YIQ can be obtained from the normalized R′, G′, B′(R′= G′= B′= 1 corresponding to white) in the NTSC system, given by:

Y=0.299R'+0.587G+0.114BY=0.299R+0.587G+0.114B(8.26)

I=0.596R0.275G0.321BI=0.596R0.275G0.321B(8.27)

Q=0.212R0.523G+0.311BQ=0.212R0.523G+0.311B(8.28)

Reversely, R′, G′, B′ can also be obtained from Y, I, Q as

R=1.000Y+0.956I+0.620Q(8.29)

G=1.000Y0.272I0.647Q(8.30)

B=1.000Y1.108I+1.700Q(8.31)

8.2.1.6Color Model for Video

One color model commonly used in video is the YCB CR color model, where Y represents the luminance component, and CB and CR represent chrominance components. The luminance component can be obtained by means of the RGB component of the color:

Y=rR+gG+bB(8.32)

where r, g, b are proportional coefficients. The chrominance component CB represents the difference between the blue portion and the luminance value, and the chrominance component CR represents the difference between the red portion and the luminance value (so they are also called color difference components)

CB=BYCR=RY(8.33)

In addition, there is CG = GY, but it can be obtained from CB and CR. The inverse transformation from Y, CB, CR to R, G, B can be expressed as

[RGB]=[1.00.000011.402001.00.344130.714141.01.772000.00004][YCBCR](8.34)

In the practical YCBCR color coordinate system, the value range of Y is [16, 235]; the value ranges of CB and CR are both [16, 240]. The maximum value of CB corresponds to blue (CB = 240 or R = G = 0, B = 255), and the minimum value of CB corresponds to yellow (CB = 16 or R = G = 255, B = 0). The maximum value of CR corresponds to red (CR = 240 or R = 255, G = B = 0), and the minimum value of CR corresponds to cyan (CR = 16 or R = 0, G = B = 255).

The spatial sampling rate of the video refers to the sampling rate of the luminance component Y, which is typically doubling the sampling rate of the chrominance components CB and CR. This could reduce the number of pixels per line, but does not change the number of lines per frame. This format is referred to as 4: 2: 2, which means that every four Y samples correspond to two CB samples and two CR samples. The format with even lower data volume than the above format is 4: 1: 1 format, that is, each four Y sampling points corresponding to one CB sample points and one CR sample points. However, in this format the horizontal and vertical resolutions are very asymmetric. Another format with the same amount of data is the 4: 2: 0 format, which still corresponds to one CB sample point and one CR sample point for every four Y samples, but both CB and CR are sampled horizontally and vertically with the half of the sample rate. Finally, a 4: 4: 4 format is also defined for applications that require high resolution, that is, the sampling rate of the luminance component Y is the same as the sampling rates of the chrominance components CB and CR. The correspondence between the luminance and chrominance sampling points in the above four formats is shown in Figure 8.6.

8.2.2Perception-Orientated Models

Perception-orientated color models are more suitable for describing colors in terms of human interpretation. Among them, the HSI (hue, saturation, and intensity) model is a basic model. Other models include the HCV (hue, chroma, and value) model, the HSV (hue, saturation, and value) model, the HSB (hue, saturation, and brightness) model, and the L*a*b* model (see below).

8.2.2.1HSI Model

In the HSI color model, the intensity component is decoupled from the components carrying hue and saturation information. As a result, the HSI model is an ideal tool for developing image-processing algorithms based on the color descriptions that are natural and intuitive to humans.

The HSI space is represented by a vertical intensity axis and the locus of color points that lie on planes perpendicular to this axis. One of the planes is shown in Figure 8.7. In this plane, a color point P is represented by a vector from the origin to the color point P. The hue of this color is determined by an angle between a reference line (usually the line between the red point and the origin) and the color vector. The saturation of this color is proportional to the length of the vector.

Figure 8.6: Illustration of four sample formats (two adjacent rows belonging to two different fields).

Figure 8.7: The HSI color plane and space.

Given an image in RGB color format, the corresponding HSI components can be obtained by

H={arccos{(RG)+(RB)2(RG)2+(RB)(GB)}RGorRB2πarccos{(RG)+(RB)2(RG)2+(RB)(GB)}B>G(8.35)

S=13R+G+Bmin(R,G,B)(8.36)

I=R+B+G3(8.37)

On the other hand, given the H, S, I components, their corresponding R, G, B values are calculated in three ranges

(1)H [0°, 120°]

B=I(1S)(8.38)

R=I[1+ScosHcos(60H)](8.39)

G=3I(B+R)(8.40)

(2)H [120°, 240°]

R=I(1S)(8.41)

G=I[1+Scos(H120)cos(180H)](8.42)

B=3I(R+G)(8.43)

(3)H [240°, 360°]

G=I(1S)(8.44)

B=I[1+Scos(H240)cos(300H)](8.45)

R=3I(G+B)(8.46)

Example 8.3 Different color components of an image

Figure 8.8 shows different components of a color image. Figures 8.8(a), (b), and (c) are the R, G, B components of the image, respectively. Figures 8.8(d), (e), and (f) are the H, S, I components of the image, respectively.

8.2.2.2HSV Model

HSV color model is closer to human perception of color than the HSI model. The coordinate system of the HSV model is also a cylindrical coordinate system, but is generally represented by a hexcone (see Figure 8.9 of Plataniotis and Venetsanopoulos, 2000).

Figure 8.8: Different components of a color image.

Figure 8.9: Coordinate system of HSV model.

The values of R, G, and B (all in [0, 255]) at a certain point in the RGB space can be converted to HSV space. The corresponding H, S, V values are:

H={arccos{(RG)+(RB)2(RG)2+(RB)(GB)}BG2πarccos{(RG)+(RB)2(RG)2+(RB)(GB)}B>G(8.47)

S=max(R,G,B)min(R,G,B)max(R,G,B)(8.48)

V=max(R,G,B)255(8.49)

8.2.2.3HSB Model

The HSB color model is based on the opposite color theory (Hurvich and Jameson, 1957). Opposite color theory derives from the observation of opposing hues (red and green, yellow and blue), which counteract each other if the colors of opposing hues are superimposed. For a given frequency stimulus, the ratio of the four basic hues (red r, green g, yellow y, and blue b) can be deduced and a hue response equation can be established. It is also possible to deduce a non-hue response equation corresponding to the brightness sensed in a spectral stimulus. According to these two response equations, the hue coefficient function and the saturation coefficient function can be obtained. The hue coefficient function represents the ratio of the hue response of each frequency to all hue responses, and the saturation coefficient function represents the ratio of the hue response of each frequency to all hue-free responses. HSB model can explain many of the psychophysical phenomena about the color.

From the RGB model, and using the following linear transformation formula:

I=wb=R+G+B(8.51)

rg=RG(8.52)

yb=2BRG(8.53)

In eq. (8.51), w and b are called white and black, respectively. In eq. (8.52) and eq. (8.53), rg and yb are the opposite color hues of the color space, respectively.

Although the opposite color model can be derived from the RGB model using a linear transformation formula, it is much more appropriate to model the perceived color than the RGB model.

8.2.2.4L* a* b* Model

From the perspective of image processing, the description of color should be closer to the perception of color as possible. From the perspective of uniform perception, the distance between two perceived colors should be proportional to the distance between the two colors in the color space that express them. The L*a*b* color model, defined by CIE, is such a uniform color model in which the distance between two points in color space is proportional to the difference between the corresponding colors perceived by human eyes. The uniform color space model is essentially a color model that is visually perceptible, but more homogeneous in visual perception.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.200.226