A Comparison Analysis of High Pass Spatial Filters using Measurement and Automation

DOI : 10.17577/IJERTV1IS3047

Download Full-Text PDF Cite this Publication

Text Only Version

A Comparison Analysis of High Pass Spatial Filters using Measurement and Automation

Parminder Singp and Harjinder Singp

1Student, 2Associate Professor

Department of Electronics and Communication Engineering UCoE Patiala-147002, Punjab, India

Abstract

This paper describes five different high pass spatial filters (Sobel, Prewitt, Roberts, Differentiation and Laplacian) used for edge detection. These filters locate edges accurately even under low signal to noise ratio (SNR) conditions in an image. All these filters are

the intensity levels contained in the region encompassed by the mask. That is, the response, R, of the mask at any point in the image [6] is

given by:

compared on the basis of SNR which is obtained after edge detection. The results of the comparison are also shown which indicates that Laplacian filter outperforms rest of the high pass spatial filters.

R w1 z1 w2 z2 w9 z9

9

wi zi

i1

…. (1)

…. (2)

Keywords: edge detection, high pass spatial filtering, signal to noise ratio comparison.

  1. Introduction

    An edge is a significant change in the grayscale values between adjacent pixels in an image. Edges consist of mainly high frequency components. A spatial filter can be seen as a classifier that takes a decision whether a certain point belongs to the edge set or not [1]. Spatial filters usually give a satisfactory result in a high quality image with low noise. Edge detectors filters out information that is not very important, preserving the important structural properties of an image [2]. Edge detectors detect meaningful discontinuities in intensity values. Such discontinuities are detected by using first and second order derivatives. The most common way to look for discontinuities is to run a mask through the

    image. For a 3×3 mask this procedure involves computing the sum of products of the coefficients with

    where zi is the intensity of the pixel associated with mask coefficient wi.

  2. Methodology

    The process of edge detection is dependent on convolution kernels that can be use to perform different types of filtering operations on an image. Edges correspond to strong illumination gradients, so highlight them by calculating the derivatives of the image. The position of the edge can be estimated with the maximum of the 1st derivative or with the zero-crossing of the 2nd derivative. So there is need to find a technique to calculate the derivative of a two-dimensional image. Edge detection operators are often implemented with convolution masks and discrete approximations to differential operators. These operators may return magnitude and direction information, some return magnitude only [3].

    In this paper, we define and compare 5 different spatial filters, namely Differentiation, Prewitt, Roberts, or Sobel and Laplacian filters.

  3. General Description of Spatial Filters

    Spatial filters detect edges along a specific direction, reducing noise and detail outlining. Filters smooth, an image to extract the valuable information. Spatial filters alter pixel values with respect to variations in light intensity in their neighborhood. The neighborhood of a pixel is defined by the size of a

    sharpen, transform and remove noise from

    assigned the maximum value of its vertical and horizontal gradient obtained with the following Prewitt convolution kernels:

    matrix, or mask, or kernel, centered on the pixel itself. These filters can be sensitive to the presence or absence of light-intensity variations. High pass spatial filters are divided into two categories:

    1 0 1

    x

    P 1 0 1 ,

    1 0 1

    1 1 1

    y

    P 0 0 0

    1 0 1

    1. Nonlinear high pass filters

      Nonlinear high pass filters extracts the pixels where significant variations of light intensity are found. The presence of sharp edges, boundaries between objects, modification in the texture of a background, noise, or other effects can cause these variations.

      1. Sobel filter

        The nonlinear Sobel filter is a highpass filter [5] that extracts the outer contours of objects. It highlights

        For each pixel the local edge gradient magnitude is estimated with the maximum response:

        G m a x G i …….(5 )

        1. Roberts filter

          The Roberts filter outlines the contours that highlight pixels where an intensity variation occurs along the diagonal axes. The Robertss Cross operators [4], [6] performs a simple, quick to compute, 2-D spatial gradient measurement on an image.

          significant variations of the light intensity along the vertical and horizontal axes. The Sobel operator [4] performs a 2-D spatial gradient measurement on an

          1 0

          P ,

          x 0 1

          0 1

          P

          y 1 0

          image and so emphasizes regions of high spatial

          gradient that correspond to edges. Typically it is used to find the approximate absolute gradient magnitude at each point in an input grayscale image. The Sobel masks are designed to respond maximally to edges running horizontally and vertically, and these directional edges are combined finally. Derivatives based on the Sobel operator masks are

          Typically, an approximate magnitude is computed using:

          G Gx Gy ………(6)

        2. Differentiation filter

        A more refined second-order edge detection approach which automatically detects edges with sub- pixel accuracy. The differentiation filter produces continuous contours by highlighting each pixel where

        1 2 1

        x

        S 0 0 0

        1 2 1

        ,

        1 0 1

        y

        S 2 0 2

        1 0 1

        an intensity variation occurs between itself and its three upper-left neighbors [6].

    2. Linear High Pass filter

A linear filter replaces each pixel by a weighted

The gradient at the centre point in a neighborhood is computed as follows by Sobel filter:

1

G [Gx2 Gy2 ] 2 ……(3)

The gradient magnitude is given by:

G Gx2 Gy2 ……(4)

b. Prewitt filter

The nonlinear Prewitt filter is a highpass filter that extracts the outer contours of objects. It highlights significant variations of the light intensity along the vertical and horizontal axes. The Prewitt operators [6] produce an image where higher grey-level values indicate the presence of an edge between two objects. The Prewitt Edge Detection filter computes the root

mean square of two 3 3 templates. Each pixel is

sum of its neighbors. The matrix defining the neighborhood of the pixel also specifies the weight assigned to each neighbor. This matrix is called the convolution kernel. If the filter kernel contains both negative and positive coefficients, the transfer function is equivalent to a weighted differentiation and produces a sharpening or highpass filter. Typical highpass filters include gradient and Laplacian filters. Laplacian filter

A Laplacian filter highlights the variation of the light intensity surrounding a pixel. The filter extracts the contour of objects and outlines details. The Laplacian convolution filter is a secondorder derivative, and its kernel uses the following model:

a d c b x b c d a

where a, b, c, and d are integers.

Laplacian operator uses second derivative, the operator is defined as:

5. Results

The results obtained by applying different high pass spatial filters are shown in following figures: Figure2 shows the original image. Figure3-7 shows the edges extracted by various high pass spatial filters. Figure8- 13 shows the histogram of the original image and the images obtained after applying high pass spatial

2 f ( x, y )

2

f ( x, y ) x 2

2 f ( x, y )

y 2

……(7)

filters. Figure14-18 shows the edge strength profiles of different high pass spatial filters.

where f(x,y) denotes an image on which Laplacian is applied.

Laplacian filter extracts the pixels where significant variations of light intensity are found. The presence of sharp edges, boundaries between objects, modification in the texture of a background, noise, or other effects can cause these variations [6]. The transformed image contains white contours on a black background.

4. Simulation Setup

The simulation setup consists of following steps: Step 1- The input image is read by Image Acquisition step. The input image may be 32-bit RGB, 16-bit grayscale or 8-bit binary.

Step 2- Now the input image is converted hue, saturation, and intensity (HSI) plane image. In this setup input image is 32-bit RGB taken.

Step 3- The results obtained in step 3 by applying high pass spatial filters on input image. The edges are determined with the help of spatial filters operation.

Step 4- The input image is filtered and performance of the spatial filters is evaluated. Edge strength profile is drawn for spatial filters in this step. SNR is evaluated with respective to edge strength of an input image.

Step 5- The filtered image is obtained in this step.

Image Acquisition

Colour Plane Extraction

Spatial Filtering

Edge Strength Profile

Filtered Image Out

Figure1. Simulation setup of Edge Detection Method

Spatial filters applied on image

Figure2. Original image

Figure3. Edges detected by Sobel filter

Figure4. Edges detected by Prewitt filter

Figure5. Edges detected by Roberts filter

Figure6. Edges detected by Differentiation

filter

Figure7. Edges detected by Laplacian filter

Histogram visualization

Figure8. Histogram of original image

Figure9. Histogram of image after applying Sobel filter

Figure10. Histogram of image after applying Prewitt filter

Figure11. Histogram of image after applying Roberts filter

Figure12. Histogram of image after applying

Differentiation filter

Figure13. Histogram of image after applying Laplacian filter

Edge strength profile

Figure14. Edge strength profile after applying Sobel filter

Figure15. Edge strength profile after applying

Prewitt filter

Figure16. Edge strength profile after applying

Roberts filter

Figure17. Edge strength profile after applying

Differentiation filter

Figure18. Edge strength profile after applying

Laplacian filter

Comparison of high pass spatial filters

Figure19 shows the graph which indicates the difference among different high pass spatial filters based on SNR.

Figure19. Comparison graph for High Pass Spatial filters Table1. Comparison of High Pass Spatial Filters

Conclusion

The results of Laplacian filter are better as compared with nonlinear high pass spatial filters figures. The results are superior to nonlinear high pass spatial filter as depicted in SNR graphs too. The results indicate that the Laplacian filter is robust against noise or blurred images. Laplacian filter accurately highlights the pixels at actual edge location as compared to other filters.

References

  1. Fadi A. Zaraket and Mohamad Adnan Al-Alaoui, Fusion Edge Detector and Objective Comparison of Edge Detectors January 26, 2003.

  2. V.Vijaya Kumari and N.Suriyanarayanan, Performance Measure of Local Operators in Fingerprint Detection

    Academic open internet journal ISSN 1311-4360 Vol.23 2008.

    Sobel

    Prewitt

    Roberts

    Differentiation

    Laplacian

    Edge Strength

    SNR (dB)

    Edge Strength

    SNR (dB)

    Edge Strength

    SNR (dB)

    Edge Strength

    SNR (dB)

    Edge Strength

    SNR (dB)

    12.45

    281.91

    30.67

    289.73

    17.12

    284.67

    18.88

    285.22

    79.88

    298.05

    22.82

    21.41

    60.18

    43.68

    38.52

    36.51

    36.39

    33.63

    123.79

    26.79

    64.88

    296.24

    52.30

    294.37

    40.36

    292.12

    37.00

    291.36

    109.64

    300.80

    19.94

    285.99

    31.42

    289.95

    24.45

    287.77

    17.94

    285.08

    43.12

    292.69

    21.39

    286.61

    49.67

    293.92

    18.24

    285.22

    29.30

    289.34

    37.33

    291.44

    61.85

    295.83

    47.45

    293.53

    29.70

    27.36

    29.94

    29.52

    69.94

    296.89

    52.36

    294.38

    34.61

    290.78

    34.61

    290.78

    25.76

    288.22

    77.64

    297.80

    42.58

    292.58

    38.36

    291.68

    22.27

    286.96

    26.27

    288.39

    92.79

    299.35

    74.82

    297.48

    67.97

    296.65

    22.76

    287.14

    25.48

    288.13

    164.45

    304.32

    27.94

    288.92

    20.85

    286.38

    13.73

    282.75

    47.12

    293.46

    50.58

    294.08

  3. Bhadauria H S, Dewal M L, Comparison of Edge Detection Techniques on Noisy Abnormal Lung CT Image before and after Using Morphological Filter Published in International Journal of Advanced Engineering & Application, Jan. 2010.

  4. William K. Pratt, Digital image processing Wiley Interscience New York, 2001.

  5. Rafael C. Gonzalez, Richard E. Woods, Digital Image Processing Prentice Hall. Upper Saddle River New Jersey, 2002.

  6. Rafael C. Gonzalez, Richard E. Woods, Steven L. Eddins, Digital Image Processing using MATLAB Pearson Education Published by Dorling Kindersley India, 2008.

Leave a Reply