A Comparative Study about Various Noise Removal Filters ... › journals › search › issues ›...

6
PSGCAS Search: A Journal of Science and Technology Volume : 4 No. : 1, ISSN: 2349 – 5456 46 A Comparative Study about Various Noise Removal Filters and Edge Detection in MATLAB Subhashini. A Department of Computer science, PSG College of Arts & Science, Coimbatore, Tamil Nadu, India *Corresponding Author: [email protected] ABSTRACT MATLAB (Matrix laboratory) is used to perform various digital image processing functions in an image. In this paper, MATLAB is used for implementation of various filters and edge commands. It is also used to calculate elapsed time of various filter and edge commands in MATLAB. Some of the implemented filters are speckles, pepper and noise, Gaussian filters etc. Aim of this paper is to include various filters with its coding for output comparisons. At the same time, we can include noise to the images. Finally, comparison of time taken for each command will be calculated and compared. Keywords: MATLAB, filters, edge commands, Edge detection INTRODUCTION Digital image processing is used to perform operations on a digital image 1 . It is used for classification, feature extraction, pattern recognition etc. METHODOLOGY In this work, 3 steps are included for converting RGB image to gray image and converting actual image to blurred image etc as step-1. a. Methods Used 1. Conversion of RGB to gray 2. Actual image to blurred image Basically there are three types of noises available in digital image processing. To include noise into a picture, we have used Gaussian, salt and pepper and speckle noise to the image with its coding 2 . Then to remove these noises from the image, we have included filters as step-2. b. Filters used Motion blurred filters Median Wiener Gaussian Average Log Unsharp c. Edge commands used Prewitt Edge Sobel edge d. Edge detection Several methods are used for edge detection in an image. Some of the methods used here are (Step 3): Canny edge Roberts edge Methods with Codings img=imread('e:\images\flower\flowers- 46.jpg'); i=rgb2gray(img); figure,imshow(img); title ('Actual image');

Transcript of A Comparative Study about Various Noise Removal Filters ... › journals › search › issues ›...

Page 1: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

PSGCAS Search: A Journal of Science and Technology Volume : 4 No. : 1, ISSN: 2349 – 5456 46

A Comparative Study about Various Noise Removal Filters and Edge

Detection in MATLAB

Subhashini. A

Department of Computer science, PSG College of Arts & Science, Coimbatore, Tamil Nadu,

India

*Corresponding Author: [email protected]

ABSTRACT

MATLAB (Matrix laboratory) is used to perform various digital image processing functions in an

image. In this paper, MATLAB is used for implementation of various filters and edge commands. It is

also used to calculate elapsed time of various filter and edge commands in MATLAB. Some of the

implemented filters are speckles, pepper and noise, Gaussian filters etc. Aim of this paper is to include

various filters with its coding for output comparisons. At the same time, we can include noise to the

images. Finally, comparison of time taken for each command will be calculated and compared.

Keywords: MATLAB, filters, edge commands, Edge detection

INTRODUCTION

Digital image processing is used to

perform operations on a digital image1. It

is used for classification, feature

extraction, pattern recognition etc.

METHODOLOGY

In this work, 3 steps are included

for converting RGB image to gray image

and converting actual image to blurred

image etc as step-1.

a. Methods Used

1. Conversion of RGB to gray

2. Actual image to blurred image

Basically there are three types of noises

available in digital image processing. To

include noise into a picture, we have used

Gaussian, salt and pepper and speckle

noise to the image with its coding2. Then

to remove these noises from the image, we

have included filters as step-2.

b. Filters used

• Motion blurred filters

• Median

• Wiener

• Gaussian

• Average

• Log

• Unsharp

c. Edge commands used

• Prewitt Edge

• Sobel edge

d. Edge detection

Several methods are used for edge

detection in an image. Some of the

methods used here are (Step 3):

• Canny edge

• Roberts edge

Methods with Codings

img=imread('e:\images\flower\flowers-

46.jpg');

i=rgb2gray(img);

figure,imshow(img);

title ('Actual image');

Page 2: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

Subhashini A.

PSGCAS Search: A Journal of Science and Technology Volume: 4 No. : 1, ISSN: 2349 – 5456 47

blur=imfilter(img,h,'replicate');

figure,imshow(blur);

title('blurred image');

t=fspecial('unsharp') 3

;

shar=imfilter(img,t,'replicate');

figure,imshow(shar);

title ('sharpen image');

l=imnoise(img,'speckle',0.02);

figure,imshow(l);

title('Speckle Noise image');

l=imnoise (img,'Gaussian',0.02);

figure,imshow(l) 4

;

title ('Gaussian image');

Actual image

blurred image

sharpen image

Speckle Noise image

Page 3: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

A Comparative Study on Various Noise Removal Filters and Edge Detection in MATLAB

PSGCAS Search: A Journal of Science and Technology Volume: 4 No. : 1, ISSN: 2349 – 5456 48

l=imnoise(i,'salt & pepper',0.02);

figure,imshow(l);

title('Salt & pepper Noise image');

k = medfilt2(l,[3 3]);

figure,imshow(k);

title('MedianFilter')5;

j = wiener2(i, [3 3]);

figure,imshow(j);

title('Wiener Filter');

bw = edge(i);

figure,imshow(bw);

title('Edge command');

BW = edge(i,'sobel');

figure,imshow(BW);

title('Sobel Edge command') 6

;

BW = edge(i,'prewitt');

figure,imshow(BW);

title('PrewittEdge command');

Gaussian image

Salt & pepper Noise image

Median Filter

Wiener Filter

Edge command

Sobel Edge command

Page 4: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

Subhashini A.

PSGCAS Search: A Journal of Science and Technology Volume: 4 No. : 1, ISSN: 2349 – 5456 49

BW = edge(i,'roberts');

figure,imshow(BW);

title('Roberts Edge command');

BW = edge(i,'canny');

figure,imshow(BW);

title('Canny Edge command');

BW = edge(i,'log');

figure,imshow(BW);

title('Log Edge command');

%sliding-neighborhood operations

using nlfilter

fun = @(x) median(x(:));

b = nlfilter(img,[3 3],fun);

figure,imshow(b);title('NLFilter');

Prewitt Edge command

Roberts Edge command

Canny Edge command

Log Edge command

Page 5: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

A Comparative Study on Various Noise Removal Filters and Edge Detection in MATLAB

PSGCAS Search: A Journal of Science and Technology Volume: 4 No. : 1, ISSN: 2349 – 5456 50

Elapsed time calculation

The following table contains the time

taken for each command when executed in

MATLAB7. This will help the researchers

to make their decisions. Edge detection is

used for image segmentation and data

extraction in areas such as image

processing, computer vision, and machine

vision.

Table 1

Elapsed time for the commands used

Noise Removal filters

Command

Name

Elapsed time (in

seconds)

Imfilter 0.055884

Fspecial 0.037882

Speckle 0.479691

Gaussian 0.467460

Salt & pepper 0.213972

Median 0.452338

Wiener 0.741304

Edge commands

Edge 18.487140

Sobel 18.632645

Prewitt 18.958424

Roberts 19.179785

Canny 2.951014

Log 0.739765

Elapsed time for all commands was

executed with the help of tic and toc

commands in MATLAB8. After applying

all the commands, the elapsed time for the

commands were measured (Table 1).

Among all the noise removal filters

salt and pepper command executes very

fast and wiener filters took large amount of

time for execution. In edge commands, log

edge command took small amount of time

whereas Roberts edge detection command

took maximum amount of time. The spinor

Fourier transform splits into two usual

complexes Fourier transforms for edge

detection9.

CONCLUSION

In the present investigation so

many filter commands were exposed with

their output. This work is going to be

useful for those who want to remove noise

from images10

. Different noises are

removed by using different filters such as

Wiener filter, Gaussian filter, nlfilter etc at

different levels. Getting clear images is the

aim of pre-processing process in image

processing. For any image the edges are

found using edge detection command like

Roberts, Sobel, Canny etc. At the same

time, execution time for all the filters is

also calculated so that shortest time taken

edge command or filter command can be

known. The output of each filter and edge

commands are displayed so that the user

can also choose their own choice of edge

command depending upon execution time

or clear output.

REFERENCES

1. MATLAB version 7.10.0. Natick,

Massachusetts: The MathWorks Inc.,

2010.

2. T. Batard and M. Bertalmío, “On

covariant derivatives and their

applicationsto image regularization,”

Page 6: A Comparative Study about Various Noise Removal Filters ... › journals › search › issues › Volume-IV-Issu… · A Comparative Study about Various Noise Removal Filters and

Subhashini A.

PSGCAS Search: A Journal of Science and Technology Volume: 4 No. : 1, ISSN: 2349 – 5456 51

SIAM J. Imag. Sci., vol. 7, no. 4,pp.

2393–2422, 2014.

3. M. Bertalmío, Image Processing for

Cinema. Boca Raton, FL, USA: CRC

Press, 2014.

4. M. Bertalmío and S. Levine,

“Denoising an image by denoising its

5. curvature image,” SIAM J. Imag. Sci.,

vol. 7, no. 2, pp. 187–201, 2014.

6. P. Blomgren and T. F. Chan, “Color

TV: Total variation methods for

restoration of vector-valued images,”

IEEE Trans. Image Process, vol. 7, no.

3, pp. 304–309, Mar. 1998.

7. X. Bresson and T. F. Chan, “Fast dual

minimization of the vectorial total

variation norm and applications to

color image processing,” Inverse

Problems Imag., vol. 2, no. 4, pp. 455–

484, 2008.

8. S. P. Awate and R. T. Whitaker,

“Higher-order image statistics for

unsupervised, information-theoretic,

adaptive, image filtering,” in Proc.

IEEE Comput. Soc. Conf. Comput. Vis.

Pattern Recognit., vol. 2. Jun. 2005,

pp. 44–51.

9. T. Batard and M. Berthier, “Spinor

Fourier transform for image

processing,”

10. IEEE J. Sel. Topics Signal Process.,

vol. 7, no. 4, pp. 605–613, Aug. 2013.