Image Processing
- It is extraction of useful information from an image.
- It improves the quality of an image
Before going in-depth of advanced processing techniques, let’s have an overview of basic pre-processing techniques in image processing with the help of Matlab tool.
Image Enhancement Techniques
These techniques are used to remove noise like salt and pepper noise, Gaussian noise etc from the image. In this example for simplicity salt and pepper noise is taken in to account and are removed by means of
a) Mean filter
Replace each pixel value of an image with mean or average value of neighbor pixels. For ex. 3 x 3 filter is shown below
b) Median filter
Replace each pixel value of an image with median value of its neighbor pixels.
i) Initially it sorts all neighbor pixel values including center pixel value.
ii) Replace the center pixel value with middle pixel value in the sorted list.
iii) Suppose if the sorted list is in even number of pixels, the mean of center two pixels is taken.
c) Gaussian filter
- The above median filter discussed is non linear filter takes more time complexity since it uses sorting.
- Gaussian filter is a linear filter and uses addition and multiplication and hence it is much faster than median filter.
- It is widely used to blur the image and if we uses two of Gaussian filtered and subtract results in edge detection.
Matlab Code:
clc;
clear all;
close all;
input_image=imread('cameraman.tif');
noise_image=imnoise(input_image,'salt & pepper',0.02);
f=(1/9)*ones(3,3);
mean_output_image=imfilter(noise_image,f);
median_output_image= medfilt2(noise_image);
subplot(2,2,1);
imshow(input_image);
title('input image')
subplot(2,2,2);
imshow(noise_image);
title('noise image')
subplot(2,2,3);
imshow(mean_output_image);
title('Mean filter')
subplot(2,2,4);
imshow(median_output_image);
title('Median filter')
No comments:
Post a Comment