You are on page 1of 25

Color Image Processing

Color and wavelet 1

RGB image
• RGB image represents each pixel color as a set of three
values, representing the red, green, and blue intensities
that make up the color.
• The RGB image range values are [0,1] and [0,255] for
class double, uint8 respectively.

Color and wavelet 2

Example RGB

Original Image R-Component

G-Component Color and wavelet B-Component 3

The RGB Color Model
If R,G, and B are represented with 8 bits (24-bit RGB
image), the total number of colors is (28 )3=16,777,216

Color and wavelet 4

Primary and secondary
• primary colors:
       R – red
        G – green
       B – blue
• Secondary colors
 M – magenta (= red + blue)
       C – cyan (= green + blue)
      Y – yellow (= red + green)

Color and wavelet 5

Indexed Image
• An indexed image is where the pixel
values are indices to elements in a
colour map or colour lookup
• Index image has two components: a
data matrix of images and color map

Color and wavelet 6

Displaying indexed images
>> I2=I(:,:,2); % green values of I
>> image(I2)Matlab considers I2 as an indexed
image as it doesn’t contain entries for
>> colorbar % display colourmap


d color

p Table

Color and wavelet 7

Displaying indexed images
Red =1.0,
Green =
1.0, Blue
• change colourmap =1.0,
to index 64
>> colormap(gray)
Red =0.0,
Green =
Type >>help graph3d to get a list 0.0, Blue =
of built-in colourmaps. Experiment 0.0,
with different built-in colourmaps. corresponds
to index 1
Define your own colourmap Red =1.0,
mymap by creating a matrix (size Green =
m x 3 ) with red, green, blue 1.0, Blue
entries. Display an image using =1.0,
your colourmap. corresponds
to index 255
• scale colourmap
Red =0.0,
>> imagesc(I2) Green =
0.0, Blue =
to index 0

Color and wavelet 8

RGB values of basic color

Color and wavelet 9

IPT Functions for converting between
RGB, Indexed, and gray scale
intensity images

Color and wavelet 10

Converting to other color
• NTSC color spaces
• The YCbCr color space
• The HSV color space
• The CMY and CMYK spaces
• The HSI color spaces

Color and wavelet 11

The HSI Color Model
• Hue—the color
• Saturation—the amount of white that
is mixed with the hue
• Intensity—expresses the brightness
or luminance of the chromaticity
(=hue and saturation)

Color and wavelet 12

Brightness, Hue, and
• Brightness is a synonym of intensity
• Hue represents the impression related to the
dominant wavelength of the color stimulus
• Saturation expresses the relative color purity
(amount of white light in the color)
• Hue and Saturation taken together are called the
chromaticity coordinates (polar system)
• Matlab conversion function: rgb2hsv

Color and wavelet 13

HSI Color Model

Color and wavelet 14

Converting from RGB to HSI

Color and wavelet 15

Example HSI

Original Image Hue

Saturation Color and wavelet Intensity 16

Spacial Filtering of color
• The spacial filtering concentrating
mostly on RGB images.
• And basic concepts are applicable to
other color models
• The two examples of linear filtering
– Color image smoothing
– Color image sharpening

Color and wavelet 17

Spacial Filtering of color
• The linear spacial filtering consists of
the following steps
– Extract the components images
– Filter each components image
– Reconstruct the filtered RGB image
• In RGB color system, we consider
color image sharpening using the
Laplacian vector.
Color and wavelet 18
• A wavelet is a waveform of
effectively limited duration that has
an average value of zero.
• A wavelet transform is the
representation of a function by
• The wavelets are scaled and
translated copies of a finite-length or
fast-decaying oscillating waveform .
Color and wavelet 19
• Compare wavelets with sine waves,
which are the basis of Fourier
• Wavelet transforms are classified into
discrete wavelet transforms (DWTs)
and continuous wavelet transforms

Color and wavelet 20

• A discrete wavelet
transform (DWT) is any wavelet
transform for which the wavelets are
discretely sampled.
• Wavelet Toolbox provides two
categories of tools:
– Command line functions
– Graphical interactive tools
Waveinfo(wfamily) eg Waveinfo(‘haar’)
Color and wavelet 21
Fast Wavelet Transform
• The Fast Wavelet Transform is
algorithm designed to turn
a waveform or signal in the time
domain into a sequence of
coefficients based on an orthogonal
basis of small finite waves,
or wavelets.

Color and wavelet 22

Wavelet Toolbox FWT filters and filter

Color and wavelet 23

The Haar scaling and wavelet

Color and wavelet 24

Wavelets in image
• Compute the two dimensional
wavelet transform of an image.
• Alter the transform coefficients
• Compute the inverse transform

Color and wavelet 25