A COMPARATIVE STUDY OF COMMON EDGE DETECTION OPERATORS IN DIGITAL IMAGE PROCESSING

Edge detection is a fundamental process in image processing that extracts information about the image and facilitates image segmentation and feature extraction. It has many applications in various fields of computer vision. Thus, it is very necessary to understand the performance of each of these edge detectors. This paper presents a comparative study of common edge detection operators in image processing using mean squared error (MSE), peak signal to noise ratio (PSNR), and Execution time (Et). The paper shows the canny edge detector is computationally expensive but provides higher accuracy in edge detection with higher PSNR and lower MSE. The software tool used in the project is MATLAB SIMULINK R2020a.


Introduction
The field of digital image processing has seen unprecedented growth due to its significant social and economic impacts. Today, there is almost no field that has not been impacted either totally or partially by digital image processing. Digital image processing refers to processing digital images by means of a digital computer. Its main goal is to improve pictorial information for human interpretation [1].
Edge detection is a fundamental process in image processing that extracts information about the image and facilitates image segmentation and feature extraction. Edge detection is the process of identifying and locating sharp discontinuities in an image. These discontinuities are the abrupt changes in pixel intensity that characterize boundaries of objects in a scene. Edge detection significantly reduces the amount of data in an image while preserving important structural features of the image [2]. Effects such as refraction or poor focus can result in objects with boundaries defined by a steady change in intensity. So, there are problems of false edge detection, missing true edges, edge localization, high computational time and problem due to noise [4]. This paper, therefore, seeks to compare and analyze the performance of the common Gradient based and Laplacian based edge detection operators using Mean Squared Error (MSE), Peak Signal to Noise Ratio (PSNR) and Execution time[Et] performance metrics. This paper is organized as follows; Section 1 presents the introduction and Section 2 reviews related works done in edge detection. Section 3 shows the Material and Methods used in the project while section 4 provides the Test and Evaluation results from the experiment carried out in the project. Section 5 presents the conclusion. [4] have performed a comparative analysis between their proposed Haar wavelet-based Prewitt operator and the various classical edge detectors under both noise and blur conditions. The Haar wavelet operates on data by calculating the sums and differences of adjacent elements [15]. According to their experimental results, the Haarbased Prewitt method can perform better in blur conditions. However, they found out that the Canny edge detector is better in noisy and blur conditions but its results are highly dependent on adjustable parameters. [2] have studied the most commonly used Gradientbased and Laplacian-based edge detection techniques. They provided a comprehensive analysis of both the advantages and disadvantages of these operators. They showed that the performance of the Canny algorithm depends heavily on the adjustable parameters, which are the standard deviation for the Gaussian filter and the threshold values. They went ahead to conclude that the JREAS, Vol. 06, Issue 04, Oct 2021

Related Works
Canny's edge detector is computationally more expensive compared to Sobel, Prewitt and Robert's operator. However, the Canny's edge detector performs better than all these operators under almost all scenarios. [6] and [17] have also arrived at similar conclusions. [5] have performed a comparative analysis on various edge detection operators based on discontinuity intensity levels. They showed that the Canny edge detector produces higher accuracy in the detection of objects with higher entropy, PSNR and MSE compared with the rest but at the expense of execution time.
[7] carried out an experimental analysis of the various edge detection algorithms under Salt & Pepper, Gaussian and Speckle noise conditions. According to their results, Log and Canny perform better than Sobel, Prewitt and Roberts under noiseless conditions. However, the Canny operator provides better results in the presence of noise. They concluded that the Canny operator is a better edge detector for detecting the edges for inner as well as outer lines of the object; and Sobel edge detector proves better for discovering better outer lines (continuous boundary) only of an object. [14] analyzed the different edge detection operators used in image processing. They showed that Canny edge detector is very expensive in terms of computation but gives the best result with a low error rate, Sobel technique gives more accurate edges and Prewitt is quickly computed

Edge Detection Operator
In this paper, we used the five (5) common edge detection operators. They are Roberts, Prewitts, Sobel, Canny and LoG.

Roberts
Robert was invented by Robert Lawrence Gilman in 1965. It is very sensitive to noise [10]. It uses the discrete method to compute the gradient. It measures the 2D point very quickly in a spatial gradient [16]. The Roberts operator uses the following mask.

Prewitt
Prewitt detector was discovered in 1970 by Judith M. S. Prewitt. It is similar to Sobel and less sensitive. It detects the edges horizontally and vertically and very inexpensive in terms of computation [11]. It uses gray level contrast of adjacent pixels to detect when the contrast reaches a peak at edges, removing some false edges [17]. The Prewitt edge detector uses the following mask to approximate digitally the first derivatives M x and M y .

Sobel
Sobel was invented by Sobel Irwin Edward in 1970. It is very fast to compute and detect thick edges [7]. Sobel operator uses the following masks. Sobel operator makes use of two 3*3 convolution masks. Second mask is 90degree rotation of first mask [19]. It is calculated using the mask;

Canny
Canny edge detector was invented by Canny John F. in 1986 and was designed to be an optimal edge detector. It maximizes the conventional signal to noise ratio to detect a particular edge. The Canny edge detector is computationally more expensive as compared to other edge detectors. This detector finds edges by looking for local maxima of the gradient of f(x, y) [12]. The gradient is calculated using the derivative of a Gaussian filter. The method uses two thresholds to detect strong and weak edges and includes the weak edges in the output only if they are connected to strong edges [5] [18].

Canny
Canny edge detector was invented by Canny John F. in 1986 and was designed to be an optimal edge detector. It maximizes the conventional signal to noise ratio to detect a particular edge. The Canny edge detector is computationally more expensive as compared to other edge detectors. This detector finds edges by looking for local maxima of the gradient of f(x, y) [12]. The gradient is calculated using the derivative of a Gaussian filter. The method uses two thresholds to detect strong and weak edges and includes the weak edges in the output only if they are connected to strong edges [5] [18].

Laplacian of Gaussian (LOG)
Laplacian of Gaussian (LoG) was discovered by David Marr and Ellen C. Hildreth in 1982. It also known as Marr-Hildreth edge detector and it smoothens the images [11]. The LoG is based on the second order derivative and it detect edges by first smoothing the image with a JREAS, Vol. 06, Issue 04, Oct 2021 Gaussian filter to reduce noise sensitivity [13]. It is further convolved with the Laplacian filter to detect the true edges after which the edges are analyzed by looking at the zero crossings. The Laplacian L(x,y) of an image with pixel intensity values I(x,y) is given by: L x, y =

Performance Measurement Metrics
In image processing applications, the performance evaluation plays main role to assess the image quality. The importance of performance evaluation is recognized in the computer vision community [20]. The metrics used in this project to measure the edge detector operators are MSE, PSNR and Et.

Mean Squared Error (MSE)
Robert MSE calculates the deviation between the pixel values of original image and edge detected image [9]. It represents the cumulative squared error between the original image and the edge detected image. The lower the value of MSE, the better the detector. It is calculated using equation (1) below: Where g is the original image and f the edge detected image. The m and n are the pixels in the rows and the columns of each image.

Peak Signal to Noise Ratio (PSNR)
It determines the degree of similarity between reference and edge detected image. A bigger value shows good results [9]. This ratio is used as a quality measurement between the original and the edge detected image. The higher the PSNR, the better the quality of the edge detected image. It is calculated using equation (2)  (2) Where R is the maximum fluctuation in the image data type or the number of gray levels in the input image. It is usually 256 [3].

Execution time (Et)
This is the total time taken by the edge detector to completely detect edges in the input image. It is measured in seconds.

Implementation
The main software used in the project is MATLAB R2020A (MATrix LABoratory). MATLAB provides an interactive environment for numerical computations and graphics analysis using matrix computations. Fig. 1 shows the flowchart of the project. First, a color image is entered into the MATLAB software and converted into a grayscale image. A grayscale image has its colors in shades of gray, which carries only intensity information. It is usually 8 bits, thus ensuring higher compression of image for faster processing with less noise. In the next step, different edge detectors are applied to the image to detect the edges. Finally, the MSE, PSNR and the Et are computed.
The MSE and PSNR are calculated using equations (1) and (2). The results are then tabulated for easier comparison. The edge detected images are also printed together with the original image for visual inspection. The edge detectors are also compared using their performance metrics for each of the image used.

Conclusion
In this paper, a comparative study of the common edge detection operators is conducted using mean squared error (MSE), peak signal to noise ratio (PSNR) and execution time (Et) as performance metrics. The software used is MATLAB R2020a. According to the experimental observations, LoG and Canny operators produce good performance results. However, the Canny edge detector has the highest accuracy in edge detection with the highest PSNR and lowest MSE at the expense of execution time compared with Roberts, Prewitts, Sobel and LoG. Therefore, it is concluded that Canny edge detector is an optimal detector in possible scenarios of image processing.