A Comparative Study of Edge Detection Techniques in Digital Images

Master's Thesis, 2016

51 Pages


Table of Content






Chapter – I: Introduction







First of all I am grateful to almighty “Allah” who bestowed upon me and enables me to timely and successfully completes this thesis work.

I am thankful to my worthy research supervisor Dr. Gordhan Das, Associate Professor, Information Technology Centre, Faculty of Agriculture Social Science, Sindh Agriculture University, Tandojam for valuable guidance, constrictive cooperation, criticism and sympathetic supervision during the entire course of studies without, it would have not possible for me to successful complete this research work.

Many thanks are extended to my co-supervisors Dr. Mubina Pathan, Associate Professor, Information Technology Centre, Faculty of Agriculture Social Science, and Dr. Barkatullah Qureshi, Associate Professor, Information Technology Centre, Faculty of Agriculture Social Science, Sindh Agriculture University, Tandojam for their valuable suggestions and help in writing of this manuscript.

I am also thankful to Dr.Mukhtiar Memon, Dr.Akhtar Jalbani, Dr.Masoor Depar, for his valuable suggestion and help during thesis work.

Last but not the least thanks are due to my parents and especially my Father, Mother and other family members for their financial and moral support.

Naeem Akbar Channar



Abbildung in dieser Leseprobe nicht enthalten


Abbildung in dieser Leseprobe nicht enthalten


Abbildung in dieser Leseprobe nicht enthalten


Naeem Akbar Channar For Masters of Science (MSIT) Hons.

Major Software Engineering and Information Systems

TITLE: Comparative study of edge detection techniques in digital images

In digital image processing, edge detection is a process for getting the boundaries of objects in digital image, structural image and removing the unwanted area from digital image, edge is important and basic information which can be manipulated by different edge detection techniques. In this work, edge detections methodologies and their mathematical formulas are investigated and detailed concepts of fundamental operations of edge detection techniques and their comparison are presented. Old theories and research papers are also repeated and replicated in this paper. Methodologies that are investigated in research are first order edge detection that includes classical operators like Prewitt, Sobel and Robert, and the canny edge detection. These edge detection techniques are applied to different images like human face, plants, birds and cups etc. Classical operator as well as Canny operators are applied on digital image and investigated the simulated results of these operators and also investigate the mathematical reasons for their performances. After doing this, the research done makes a conclusion that Canny operator offers the best performance among the operators considered in this work but not give same results in all type of images, canny also failed to detect edges where image have more data. Simulation of edge detection techniques are carried out in Matlab and the comparison is made on the basis of the Matlab results and mathematical equations.

Chapter – I: Introduction

I.I Image Processing

In computer science, image processing area is going famous and widely used in many fields like (medical imaging, computer guided surgery diagnosis, face reorganization and finger print reorganization). The use of analog imaging is decreases because of digital image, digital image can be further processed for many operations like (image editing, reducing noise, edge detection etc) and the analogue image can’t be processed as compared to digital image, because of that the area which uses analogue image now transferring to digital image.

Digital image processing is used for removing useless data from image and evaluating the beneficial information from images that is done by computer automatically without any human interaction, objectives of digital image processing is to gain image that was more suitable for human being. And the other is process by computer automatically without any human interaction.

Image processing algorithms are divided into three stages, in the lowest stage those techniques are discussed that deal with directly with raw, the best example of that edge detection and denoising, in the second stage are those algorithms which applies low level applied results for giving additional meaning like segmentation and also edge linking is the examples of second stage. At the last stage those functions applies on information that are provided by lower levels and try to remove semantic sense for example, handwriting recognition.

Image processing can be divided into analogue image processing and digital image processing.

I.I.I Analogue Image Processing

The electrical and computer engineering, analog image processing means processes the analog image into an analog signal in two dimensions (as opposed to the process of the digital image). Basically, all of the data can be displayed in two type’s 1.Analog data in the form of analog wave so that can be specified as an analog image 2. Digital data where the data presented in graphical representation. Examples of analogue are data transfer through a satellite antenna or making communication by telephone and television broadcasting are the example of analogue processing. Processes the analog image is performed on an analog signal. This includes the analog signal processing of two-dimensional. In this type of process, the image, by changing the electrical signals are operated by electrical.

I.I.II Digital Image Processing

The image is scanned to convert into a form that can be stored on some form of storage medium such as a memory or a hard disk or CD-ROM of the computer. The scanning procedure is may be done on the connected scanner and video camera in the imaging panel of the computer. When the image is digitized, it can be manipulated by a variety of image processing operations. Image processing operations are divided into three broad categories, image compression, expansion, and image restoration. Compression of the image is well-known to most people. This is to reduce the amount of memory required to store the digital images. By the scan process, set up imaging (for example, dark lighting) of image defects can be caused by a defect, it can be corrected using the image enhancement technology. When the image is in a good condition, the degree of mining operations can be used to obtain useful information from the image.

I.II Digital Image

Digital image is a binary representation of the visual information such as graphics, logos or individual video frames. Digital image can be electronically recorded in any of the storage device. Digital image basically is the matrix of color values/codes every color have certain value. Digital gray scale image have color range from 0 to 255, 0 represents the black color and 255 represents the black.

I.II.II How a Digital Image formed

Since the capture, image from the camera is the physical process. It will be used as energy source sunlight. Array of sensors, will be used for the acquisition of the image. Sunlight follow when impinging on the object, the amount of light reflected by the object is detected by the sensor. In order to create a digital image, you need to convert the data into digital format that comes from reflected light. This requires the sampling and quantization. Actually sampling and quantization are process that converts the light signal into digital form, the only sampling and quantization results of a two-dimensional array or matrix of certain images.


Digitizing or digitization may be those representational from claiming an object, image, sound, archive continuously signals (usually an simple signal) Toward An discrete value in the form of matrix. Digitizing is a process that will perform on analogue signals that are in continuously form and convert analogue signal into discrete representation ( parallel code ) two dimensional array of matrix that will be stored easily on memory like (hard drive, cd rom or other digital materiel).


The whole digitization will be regularly utilized at different form of information, for example, text, sound, picture or voice, are changed over under a solitary parallel code. Advanced majority of the data exists concerning illustration a standout amongst two digits, possibly 0 or 1. These are known as odds (a withdrawal from claiming double digits) and the successions about 0s and 1s that constitute data would know as bytes.

Is a process that has to form discrete values from analogue signals, these discrete values also known as bytes, Bytes are binary numbers that contain only 0s and 1s. Data is converted into parallel code of two dimensional array.

I.III Edge

Edges are the pixels of an image that identifies the boundaries of an object in image. Edges identify the structural shape of an object in image. Edge basically indicates the starting point of one area of an object and end point of an object to recognize the skeleton shape of objects in a digital image. Edge detection is a technique or method which finds the presence of an edge in an image or Edge detection is a function which determines the outlines of an image in an efficient and suitable manner. Edges generally are the margins pixel, which joins two different areas with amplitude of altering image.

An edge is the combined crowed of pixels whose neighbor’s pixels may changes in gray scale values. Edges contains important data and remove useless data from an image, presence of an edge is between background and objects, it contains the structural shape of digital image. Edges are also capable to marking objects. Identification of discreteness in partial image is called edge that represents the start point of one area and the ending point of the other one. Before the edge detection, edges are noise and full of ambiguity but the detected edge are different because the useless are of the image had been removed, so the detected edge becomes different.

I.IV Edge Detection

Process of finding the boundaries from an image is called edge detection that is depends upon gray level values. Edge detection is the most common approach for detecting the discontinuity in gradient value. The aim of edge detection is to find the limits of the object of interest [Sangwine 1998]. The sensing edge in many respects may be considered as an image segmentation, object recognition, was used for tracking boundaries in an image. Edge detection, to identify a strong discontinuity of the image refers to the localization process. Discontinuity has a pixel intensity that characterizes the boundary of the object in the scene changes abruptly. Conventional edge detection methods, while returning a value of zero to a uniform area, are configured to be responsive to the gradient of the image, including the convolution of the image with an operator (2-D filters). As the edge detection operator is available, is designed to be sensitive to a particular type of edge. Variables involved in the selection of the edge detection operators, including the orientation of the edge, the sound environment and the edge structure. The form of the operator determines the direction characteristic which is more sensitive to the edge. The operator can be optimized for search horizontal, vertical or diagonal edges. Noisy images contains a high frequency component, the edge detection is difficult with noisy images. It attempts to reduce the effect of background noise and distorted blur. The operation used in noisy images, as generally larger in scope, it is possible to average the data sufficient to discount several local noise pixels.

The main purpose of edge detection is to simplify the image data in order to minimize the amount of data to be processed. Edge detection operation will be from the local inspection discontinuity in each pixel of the image element. Amplitude, direction, and location of the particular sub-region of interest in the image are an important characteristic. Based on these characteristics, the sensor, each pixel of the inspection, it is necessary to determine whether it is an edge. Fly and Chen for the edge detection to optimize the best of the border, we suggest it is made by a simple edge detector, followed by morphological thinning and bonding treatment. In this article, we detect the first order differential edge, and the appropriate detection model edge, provides an overview of the evaluation of the performance of the detector. There are several edge detection methods. Some methods, was to determine the best of the gradient operator to detect a sudden change in the intensity.

There are two types of edge detection: First order edge detection that is totally depends upon first derivate and the gradient value, when the first change in gradient value occur the edge is detected Such (Sobel, Chen fly, Prewitt, Canny, Robert) and the second is second order derivative that depends upon the second order derivative like (Laplacian Operator also called zero crossing method). In computer vision, edge detection, traditionally the first or second differential operator is obtained by convolution approximation of normal linear filter signal. Edge detection method Sobel and Prewitt is considered its simplicity, they are onboard the primary differential operator [Sobel, 1990] the algorithm on the idea that it is possible to detect a local maximum value of the Image convoluted with the implements. Sobel and Prewitt edge detector uses two masks, vertical and horizontal. These masks generally 5 × 5 size of the matrix, the matrix of 3 x 3, which has been extended in this work we use. Matlab is given to high-performance language for technical computing, with Mathworks, Inc. of the company's products, MathWorks Inc. MATLAB to deal with many of the toolbox with a lot of functions and algorithms [image toolbox, 2002]. Set of 6 images will be used to test the 3x3 and 5x5 detector Sobel and Prewitt edge in MATLAB.


MATLAB (Matrix Laboratory) is the product of Mathworks Incorporation Company, mostly used for algorithm development, information visualization, information analysis, numerical and matrix calculation. Utilizing MATLAB, you might take care of specialized foul registering issues speedier over with accepted modifying languages, for example, such that C, C++, Furthermore Fortran.

MATLAB could a chance to be utilized within an extensive variety about applications, including indicator and picture processing, communications, control design, measurement, money related demonstrating analysis, computational science. Add-on toolboxes (collections of special-purpose MATLAB functions) augment the MATLAB earth will fathom specific classes of issues in these provision territories.

MATLAB gives an amount from claiming Characteristics for documenting and imparting your worth of effort. You camwood coordinate your MATLAB code with different dialects and applications, Furthermore disseminate your MATLAB calculations Also requisitions.

I.V.II Key Features of MATLAB

- Large amount designing for specialized foul registering.
- Improvement surroundings for dealing with code, files, and information.
- Intelligent instruments to iterative exploration, design, furthermore issue comprehending.
- Scientific capacities to straight algebra, statistics, filtering, optimization, Also numerical coordination.
- 2-D Furthermore 3-D graphics capacities for visualizing information.
- Devices for fabricating custom graphical client interfaces.
- Works for coordination MATLAB based calculations for outer requisitions and languages, for example, such that C, C++, Fortran, Java™, COM, Furthermore Microsoft® Excel®.

I.V.II MATLAB Language

Libraries written in Perl, Java, ActiveX or .NET can be specifically called from MATLAB, and numerous MATLAB libraries (for instance XML or SQL backing) are actualized as wrappers around Java or ActiveX libraries. The MATLAB dialect helps the vector grid operations that would basic should building and experimental issues. It empowers quick advancement execution. At the same time, MATLAB gives Characteristics of a conventional modifying language, including math operators, stream control, information structures, information types, object-oriented modifying (OOP), and debugging offers. Calling MATLAB from Java is more entangled, however should be possible with a MATLAB tool compartment which is sold independently by Math Works, or utilizing an undocumented instrument called JMI (Java-to-MATLAB Interface), (which ought not be mistaken for the irrelevant Java Metadata Interface that is likewise called JMI)

I.V.IV Development Tools

MATLAB incorporates improvement devices that assistance you execute your calculation effectively. These incorporate the following:

1) MATLAB editorial manager - gives standard altering Furthermore debugging features, for example, such that setting breakpoints Also single stepping.
2) Code analyzer - Checks your code to issues What's more prescribes adjustments with boost execution Also maintainability.
3) MATLAB Profiler - Records that long run used executing accordance of code.
4) Registry Reports - examine every last one of files for a registry What's more report card on code efficiency, document differences, record dependencies, What's more code scope.


1. To understand the famous edge detection techniques and understanding the internal working by using mathematics formals.
2. To compare different edge detection techniques and identify the best technique for detection edges of digital image.
3. To implement pre-defined matlab functions for simulation of edge detection techniques.


Tamaruperi et al. (1981), various types of studies of noise of the digital image, studies linear and nonlinear methods primarily different types of studies of the edge detector, compares linear and nonlinear methods and also different types of noise.

Mike Heath et al. (1996), a comparative study of a variety of edge detection technique, Sobel edge detection, Nalwa-Binford Sarkar and Boyer edge detector, were compared edge detection.

Torsten Zeeman (2002), research on the treatment of digital images using the local segmentation, focus on removing the noise of the digital image using an image scalar algebra, provides a variety of technology, digitize the image and noise removal.

Mamta Juneja et al. (2009), research on performance evaluation of advanced edge detection technology to the image of the space, in his study, he analyzes the behavior of the zero crossing operators and ability of gradient edge detection operator for image. In various methods under consideration, it is possible to detect the intensity of both edges; it seems to be more appropriate than Gaussian Laplacian. Performance statistical analysis provides a strong conclusion to this complex image class.

O. R. Vincent et al. (2009), comparative analysis of edge detection method of another image has been presented in this article. The best type of evidence of the sensor is evaluated by examining the card of the edge of respect to each other by statistical evaluation. During this evaluation, the edge detection method can be used to characterize the edge to represent the image for further analysis and implementation. Canny edge detection algorithm has been demonstrated to function better than almost all of all of the scenarios of these operators.

Shubham Saini et al. (2010), test the two edge detectors which use different methods for detecting an edge, compared the result In order to determine the suitable and was the detector under different conditions, it is necessary to know the difference between the edge detection algorithm. Mar -Hildreth Not particularly good centralize the location of the edge is not always detects thin edges. Canny method generates a continuous edge, and also create the thin edge from which causes the sharp edges and object identification. Canny provides low error rate, location, thin edges and Response.

G.T. Shrivakshan et al. (2012), in this article, understand the basic concepts of different filters, it is to apply filter to identify the type of shark fish, believed to case studies. In this document, edge detection technology it has been taken for testing. Software is implemented using MATLAB. 2, main image processing operator is reduced, is a Laplace operator. Case studies, a variety of filters related to the observation of fish shark classified by using the image processing, Sobel edge detection operator Prewitt, Laplacian edge detector based sensor calibration edge which is decomposed by the main Roberts. Advantages and disadvantages of these filters have been addressed in this study actively. Treat research of edge detection technology based on Laplacian-based gradient. Edge detection technique is compared with the identification of the case study. Canny edge detection algorithm of fish of sharks, Sobel, is expensive compared to the Prewitt operators and Robert. It has been shown to the evaluation of the image. In many conditions of noise, Canny, log, Sobel, Prewitt, Roberts, respectively, shows a better performance. A variety of ways to use the advanced detection technology, we know the gradient and the Laplace transform.

Li Bin et al. (2012), investigates several kinds of classical algorithms of image edge detection, including Roberts, Sobel, Prewitt, LOG and Canny with MATLAB tool on satellite image. In the results they declared that dimension Roberts’s operator, Sobel and Prewitt will be able to manage the impact of image processing more shades of gray and noise. Sobel operator is more sensitive to diagonal edge is horizontal and vertical edges. In contrast, the operator of Prewitt is sensitive to the horizontal and vertical direction of the edge. LOG is, in many cases, will occur at the edges of the double-wide pixel. Therefore, the operator almost LOG is not directly used for edge detection and used to determine the pixel to determine whether the pixel or not the main images of the bright edges known as dark regions region. Canny operator is based on three criteria. The basic idea is use a Gaussian function in order to smooth the first image. Then, the maximum value of the first derivative is equivalent to the minimum value of the first derivative. In other words, the two points with a dramatic change in the slight change and the gray level (high-end) and the point of the gray level corresponding to the zero-crossing point of the second derivative. Therefore, these two thresholds are used to detect the edge and weak strong edges. Canny algorithm, the fact that not interfered enables the ability to detect true weak edges. Canny algorithm enables the ability to detect true weak edges not interfered. This is the optimal edge detection algorithm.

Ayaz Akram et al. (2013), in this article, they are classified into three major categories, will attempt to provide a comparison of the various edge detection system edge detector: gradient-based edge detector, Laplacian edge detector and non-derivative-based edge on the base detector. Figure benefit of Platts, is used to compare the results of the quantitative, card edge of the composite image different noise levels. The real life of the resulting image has been qualitatively analyzed. Of non-derivative-based edge detector SUSAN is even, the best results are obtained in the presence of noise. The principle and the integral effect of the non-linear response, provides a loud noise removal. This it can only be understood if the similarly independently distributed Gaussian noise and SIGNAL input is taken into consideration, as long as because noise is small is ignored enough USAN function noise "such as" it contains each value. Integration the individual values of the calculation of the area, we can further reduce the effects of noise. Another strength of the edge detector of SUSAN the use of control parameters, is any less the most of much simpler than (and, therefore, easy to automate) other edge detection algorithm. Numerical analysis of these algorithms are intended for (with known edge) computer graphics, using a performance index of Pratt, to different noise levels. We analyze the visual outcome for the natural image.

H.S. Bhadauria et al. (2013), in this article comparative analysis of a variety of edge detection algorithm. This research paper is presented, a brief survey of the basic concepts of edge detection operation, theory behind another edge detector, compare the different edge detection image algorithms, including Roberts, Sobel, Prewitt, the Canny and MATLAB tool. The basic idea is, the maximum value of the first derivative is using a Gaussian function in order to smooth the firstly, then image corresponding to the minimum value of the first derivative. That is, two points with a dramatic change of slight changes and gray level (high end) and the point of the gray level correspond to a second point of zero derivation method. Therefore, these two thresholds are used to detect the weak strong edges. Canny algorithm, the fact that not interfered enables the ability to detect true weak edges. Canny algorithm enables the ability to detect true weak edges not interfered. This is the optimal edge detection algorithm.

Parminder Kaur et al. (2014), the author, trying to compare different edge detection methods to calculate the signal-to-noise ratio. Such as edge detection, shape, color, and provides information about the contrast detection, the intensity change of the point of there you image in the tool that is used to image segmentation scene analysis, to detect the edges of the image. In this article, comparison and analysis of the visual performance of the different variety of edge detection technology and the many conditions of noise technology, line by using Canny, LOG (Gaussian Laplacian), Robert, Prewitt, a variety of methods etc. we will, Sobel, Laplacian and wavelet. Each of these methods, we have different performance under these conditions. Horizontal, vertical and diagonal edges properly Prewitt edge detector result of the detected college image using. Is cunning and LOG, other methods. In other on the noisy clock image results, the best, the best of the still low quality of image than can be obtained using the cunning edge detector than other methods and it provides the results. Various detector is useful for different quality of the image. In the future, hybrid technology can be used in order to obtain the best results use.

Vineet Saini et al. (2014), this article proposes an adaptation and optimization of the two edge detection algorithm used to extract features in the CBIR. In this paper, compare the performance of Sobel and Canny edge detector; it has proposed a better solution for the extraction of features in CBIR. Edge detection algorithm, the results of edge detection, image search and large the importance of holding that can exceed the compromise time. In canny edge detection and Sobel has been shown image segmentation and the recognition of Sobel edge detector is a high-speed to the treatment, but it is very accurate. Unique product of the pixel, is Canny's method a thick continuous and accurate edge, slows down the process in comparison with Sobel. If there is a requirement by the user, is sufficiently carry out system in the presence of noise, Canny is clearly Better, that is shown by the results, to respond to user requests for removal of noise due.

Soumyajit Sarkar et al.(2014), in this article, in order to compare a variety of edge detection technology, therefore, we order what for the picture to assess the best of techniques related to will be able to conclude that it has successfully calculated the above results Canny edge detection technique that we conducted a thorough investigation is perfect for a large amount for data hiding High load capacity, is higher in the subsequent low PSNR value and M.S.E. comes with our daily life Without creating We are dealing with a secretly large amounts of data sensitive that can be transferred through the image doubt. Because it can be arbitrarily correspondence, therefore, Canny edge detection technique has been used as an important tool. The length of the message from a small value in the simple to the payload capacity. If intruder comes from knowing the data that has been hidden in the image also is, he or she is, will not be able to know the model that has been hidden without the data Their knowledge of another edge detection technology that has a random nature to the bit allocation. Perhaps data without integrated will not edge detection technology Flash is also important to note that low Robert, than that, such as Laplace operator. In conclusion, we can say that shrewd operator is a powerful data hiding technology in the field of steganography image.


For detecting edges of image many ways and techniques are available, that detect edges of image by using different algorithms, in this research main algorithms are applied and researched that is ( Robert operator, Prewitt operator, Sobel operator and canny edge detector ). For simulation MATLAB is used for image processing and getting results of all edge detection operators, Methodology is divided into following steps.

Step 1:- First read the image and save into any variable.

Step 2:- Now converting the image into gray scale for detecting edge and save into another variable.

Step 3:- applying edge detection operators one by one earlier First Order Edge Detection is applied which contain (Robert, Prewitt, Sobel and Canny), then Second Order Edge Detection will be applied which contain ( Laplacian of Gussain operator ) and result will be saved in separate variables.

Step 4:- Comparing the all edge detector results and identifying the best edge detector in terms of noise, false edges and sharp edges.

Below show the flow chart of work flow.


Abbildung in diesser Leseprobe nicht enthalten

Figure 3.1 Flow Chart of Methodology


i = imread('naeem.jpg');

where i refer to a variable, imread() is a method/ function which can except image url and read image and return the matrix value of that image and ‘naeem.jpg’ is the image url or path. The imread(‘naeem.jpg’) method returns image matrix which can contains the every pixel value and that matrix will be saved in variable i.

b = rgb2gray(i);

Now image is converted into gray scale rgb2gray() is a method/function that read the value of variable i and converted that image into gray scale and return the resultant matrix and that gray scale image matrix will be saved in variable b.

Now First Order Edge Detector applied.

First Order Edge Detector

Depends upon the utilization of First Order Derivative and further categories into Classical operator and Canny Edge Detector. In classical operator different operators are used like (Robert, Prewitt and Sobel) these operators are called classical operator that can be manipulated easily but disadvantage is very sensitive for noise.

Canny is derived from past work that was advanced algorithm that is Marr and Hildreath.

Canny edge detector have advanced algorithm derived from previous work of Marr and Hildreath. Canny is ideal edge detection algorithm because it facilities good identification for edges, decrease noise and better localization; in current image processing techniques canny is widely used.

First order edge detection finds the edge by changing in gradient value, if the pixels have continuously same gradient value that there is no edge when the gradient value changes these change will be caused for edge detection. First change in the gradient value identifies there is some object and the edge detection start from that point until the pixels value can’t change edge continuously detected when again change in pixels gradient value that identifies the end point of edge.

First order edge detection contains different operators that are described below

1) Robert Cross Operator.
2) Prwitt Operator.
3) Sobel Operator.
4) Canny Edge Detection.

Robert’s cross operator and how it works

Matlab code: - robert = edge(I,'roberts');

Where edge () is a method which except two parameter, first parameter is gray scale image that edge will be detected and second parameter is the edge detector operator/algorithm that applied on image. This method applies given edge detector to given image and returns the result in the form of matrix and that matrix value will be saved in robert variable.

To measure the spatial gradient in multi dimensions the Roberts algorithm is very fast and simple calculation for that. The absolute values of the output pixel value of each point from the other 2 × 2 convolution kernel constitute estimates of the time. The space operator input image gradient in the core is a simple rotation of 90 degrees it represents. This is very similar to Sobel operator.

Abbildung in dieser Leseprobe nicht enthalten

Table 3.1 Horizontal Filter of Robert Operator

Abbildung in dieser Leseprobe nicht enthalten

Table 3.2 Vertical Filters of Robert Operator

Robert Filters For X and Y Direction.

These kernels, both of which are designed to meet any of the core end for aligning the maximum running every 45 degrees to the vertical pixel grid. Core will produce gradient component in each direction of different measurements can be applied separately to the input image (call these GX and GY). These can determine the absolute value of the slope, and the combination of the gradient direction of each point in time. Gradient magnitude is given by the following equation.

Abbildung in dieser Leseprobe nicht enthalten

Formula 3.1 Calculating the gradient

Usually it is calculated using an approximate size: |G| = |GX|+|GY|

It is calculated more quickly. Spatial gradient (relative to the pixel grid direction) is given by the angle of orientation by expression of the edge.

Formula 3.2 Measuring the direction of pixels in Robert

Prewitt Edge Detector

Matlab code:- prewit = edge(b,'prewitt');

where edge() is a method which except two parameter, first parameter is gray scale image that edge will be detected and second parameter is the edge detector operator/algorithm that applied on image. This method applies prewit operator to given image and returns the result in the form of matrix and that matrix value will be saved in prewit variable.

Prewitt operator, will be used for edge detection in the image. This is for two types of edge detection.

- Horizontal edge
- Vertical edge

Incidentally, it is the intensity of a differential edge image corresponding to a pixel in the calculation. Derivatives, as a mask, also referred to as a mask for the edge detection that calculates the change in the use of differential signals, the image sequence is a signal.

All derivatives, it is necessary that you have the following characteristics mask.

- Opposite sign, must be present in the mask.
- Mask sum must be zero.
- More weight ratio detection means more edge.

Prewitt operator provides the 1, and the other for testing, for two vertical edges of the mask detection of horizontal edges.

Abbildung in dieser Leseprobe nicht enthalten

Table 3.3 Prewitt vertical filter

This is because, in order to find the vertical edges of the mask in the vertical direction of the desired zero. If you are in this intricate mask on the image, it will give the vertical edges of your photos.

How to use

In the leading edge of the vertical image, then apply the mask. This is, simply calculating the difference in the boundary region of the intensities of the pixels, which will act as the main derivative. It is the middle column is zero, not including the initial value of the image, the difference between the left and right edges of the calculated pixel. Increased edge strength will be the basis of the image, is relatively high.

Abbildung in dieser Leseprobe nicht enthalten

Table 3.4 Prewitt horizontal filter

This is because zero is horizontal, it desired, we discovered that horizontal edge mask. Horizontal edge, you'll convolution of the mask image on the image, you come out.

How to use

Important edge image of the mask. It also calculates the difference between the luminance of a particular edge pixel while acting on the principle of the shadow mask. It is from zero instead, but not included in the initial value of the edge of the image, because the difference of the edge intensity is calculated above and below the particular pixel between, to mask the center of the column. Therefore, quickly displayed will change to enhance the edge strength. These two masks, please follow the principles derived from the mask. Two masks the sum of the two masks to zero, has the opposite sign. Since both of the mask is standardized, it will not be able to change these values, the third condition does not apply to the operator.

Now Sobel operator will be computed.

sobel = edge(I,'sobel');

where edge() is a method which except two parameter, first parameter is gray scale image that edge will be detected and second parameter is the edge detector operator/algorithm that applied on image. This method applies Sobel operator to given image and returns the result in the form of matrix and that matrix value will be saved in sobel variable.

Sobel Operator

That algorithm uses a convolution kernel of a pair of 3 x 3. One of the cores merely rotated through 90 °, on the other hand.

Abbildung in dieser Leseprobe nicht enthalten

Table 3.5 Sobel horizontal filter

Abbildung in dieser Leseprobe nicht enthalten

Table 3.6 Sobel vertical filter

Filters that uses in x and y direction

These cores are designed to meet maximum performance edge on the vertical and horizontal directions in a core for each grid of two vertically aligned pixels. The core, to generate distinct amounts of the gradient components in x and y direction individually apply to the given image. These can determine the absolute value of the slope, and the combination of the gradient direction of each point in time. Gradient magnitude is given by the following equation.

Abbildung in dieser Leseprobe nicht enthalten

Formula 3.3 Sobel calculating gradient magnitude

Magnitude is calculating using:

|G| = |GX|+|GY|

Usually in, but it is calculated using an approximate size.

It is calculated more quickly. Spatial gradient (relative to the pixel grid direction) is given by the angle of orientation by expression of the edge.

Abbildung in dieser Leseprobe nicht enthalten

Formula 3.4 Sobel calculating direction of pixels

At the last canny edge detector applies

cany = edge(I,'sobel');

where edge() is a method which except two parameter, first parameter is gray scale image that edge will be detected and second parameter is the edge detector operator/algorithm that applied on image. This method applies canny edge detection to given image and returns the result in the form of matrix and that matrix value will be saved in cany variable.

Canny Edge Detector

Smart board adding the type of detection is designated as the best edge detector. The crack of expression is very useful for improving the detector .To stabbed to improve the current strategy of edge detection, has a list of criteria are described below:

1. The main expectation and most obvious is the lowest rate of error. Side should not be inexplicable happens in photography, it should not respond to non-board.
2. The second criterion is that the edge point is called localization. In other words, bite, by the difference between the pixels detectors, but also in this case, the actual edges detected is reduced.
3. The third criterion is a response to one side. As this does not significantly enough for the first 2 results exclude the possibility of more than one response to the position completely, it was forced.

On the top to the base reference, an intelligent edge detector, first, removing noise, smooth image, and detects the inclination of the area of ​​the image projector using the following more specific derivatives. Most} (non-maximum suppression) | the algorithm program and with local tracks to remove any component is not in most of the maximum. Gradient array is now very small in physical phenomena. physical phenomenon is beneficial to regain the rest of the pixels that are not hidden. physical phenomenon generally uses two thresholds, If you have a primary low threshold, it is set to zero. Two threshold magnitude when the amplitude is greater than the high threshold, if it is between the largest component in addition to the path from the setting of T2 lamp to zero, creating a scaffold.

Step 1: In order to express clever edge detection, the number of steps should be executed. First, it tries to be excluded prior to each side of the scene and search any and all of the first image. Mathematicians filter to easily use several masks. It is for use in a completely ingenious expression. At present, a suitable mask is calculated, the general mathematical smoothing injury convolution method is completed. Convolution mask is usually smaller than a certain image. As output, the mask is sliding at the top of the image, and then manipulates square pixels. Due to the large size of the mathematics of the mask, it reduces the noise of the detector with respect to sympathy. Since the size of mathematics is enlarged, the edge placement error is known to be a smaller degree of amplification.

Step 2: The image smoothing noise, after eliminating, by taking the next step is to bite the intensity gradient of the image search. It measures two-dimensional spatial gradient that will be to the image by Sobel. After that, the calculation can be an absolute scale gradient has been found for any purpose. Sobel operator, for the combination of a convolution mask 3 × 3 further, alternatively, the estimated gradient in the Y direction (row) of the estimated gradient (column) in the x direction. As shown in the following:

Abbildung in dieser Leseprobe nicht enthalten

Thereafter, the magnitude of the gradient or edge strength was measured using the following equation.

Abbildung in dieser Leseprobe nicht enthalten

Step 3: The direction x, the direction of the y measured by the sacrifice of the gradient, and then trying to build total resistance point X willingness once zero. If this happens, follow when the gradient in the x-direction is zero, the code, should not be limited to the settlement. Direction, depending on whether occlusion is inclined to the maximum value or the Y-direction of 90 °, zero, and should be. If the value is 90 degrees from zero, occlusal direction GY contrast, more puncture direction is zero. This is, the desired bite you can find under the direction of the next state.

Abbildung in dieser Leseprobe nicht enthalten

Step 4: If the direction of the knife is carried out, the last step in the direction of the knife, can be induced in the direction of the associated image. Therefore, a 5 × 5 pixel array following image:

Abbildung in dieser Leseprobe nicht enthalten

Table 3.7 5X5 pixels array for non-maxima suppression

(Horizontally) zero (along the positive diagonal) 45 degrees (vertically) 90 degrees - is committed to four potential that the unit pixel direction around there is no description of an "A" or 135 (degrees negative along the diagonal). Therefore, the number should solve current corresponding heeled two closest meaning of the four directions (eg, azimuth, when zero construction, was found to be three times). This five semicircular areas represented in FIG. two

Abbildung in dieser Leseprobe nicht enthalten

Figure 3.2 Semi-circle into 5 regions

Therefore, it is ready zero change interval management stabbed to yellow (from 0 to 180 degrees 20 two.5 & 157.5) indicates the location. However, the migration of the experience of leadership to bite (22.5 67.5) will be provided at 45 degrees. Range within the Thorn of blue of a different direction, we are ready to 90 degrees (67.5 degrees 112.5). Finally, decrease stinging display red interval, I was ready to change the 135 degrees (112.5 degrees 157.5).

Step 5: When management area Sting is determined that the non-maximum suppression is applied. Non-maximum suppression, TRACE puncture is not intended to input (0) and the edge direction has been used to suppress the value of any component. It provides an output image of a thin line.

Step 6: Finally, it will be used as a way to eliminate the lag [10] charter Strike. Edge contour fringes will be decomposed by the operator of the variable threshold output. Threshold T1 is applied to a single image, it is smaller than the slope threshold, such as when the edge has an average noise intensity to cause the edge T1. Similarly appearance, it also creates a dashed edge and extends beyond the threshold. This, the second hysteresis threshold, in order to prevent high and low thresholds. Image has a value greater than T1 at any pixel to be estimated as an edge pixel is marked immediately. Then, the edge pixel and T2 is connected to a larger pixel value than is selected to be at the edge pixel. If you think the other side edge, if you start, you are, but you, you will need a gradient of T2, T1 or less hit the slope does not stop.


original_img = imread('plants\1.jpg');

gray_img = rgb2gray(original_img);

edge_robert= edge(gray_img,'roberts');

edge_prewit = edge(gray_img,'prewitt');

edge_sobel= edge(gray_img,'sobel');

edge_canny = edge(gray_img,'canny');



title('Gray Scale Orignal Image');



title('Robert Edge Result');



title('Prewitt Edge Result');



title('Sobel Edge Result');



title('Canny Edge Result');


Abbildung in dieser Leseprobe nicht enthalten

Figure 3.3 Output of Matlab code


From this study and research, analysis that Robert cross operator can’t produce continues edges weeks edges are missed on many pixels, also can’t produce thin edges. Edges that are detected from Robert operator are wide because of that, different objects edges combine together and objects are not clearly identified. Because of wide edges small objects can’t be identifies clearly and week edges also negated by Robert. Robert operator gives better result in binary/black and white images.

Prewitt operator detects more edges as compared to robert and gives better performance as compared to robert operator. Prwitt also failed to detect continues edges, edge of small objects are not detected, it also ignores the week objects in an image.

Sobel operator identifies more edges but can’t produce the edges of black areas, it ignore to detect the edges of hair, black coat in human image and in the cup image again it ignores to detect the shadow edges. Sobel gives better result as compared to robert and prewitt.

Canny edge detection is able to detect continues edges; it also detects weak edges that was not detected by (Robert, Prewitt and Sobel). Canny also gives better result in noisy images, also detects thin edge from which objects are clearly identified by human, because it produce continues and thin line where the edges are detected. It also detects the edges of black areas where all other edge detectors are failed. Canny adopt sobel operator to calculate the gradient value but also have other extended process like non maxima suppression that is used for thinning edges and hysterics that process is used to removing false edges from image.

Before calculating the gradient magnitude canny applies gaussian filter for smoothing image and after calculating the gradient magnitude by applying sobel filters, because of applying extended processes, gaussian filter, non-maxima suppression and hysterics canny gives better result as compared to Rober, Prewitt and Sobel.

Abbildung in dieser Leseprobe nicht enthalten

Figure 4.1 Results of applying edge detectors on human image

Abbildung in dieser Leseprobe nicht enthalten

Figure 4.2 Results of edge detector operator on cup

Abbildung in dieser Leseprobe nicht enthalten

Figure 4.3 Results of edge detector operators on bird image


In this study, results of Robert, Prwitt, Sobel and Canny edge detection are compared graphically that is produce by matlab. Also analysis the mathematical equations of each and every edge detection operators that are researched in this study. According to matlab graphically results and mathematical formulas, analysis that the performance of canny edge detection is best because of their extended process (Non-maxima suppression and hysterics) it detects the thin edges of objects and removes the false edge from image.

In the second number sobel operator gives good result but can’t able to detect continues and thin edges. Canny also adopted sobel but canny first smoothing image by using gaussain filter that removes the noise from image and after calculates the gradient magnitude by using sobel operator. Sobel operator just only calculates the gradient magnitude and direction of pixels but canny have two more extended process, after detecting gradient magnitude and direction canny applied non maxima suppression for creating thin edges and at the last applies hysterics for removing false edges.

Prewitt is in 3rd number, It can’t able to identifies weak edges because there filters can’t able to detect weak objects, it only detects those objects that have high gradient values. Prewitt also fail to create continues and thin edges.

At the last Robert operator, it can’t detect the more edges because there filters only use 2X2 matrix pixels for detecting edges. Robert operator is suitable for binary images which have only two colors but in gray scale image robert operator performance is very poor as compared to other operators. It only focus on the gradient magnitude and can’t measure the direction of the pixels.

All operators result are depends upon the pixels if the pixels of the images is high the performance of edge detection operators is good but if we process low pixels images the performance of edge detection operators will be decreases. In this research we also identifies that noise causes to decrease the performance of edge detection. If noise less images will processed than edge detection techniques gives better result, but these techniques will be applied on noisy image the performance of these operators is very poor.


Xiaogbin Wang,Baokui Li,Qingbo Geng, “Runway Detection and Tracking for Unmanned Aerial Vehicle Based on an Improved Canny Edge Detection Algorithm” IEEE, 4th International Conference on Intelligent Human-Machine Systems and Cybernetics 978-0-7695-4721-3/12, 2012.

G.T. Shrivakshan, Dr.C. Chandrasekar,” A Comparison of various Edge Detection Techniques used in Image Processing”, IJCSI, Vol. 9, Spetember 2012.

Geng Xing, Chen ken and Hu Xiaoguang “An improved Canny edge detection algorithm for color image” IEEE TRANSACTION, 2012.

Yuesong Mei, Jianqiao Yu “ An Algorithm for Automatic Extraction of Moving Object in the image Guidance”, IEEE, International Conference on Intelligent System Design and Engineering Application,2010.

Parker J. R., “Algorithms for Image processing and computer vision,” 2nd Edition, Wiley publishers, 3-15, 2010.

Y.Q Lv and G.Y Zeng , Detection Algorithm of Picture Edge, TAIYUANSCIENCE & TECHNOLOGY, 27(2), 34-35, 2009.

Milan S, Vaclav H, and Roger B, “Image processing, analysis, and machine vision, second Edition,” Thompson Learning, pp. 82-90, 2009.

Raman Maini and Himanshu Aggarwal. Study and comparison of various image edge detection techniques. International Journal of Image Processing (IJIP), 3(1):1–11, 2009.

Rafael C. Gonzalez and Richard E. Woods, Digital Image Processing. 3nd. ed. New Jersey: Pearson Prentice Hall, 2008.

Rezai-Rad, G. and M. Aghababaie, Comparison of SUSAN and Sobel Edge Detection in MRI Images for Feature Extraction. In Information and Communication Technologies. ICTTA '06. 2nd. pp 1103 – 1106,2006.

Qiang Ji, Robert M. Haralick, Efficient facet edge detection and quantitative performance evaluation, Pattern Recognition 35, pp. 689-700, 2002.

Mohamed Ali and David Clausi , Using The Canny Edge Detector for Feature Extraction and Enhancement of Remote Sensing Images, IEEE, pp 2298-2300,2001.

Gang Liu and Robert M. Haralick, Two practical issue in Canny edge Detector Implementation, IEEE, pp 676-678, 2000.

R.Gonzalez and R. Woods, “Digital Image Processing”, Addision Wesley.pp 414-428, 1992.

T.Peli, “A Study of Algorithms for Edge Detection in Images”, M.Sc. Thesis, Technion-Isreal Institute of Technology Department of Electrical Engineering, June 1979.

J.H.G. Hale, “Detection of Elementary Features in a Picture by Non-Linear Local Numerical Processing”,Proc.Third Int. Joint Conference on Pattern Recognition, pp. 764-768, 1976.

A.Rosenfeld and A.C.Kak, “Digital Picture Processing”, Academic Press, New York, 1976.

Wikipedia, ―Robot‖ [online]. Available: http://en.wikipedia.org/wiki/Robot [Accessed December 2013].

Modern farmer, ―5 Coolest Farm Robots‖ [online]. Availablehttp://modernfarmer.com/2013/08/5-robots-on-the-farm/ [Accessed December 2013].

Mehmet Bodur, Ehsan Kiani, & Hasan Hacısevki, (2012). Double look-ahead reference point control for autonomous agricultural vehicles, biosystems engineering 113 173-186.

Thomas Deselaers, Daniel Keysers, & Hermann Ney, (2005). Discriminative Training for Object Recognition Using Image Patches, IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'05) - Volume 2 - Volume 02.

Vision Systems, ―Robot plants itself in phenotyping task‖ [Online]. Available: http://www. vision-systems.com/articles/slideshow/robots-join-forces-withvision-systems/pg004.html [Accessed December 2013].

Sobel, I., (1990). An Isotropic 3×3 Gradient Operator, Machine Vision for Three – Dimensional Scenes,Freeman, H., Academic Pres, NY, 376-379.

Aybar, E., (2003). ―Topolojik Kenar _slecleri‖, Anadolu Üniversitesi, Fen Bilimleri Enstitüsü, Ph.D. thesis.

J. Matthews. (2002). ―An introduction to edge detection: The sobel edge detector,‖ Available at http://www.generation5.org/content/2002/im01.asp.

J. F. Canny. (1986). ―A computational approach to edge detection‖. IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-8, no. 6, pp. 679-697.

J. Canny. (1983). ―Finding edges and lines in image‖. Master’s thesis, MIT.

Static Maps API V2 Developer Guide. Google Inc. Web. 11 July. 2013. https://developers.google.com /maps/documentation/staticmaps.

Muhammad Rizwan Khokher, Abdul Ghafoor, & Adil Masood Siddiqui, (2013). Image segmentation using multilevel graph cuts and graph development using fuzzy rule-based system, IET Image Process., Vol. 7, Iss. 3, pp. 201–211 201.

Anuj Mohan, Constantine Papageorgiou, & Tomaso Poggio, (APRIL 2001). Example-Based Object Detection in Images by Components, IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 23, NO. 4, Pages 349—361.

Luc Vincent, (April 1993). Morphological Grayscale Reconstruction in Image Analysis: Applications and Efficient Algorithms. IEEE Transactions on Image Processing, Vol. 2, No, 2, pp.176-201.

Kevin Murphy, Antonio Torralba, Daniel Eaton, & William Freeman, (2006). Object detection and localization using local and global features, Toward Category-Level Object Recognition Lecture Notes in Computer Science Volume 4170, pp 382-400.

D. Maheswari, & V.Radha, (2010). Noise removal in compound image using median filter. IJCSE) International Journal on Computer Science and Engineering. Vol. 02, No. 04, 1359-1362.

Marcin Smereka, & Ignacy Duleba, (2008). Circular object detection using a modified Hough transfom. Int. J. Appl. Math. Comput. Sci., Vol. 18, No. 1, 85–91.

Jiann-Jone Chen, Chun-Rong Su, W. Eric L. Grimson, Jun-Lin Liu, & De-Hui Shiue, (FEBRUARY 2012). Object Segmentation of Database Images by Dual Multiscale Morphological Reconstructions and Retrieval Applications, IEEE TRANSACTIONS ON IMAGE PROCESSING, VOL. 21, NO. 2.

Marie Liénou, Henri Maître, & Mihai Datcu, (JANUARY 2010). Semantic Annotation of Satellite Images Using Latent Dirichlet Allocation, IEEE GEOSCIENCE AND REMOTE SENSING LETTERS, VOL. 7, NO.1.

M. Sharifi, M. Fathy and M. T. Mahmoudi, "A classified and comparative study of edge detection algorithms," Information Technology: Coding and Computing, 2002. Proceedings. International Conference on, 2002, pp. 117-120. doi: 10.1109/ITCC.2002.1000371.

Chunming Li, Chenyang Xu, Changfeng Gui, and Martin D. Fox, for the paper entitled, Distance Regularized Level Set Evolution and Its Application to Image Segmentation, IEEE Transactions on Image Processing, Volume 19, Number 12, December 2010.

Chunming Li, Chiu-Yen Kao, John C. Gore, and Zhaohua Ding, Minimization of Region-Scalable Fitting Energy for Image Segmentation, IEEE Transactions on Image Processing, Volume 17, Number 10, October 2008.

Dinggang Shen and Christos Davatzikos, for the paper entitled, HAMMER: Hierarchical Attribute Matching Mechanism for Elastic Registration, IEEE Transactions on Medical Imaging, Volume 21, Number 11, November 2002.

Excerpt out of 51 pages


A Comparative Study of Edge Detection Techniques in Digital Images
MSIT (Hons)
Catalog Number
ISBN (eBook)
ISBN (Book)
comparative, study, edge, detection, techniques, digital, images
Quote paper
Naeem Akbar Channar (Author), 2016, A Comparative Study of Edge Detection Techniques in Digital Images, Munich, GRIN Verlag, https://www.grin.com/document/512938


  • No comments yet.
Look inside the ebook
Title: A Comparative Study of Edge Detection Techniques in Digital Images

Upload papers

Your term paper / thesis:

- Publication as eBook and book
- High royalties for the sales
- Completely free - with ISBN
- It only takes five minutes
- Every paper finds readers

Publish now - it's free