8/9/2019 Image Processing 12-ColourImageProcessing.ppt
1/76
Course Website: http://www.comp.dit.ie/bmacnamee
Digital Image Processing
Colour Image Processing
http://www.comp.dit.ie/bmacnameehttp://www.comp.dit.ie/bmacnamee
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
2/76
2
of
39Introduction
oda! we"ll loo# at colour image processing$co%ering:
& Colour fundamentals
& Colour models
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
3/76
3
of
39Colour 'undamentals
In ())) *ir Isaac +ewton disco%ered thatwhen a beam of sunlight passes through a
glass prism$ the emerging beam is split into a
spectrum of colours
I m a
g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
4/76
of
39Colour 'undamentals cont1
he colours that humans and most animalspercei%e in an ob4ect are determined b! the
nature of the light reflected from the ob4ect
'or e5ample$ greenob4ects reflect light
with wa%e lengths
primaril! in the rangeof 600 & 670 nm while
absorbing most of the
energ! at other
wa%elengths
W h i t e 8i g h t
Colours
bsorbed
, r e e n 8 i g h t
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
5/76
6
of
39Colour 'undamentals cont1
Chromatic light spans the electromagneticspectrum from appro5imatel! 00 to 700 nm
s we mentioned before human colour %ision
is achie%ed through ) to 7 million cones ineach e!e
I m a
g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
6/76
)
of
39Colour 'undamentals cont1
ppro5imatel! )) of these cones aresensiti%e to red light$ 33 to green light and
) to blue light
bsorption cur%es for the different cones ha%ebeen determined e5perimentall!
*trangel! these do not match the CI;
standards for red 700nm1$ green 6).(nm1and blue 36.
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
7/76
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
8/76
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
9/76
9
of
39CI; Chromacit! Diagram
*pecif!ing colours s!stematicall! can beachie%ed using the CI; chromacity diagram
@n this diagram the 5Aa5is represents the
proportion of red and the !Aa5is represents theproportion of red used
he proportion of blue used in a colour is
calculated as: z = 1 – (x + y)
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
10/76
(0
of
39CI; Chromacit! Diagram cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 ,reen: )2 green$
26 red and (3blue
Bed: 32 green$)7 red and (blue
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
11/76
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
12/76
(2
of
39CI; Chromacit! Diagram cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 his means the entire
colour range cannot be
displa!ed based on
an! three colours
he triangle shows the
t!pical colour gamut
produced b! B,
monitorshe strange shape is
the gamut achie%ed b!
high >ualit! colour
printers
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
13/76
(3
of
39Colour odels
'rom the pre%ious discussion it should beob%ious that there are different wa!s to model
colour
We will consider two %er! popular modelsused in colour image processing:
& B, Red Green Blue1
& EI* Hue Saturation Intensit!1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
14/76
(
of
39B,
In the B, model each colour appears in itsprimar! spectral components of red$ green and
blue
he model is based on a Cartesian coordinates!stem
& B, %alues are at 3 corners
& C!an magenta and !ellow are at three other corners
& lac# is at the origin
& White is the corner furthest from the origin
& Different colours are points on or inside the cube
represented b! B, %ectors
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
15/76
(6
of
39B, cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
16/76
()
of
39B, cont1
Images represented in the B, colour modelconsist of three component images & one for
each primar! colour
When fed into a monitor these images arecombined to create a composite colour image
he number of bits used to represent each
pi5el is referred to as the colour depth 2Abit image is often referred to as a fullA
colour image as it allows F ()$777$2()
colours
3
82( )
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
17/76
(7
of
39B, cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
18/76
(<
of
39he E*I Colour odel
B, is useful for hardware implementationsand is serendipitousl! related to the wa! in
which the human %isual s!stem wor#s
Eowe%er$ B, is not a particularl! intuiti%ewa! in which to describe colours
Bather when people describe colours the!
tend to use hue$ saturation and brightnessB, is great for colour generation$ but E*I is
great for colour description
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
19/76
(9
of
39he E*I Colour odel cont1
he E*I model uses three measures todescribe colours:
& Hue: colour attribute that describes a pure
colour pure !ellow$ orange or red1 & Saturation: ,i%es a measure of how much a
pure colour is diluted with white light
& Intensity: rightness is nearl! impossible to
measure because it is so sub4ecti%e. Instead we
use intensit!. Intensit! is the same achromatic
notion that we ha%e seen in gre! le%el images
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
20/76
20
of
39E*I$ Intensit! B,
Intensit! can be e5tracted from B, images &which is not surprising if we stop to thin#
about it
Bemember the diagonal on the B, colourcube that we saw pre%iousl! ran from blac# to
white
+ow consider if we stand this cube on theblac# %erte5 and position the white %erte5
directl! abo%e it
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
21/76
2(
of
39E*I$ Intensit! B, cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 +ow the intensit! component
of an! colour can be
determined b! passing a
plane perpendicular tothe intenist! a5is and
containing the colour
point
he intersection of the plane
with the intensit! a5is gi%es us the intensit!
component of the colour
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
22/76
22
of
39E*I$ Eue B,
In a similar wa! we can e5tract the hue fromthe B, colour cube
Consider a plane defined b!
the three points c!an$ blac#and white
ll points contained in
this plane must ha%e thesame hue c!an1 as blac#
and white cannot contribute
hue information to a colour I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
23/76
23
of
39he E*I Colour odel
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 Consider if we loo# straight down at the B,
cube as it was arranged pre%iousl!
We would see a he5agonal
shape with each primar!colour separated b! (20G
and secondar! colours
at )0G from the primaries
*o the E*I model is
composed of a %ertical
intensit! a5is and the locus of colour points that
lie on planes perpendicular to that a5is
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
24/76
2
of
39he E*I Colour odel cont1
I m a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 o the right we see a he5agonal
shape and an arbitrar! colour
point
& he hue is determined b! anangle from a reference point$
usuall! red
& he saturation is the distance from the origin to the
point & he intensit! is determined b! how far up the
%ertical intenist! a5is this he5agonal plane sits not
apparent from this diagram
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
25/76
26
of
39he E*I Colour odel cont1
I m
a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a
g e P r o c e s s i n g / 2 0 0 2 1 ecause the onl! important things are the angle
and the length of the saturation %ector this planeis also often represented as a circle or a triangle
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
26/76
2)
of
39E*I odel ;5amples
I m
a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
27/76
27
of
39E*I odel ;5amples
I m
a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
28/76
2<
of
39Con%erting 'rom B, o E*I
,i%en a colour as B$ ,$ and its E$ *$ and I%alues are calculated as follows:
H =θ if B ≤G
360 −θ if B >G
⎨ ⎩
θ = cos−1
1
2 R −G( ) + R − B( )[ ]
R −G( )2+ R − B( ) G − B( )[ ]
1
2
⎨ ⎪
⎩ ⎪
⎪
⎭⎪
S =1−3
R +G + B( )
min R,G, B( )[ ]
I = 13 R +G + B( )
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
29/76
29
of
39Con%erting 'rom E*I o B,
,i%en a colour as E$ *$ and I it"s B$ ,$ and %alues are calculated as follows:
& B, sector 0
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
30/76
30
of
39Con%erting 'rom E*I o B, cont1
& B sector 240°
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
31/76
3(
of
39E*I B,
I m
a g e s t a # e n f r o m , o n - a l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
B, Colour Cube
E$ *$ and I Components of B, Colour Cube
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
32/76
32
of
39anipulating Images In he E*I odel
In order to manipulate an image under the EI*model we:
& 'irst con%ert it from B, to EI*
& Perform our manipulations under E*I & 'inall! con%ert the image bac# from E*I to B,
B,Image E*I Image B,Image
anipulations
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
33/76
33
of
39B, AH E*I AH B,
I m
a g e s t a # e n f r o m , o n - a
l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
B,
Image
*aturation
Eue
Intensit!
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
34/76
36
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
35/76
36
of
39Pseudocolour Image Processing
Pseudocolour also called falsecolour1 image processing consists
of assigning colours to gre! %alues
based on a specific criterionhe principle use of pseudocolour
image processing is for human
%isualisation & Eumans can discern betweenthousands of colour shades and
intensities$ compared to onl! about
two do-en or so shades of gre!
3) Pseudo Colour Image Processing
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
36/76
3)
of
39
Pseudo Colour Image Processing &
Intensit! *licing
Intensit! slicing and colour coding is one of thesimplest #inds of pseudocolour image
processing
'irst we consider an image as a 3D functionmapping spatial coordinates to intensities that
we can consider heights1
+ow consider placing planes at certain le%els
parallel to the coordinate plane
If a %alue is one side of such a plane it is
rendered in one colour$ and a different colour if
on the other side
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
37/76
3< Pseudocolour Image Processing
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
38/76
3<
of
39
Pseudocolour Image Processing &
Intensit! *licing cont1
In general intensit! slicing can be summarisedas:
& 8et 0, L-1J represent the gre! scale
& 8et l0 represent blac# f(x, y) = 0J and let l L-1 represent white f(x, y) = L-1J
& *uppose P planes perpendicular to the intensit!
a5is are defined at le%els l 1, l 2, …, l p
& ssuming that 0 < P < L-1 then the P planes
partition the gre! scale into P + 1 inter%als V 1 , V 2 ,
…,V P+1
39 Pseudocolour Image Processing
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
39/76
39
of
39
Pseudocolour Image Processing &
Intensit! *licing cont1
& ,re! le%el colour assignments can then be madeaccording to the relation:
& where ck is the colour associated with the k th
intensit! le%el V k defined b! the partitioning
planes at l = k – 1 and l = k
f ( x, y) = ck if f ( x, y)∈V k
0
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
40/76
0
of
39B, AH E*I AH B, cont1
I m
a g e s t a # e n f r o m , o n - a
l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
(
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
41/76
(
of
39B, AH E*I AH B, cont1
I m
a g e s t a # e n f r o m , o n - a
l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
2
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
42/76
2
of
39B, AH E*I AH B, cont1
I m
a g e s t a # e n f r o m , o n - a
l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
3
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
43/76
3
of
39B, AH E*I AH B, cont1
I m
a g e s t a # e n f r o m , o n - a
l e - . W o o d s $
D i g i t a l I m a g e P r o c e s s i n g / 2 0 0 2 1
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
44/76
of
39Chapter 6
Color Image Processing
6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
45/76
6
of
39Chapter 6
Color Image Processing
)
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
46/76
)
of
39Chapter 6
Color Image Processing
7
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
47/76
7
of
39Chapter 6
Color Image Processing
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
48/76
<
of
39Chapter 6
Color Image Processing
9
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
49/76
9
of
39Chapter 6
Color Image Processing
60
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
50/76
60
of
39Chapter 6
Color Image Processing
6(
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
51/76
6(
of
39Chapter 6
Color Image Processing
62
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
52/76
62
of
39Chapter 6
Color Image Processing
63
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
53/76
63
of
39Chapter 6
Color Image Processing
6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
54/76
of
39Chapter 6
Color Image Processing
66
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
55/76
of
39Chapter 6
Color Image Processing
6)
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
56/76
of
39Chapter 6
Color Image Processing
67
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
57/76
of
39Chapter 6
Color Image Processing
6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
58/76
of
39Chapter 6
Color Image Processing
69
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
59/76
of
39Chapter 6
Color Image Processing
)0
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
60/76
of
39Chapter 6
Color Image Processing
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
61/76
)2
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
62/76
of
39Chapter 6
Color Image Processing
)3
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
63/76
of
39Chapter 6
Color Image Processing
)
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
64/76
of
39Chapter 6
Color Image Processing
)6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
65/76
of
39Chapter 6
Color Image Processing
))
f
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
66/76
of
39Chapter 6
Color Image Processing
)7
f h
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
67/76
of
39Chapter 6
Color Image Processing
)<
f Ch 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
68/76
of
39Chapter 6
Color Image Processing
)9
f Ch t 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
69/76
of
39Chapter 6
Color Image Processing
70
f Ch t 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
70/76
of
39Chapter 6
Color Image Processing
7(
of Ch t 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
71/76
of
39Chapter 6
Color Image Processing
72
of Ch t 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
72/76
of
39Chapter 6
Color Image Processing
73
of Chapter 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
73/76
of
39Chapter 6
Color Image Processing
7
of Chapter 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
74/76
of
39Chapter 6
Color Image Processing
76
of Chapter 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
75/76
of
39Chapter 6
Color Image Processing
7)
of Chapter 6
8/9/2019 Image Processing 12-ColourImageProcessing.ppt
76/76
of
39Chapter 6
Color Image Processing