Image Enhancement And Its
Techniques
To Improve color Image
Abhishek KS 1CD21EC005
Aditya Laxman 1CD21EC009
Vamshi Arun 1CD21EC167
Vilash HJ 1CD21EC174
SlideMake.com
Introduction to Color Image
Enhancement
Color image processing involves the Color image enhancement is a crucial
process in digital image processing, aimed at improving the visual quality of
images while preserving their natural color characteristics.
This process is particularly important in fields such as
• medical imaging,
• satellite image analysis
• remote sensing
• Photography
• computer vision
where enhanced image details can lead to more accurate
• Observations
• diagnostics
• analyses.
The goal of color image enhancement is to make an image more interpretable or visually pleasing by emphasizing
essential details, improving contrast, reducing noise, and preserving or enhancing the vividness of colors.
Unlike grayscale images, color images consist of multiple color channels (typically Red, Green, and Blue), each of
which may require individual enhancement to maintain color balance and avoid distortion.
Several techniques are commonly used for color image enhancement:
1.Histogram Equalization: This technique adjusts the distribution of pixel intensities,
thereby enhancing contrast across the color channels.
2. Contrast Stretching: This approach adjusts the intensity range in each channel, bringing
out details in low-contrast regions of the image
3. Noise Reduction: Techniques like median filtering help to reduce noise while preserving
edges, which is critical for maintaining image clarity in noisy environments.
4. Sharpening: Methods such as unsharp masking enhance edges and fine details, making
objects within the image appear more distinct.
Purpose of Image Enhancement
Each of these techniques can be applied individually or combined to achieve a balance
between enhancing details and preserving color integrity.
By improving the quality and clarity of color images, color image enhancement plays a vital
role in delivering high-quality images that are useful for both professional applications and
everyday viewing manipulation of images in color spaces to enhance or extract information.
It is widely used in various applications, including photography, medical imaging, and
computer vision.
Understanding color models such as RGB, CMY, and HSV is crucial for effectively
processing color images.
Color Models
The RGB model represents colors
using combinations of red, green, and
blue light.
The CMY color model is often used in
printing, where cyan, magenta, and
yellow pigments are combined.
The HSV model provides a more
intuitive understanding of colors in
terms of hue, saturation, and value.
Image Enhancement Techniques
Image enhancement techniques
improve the visual appearance of
images or convert them to a more
suitable format.
Common techniques include
histogram equalization, contrast
stretching, and filtering.
These methods help to emphasize
features of interest and improve the
overall quality of the image.
Histogram Equalization
Histogram equalization is a method
used to enhance the contrast of an
image.
It works by redistributing the intensity
values of the pixels to cover the full
range of possible values.
This technique is particularly useful
for images with poor contrast due to
lighting conditions.
MEDIAN FILTER
A median filter is a non-linear filtering technique commonly used in digital image processing to
reduce noise while preserving edges in an image.
It is especially effective for removing "salt-and-pepper" noise (random white and black pixels)
without overly blurring sharp edges, making it a popular choice for image enhancement.
How the Median Filter Works
The median filter operates by moving a window (usually square, such as 3x3, 5x5, etc.) over each pixel
in the image. For each window:
1.The pixel values within the window are sorted in ascending order.
2.The middle (median) value of these sorted values replaces the original pixel value in the center of the
window.
This median replacement process is repeated as the window moves across the entire image. By
replacing the pixel with the median, rather than the average, the filter reduces the impact of extreme
values (like salt-and-pepper noise) while maintaining a sharper image.
Benefits of the Median Filter
1.Noise Reduction: The median filter is particularly good at removing impulsive noise without
significantly blurring the edges, making it suitable for images where edge details are important.
2.Edge Preservation: Since the median filter does not rely on averaging, it better preserves
edges and fine details compared to linear filters like the mean filter, which may blur edges.
3.Simplicity and Efficiency: The median filter is computationally simple and easy to
implement, especially in real-time applications where speed is essential.
Applications in Image Enhancement
By reducing noise and preserving edges, the median filter enhances the image's clarity, making it
more visually pleasing and easier to analyze.
This is useful in fields like medical imaging, astronomy, and photography, where high-quality
image details are essential for accurate interpretation.
Matlab Code
clc;
close all;
clear all;
% Image Enhancement in MATLAB (without converting to grayscale)
% Read the input image
input_image = imread('PROJECT.jpg'); % Replace with your image file
figure, imshow(input_image), title('Original Image');
% 1. Histogram Equalization (applied to each channel independently)
if size(input_image, 3) == 3
% Separate the color channels
R = input_image(:, :, 1);
G = input_image(:, :, 2);
B = input_image(:, :, 3);
% Apply histogram equalization on each channel
equalized_R = histeq(R);
equalized_G = histeq(G);
equalized_B = histeq(B);
% Recombine channels
equalized_image = cat(3, equalized_R, equalized_G, equalized_B);
else
% If grayscale, apply directly
equalized_image = histeq(input_image);
end
figure, imshow(equalized_image)
title('Histogram Equalized Image');
% 2. Contrast Stretching (applied to each channel independently)
if size(input_image, 3) == 3
contrast_stretched_image = zeros(size(input_image), 'like', input_image);
for c = 1:3
channel = double(input_image(:, :, c));
min_val = min(channel(:));
max_val = max(channel(:));
contrast_stretched_image(:, :, c) = imadjust(input_image(:, :, c), [min_val/255;
max_val/255], []);
end
else
min_val = double(min(input_image(:)));
max_val = double(max(input_image(:)));
contrast_stretched_image = imadjust(input_image, [min_val/255; max_val/255], []);
end
figure, imshow(contrast_stretched_image)
title('Contrast Stretched Image');
% 3. Noise Reduction using a Median Filter
if size(input_image, 3) == 3
median_filtered_image = zeros(size(input_image), 'like', input_image);
for c = 1:3
median_filtered_image(:, :, c) = medfilt2(input_image(:, :, c), [3, 3]);
end
else
median_filtered_image = medfilt2(input_image, [3, 3]);
end
figure
imshow(median_filtered_image)
title('Noise Reduced Image (Median Filter)');
% 4. Sharpening the image using an Unsharp Mask
sharpened_image = imsharpen(input_image);
figure
imshow(sharpened_image)
title('Sharpened Image');
% 5. Combine Histogram Equalization with Sharpening
enhanced_image = imsharpen(equalized_image);
figure
imshow(enhanced_image)
title('Enhanced Image (Histogram Equalization + Sharpening)’);
% Save the final enhanced image
imwrite(enhanced_image, 'enhanced_image.jpg');
Output Images
References
Gonzalez, R.C., & Woods, R.E. (2018).
Digital Image Processing (4th ed.).
Pearson.
Pratt, W.K. (2007). Digital Image
Processing: PIKS Scientific Inside.
Wiley.
Szeliski, R. (2010). Computer Vision:
Algorithms and Applications. Springer.