0% found this document useful (0 votes)
39 views26 pages

DIP Unit 4

Uploaded by

halfblood8400
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)
39 views26 pages

DIP Unit 4

Uploaded by

halfblood8400
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/ 26

Digital Image Processing

Chapter 6:
Color Image Processing

Color Image Processing


Color Models
„ Color Model
„ A mathematical system for representing color

„ The human eye combines 3 primary colors (using the 3 different


types of cones) to discern all possible colors.

„ Colors are just different light frequencies


„ red – 700nm wavelength

„ green – 546.1 nm wavelength

„ blue – 435.8 nm wavelength


g

„ Higher frequencies are cooler colors

3
Primary
y Colors
„ Primary colors of light are additive
„ Primary
y colors are red, green,
g and blue
„ Combining red + green + blue yields white

„ Primary colors of pigment are


subtractive
„ Primary
P i colors
l are cyan, magenta, and
d yellow
ll
„ Combining cyan + magenta + yellow yields
black 5

RGB Color model

Active displays, such as computer monitors and television sets, emit


combinations of red,
red green and blue light.
light This is an additive color model
6
CMY Color model

Passive displays, such as color inkjet printers, absorb light instead of


emitting it.
it Combinations of cyan,
cyan magenta and yellow inks are used.used This
is a subtractive color model.
7

RGB vs CMY
RGB color cube

RGB 24-bit color cube

RGB and CMY Color Cubes

10
RGB and CMY Color Cubes

11

RGB Example
p

Original Red Band Green Band Blue Band

12
RGB Example
p

Original
g No Red No Green No Blue

13

RGB Example
Color receptors and color
deficiency
„ In color normal people
people, there are three types of color
receptors, called cones, which vary in their sensitivity to
g at different wavelengths.
light g
„ Deficiency by optical problems in the eye, or by absent
receptor types
„ Usually a result of absent genes.

„ Some people
l have
h fewer
f than
h three
h types off receptor; most
common deficiency is red-green color blindness in men.
„ Color deficiency is less common in women; red and green
receptor genes are carried on the X chromosome, and these
are the ones that typically go wrong. Women need two bad X
chromosomes to have a deficiency, and this is less likely.

Light
g Intensity
y
„ Note that intensity is a weighted function of the r,
r gg, b
values.

„ The human eye doesn’t weight each component


identically!

intensity = 0.299*Red
0 299*Red + 0.587*Green
0 587*Green + 0.144*Blue
0 144*Blue

„ Assume three light sources have the same actual


intensity but are colored red, green, and blue
The green light will appear brightest followed by red and blue
16
HSI Color Model
„ HUE
„ A subjective measure of color
„ A
Average h
human eye can perceive
i ~200
200 different
diff t colors
l

„ S
Saturation
i
„ Relative purity of the color. Mixing more “white” with a
color
l reduces
d iits saturation.
i
„ Pink has the same hue as red but less saturation

„ Intensity
„ The brightness or darkness of an object
17

HSI Color Model


H
dominant
g
wavelength

S
purity
% white

I
Intensity
18
HSI Color Model
„ Hue is defined as an angle
„ 0 degrees is RED

„ 120 degrees
d iis GREEN
„ 240 degrees is BLUE

„ Saturation is defined as the percentage of distance from the


center
t of f the
th HSI ttriangle
i l to
t th
the pyramid
id surface.
f
„ Values range from 0 to 1.

„ Intensity is denoted as the distance “up” the axis from black.


„ Values range from 0 to 1
19

HSI Color Model

20
HSI Color
Model

HSI and RGB

RGB and HSI are commonly used to


specify colors in software applications.

HSI has variants such as HSL, HSB and


HSV.
HSV

22
Conversion Between RGB and
HSI
Color Distance

„ Quantifying
Q tif i ththe diff
difference ((or simil
similarity)
it )
between two colors
„ L1 metric is the taxi-cab distance
„ L2 metric
t i iis th
the straight-line
t i ht li di distance
t
„ Distances are often normalized to the
interval [0-1]
„ Compute the distance in normalized color space
„ Divide by maximum possible distance in that
space 25

Color Distance

26
Color and Images
g
„ Structure of a digital image
„ p
pixel – the color of an image
g at a specific
p
point
„ sample – one dimension of a pixel
„ band – all samples on the same layer

27

I
Image “T s”
“Types”
((categorized
g by
y “color”))

„ Binary Image
„ has exactly two colors

„ Grayscale
„ has no chromatic content

„ Color
„ contains some pixels with color
„ more than two colors exist
28
Color Depth
p
„ Describes the ability of an image to accurately
reproduce colors
„ Given as the “number
number of bits consumed by a single
pixel”
„ Otherwise
Other ise known
kn n ass “bits per pixel” (bpp)

„ Binary images are ____ bpp?


„ Grayscale images are typically ____ bpp?
„ Color images are typically ____ bpp?
29

A B
C D

A: 1 bpp
pp
B: 2 bpp
C: 5 bpp
D: 24 bpp

30
Tristimulus Values
„ Tristimulus value
„ The amounts of red, green, and blue needed to form
any particular
ti l color
l are called
ll d th
the tristimulus
t i ti l values,
l
denoted by X, Y, and Z.
„ T i h
Trichromatic
i coefficients
ffi i
X Y Z
x= , y= , z=
X +Y + Z X +Y + Z X +Y + Z
„ Only two chromaticity coefficients are necessary to
specify the chrominance of a light.
X +Y + Z =1

CIE Chromaticity Diagram


„ CIE (Commission
Internationale de
L’Eclairage,
g International
Commission on Illumination
) system of color
specificati n
specification.
„ x axis: red
y axis: green
„ e.g. GREEN point:
x: 25%,
25% y: 62%,
62% z: 13%.
13%
„ Colors on the boundary:
spectrum colors,
colors highest
saturation.
CIE Chromaticity Diagram

„ The blobby
region
represents
p
visible colors.
There are sets
off (x,
( y))
coordinates
that don
don’tt
represent real
colors because
colors,
the primaries
are not real
lights

Color Colors perceived


by human eye

Gamut
Printable Colors
(CMYK mode)

Colors that can


be displayed on
an RGB monitor
Subtractive mixing of inks
„ Inks subtract light from white.
white
„ Inks: Cyan=White-Red, Magenta=White-Green,
Y ll
Yellow=White-Blue.
Whit Bl
„ For a good choice of inks,
inks and good registration,
registration matching
is linear and easy
„ eg.
g C+M+Y=White-White=Black,, C+M=White-Yellow=Blue

„ Usually require CMY and Black, because colored inks are


more expensive,
expensive and registration is hard (CMYK)
„ For g
good choice of inks,, there is a linear transform
between XYZ and CMY

Color Models
„ Specify three primary or secondary colors
„ Red, Green, Blue.
„ Cyan Magenta
Cyan, Magenta, Yellow.
Yellow
„ Specify the luminance and chrominance
„ – HSB, HSI or HSV (Hue, saturation, and
brightness, intensity or value)
„ YIQ (used
( d in
i NTSC colorl TV)
„ YCbCr (used in digital color TV)
„ Amplitude specification:
„ 8 bits p
per color component,
p , or 24 bits p
per pixel
p
„ Total of 16 million colors
YIQ Color Coordinate System
„ YIQ is defined by the National Television
System
y Committee (NTSC)
„ Y describes the luminance, I and Q
describes the chrominance.
chrominance
„ A more compact representation of the
color.
„ YUV plays similar role in PAL and SECAM.

YUV/YCbCr Coordinate
„ YUV is the color coordinate used in color
TV in PAL system,
y somewhat different
from YIQ.

„ YCbCr is the digital equivalent of YUV,


used
d for
f digital
di i l TV
TV, with
i h 8 bit
bi for
f eachh
component, in range of 00-255
255
Criteria for Choosing the Color
Coordinates
„ The type of representation depends on the
applications at hand.
„ For display
F d l or printing, choose
h primary colors
l so
that more colors can be produced. E.g. RGB for
di l i and
displaying d CMY ffor printing.
i ti
„ For analytical
y analysis
y of color differences,,
HSI is more suitable.
„ For transmission or storage
storage, choose a less
redundant representation, eg. YIQ or YUV or
YCbCr
YCbC

Comparison
p of Different Color Spaces
p

Much details
than other
bands (can be
used for
processing
color images)
Color image processing
„ How can we process a colored image?
„ By
y processing
p g each RGB component
p
„ By processing the intensity component of
the HSI image and then converting it to
RGB.

Original /
Corrected

Color Balancing
„ Color Balancing Corrections for CMYK color images
Original /
Corrected

Color Balancing cont.


cont
„ Color Balancing Corrections for CMYK color images

Pseudo Color Display


„ Intensity
I t it slicing:
li i : Display
Dis l different
diff t gray
levels as different colors
„ Can be useful to visualize medical / scientific
/ vegetation imagery
„ E.g. if one is interested in features with a certain
intensityy range
g or several intensity
y ranges
g
„ Frequency slicing: Decomposing an image
into different frequency components and
represent them using different colors.
Intensity Slicing

„ gray scale (intensity) value in the range of (f


Pixels with gray-scale i-1 , fi) are
rendered with color Ci

Example
Another Example
p

Pseudo Color Display of Multiple


Images
„ Display multi
multi-sensor
sensor images as a single color
image
„ Multi-sensor
Multi sensor images: e
e.g.
g multi
multi-spectral
spectral images by
satellite
Example
p

Example

(a) Pseudocolor
rendition
diti of f
Jupiter
p Moon.
(b) A close-
up.(Courtesy
(C t off
N
NASA.) .)
Color Quantization
„ In low end monitors,
monitors the monitor cannot display
all possible colors.

„ Select a set of colors, save them in a look-up


table (also known as color map or color palette)

„ Any color is quantized to one of the indexed


colors

„ Only needs to save the index as the image pixel


value
l andd iin th
the display
di l b buffer
ff

Example of Color Quantization

You might also like