0% found this document useful (0 votes)
11 views

Ch06-Color Image Processing

The document discusses color fundamentals and color models for digital image processing. It explains that color provides more visual information than intensity alone and is useful for object recognition. Color is perceived based on the light wavelengths reflected from objects. The human visual system senses color using red, green, and blue cones. Common color models include RGB, used for computer and screen color, and CMYK, used for color printing. Color can be represented using chromaticity diagrams and defined in terms of brightness, hue, and saturation.

Uploaded by

baigsalman251
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Ch06-Color Image Processing

The document discusses color fundamentals and color models for digital image processing. It explains that color provides more visual information than intensity alone and is useful for object recognition. Color is perceived based on the light wavelengths reflected from objects. The human visual system senses color using red, green, and blue cones. Common color models include RGB, used for computer and screen color, and CMYK, used for color printing. Color can be represented using chromaticity diagrams and defined in terms of brightness, hue, and saturation.

Uploaded by

baigsalman251
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 40

Digital Image Processing, 2nd ed.

1
www.imageprocessingbook.com

Chapter 6
Color
Image
Processing
www.ImageProcessingPlace.com
w.csie.ntnu.edu.tw/~violet/IP93/Chapter06.ppt
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 2
www.imageprocessingbook.com

Color Fundamentals

• When color is available, it gives much more


information about an image than intensity
alone.
• Color is very useful for recognition of objects
in an image both for humans and computers.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 3
www.imageprocessingbook.com

Color Fundamentals

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 4
www.imageprocessingbook.com

Color Fundamentals
• The actual color perceived by a human of an object
depends on both the color of the illumination and the
reflectivity of the object, as well as the sensitivity of
human perception.
• Objects appear to be different colors because they absorb
and reflect different colors of light. A blue object, for
example, reflects blue light while absorbing other colors.
• Grey objects or grey images reflect and absorb all
frequencies of light about equally, so they do not appear
colored.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 5
www.imageprocessingbook.com

Color Fundamentals
• Color is sensed by the eye using three kinds of cones, each sensitive primarily to
red, green or blue, though there is significant overlap.
• We refer to red, green and blue
as the primary colors,
and denote to set as RGB:
blue = 435.8nm
green = 546.1nm
red = 700nm
• Approximately:
65% cones are sensitive to red
33% cones are sensitive to green
2% cones are sensitive to blue

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 6
www.imageprocessingbook.com

Color Fundamentals
• Secondary colors:
Magenta (red + blue)
Cyan (green + blue)
Yellow (red + green)

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 7
www.imageprocessingbook.com

Color Fundamentals

Subtractive color - reflected light

Additive color - emitted light

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 8
www.imageprocessingbook.com

Chromaticity
• Brightness: associated with intensity
• Hue: associated with the dominant wavelength in a
mixture of light waves. It represents dominant color as
perceived by an observer.
• Saturation: refers to the relative purity or the amount of
white light mixed with a hue.

Hue & saturation taken together are called chromaticity

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 9
www.imageprocessingbook.com

Chromaticity Diagram

• The amounts of red, green, and blue needed to form any


particular color are called tristimulus values (X, Y and Z).
These represent three dimensional coordinates of any
perceived color.
• The tristimulus values can be normalized to give
trichromatic coefficients, x (red), y (green) and z (blue).
Note that because of normalization: x + y + z = 1.
• Since x, y and z are not independent, only x and y are
enough to specify a color.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 10
www.imageprocessingbook.com

Chromaticity Diagram

• If the wavelength of the pure colors are plotted in these


coordinates, and the mixtures of these wavelengths are
plotted inside the pure colors, the result is known as the
CIE (International Commission on Illumination)
chromaticity diagram.
• In the chromaticity diagram, white light is defined as the
mixture of equal amounts of all wavelengths of visible
light.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 11
www.imageprocessingbook.com

Chromaticity Diagram

Color gamut: X (red)


The color range
produced by an Y (green)
RGB monitor
Z (blue) =
(1-(X+Y))
Color printing
gamut is
irregular and
more limited

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 12
www.imageprocessingbook.com

Chromaticity Diagram

Exercise: [2, Problem 6.1]

Give the percentage of red


(X), green (Y), and blue (Z)
light required to generate
the point labeled “warm
white” in Fig. 6.5.

Exercise: [2, Problem 6.2]

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 13
www.imageprocessingbook.com

Color Models -- RGB Model

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 14
www.imageprocessingbook.com

Color Models -- RGB Model

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 15
www.imageprocessingbook.com

Color Models -- RGB Model

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 16
www.imageprocessingbook.com

Color Models -- RGB Model

For most graphics


images used for
Internet applications,
a set of 216 colors
has been selected to
represent “safe
colors” which
should be reliably
displayed on
computer monitors.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 17
www.imageprocessingbook.com

Color Models -- RGB Model

Exercise: [2, Problems 6.5, 6.7, 6.11]

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 18
www.imageprocessingbook.com

Color Models -- CMY and CMYK Models

• An RGB to CMY conversion


 C  1  R 
 M   1  G 
    
 Y  1  B 

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 19
www.imageprocessingbook.com

Color Image Representation in Matlab


Image Types

1. Intensity images
2. Binary images
3. RGB images
4. Indexed images

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 20
www.imageprocessingbook.com

Color Image Representation in Matlab


RGB Images

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 21
www.imageprocessingbook.com

Color Image Representation in Matlab


RGB Images

>> I = imread('filename');
>> imtool(I)

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 22
www.imageprocessingbook.com

Color Image Representation in Matlab


RGB Images

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 23
www.imageprocessingbook.com

Color Image Representation in Matlab


Indexed Images

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 24
www.imageprocessingbook.com

Color Image Representation in Matlab

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 25
www.imageprocessingbook.com

Color Image Representation in Matlab

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 26
www.imageprocessingbook.com

Color Image Representation in Matlab

RED GREEN BLUE


© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 27
www.imageprocessingbook.com

Color Image Representation in Matlab


>> imfinfo bt.jpg
ans =
Filename: 'bt.jpg'
FileModDate: '19-Dec-2007 11:07:32'
FileSize: 789895
Format: 'jpg'
FormatVersion: ''
Width: 2048
Height: 1536
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: ''
NumberOfSamples: 3
CodingMethod: 'Huffman'
CodingProcess: 'Sequential'
Comment: {}

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 28
www.imageprocessingbook.com

Color Image Representation in Matlab

>> f=imread('bt.jpg');
>> whos f
Name Size Bytes Class Attributes
f 1536x2048x3 9437184 uint8
>> imshow(f);
>> fR = f(:, :, 1);
>> fG = f(:, :, 2);
>> fB = f(:, :, 3);
>> f1=cat(3, fR, fG, fB);
>> imshow(f1)
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 29
www.imageprocessingbook.com

Color Image Representation in Matlab


>> f = imread(‘iris.jpg');
>> [X1, map1] = rgb2ind(f, 8, 'nodither');
>> [X2, map2] = rgb2ind(f, 8, 'dither');
>> imshow(X1, map1), figure, imshow(X2, map2);
map1 =
0.1882 0.1961 0.1765
0.7333 0.6588 0.6039
0.4667 0.4196 0.3922
0.7804 0.7961 0.8039
0.3333 0.3137 0.2980
0.5765 0.5176 0.4745
0.7451 0.7608 0.7725
0.7961 0.8235 0.8353
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 30
www.imageprocessingbook.com

Color Image Representation in Matlab

>> g = rgb2gray(f);
>> g1 = dither(g);
>> imshow(g);
>> figure, imshow(g1);

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 31
www.imageprocessingbook.com

The Basics of Color Image Processing


Three Principal Areas
1. Color Transformations:
Processing the pixels of each color plane based strictly on
their values and not on their spatial (neighborhood)
coordinates. It is similar to the grayscale image intensity
transformations
2. Spatial Processing of Individual Color Planes:
Spatial filtering of each color planes and is similar to the
grayscale image spatial filtering.
3. Color Vector Processing
Processing all components of a color image simultaneously,
where each pixel is represented as a vector.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 32
www.imageprocessingbook.com

Color Transformations

• Extension of the gray level transformations to color space


• In theory any transformation can be done in any color space
• Some transformations are better suited for specific color spaces
• The cost of color space transformations must be considered
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 33
www.imageprocessingbook.com

Color Transformations

g(x, y) = T[f(x, y)]


or
si = Ti(r1, r2,…,rn), i = 1, 2,…,n
where ri and si are color components of f(x, y) and g(x, y)

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 34
www.imageprocessingbook.com

Color Transformations
Intensity transformation

g(x, y) = k f(x, y), 0 < k < 1


or
si = k ri, i = 1, 2,…,n

CMY: si = k ri + (1-k), i = 1, 2, 3
RGB: si = k ri , i = 1, 2, 3
HSI: si = ri , i = 1, 2, s3 = k r3

The conversion calculations are more computationally


intense than the intensity transformation itself.
Exercise: [2, Problem 6.10]
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. 35
www.imageprocessingbook.com

Color Transformations
Intensity transformation

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 36
www.imageprocessingbook.com

Color Transformations
Intensity transformation

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 37
www.imageprocessingbook.com

Color Transformations
Color Complements Transformation
• Identical to the gray-scale negative transformation.
• Complements are basically given by subtracting one color from
white, or by changing a hue by 180 degrees.
• Useful for visualization of image detail obscured by dark regions.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 38
www.imageprocessingbook.com

Color Transformations
Color Complements Transformation

Exercise:
[2, Problems 6.20]

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 39
www.imageprocessingbook.com

Assignment
[1, Appendix B]
Create ICE graphical user interface and submit its
softcopy until April 24, 2008. This is a group
assignment and group leader will submit it by
email. Test this function ICE with all parameters
discussed in [1, Ch. 6].

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. 40
www.imageprocessingbook.com

References
1. Gonzalez R. C., Woods R. E., Eddins S. L., Digital Image
Processing Using Matlab, Pearson Education, 2006.
2. Gonzalez R. C., Woods R. E., Digital Image Processing,
Pearson Education, 2006.
3. http://www.imageprocessingplace.com/
4. http://www.cs.umu.se/kurser/TDBC30/VT05/

© 2002 R. C. Gonzalez & R. E. Woods

You might also like