Registration : 21mic7178 Name : Sai Sanjay K
Title : Handling noise in an Image
Aim :
Aim of this experiment is to handle noise in an image using smoothing techniques to enhance image quality**.**
Theory :
Noise in digital images is variation of brightness or color information, typically introduced during image acquisition or transmission. Handling noise involves techniques like smoothing or filtering, which reduce noise while preserving important details. Convolution with smoothing kernels is a common method to achieve this. In this experiment, 1D Gaussian-like kernels are used to perform convolution along the rows and columns of the image to reduce noise.
CODE :
%Experiment 6 - Handling noise in image
%Image with noise
% Load image from MATLAB library load('clown');
% Get the size of the image matrix X [m, n] = size(X);
% Define smoothing parameters (you can adjust these for more or less smoothing) gs = [0.5 0.5]; % 1D kernel for the rows
hs = [0.5 0.5]; % 1D kernel for the columns
% Perform the convolution along the rows and columns using conv2
W = conv2(gs, hs, X, 'same'); % 'same' ensures the output size matches the input size
% Display original and blurred images figure(1);
imshow(X, []); title('Original Image'); figure(2);
imshow(W, []); title('Blurred Image'); figure(3);
imshow(X, []); colormap(map);
title('Original Image with Colormap'); figure(4);
imshow(W, []); colormap(map);
title('Blurred Image with Colormap');
Sample Results :
Results :
The original image, loaded from MATLAB’s library, is displayed alongside its smoothed version. Convolution using 1D smoothing kernels along both dimensions effectively reduces noise, producing a blurred image that retains essential features while minimizing random variations. The results are shown both in grayscale and with the original colormap to highlight the noise reduction impact visually.
Conclusion :
This experiment demonstrates that smoothing techniques like convolution with appropriate kernels can significantly reduce noise in images. By applying 1D kernels along rows and columns, the noise is smoothed out, resulting in a clearer and less noisy image. This approach is essential in various image processing applications to enhance image quality and is a fundamental technique in the field of digital image processing.