Digital Signal Processing Reference
In-Depth Information
FIGURE 14.20
Equalized indexed 8-bit color image.
14.2.4 MATLAB Functions for Equalization
Figure 14.21 lists MATLAB functions for performing equalization for the different image formats. The
MATLAB functions are explained as follows:
histeq ¼ grayscale histogram equalization, or 8-bit indexed color histogram equalization
imhist ¼ histogram display
rgb2ntsc ¼ 24-bit RGB color image to 24-bit YIQ color image conversion
ntsc2rgb ¼ 24-bit YIQ color image to 24-bit RGB color image conversion
Examples using the MATLAB functions for image format conversion and equalization are given in
Program 14.1.
Program 14.1. Examples of image format conversion and equalization.
disp(
Read the RGB image
);
'
'
XX
¼
imread(
trees
,
JPEG
);
% Provided by the instructor
'
'
'
'
figure, imshow(XX); title(
24-bit color
);
'
'
disp(
The grayscale image and histogram
);
'
'
Y
¼
rgb2gray(XX);
% RGB to grayscale conversion
figure, subplot(1,2,1);imshow(Y);
title( ' original ' );subplot(1,2,2);imhist(Y, 256);
disp( ' Equalization in grayscale domain ' );
Y ¼ histeq(Y);
figure, subplot(1,2,1); imshow(Y);
title( ' EQ in grayscale domain ' ); subplot(1,2,2); imhist(Y, 256);
disp( ' Equalization of Y channel for RGB color image ' );
figure
subplot(1,2,1); imshow(XX);
title( ' EQ in RGB color ' );
subplot(1,2,2); imhist(rgb2gray(XX),256);
Z1 ¼ rgb2ntsc(XX);
% Conversion from RGB to YIQ
 
Search WWH ::




Custom Search