Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 6 Color Image Processing

Similar presentations


Presentation on theme: "Chapter 6 Color Image Processing"— Presentation transcript:

1 Chapter 6 Color Image Processing
國立雲林科技大學 資訊工程研究所 張傳育(Chuan-Yu Chang ) 博士 Office: EB 212 TEL: ext. 4337

2 Color Fundamentals In 1666, Sir Isaac Newton
He discovered that when a beam of sunlight passes through a glass prism, the emerging beam of light is consists of a continuous spectrum of colors ranging from violet to red.

3 Color Fundamentals (cont.)
Basically, humans and some other animals perceive in an object are determined by the nature of the light reflected from the object. Visible light is composed of a relatively narrow band of frequencies in the electromagnetic spectrum. For humans, colors are seen as variable combinations of the primary colors: red, green, and blue.

4 Color Fundamentals (cont.)
人眼椎狀體吸收之紅、綠、藍光的波長函數 1931年國際照明組織(CIE)指定三原色的波長: Blue:435.8nm Green:546.1nm Red:700nm 65%的椎狀體可感應到紅光,33%可感應到綠光,只有2%感應到藍光

5 Color Fundamentals (cont.)
For the purpose of standardization, the CIE (the international Commission on Illumination) designated in 1931 the following specific wavelength values to the three primary colors: Blue=435.8 nm, Green=546.1 nm, and Red=700 nm. From Fig. 6.2 and 6.3 that no single color may be called red, green , or blue. Having three specific primary color wavelengths for the purpose of standardization does not mean that these three fixed RGB components acting alone can generate all spectrum colors.

6 Color Fundamentals (cont.)
Primary and secondary colors of light and pigments The primary colors can be added to produce the secondary colors of light: magenta (R+B), cyan (G+B), yellow (R+G) 光的混合式採用加成的方式 In colorants, a primary color is defined as one that subtracts or absorbs a primary color of light and reflects or transmits the other two. The primary colors of pigments are magenta, cyan, and yellow

7 Color Fundamentals (cont.)
The characteristics generally used to distinguish one color from another are Brightness embodies the chromatic notion of intensity. Hue represents dominant color as perceived by an observer. Saturation is an attribute associated with the dominant wavelength in a mixture of light waves. Saturation refers to the relative purity or the amount of white light mixed with a hue. Hue and saturation taken together are called chromaticity, therefore, a color may be characterized by its brightness and chromaticity.

8 Color Fundamentals (cont.)
The amounts of red, green, and blue needed to form any particular color are called the tri-stimulus values and are denoted, X, Y, and Z. A color is then specified by its tri-chromatic coefficients, defined as It is noted from these equations that x + y + z = 1 (6.1-1) (6.1-2) (6.1-3) (6.1-4)

9 Color Fundamentals (cont.)
The CIE chromaticity diagram Which shows color composition as a function of x (red) and y (green). For any value of x and y, the corresponding value of z (blue) is obtained from Eq.(6.1-4). z = 1- ( x + y ) approximately 62% green, 25% red , and 13% blue content. The positions of the various spectrum colors from violet at 380 nm to red at 780 nm are indicated around the boundary of the tongue-shaped chromaticity diagram. These are the pure colors shown in the spectrum of Fig. 6.2.

10 Color Fundamentals (cont.)
紅色點佔25% CIE色度圖 綠色點佔62% 藍色點佔13%

11 Color Fundamentals (cont.)
Any point located on the boundary of the chromaticity chart is fully saturated. A straight-line segment joining any two points in the diagram defines all the different color variations that can be obtained by combining these two color additively. Any color inside the triangle can be produced by various combinations of the three initial colors.

12 Color Models The RGB Color Model
Each color appears in its primary spectral components of red, green, and blue. Images represented in the RGB color model consist of three component images, one for each primary color. When fed into an RGB monitor, these three images combine on the phosphor screen to produce a composite color image. The number of bits used to represent each pixel in RGB space is called the pixel depth. Full-color denote a 24-bit RGB color image

13 Color Models (cont.) Example 6.1
Generating the hidden face planes and a cross section of the RGB color cube. Composed of the colors

14 Color Models (cont.) Example 6.1 (cont.)
Acquiring a color image is basically the process shown in Fig. 6.9 in reverse. A color image can be acquired by using three filters, sensitive to red, green, and blue. When we view a color scene with a monochrome camera equipped with one of these filters, the result is a monochrome image whose intensity is proportional to the response of that filter. Repeating this process with each filter produces three monochrome images that are RGB component images of the color scene.

15 Color Models (cont.) Safe RGB color, All-system-safe color, Safe Web color, Safe browser color Given the variety of systems in current use, it is of considerable interest to have a subset of colors that are likely to be reproduced faithfully, reasonably independently of viewer hardware capabilities. 216 colors are common to most systems, these colors have become the standard for safe colors. Each of the 216 safe colors if formed from three RGB values, each value can only be 0, 51, 102, 153, 204, or 255. The values and FFFFFF represent black and white, respectively.

16 Color Models (cont.)

17 Color Models (cont.) The CMY color model
Cyan, magenta, and yellow are the secondary colors of light When cyan is illuminated with white light, no red light is reflected from the surface. Most devices that deposit colored pigments on paper, such as color printers and copiers, require CMY data input or perform an RGB to CMY conversion internally. The assumptions is that all color values have been normalized to range [0,1]. The CMYK color model In order to produce true black, a fourth color block is added (6.2-1)

18 Color Models (cont.) The HIS Color Model
When humans view a color object, we describe it by its hue, saturation, and brightness. Hue is a color attribute that describes a pure color. Saturation gives a measure of the degree to which a pure color is diluted by white light. Brightness is a subjective descriptor that is practically impossible to measure. (所以用intensity來取代brightness) HIS color model decouples the intensity component from the color-carrying information (hue and saturation) in a color image.

19 Color Models (cont.) Conceptual relationships between the RGB and HIS color models The intensity is along the line joining the vertices (0,0,0) and (1,1,1). If we wanted to determine the intensity component of any color point, we would simply pass a plane perpendicular to the intensity axis and containing the point. The intersection of the plane with the intensity axis would give us a point with intensity value in the range [0,1]. The intensity axis joining the black and white vertices is vertical

20 Color Models (cont.) Fig. 12(b) shows a plane defined by three points (black, white, and cyan) All points contained in the plane segment defined by the intensity axis and the boundaries of the cube have the same hue. All colors generated by three colors lie in the triangle defined by those colors. If two of those points are black and white and the third is a color point, all points on the triangle would have the same hue. By rotating the shaded plane about the vertical intensity axis, we would obtain different hues.

21 Color Models (cont.) The HIS space is represented by a vertical intensity axis and the locus of color points that lie on planes perpendicular Looking at the cube (Fig. 12) down its gray-scale axis, as shown in Fig. 6.13(a). In this plane we see that the primary colors are separated by 120°. The hue of the point is determined by an angle from some reference point. Usually an angle of 0° from the red axis designates 0 hue, and the hue increases countercolockwise from there. The saturation is the length of the vector from the origin to the point.

22 Color Models (cont.): Converting colors from RGB to HSI
The H component of each RGB pixel is obtained by with The saturation component is given by The intensity component is given by The RGB values have been normalized to range [0,1] and that angle is measured with respect to the red axis of the HIS space.

23 Color Models (cont.): Converting colors from HIS to RGB
Given values of HIS in the interval [0,1], we can find the corresponding RGB values in the same range. The applicable equations depend on the values of H. There are three sectors of interest, corresponding to the 120。 intervals in the separation of primaries

24 Color Models (cont.) RG sector
When H is in this sector, the RGB components are given by GB sector If the given value of H is in this sector, we first subtract 120° from it. Then the RGB components are BR sector If the given value of H is in this sector, we first subtract 240° from it.

25 Color Models (cont.) Its most distinguishing feature is the discontinuity in value along 45 line in the front (red) plane of the cube. Fig. 6.8影像的saturation Fig. 6.8影像的intensity Fig. 6.8影像的Hue

26 Color Models (cont.) RGB影像 Hue的成分影像 intensity的成分影像 saturation的成分影像

27 Color Models (cont.) 修改過的hue成分影像 修改過的saturation成分影像 重建的RGB影像
修改過的intensity成分影像

28 Pseudocolor Image Processing
Pseudocolor image processing consists of assigning colors to gray values based on a specified criterion. The principal use of pseudocolor is for human visualization and interpretation of gray-scale events in an images or sequence of images. Intensity Slicing If an image is interpreted as a 3D function, the method can be viewed as one of placing planes parallel to the coordinate plane of the image; Each plan then “slices” the function in the area of intersection.

29 Pseudocolor Image Processing (cont.)
Let [0, L-1] represent the gray scale Let level l0 represent black [f(x,y)=0] Level lL-1 represent white [f(x,y)=L-1] Suppose that P planes perpendicular to the intensity axis are defined at levels l1, l2,…, lp Assuming that 0<P<L-1 The P planes partition the gray scale into P+1 intervals, V1, V2, …, VP+1 Gray-level to color assignments are made according to the relation where ck is the color associated with the k-th intensity interval Vk.

30 Pseudocolor Image Processing (cont.)
Fig shows an example of using a plane at f(x,y)=li to slice the image function into two levels. If a different color is assigned to each side of the plane, any pixel whose gray level is above the plane will be coded with one color, and any pixel below the plane will be coded with the other. Levels that lie on the plane itself may be arbitrarily assigned one of the two colors. The result is a two-color image whose relative appearance can be controlled by moving the slicing plane up and down the gray-level axis.

31 Pseudocolor Image Processing (cont.)
When more levels are used, the mapping function takes on a staircase form. Any input gray level is assigned one of two colors, depending on whether it is above or below the value of li.

32 Pseudocolor Image Processing (cont.)
Example 6.3 Intensity Slicing 單色的甲狀腺影像(monochrome image of the Picker Thyroid Phantom ) The result of intensity slicing this image into eight color regions.

33 Pseudocolor Image Processing (cont.)
Example 6.3 Intensity Slicing (cont.) Intensity slicing assumes a much more meaningful and useful role when subdivision of the gray scale is based on physical characteristics of the image. Fig. 6.21(a) shows an X-ray image of a weld containing several cracks and porosities with graylevel of 255. If the exact values of gray levels one is looking for are known, intensity slicing is a simple but powerful aid in visualization. Cracks/porosities

34 Pseudocolor Image Processing (cont.)
Example 6.4 Use of color to highlight rainfall levels 影像灰階對應平均月降雨量 指定色彩給灰階 色彩編碼後的影像 放大南美洲的色彩編碼影像

35 Pseudocolor Image Processing (cont.)
Gray Level to Color Transformations To perform three independent transformations on the gray level of any input pixel. The three results are then fed separately into the red, green, and blue channels of a color television monitor. These are transformations on the gray level values of an image and are not functions of position.

36 Pseudocolor Image Processing (cont.)
Ordinary materials Example 6.5 Fig. 6.24(a) shows two monochrome images of luggage obtained from an airport X-ray scanning system. The purpose of this example is to illustrate the use of gray level to color transformations to obtain various degrees of enhancement. 塑膠炸藥(plastic explosive)

37 Pseudocolor Image Processing (cont.)
Fig 6.25 shows the transformation functions used. These sinusoidal functions contain regions of relatively constant value around the peaks and regions that change rapidly near the valleys. Changing the phase and frequency of each sinusoid can emphasize (in color) ranged in the gray scale. If all three transformations have the same phase and frequency, the output image will be monochrome. Fig. 6.24(b) was obtained with the transformation functions in Fig (a). Fig. 6.24(c) was obtained with the transformation functions in Fig (b).

38 Pseudocolor Image Processing (cont.)
Combine several monochrome images into a single color composite. Usually used in Multispectral image processing Different sensors produce individual monochrome images, each in a different spectral band.

39 Pseudocolor Image Processing (cont.)
Green component of an RGB image Red component of an RGB image Near-infrared image Blue component of an RGB image Red+Green+Blue Green+Blue+Near-infrared image

40 Pseudocolor Image Processing (cont.)
Jupiter moon Io 木星Io衛星影像 Surrounding yellow materials are older sulfur deposits 黃色的區域表示硫磺的沉積物質 Bright red depicts material newly ejected from an active volcano 紅色的區域表示活火山新噴出的物質

41 Basic of Full-Color Image Processing
Full-color image processing approached fall into two major categories: Process each component image individually and then form a composite processed color image from the individually processed components. Work with color pixels directly. Let c represent an arbitrary vector in RGB color space: (6.4-1) (6.4-2)

42 Basic of Full-Color Image Processing
The results of individual color component processing are not always equivalent to direct processing in color vector space. In order for per-color-component and vector-based processing to be equivalent, two conditions have to be satisfied: The process has to be applicable to both vectors and scalars. The operations on each component of a vector must be independent of the other components.

43 Color Transformation Color transformation deal with processing the components of a color image within the context of a single color model. We model color transformations using the expression where f(x,y) is a color input image, g(x,y) is the transformed color output image, and T is an operator on f over a spatial neighborhood of (x,y). The pixel values here are triplets or quartets from the color space chosen to represent the images. Color transformations ri and si are variables denoting the color components of f(x,y)and g(x,y) at any point (x,y). n is the number of color components. {T1, T2, …, Tn} is a set of color mapping function that operate on ri to produce si. n transformations, Ti, combine to implement the single transformation function, T, in Eq(6.5-1). (6.5-1) (6.5-2)

44 Color Transformation (cont.)
A bowl of strawberries and cup of coffee Strawberries are composed of large amounts of magenta and yellow. CMYK成分,黑色代表0,白色代表1。 草莓由大量的紅色成分所組成。 Intensity成分 原始影像的單色呈現

45 Color Transformation (cont.)
Suppose that we wish to modify the intensity of the image in Fig. 6.30(a) using where 0<k<1. In the HIS color space, this can be down with the simple transformation where s1=r1, s2=r2。Only HIS intensity component r3 is modified. In the RGB color space, three components must be transformed: The CMY space requires a similar set of linear transformations

46 Color Transformation (cont.)
The result of applying any of the transformations in Eq.(6.5-4)~ (6.5-6), using k=0.7

47 Color Complements The hues directly opposite one another on the color circle of Fig are called complements. Color complements are useful for enhancing detail that is embedded in dark regions of a color image.

48 Example 6.7 Identical to the gray-scale negative transformation.
RGB的補色轉換 HSI的補色轉換

49 Color Slicing Color slicing
Highlighting a specific range of colors in an image is useful for separating objects from their surroundings. The basic idea is either to (將 ROI以外的色彩,映射到不重要的中性色彩。) Display the colors of interest so that they stand out from the background Use the region defined by the colors as a mask for further processing To map the colors outside some range of interest to a nonprominent neutral color. If the colors of interest are enclosed by a cube of width W and centered at a prototypical color with components (a1, a2, …, an) the necessary set of transformations is Color Cube (hypercube) W是立方體寬度,中心成分在(a1,a2,…,an)

50 Color Slicing (cont.) If a sphere is used to specify the colors of interest, Eq. (6.5-7) becomes R0是球體的半徑,中心成分在(a1,a2,…,an)

51 Example 6.8 An illustration of color slicing
W=0.2549,中心在(0.6863, , )的 RGB cube Radius=0.1765,中心在(0.6863, , )的 RGB sphere

52 Tone and Color Corrections
Device-independent color model 建立螢幕和輸出裝置以及其裝置之間的色彩範圍 Color management system (CMS) 選擇採用CIE L*a*b*模型,或是CIELAB CIE L*a*b*具有下列特性: Colormetric Perceptually uniform Device independent

53 Tone and Color Corrections (cont.)
L*a*b* color model Xw, YW, Zw是白色的三色激勵值(由圖6.5的 CIE色調圖上x=0.3127, y=0.3290所定義)

54 Tone and Color Corrections (cont.)
色調範圍 (tonal range) ,亦稱為(key type)是指影像色彩強度的一般分布。 High-key 影像的大部分資訊集中於高(或亮)的強度 Low-key 影像的大部分資訊集中於低(或暗)的強度 Middle-key 影像的大部分資訊介於high-key和low-key之間

55 Example 6.9 Tonal transformations

56 Example 6.10 Color balancing

57 Histogram Processing The gray-level histogram processing transformations can be applied to color images in an automated way. Since color images are composed of multiple components, consideration must be given to adapting the gray-scale technique to more than one component and/or histogram. To spread the color intensities uniformly, leaving the color themselves (ed. hues) unchanged.

58 Histogram Processing 只將color intensity 作equalization,而hue和saturation不變。

59 Smoothing and Sharpening
Color Image Smoothing The average of the RGB component vectors in the neighborhood is 對每個顏色分量進行smooth Smoothing by neighborhood averaging can be carried out on a per-color-plane basis.

60 Example 6.12 Color image smoothing by neighborhood averaging
Red component image Original RGB image Green component image Blue component image

61 Example 6.12 Color image smoothing by neighborhood averaging (cont.)
Hue component image Saturation component image Intensity component image

62 Example 6.12 Color image smoothing by neighborhood averaging (cont.)
Image smoothing with 5x5 averaging mask Result of processing Intensity component image Difference between the two results Result of processing each RGB component image

63 Smoothing and Sharpening (cont.)
Color Image Sharpening Computing the Laplacian of each component image separately.

64 Color Segmentation Segmentation in HIS color Space
Color is represented in the hue image. Saturation is used as a masking image to isolate further regions of interest in the hue image. Intensity image is used less frequency for segmentation of color image because it carries no color information.

65 Example 6.14 Segmentation in HIS space
Original image Hue image Saturation image Intensity image 對飽和影像取臨界值(最大值的10%)所得的遮罩影像,將大於臨界值的像素點設為1,其餘設為黑色。 遮罩影像和Hue影像的乘積。 對乘積影像取臨界值(90%) ,後所得之影像。 乘積影像的histogram。

66 Color Segmentation (cont.)
Segmentation in RGB Vector Space The objective is to segment objects of a specified color range in an RGB image. Let the average color be denoted by the RGB vector a. The objective of segmentation is to classify each RGB pixel in a given image as having a color in the specified range or not.

67 Example 6.15 Color image segmentation in RGB space

68 Color Segmentation (cont.)
Color Edge Detection Consider the two MxM color images Processing the three individual planes to form a composite gradient image can yield erroneous results.

69 Color Image Processing
Chapter 6 Color Image Processing

70 Color Segmentation (cont.)
Let r, g, and b be unit vectors along the R, G, and B axis of RGB color space Let

71 Color Segmentation (cont.)
The direction of maximum rate of change of c(x,y) is given by and the value of the rate of change at (x,y), in the direction of q, is given by

72 Example 6.16 Edge detection in vector space

73 Example 6.16 Edge detection in vector space (cont.)
Red component的gradient Green component的gradient Blue component的gradient

74 Noise in Color Image Usually, the noise content of a color image has the same characteristics in each color channel. But it is possible for color channels to be affected differently by noise. Ex: Use of a red reject filter in a CCD camera will reduce the strength of illumination available to the red sensor.

75 Example 6.17 Illustration of the effects of converting noisy RGB images to HSI

76 Example 6.17 Illustration of the effects of converting noisy RGB images to HIS (cont.)

77 Example 6.17 Illustration of the effects of converting noisy RGB images to HIS (cont.)

78 Example 6.18 A color image compression example


Download ppt "Chapter 6 Color Image Processing"

Similar presentations


Ads by Google