0% found this document useful (0 votes)
14 views36 pages

Lecture 11

The document covers color image processing fundamentals, including color models (RGB, CMY, HSI), pseudocolor techniques, and full-color image processing methods. It discusses the characteristics of colors, color transformations, and various processing techniques such as smoothing, sharpening, and segmentation. The lecture also addresses noise in color images and concludes with a preview of future topics related to image compression.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views36 pages

Lecture 11

The document covers color image processing fundamentals, including color models (RGB, CMY, HSI), pseudocolor techniques, and full-color image processing methods. It discusses the characteristics of colors, color transformations, and various processing techniques such as smoothing, sharpening, and segmentation. The lecture also addresses noise in color images and concludes with a preview of future topics related to image compression.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

EENG 860 Special Topics: Digital Image Processing

Lecture 11: Color Image Processing

Dr. Ahmadreza Baghaie


Department of Electrical and Computer Engineering
New York Institute of Technology

Spring 2020

Readings: Chapter 6
1 / 36
How to read: relaxed, with notes!
Table of Content

● Color Fundamentals
● Color Models
● Pseudocolor Image Processing
● Full-Color Image Processing

2 / 36
Color Fundamentals

● In 1666, Isaac Newton discovered that when a beam of sunlight passes


through a glass prism, the emerging light consists of a continuous spectrum
of colors, from violet to red.
● A body that reflects light that is balanced in all visible wavelength appears
white.
● A body that favors reflectance in a limited range of the visible spectrum
shows some shades of color.

3 / 36
Color Fundamentals

● Monochromatic (achromatic) light, is a light that is void of color,


represented only by its intensity (gray level), ranging from black to white.
● Chromatic light spans the electromagnetic energy spectrum from 400 to
700 nano-meter.
● Radiance: total amount of energy that flows from the light source, measured
in watts (W).
● Luminance: amount of energy an observer perceives from a light source,
measured in lumens (lm).
● Brightness: a subjective descriptor of light perception, impossible to
measure, representing the achromatic notion of intensity.
● Cone cells are responsible for color vision.

4 / 36
Color Fundamentals

● Standard primary colors: red (R) at 700


nm, green (G) at 546.1 nm and blue (B)
at 435.8 nm.
● Primary does not mean that all visible
colors can be generated by primary
colors; the wavelength needs to change
as well.
● Secondary colors can be made by
adding primary colors: magenta (R+B),
cyan (G+B) and yellow (R+G).

5 / 36
Color Fundamentals

● There is a difference between primary colors of light and the primary colors
of pigments or colorants.
● In pigments, a primary color is the 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, and the
secondary colors are red, green and blue.
● Distinguishing characteristics of colors:
– Brightness: achromatic notion of intensity.
– Hue: dominant wavelength in a mixture of light waves, or the dominant
color perceived by an observer.
– Saturation: relative purity or the amount of white light mixed with the
hue.
● Hue and saturation combined are called chromaticity.
6 / 36
Color Fundamentals

● The amounts of red, green and


blue to form any particular color are
called tristimulus values, and are
shown by X, Y and Z.
● The color is specified by its
trichromatic coefficients as:

X
x=
X +Y +Z
Y
y=
X +Y +Z
Z
z=
X +Y +Z
x+ y+ z=1

7 / 36
Color Models - RGB

● In the RGB model, each color appears in


its primary spectral components of red,
green and blue.
● The model is shown in a Cartesian
coordinate system.
● In the figure, the primary values are at
the three corners while the secondary
colors are at the other three corners.
● Black is at the origin, and white is at the
corner farthest from the origin.
● The grayscale, where the RGB values
are all equal, extends from black to white
along the line joining these two points.

8 / 36
Color Models – CMY and CMYK

● The secondary colors of light (cyan, magenta and yellow) are the primary
colors of pigments.
● For example, when a surface coated with cyan pigment is illuminated by
white light, no red light is reflected from the surface, since cyan subtracts red
light from the white light.
● Conversion from RGB to CMY is simple:
C 1 R

[ ] [] [ ]
M =1−G
Y 1 B
● Equal amounts of pigment primaries should produce black.
● In practice, since C, M and Y inks are not pure colors, this cannot be done.
Instead, a fourth color black, shown by K, is added.

9 / 36
Color Models – HSI

● RGB and CMY color models are not well-suited for color description for
practical human interpretation.
● Humans describe colors by hue, saturation and brightness.
● Distinguishing characteristics of colors:
– Brightness: achromatic notion of intensity.
– Hue: dominant wavelength in a mixture of light waves, or the dominant
color perceived by an observer.
– Saturation: relative purity or the amount of white light mixed with the
hue.
● Hue and saturation combined are called chromaticity.
● The HSI (hue, saturation, intensity) color model, decouples the intensity
component from the color-carrying information.
● The derivation is described in Section 6.2.
10 / 36
Color Models – HSI

● The equations for converting from RGB to HSI are as follows:


1
H= θ
{ if B≤G with θ =cos−1
360− θ if B>G

3
{ 2
[( R−G )+(R−B)]

2
[(R−G) +( R−B)(G−B)]
1
2 }
S=1− [min( R , G , B )]
R +G +B
1
I = ( R+G +B)
3

11 / 36
Pseudocolor Image Processing

● Pseudocolor image processing consists of assigning colors to gray values


based a specified criterion.
● Humans can distinguish thousands of color shades and intensities compared
to less than two dozen shades of gray.
● Intensity slicing is the simplest method in pseudocolor image processing.
● In this technique the range from black to white colors are divided into
sections, each shown with a different color.

12 / 36
Pseudocolor Image Processing

13 / 36
Basics of Full-Color Image Processing

● Full-color image processing consists of two categories:


– To process each grayscale component individually, then form the
composite color image.
– To process color pixels directly. c R ( x , y) R( x , y)

[ ][ ]
The color pixel can be shown as a vector: c (x , y)= c G ( x , y) = G( x , y )
cB( x , y ) B( x , y )

14 / 36
Color Models

15 / 36
Color Transformations

● Color transformation can be modeled as:


s i =T i (r i ), i=1,2,... , n

where n is the total number of component images, ri are the intensity values
of the input component images and si are the spatially corresponding
intensities in the output component images and Ti are the set of
transformations or color mappings.
● n is 3 for RGB, CMY and HSI, and is 4 for CMYK.
● T can be different for each component image.
● Even though any transformation can be performed in any color space, some
operations are better suited to specific models.

16 / 36
Color Transformations

● For example, let’s modify the intensity of an image with a constant value k in
the range [0,1].
● In the HSI color space, only we should modify the intensity component:

HSI: s1=r 1 , s 2=r 2 , s3=k r 3


● In RGB we modify all three components by the same constant:
RGB: s i =k r i
● In CMY, all three components are modified similarly as well:
CMY: si =k r i +(1−k ) i=1,2,3
● In CMYK, the transformation is done only by modifying the K component:

ri i=1,2,3
CMYK: si =
{k r i +(1−k ) i=4
17 / 36
Color Transformations

18 / 36
Color Complements

● The color circle, or the color wheel, is a visual representation of colors


according to their chromatic relationship.
● Hues directly opposite one another on the color circle are complements.
● In RGB, the implementation is as:
Blue Magenta

R out 1 R in

[ ] [][ ]
Gout = 1 − G in
B out 1 B in
Cyan
Com
plemen
ts
Red

Green Yellow

19 / 36
Color Complements

● In HSI color space, the complement transformation is not as straightforward.


● The saturation component of the complement cannot be computed only by
the saturation component of the input image.
● The implementation is as follows:

H in +0.5 0.0≤H in≤0.5


H out =
{
H in−0.5 0.5< H in ≤1.0

S out =S in

I out =1−I in

20 / 36
Color Slicing

● Highlighting a specific range of colors to display.


● If the colors of interest are shown by a cube (hyper-cube for n>3) of width W,
centered at color (a1, a2, …, an), the transformations are:

W
si=
{ [
0.5 if |r j −a j|> ]
2 any 1≤ j≤n for i=1,2,. .. , n
ri otherwise
● If the colors of interest are shown by a sphere (hyper-sphere for n>3) of
radius R0, centered at color (a1, a2, …, an), the transformations are:
n

si=
{0.5 if
ri
∑ (r j−a j )2 > R 20
j=1
otherwise
for i=1,2,... , n

21 / 36
Color Slicing

22 / 36
Tonal and Color Corrections

● Typically the same transformation


function is applied to each component
if the RGB or CMY is used.
● For HSI, only the intensity component
is modified while the hue and
saturation remain unchanged.

23 / 36
Tonal and Color Corrections

24 / 36
Histogram Processing

● Histogram processing of individual color components is not recommended.


● In HSI, we can process the intensity component only, and leave the hue and
saturation components unchanged.

25 / 36
Color Image Smoothing

● In RGB color space, smoothing can be done on individual image’s color


components.
● In HSI color space, the intensity and color information are decoupled, so we
can only smooth the intensity component.

26 / 36
Color Image Sharpening

● In RGB, the Laplacian operator can be computed for each of the image’s
color components.
● In HSI, only Laplacian of the intensity component is computed for image
sharpening.

27 / 36
Color Image Segmentation

● In HSI, saturation is commonly used as a masking image in order to isolate


further regions of interest in the hue image.
● The intensity image is less common since it does not carry color information.

28 / 36
Color Image Segmentation

● Even though working in HSI space is more


intuitive, segmentation is better if done in
RGB color space.
● Given a set of sample color points for the
color of interest, we can use a distance
function to measure the distance of all of the
color points to the color of interest, and
segment the image by applying a threshold
on the distance.

29 / 36
Color Edge Detection

● The gradient discussed before for edge detection of grayscale images


cannot be applied directly to color images, since it was not defined for vector
quantities.
● Assume r, g and b as the unit vectors along the R, G and B axis of RGB
color space, and define:

2 2 2
∂R ∂G ∂B
| || || |
{
T
∂R ∂G ∂B g xx =⃗
u . ⃗u=u u= + +
∂x ∂x ∂x

{ u=

v=
∂x
∂R
∂y
r+

r+
∂x
∂G
∂y
g+

g+
∂x
∂B
∂y
b

b yy
∂R
∂y
u . ⃗v =uT v=
g xy =⃗
∂G
∂y
2
∂B
g =⃗v . ⃗v =v v=| | +| | +| |
T

∂y
2 2

∂R ∂ R ∂G ∂G ∂ B ∂ B
+ +
∂x ∂ y ∂x ∂ y ∂x ∂ y

30 / 36
Color Edge Detection

● Based on the defined quantities, the direction of the maximum rate of change
of c(x,y) is given by:

1 2 g xy
θ ( x , y )= arctan
2 [
g xx −g yy ]
● The value of the rate of change in this direction is:

1
1
{
F θ ( x , y )= [ ( g xx + g yy )+( g xx −g yy ) cos 2 θ ( x , y )+2 g xy sin 2 θ ( x , y ) ]
2 }
2

● These equations associate with each point (x,y) a pair of orthogonal


directions, where along one of them F is maximum and it is minimum along
the other one.
31 / 36
Color Edge Detection – Example

32 / 36
Noise in Color Images

● The characteristics of noise are usually similar in all of the image’s color
components, but this is not always the case.
● Fine grain noise is less visually noticeable in color images than in grayscale
images.

33 / 36
Noise in Color Images

● Converting an RGB image to an HSI causes significant degradation of the


hue and saturation components, because of the non-linearity of cosine and
minimum functions in the conversion process.
● The intensity component is slightly smoother, since it is the average of the
RGB component images.

34 / 36
What is Next?

● Image Compression Fundamentals


● Redundancies
● Measuring Image Information
● Fidelity Criteria
● Image Compression Models
● Image Coding
● Image Watermarking

35 / 36
Questions?
[email protected]

36 / 36

You might also like