DIP9
DIP9
PROCESSING
Colour Image Processing
Introduction
Today we’ll look at colour image processing, covering:
Colour fundamentals
Colour models
Colour Fundamentals
In 1666 Sir Isaac Newton discovered that when a
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
RGB (cont…)
RGB (cont…)
Images represented in the RGB colour model consist of
three component images – one for each primary
colour
When fed into a monitor these images are combined
to create a composite colour image
The number of bits used to represent each pixel is
referred to as the colour depth
A 24-bit image is often3 referred to as a full-colour
image as it allows 28 = 16,777,216 colours
Colour Models – RGB – The Web-safe/All
systems safe colours
Given the variety of hardware systems the colour reproduction
becomes an issue
The web-safe colours is a subset (216 colours) that are tested to be
produced in the same way by all hardware systems
Web safe colours are used whenever it is desired that a certain colour
viewed by most people appear the same
The HSI Colour Model
RGB is useful for hardware implementations and is
related to the way in which the human visual system
works
However, RGB is not a particularly intuitive way in
which to describe colours
For example, it is not common to say that a car’s colour
contains 30% red, 40% green and 10% blue in a
normal conversation
RGB is great for colour generation, but HSI is great
for colour description
The HSI Colour Model (cont…)
A more useful model is the HSI model
The HSI model uses three measures to describe
colours:
Hue represents the perception of an observer
about the dominant colour
Saturation refers to the purity of a colour or the
amount of white light mixed with hue
Intensity (gray level) gives a measure of the
degree of blackness and whiteness
HSI, Intensity & RGB
Intensity can be extracted from RGB images
Remember the diagonal on the RGB colour cube that
we saw previously ran from black to white – called
intensity axis.
Now consider if we stand this cube on the black
vertex and position the white vertex directly above it
HSI, Intensity & RGB (cont…)
Now the intensity component of any
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
colour cube
Consider a plane defined by
the three points cyan, black
and white
All points contained in
this plane must have the
same hue (cyan) as black
and white cannot contribute
hue information to a colour
The HSI Colour Model
Consider if we look straight down at the RGB cube as it
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
360 if B G
R G2 R BG B 2
3
S 1 min R,G,B I 13 R G B
R G B
Converting From HSI To RGB
Given a colour as H, S, and I it’s R, G, and B values
are calculated as follows:
RG sector (0 <= H < 120°)
S cos H
R I1 G 3I R B B I1 S
cos60 H
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
RGB RGB
HSI Image
Image Image
Manipulations
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Saturation
Image
RGB
RGB -> HSI -> RGB
Hue
Intensity
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Intensity
Hue
RGB -> HSI -> RGB (cont…)
RGB
Image
Saturation
Pseudocolour Image Processing
Pseudocolour (also called false colour)
image processing consists of assigning
colours to grey values based on a specific
criterion
The principle use of pseudocolour image
processing is for human visualisation
Humans can discern between thousands of
colour shades and intensities, compared to
only about two dozen or so shades of grey
Pseudo Colour Image Processing –
Intensity Slicing
Intensity slicing and colour coding is one of the
simplest kinds of pseudocolour image processing
First we consider an image as a 3D function
mapping spatial coordinates to intensities (that we
can consider heights)
Now consider placing planes at certain levels
parallel to the coordinate plane
If a value is one side of such a plane it is rendered
in one colour, and a different colour if on the other
side
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Slicing (cont…)
Pseudocolour Image Processing – Intensity
Pseudocolour Image Processing – Intensity
Slicing (cont…)
In general intensity slicing can be summarised as:
Let [0, L-1] represent the grey scale
Let l0 represent black [f(x, y) = 0] and let lL-1 represent
white [f(x, y) = L-1]
Suppose P planes perpendicular to the intensity axis
are defined at levels l1, l2, …, lp
Assuming that 0 < P < L-1 then the P planes partition
the grey scale into P + 1 intervals V1, V2,…,VP+1
Pseudocolour Image Processing – Intensity
Slicing (cont…)
Grey level colour assignments can then be made
according to the relation:
f (x, y) ck if f (x, y) Vk
where ck is the colour associated with the kth intensity
level Vk defined by the partitioning planes at l = k – 1
and l = k
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
W
0.5 if rj - a j
si 2 any1 jn
r
i otherwise
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing
Chapter 6
Color Image Processing