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
R-Component
Original Image
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 colors • 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 table. • Index image has two components: a data matrix of images and color map matrix.
Color and wavelet
6
Displaying indexed images >> I2=I(:,:,2); % green values of I considers I2 as an indexed >> image(I2)Matlab image as it doesn’t contain entries for >> colorbar % display colourmap Index Associate d color Colour Looku p Table
Color and wavelet
7
Displaying indexed images (continued)
• change colourmap >> colormap(gray) Type >>help graph3d to get a list of built-in colourmaps. Experiment with different built-in colourmaps. Define your own colourmap mymap by creating a matrix (size m x 3 ) with red, green, blue entries. Display an image using your colourmap.
• scale colourmap >> imagesc(I2)
Red =1.0, Green = 1.0, Blue =1.0, corresponds to index 64 Red =0.0, Green = 0.0, Blue = 0.0, corresponds to index 1 Red =1.0, Green = 1.0, Blue =1.0, corresponds to index 255 Red =0.0, Green = 0.0, Blue = 0.0, corresponds 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 spaces • • • • •
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 Saturation • 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
Hue
Original Image
Saturation
Color and wavelet
Intensity
16
Spacial Filtering of color images • 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 images(cont…) • The linear spacial filtering consists of the following steps – Extract the components images – Filter each components image individually. – Reconstruct the filtered RGB image
• In RGB color system, we consider color image sharpening using the Laplacian vector. Color and wavelet
18
Wavelets • 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 wavelets. • The wavelets are scaled and translated copies of a finite-length or fast-decaying oscillating waveform . Color and wavelet
19
Wavelets • Compare wavelets with sine waves, which are the basis of Fourier analysis. • Wavelet transforms are classified into discrete wavelet transforms (DWTs) and continuous wavelet transforms (CWTs).
Color and wavelet
20
Wavelets • 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’) Wavemenu 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 family
Color and wavelet
23
The Haar scaling and wavelet functions
Color and wavelet
24
Wavelets in image processing • Compute the two dimensional wavelet transform of an image. • Alter the transform coefficients • Compute the inverse transform
Color and wavelet
25