Sunteți pe pagina 1din 10

c

EASTERN MEDITERRANEAN UNIVERSITY

Electrical and Electronic Engineering Department


EE 583 (Digital Image Processing)c
c

  
c

j j 

¦   






  
    c
c

14thMarch, 2011 

  

In simple terms, edge detection is the process of identifying points in a digital image where

the brightness changes aggressively. Edges in images are areas with strong intensity

contrasts±a jump in intensity from one pixel to the next. Edge detection is mainly used for

feature detection or feature extraction in various fields.

Inideal circumstances, the outcome of applying an edge detector to an image may lead to a

set of connected curves that indicate the borders of objects, the borders of surface markings

as well as curves that correspond to discontinuities in surface orientation. Thus, applying an

edge detection algorithm to an image may significantly reduce the amount of data to be

processed and may therefore filter out information that may be regarded as less relevant,

while preserving the important structural properties of an image. Usually gradient

operators,laplacian operators and zero-crossing operators are used for edge detection.

There are several approaches to edge detection but in this report, four of them are discussed.

They differ mainly in the types of smoothing filters that are applied and the way the measures

of edge strength are computed. The techniques, their formulation and examples are discussed

in the following sections.

    

The Sobel operator performs a 2-D spatial gradient measurement on an image. It uses a pair

of 3×3 convolution masks, one estimating the gradient in the x-direction (columns) and the

other estimating the gradient in the y-direction (rows). A convolution mask is usually much

smaller than the actual image. As a result, the mask is slid over the image, manipulating a

square of pixels at a time.

TheSobel masks are shown below:


     
å      å     
     

The magnitude of the gradient is given by:


å
 å
å

The approximation of this magnitude is:


å

å 
å  

The Sobel operator is computationally cheap but it has the disadvantage of poor edge

detection in the presence of noise. The operator highlights the noisy areas as edges, especially

when the points are as large as a pixel.



ƒonsider the grey scale 256×256 image and the edges detected using the Sobel operator

Figure 1a: Original Image Figure 2b: Edges detected using the Sobel
operator

The Matlab code is as follows:

m  
 


  
m  
 



   
 


    

This is a discrete differentiation operator that computes an approximation of the gradient of

the image intensity function. The Prewitt operator is similar to the Sobel operator because it

also involves convolving the image with a smaller integer valued filter in the vertical and

horizontal direction.

At each point in the image, the gradient vector points in the direction in which the highest

intensity increase occurs; the length of this vector corresponds to the rate of change in that

direction. Just like the Sobel operator, the Prewitt operator uses two 3×3 kernels which are

convolved with the original image to calculate the approximations of the gradients.

The Sobel masks are shown below:

     
å      å     
     

The rest of the formulation is the same as that of the Sobel operator.

Again, it is a computationally cheap way of achieving edge detection but it still performs

poorly in the presence of noise.




Figure 2a: Original Image Figure 2b: Edges detected using the
Prewitt operator
The Matlab code is shown below

m  
 


  
m  
 



  
 


    

Is a differential operator that operates by approximating the gradient of an image through

discrete differentiation which is achieved by computing the sum of the squares of the

differences between diagonally adjacent pixels. Unlike the Sobel and Prewitt operator, the

Robert operator involves convolving the image with the kernel in diagonal directions.

According to Roberts, an edge detector should have the following properties: the produced

edges should be well-defined, the background should contribute as little noise as possible,

and the intensity of edges should correspond as close as possible to what a human would

perceive[1]. With the set benchmarks in mind, the following equations were proposed:
   


         

where the initial intensity value in the image is,  is the computed derivative and  

represent the location in the image. The consequence of this procedure will focus on changes

in intensity in a diagonal direction  .

The process of performing edge detection with the Robert operator is quite similar to the

previously discussed operators in that two kernels are convolved with the image and then the

absolute value of the gradient is taken as the new pixel value. The two Robert Kernels are:

   
å ! " å  ! "
   

These kernels are designed to respond maximally to edges running at  to the pixel grid,

one kernel for each of the two perpendicular orientations. The kernels can be applied

separately to the input image, to produce separate measurements of the gradient component in

each orientation. These can then be combined together to find the absolute magnitude of the

gradient at each point and the orientation of that gradient.


å
 å
å

and can be approximated as:


å

å

å

The Robert operator is very quick to compute but since it uses such a small kernel, it is very

sensitive to noise. It also produces very weak responses to genuine edges unless they are very

sharp. The Sobel operator performs much better in this respect.




Figure 3a: Original Image Figure 3b: Edges detected using the
Roberts operator
The Matlab code used is presented below
m  
 


  
m  
 



  
 


ƒ 
  

In his paper, ƒanny followed a list of criteria to improve current methods of edge detection.

The first and most obvious is low error rate. It is important that edges occurring in images

should not be missed and that there be no responses to non-edges.

The second criterion is that the edge points be well localized. In other words, the distance

between the edge pixels as found by the detector and the actual edge is to be at a minimum.

A third criterion is to have only one response to a single edge. This was implemented because

the first two were not substantial enough to completely eliminate the possibility of multiple

responses to an edge.

Based on these criteria, the canny edge detector first smoothens out the image to eliminate

any noise. It then findsthe image gradient to highlight regions with high spatial derivatives.

The algorithm then tracks along these regions and suppresses any pixel that is not at the
maximum (non-maximum suppression). The gradient array is now further reduced by

hysteresis. Hysteresis is used to track along the remaining pixels that have not been

suppressed. Hysteresis uses two thresholds and if the magnitude is below the first threshold, it

is set to zero (made a non-edge). If the magnitude is above the high threshold, it is made an

edge. And if the magnitude is between the two thresholds, then it is set to zero unless there is

a path from this pixel to a pixel with a gradient above the high threshold. For a detailed step

by step description and mathematical formulation of the algorithm please refer to [2] and [3].

The ƒanny edge detector is known as an optimized edge detector because what it effectively

does is optimize the already existing edge detection algorithms; for example the Sobel

operator is used to find the edge strength after the noise has been filtered out and before

direction tracing.

The algorithm has been lauded for its usage of probability for finding error rate, its

localization and response, improvement of signal to noise ratio, and its better detection

especially in noisy conditions. It however involves complex computations, false zero

crossings and it is time consuming.



Figure 3a: Original Image Figure 3b: Edges detected using the
ƒanny edge detector
The Matlab code is presented below:
m  
 


  
m  
 



  
 


ƒ  

The comparison of the four presented edge detection techniques has shown that even though

the classical methods (Sobel, Prewitt and Roberts) are computationally cheaper and less time

consuming, the ƒanny edge detector is the most proficient because it uses probability for

finding error rate, localization and response; the cost of computation nowadays is not a big

issue to contend with considering that there are high speed, high performance computer

systems that perform complex computations in a matter of seconds. The figure below shows

the result of the different methods used.

Original Sobel Prewitt Roberts ƒanny

Figure 4: Edge Detection Techniques


 

[1]cFeature Detectors - Roberts ƒross Edge Detector. (n.d.).  !" 


 # . Retrieved March 13, 2011, from
http://homepages.inf.ed.ac.uk/rbf/HIPR2/roberts.htm

[2]cMaini, R.,Aggarwal, H., $%&%'!($" %"   


 )*$ , International Journal of Image Processing, Vol. 3, No. 1, 2009, pp 1-11

[3]cƒanny edge detector. (n.d.). 3+! %. Retrieved March 12, 2011, from
en.wikipedia.org/wiki/ƒanny_edge_detector
[4]cRoushdy,M., '!# $%&%"   ,")!!,&"
) -&, .&" "!),",/, , GVIP Journal, Vol. 6, No. 4,
December, 2006

[5]cSobel operator. (n.d.). 3+! %. Retrieved March 12, 2011, from
en.wikipedia.org/wiki/Sobel_operator

S-ar putea să vă placă și