0% found this document useful (0 votes)
26 views34 pages

Dip 12 34

The document discusses colour models and how they represent colours. It describes the RGB, CMY, and HSI colour models and how colours are represented in each. It also covers converting between the different colour models and techniques for pseudo colouring images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views34 pages

Dip 12 34

The document discusses colour models and how they represent colours. It describes the RGB, CMY, and HSI colour models and how colours are represented in each. It also covers converting between the different colour models and techniques for pseudo colouring images.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 34

colour space or

colour system
1
Colour Models

It is a specification of a coordinate
system & a subspace within that
system where each colour is
represented by a single point

A colour model is a method to specify colours


with respect to some reference framework.

2
3
The RGB Colour Model

RGB values at three corners.


Cyan, magenta & yellow at other three corners.

4
Different colours in the model are
points on or inside the cube

Images in RGB model consists of


three component images –
one for each primary colour

RGB
Monitor
Composite colour
image

Three images
combine on
phosphor screen
5
E ac
h RG
is a B im
t age
Pixel Depth valu ri p
es (R let of
, G,
B)

The number of bits used


to represent each pixel
in the RGB space
E.g. Consider an RGB image in which each of the three
images is an 8-bit image. Then
depth = 24 bits

6
24-bit RGB image = 16,777,216 colours
Many systems today limited to 256 colours

Many applications require fewer colours!!

Safe RGB Colours


Subset of colours that are
•likely to be reproduced faithfully
•Reasonably independently of
viewer H/W capabilities

7
256
es e Remaining 216
f t h s ntly de facto standard for safe
o u r
40 colo iffere colours, especially in Internet
d
d nt O S
s e Applications
o ces ffere
Pr y di
b

The no. of colours these RGB (6)3 = 216 !!!


triplets give us
8
Customary to express these values
in Hexadecimal no. system

Purest Red in Hexadecimal will


be represented as ?
FF0000

Black 000000

White FFFFFF

9
The CMY & CMYK Ki
sf
bla or
cK
Colour Models
Devices that deposit coloured pigments on paper
(e.g. coloured printers, copiers etc)
require CMY data input
RGB to CMY conversion is done internally using the
following operation

Note: all colour values are normalized to the range [0, 1] 10


RGB Colour Space CYM Colour Space
The colours with a P are
the primary colours. RGB and CYM are
complementary; what is a
The dashed line indicates secondary colour in RGB is
where to find the grays, a primary colour in CYM
going from (0,0,0) to
(255,255,255).
11
RGB & CMY Models
•Well suited for H/W implementations
•Changing from one model to another easy
•RGB model suits well with the perception of
human eye

But …
RGB, CMY & other similar models not well suited for
describing colours in terms that are practical for human
interpretation.
We do not think of colour
images as being composed of 3
primary images combined to
form that single image!!
12
The HSI Colour Model
The HSI Colour Model was designed
having in mind the way graphic
designers and artists think of colours.

Artists use terms like saturation (the "pureness" of


a colour), hue (the colour in itself) and intensity (the
brightness of the colour).

This is exactly what the HSI Colour Model


Represents.

13
HSV Color Space
more intuitive
color space Saturation
for people Value
 H = Hue
 S = Saturation
 V = Value
 or brightness B Hue
 or intensity I
 or lightness L

14
Like in
other
colour
spaces, a
colour is a
vector.

H (Hue) is the angle of the vector over the basic triangle,


starting from Red (o degrees).
S (Saturation) is the proportional size of the module of
the projection of the vector over the basic triangle;
I (Intensity) is the distance from the end of the vector to
the basic triangle.
15
The HSI colour
model based on
a)Triangular
b)Circular colour
planes

The triangles &


circles are
perpendicular to the
vertical intensity axis

16
Converting Colours from
RGB to HSI
Given an image in RGB format, the H, S & I components for HSI model
can be obtained as follows.

Assumption:
  cos 
1

  ( R  G )  ( R  B )  / 2 


 ( R  G )  ( R  B )(G  B ) 
2
•RGB values in  
the range [0, 1]
  BG
•θ is measured
H 
360   B  G
wrt the red axis
of the HSI space
3  min( R, G, B)
•H can be
S  1
normalized by
dividing by 3600
RG B
I  R  G  B / 3
17
Converting Colours from Given values of
HSI in the interval
HSI to RGB [0, 1], it is required
to find the RGB
RG Sector values in the same
00 ≤ H < 1200 range.

B = I (1 – S)

G = 1 – (R + B)

18
GB Sector
1200 ≤ H < 2400
The given value of H is in this sector – first subtract 1200 from it
H = H - 1200

R = I (1 – S)

B = 1 – (R + G)

19
BR Sector
2400 ≤ H ≤ 3600
The given value of H is in this sector – first subtract 2400 from it
H = H - 2400

G = I (1 – S)

R = 1 – (G + B)

20
Pseudo coloring
Eye can distinguish between ~30 different grey-levels
... and 350,000 different colors

Display gray-level image as a color image for easier


visual inspection

The amount of information in the gray-level image is not


changed 21
The process of assigning different
colour to every intensity value available
in a Gray scale image is known as
pseudo-colour processing.
Advantage:
Many image features & their comparison can be
readily done using pseudo-colouring.
fR(x,y)
Colour
f(x,y) fG(x,y)
Coordinate
Gray-level
Transformation
image fB(x,y)

22
Intensity Slicing
(A Technique for Pseudo colouring)
For 3-D images, use a plane at f(x,y)=li to slice the
image function into two levels

􀃆 Any pixel whose gray level is above the plane is


coded with one colour, and any pixel below the plane
is coded with the other
􀃆 The result is a two-colour image whose relative
appearance can be controlled by moving the slicing
plane up and down the gray-level axis
􀃆 In general, we can use multi-level slicing and
colour coding
23
24
25
Processing components of a colour
image within the context of a single
colour model
Formulation g(x, y) = T[f(x, y)]
Looks same as that for gray
level images. What is the
difference?

27
ri color component of f(x,y) si color components of g(x,y)

Let n be the number of colours in the colour


space & ri for i = 1 to n denote the colours .
e.g. in RGB colour space, n = 3 and
r1, r2 & r3 denotes the colours red, green & blue
respectively.
The transformation or Colour mapping functions that
operate on the set of ri’s to produce si are given as:

si = Ti (r1, r2, …, rn) i = 1,2, …, n

n transformation functions, Ti,


combine to implement the single
transformation function T 28
ap How is spatial filtering operation
Rec
carried out for gray scale image
smoothing???

The mask is slid across the image to be smoothed.


Each pixel is replaced by the average of the pixels in the
neighbourhood defined by the mask. (When the
coefficients of the filtering mask are all taken to be 1)

29
Let c be an arbitrary vector in RGB colour space, whose
components represent the RGB components of a colour
image.

For an M x N image, how many such vectors, c(x, y),


will we have ??
30
Sxy – denotes the set of coordinates defining the neighbourhood
centred at (x,y) in an RGB colour image

31
32
Laplacian
ecap
R It is a function (image) f(x, y) of
two variables, defined as
2 f
 f ( x  1, y )  f ( x  1, y )  2 f ( x, y )
x 2

 f  f 2 2
 f  2  2
2

x y
2 f
 f ( x, y  1)  f ( x, y  1)  2 f ( x33, y )
y 2
Note:
The Laplacian of a vector is defined as a vector whose
components are equal to the Laplacian of the individual
scalar components of the i/p vector.

In the RGB colour system, the


Laplacian of vector c is given as:

34

You might also like