A Comparative Study of Edge Detectors in Digital Image Processing Ashutosh Sharma
Mohd Dilshad Ansari
Rajiv Kumar
Department of Electronics and Communication Jaypee University of I. T. Solan (H.P.), India
[email protected]
Dept. of Computer Science and Engineering Jaypee University of I. T. Solan (H.P.), India
[email protected]
Department of Electronics and Communication Jaypee University of I. T. Solan (H.P.), India
[email protected]
Abstract—The advanced technology in digital image processing has one of the most useful operations known as edge detection which have been shown a significant role in pattern reorganization. The reason behind this is because of reduction in the size of file without any loss of necessary information. The information of the file consists only on the edges thus data other than the edges can be removed; hence amount of data needed to process reduces. Using the knowledge of edge boundaries it has been easier to perform the various operations like image restoration, segmentation, enhancement and compression. Usefulness of edge detection can be seen in broad sense as edges information can provide better perception for human being about the image. The edge detection has a very vast area of applications in the field of biomedical image processing and telecommunication engineering. In this paper a comparison of different edge detectors has been made and results formed using different measures which shows that intuitionistic fuzzy edge detector outperform over the existed edge detectors.
In general, practically an image can be infected by noise and that is severe problem. There are variety of noises presents like Impulse noise, Speckle noise, Gaussian noise and Rayleigh noise [9, 10]. Several edge detection algorithms has been proposed by researchers which are helpful to get the edges very precisely and present with maximum features of an image like area, shape, variation in colors etc. As edge of image formed where a sharp change in intensities of pixels occurs, an edge detector should have capability to locate them easily without loss of information [11]. In an image any change in the properties of image can form an edge and some of those edges are listed below with the expected shape [12]:
Keywords—Edge detection; Compression; Sobel; Prewitt; Canny; Digital image processing.
I.
INTRODUCTION
In the field of digital image processing, the edge detection has a very important role in the digital image processing [1]. Edge detection can be defined as the process localization and identification of abrupt changes in the smoothness of an image [2]. An image is a collection of different pixels intensities which may forms edges or boundaries of an image [3]. In edge detection technique, an image has a standard fundamental problem which consists of image segmentation and enhancement or compression and computer vision in image processing [4]. It has been a major concerning issue in image segmentation. For image segmentation an image can be segmented into parts and finds the abrupt change in image processing and then detect the edges of an image [5]. In digital image processing an image has several edge detectors. Some of them are canny, Sobel, Prewitt, Log and fuzzy logic detectors useful in image edge detection, segmentation, and boundary detection in digital image processing [6, 7]. Each operator is designed to be sensitive to certain types of edges. Among them Sobel, Roberts, Prewitt, Log and Canny are major concerning operators [8]. The geometry of the operator determines a characteristic direction in which it is most sensitive to edges.
(a)
(b)
(c)
(d)
Fig. 1. (a) Step Edge (b) Ramp Edge (c) Roof Edge and (d) Spike Edge
Step edge has been formed due to an abrupt change in intensity. Ramp edge, on the other hand has been given by gradual or sluggish change in pixel intensities. Roof edges can be formed in image where the change in pixel intensities is not instant. Spiky edges got there where pixel intensities got some abrupt change and then comes to its original state or pixel intensity level. Edge detection got much more attentions because of its wide area of applications. The major application of edge detection came in the processing of image segmentation and image compression and enhancement. The different application
areas of edge detection have been shown in Fig. 1 which are based on the requirement of application.
Convolution kernels in (a) x −directions G y −direction G
TABLE I.
-1
0
1
1
2
1
-2
0
2
0
0
0
-1
0
1
-1
-2
-1
(a) Fig. 2. Applications of edge detection
Usually an edge can be defined as the abrupt change in the pixel intensity values or change in brightness. This abrupt change can be happened as in the form of spike, roof, ramp, and step. The colored image has been converted into gray scale because in a gray image changes can be seen easily [14, 15]. The gray scaled image can show the discontinuities in very small change that’s why general edge detection has been done on gray scale images. Using the information of edges one can take the knowledge of an object without processing lots of data. Therefore, the edge detection plays a swift role in graphic processing and feature extractions [16]. II. METHODOLOGY In the digital image processing, number of technique has been used for the edge detection viz. Sobel, Canny, Prewitt. They are significantly used in image processing as per requirement of information from an image. The edge detection is mainly divided into two parts Gradient and Laplacian detection. In this paper the comparison has been made between different edge detection techniques using mathematical analysis [17]. There are two types of edge detection techniques one is of gradient based edge detection and other one is Laplacian type edge detection. In gradient edge detection technique, the edges are detected by taking maxima and minima of first derivative. On the other hand side Laplacian edge detection technique, the detection has been made by searching zero crossing in second derivative [18]. A. Sobel Edge Detector In this edge detection, the detection has been performed by using two masks: (i) vertical and (ii) horizontal [19]. These two masks are of generally 3 × 3 matrices which are used in Matlab to perform the making of the image This filter has mainly two advantages which are useful in smoothing of random noise in an image: (i) using introduction of average factor, this filter has smoothing effect for the noise in images and (ii) edges on images got bright because of differentiation of columns and rows. As discussed above the applications of edge detections in various fields of engineering, edge detection has been carried using the local operators. Generally different types of operators have been used like 2nd order differential, orthogonal and directional operator. This operator exists in the categories of orthogonal operators. An image is of converted into two kernel gradients (i) gradient in − direction and (ii) gradient in − direction.
and (b) in
(b)
The use of these two gradient kernels has been used to find the magnitude and angle of each point given as below: | |= Typically an approximate magnitude and direction has been computed using the formula: |
| |=|
= ∠ tan is the derivative in where derivative in − direction.
− direction and
is the
In this edge detector, due to the smoothing feature the sobel edge detector is less sensitive to noise which is present in the images whereas the smoothing of the image affects the process of edge detection. The problem with this detector is that it can’t produce edge in the image with high accuracy. But it doesn’t means to say that it has no use. There have been some adequate applications which can use this edge detector. B. Prewitt Edge Detector The convoluting type filter has been known as Prewitt edge detector which detect edge basis on the two filters which are in vertical or horizontal sequence [20]. Both sequence added together to give the final result and these two sequence are given as: TABLE II.
(a) Horizontal and (b) Vertical filter of Prewitt filter
1
1
1
-1
0
1
0
0
0
-1
0
1
-1
-1
-1
-1
0
1
(a)
(b)
A 3 × 3 metrics has been shown in the Table III below: TABLE III.
3x3 window matrix
In the given Table III the center pixel value of given by calculated pixel calculated using 1 and pixel by 1 . has been calculated by using formula:
The pixel value of Pixel =
−
− −
−
−
−
which has to be quantized up to the range of 0 − 255. The final value of each horizontal and vertical component has been calculated using the formula given as below: Pixel In the above formula = The value of
=
∗
∗ −
−
has been given by the combination as: =
−
−
All these above discussed detectors have been simulated and corresponding to them results has been shown in the next section. III. RESULTS AND DISCUSSION
has been given as: −
(i) First input image is taken then image is divided into overlapping. (ii) Find the divergence measure. (iii) Calculated the minimum and maximum divergence measure (iv) Intuitionistic fuzzy set with the measure value of divergence value and a set of threshold value. (v) Finally an edge detected image has been taken.
−
C. Canny Edge Detector This edge detector has been listed as the ultimate edge detector in digital image processing and also known as optimal detector [21]. This detector aims to fulfill the three main criteria (i) occurrence of rate with low error (ii) excellent edge localization and (iii) minimal time taken. The canny edge detector consists of multiple stages called as multistage edge detector algorithm. The main steps of this edge detector have been constitutes of (i) Pre-processing (ii) Gradients calculations (iii) Non-maximum suppression and (iv) Thresholding with hysteresis. In the first step pre-processing as it has been known that edge detectors are prone to noise, so a filter has been used in pre-processing scheme. A Gaussian filter has been used for the noise blurring with the value of standard deviation of 1.4. Second step of Canny filter consist of gradient calculation which is same as the Sobel. The actual edge detector starts from step three. This step checks the pixel value and if that value is not highest, it suppresses that value and move to next value. Thus this process has been followed for all the pixel values and any value that has highest value and magnitude value which has been associated with the value more than the given threshold value then that pixel has to be known as edge and gives the thin lines. This step followed by thresholding with hysterics which has been used in three points: (1) in this if any pixel gradient has value higher than that of the upper most threshold value then that pixel has to be known as an edge (2) if pixel value is lower than that of threshold value it has been rejected and (3) if value of pixel lies between two levels of threefold then it will be accepted only and only if it has been connected with that pixel which has value more than given threshold value. D. Intuitionistic Fuzzy Edge Detector This edge detector is basically based on intuitionistic fuzzy set which has the measures of divergence and entropy [22 - 24]. The edge detector has following these steps:
In this section the various edge detection schemes has been simulated to perform the comparative study of all edge detection techniques. The very first step for the edge detection a colored image has been taken and converted into gray scale image. The simulations have been carried on Matlab 2013a simulator. In a gray image only two colors has been presented i.e. black and white where black colored pixels have low intensity and white pixels have highest intensity. In the very last step edge detection operators applied to get the edges of an image with boundaries.
Fig. 3. Flow chart of edge detection
A colored image has been taken from image database for the edge detection purpose so that easily one can find its shape, edges, smoothness etc. In this paper for the comparison purpose we have taken three different types of images (i) Cameraman (ii) Lena and (iii) Baboon. Each one of these images has been converted to gray scale image. In the edge detection techniques the main problem to use the colored images the colored image is that it has number of edges and it has been difficult to recognize the true edges. First of all a colored image has been converted into gray image so that only two intensity level black and white exits. After first step Sobel, Prewitt, Canny and Intuitionistic fuzzy edge detector has been used to detect the edges of an image.
The comparison has been made using PSNR value of edge detector values and given as:
where has been given as the original input image and has been given as the edge – detected image and size of the image has been given by the dimensions × .
A. Mean Square Error (MSE) =
∑
∑
,
(a)
−
B. Peak Signal to Noise Ratio (PSNR) 255 = 10
,
(b)
(c)
(d)
(e)
Fig. 4. From left to right (a) original input image (b) Canny (c) Sobel (d) Prewitt and (e) Intuitionistic Fuzzy, detectors
(a)
(b)
(c)
(d)
(e)
Fig. 5. From left to right (a) original input image (b) Canny (c) Sobel (d) Prewitt and (e) Intuitionistic Fuzzy, detectors
(a)
(b)
(c)
(d)
(e)
Fig. 6. From left to right (a) original input image (b) Canny (c) Sobel (d) Prewitt and (e) Intuitionistic Fuzzy, detectors TABLE IV. Canny
The comparison of different edge detection methods
Sr. No.
Image Name
Prewitt
Sobel
Intuitionistic Fuzzy
1
Cameraman
0.2846
53.5887
0.2780
53.6907
0.2780
53.6905
0.2487
54.1734
2
Lena
0.2835
53.6055
0.2768
53.7089
0.2769
53.7077
0.2436
54.2637
3
Baboon
0.2860
53.5670
0.2810
53.6440
0.2810
53.6435
0.2521
54.1151
IV. CONCLUSION In this Paper, four edge detection techniques have been discussed for image processing images. The edges are detected from original image and four techniques have been used to detect edges such as Canny, Sobel, Prewitt and Intuitionistic Fuzzy. These techniques are compared on the basis of MSE and PSNR value. From obtained results visual as well as PSNR value we can say that, Intuitionistic Fuzzy edge detector provide quite better results compare to other edge detector. Intuitionistic Fuzzy shows the highest values of PSNR and lowest values of MSE. This concludes that Fuzzy technique has been useful for the more bright pixels other than the three different edge detection techniques.
REFERENCES [1] [2] [3] [4] [5] [6] [7]
[8] [9]
[10] [11]
[12]
[13]
[14] [15] [16] [17]
[18]
[19] [20]
R. C. Gonzalez and R. E. Woods. “Digital Image Processing”. 2nd ed. Prentice Hall, 2002. E. C. Hildreth, Implementation of a theory of edge detection, 1980. D. C. Marr, "Early processing of visual information", Phil. Trans. Roy. Soc. London, vol. Î’ 275, pp. 483-524, 1976. A. Herskovits and T. O. Binford, On boundary detection, 1970. E. C. Hildreth, The Measurement of Visual Motion, 1983, M.I.T. Press K. A. Stevens, Surface perception from local analysis of texture and contour, 1980. W. Frei and C.-C. Chen. “Fast boundary detection: A generalization and a new algorithm ”. lEEE Trans. Comput., vol. C-26, no. 10, pp. 988-998, 1977. E. Argyle. “Techniques for edge detection,” Proc. IEEE, vol. 59, pp. 285-286, 1971. Ansari, M. D., Singh, G. and Singh, A., kumar, A., "An Efficient Salt and Pepper noise Removal and Edge preserving Scheme for Image Restoration." International Journal of Computer Technology & Applications, vol 3 n0. 5, pp 1848-1842, 2012. S. O. Rice, "Mathematical analysis of random Noise", Bell Syst. Tech. J., vol. 24, pp. 46-156, 1945. M. Heath, S. Sarkar, T. Sanocki, and K.W. Bowyer. “A Robust Visual Method for Assessing the Relative.Performance of Edge Detection Algorithms”. IEEE Trans. Pattern Analysis and Machine Intelligence, vol.19, no. 12, pp. 1338-1359, Dec. 1997. R. M. Haralick and K. Shanmugam, “Textural features for image classification.” IEEE Transactions on systems, man, and cybernetics, vol. 6, pp. 610-621, 1973. M.C. Shin, D. Goldgof, and K.W. Bowyer .“Comparison of Edge Detector Performance through Use in an Object Recognition Task”. Computer Vision and Image Understanding, vol. 84, no. 1, pp. 160-178, Oct. 2001. K. A. Stevens, Surface perception from local analysis of texture and contour, 1980. J. Canny. “Finding edges and lines in image”. Master’s thesis, MIT, 1983. T. Peli and D. Malah. “A Study of Edge Detection Algorithms”. Computer Graphics and Image Processing, vol. 20, pp. 1-21, 1982. M. Heath, S. Sarkar, T. Sanocki and K.W. Bowyer. “Comparison of Edge Detectors: A Methodology and Initial Study”. Computer Vision and Image Understanding, vol. 69, no. 1, pp. 38-54, Jan. 1998. R. M. Haralick. “Digital step edges from zero crossing of the second directional derivatives,” IEEE Trans. Pattern Anal. Machine Intell., vol. PAMI-6, no. 1, pp. 58-68, Jan. 1984. J. Matthews, An introduction to edge detection: The sobel edge detector, 2002. D. Rao, and S. Rai, A Review on Edge Detection Technique in Image Processing Techniques, 2016.
[21] J. Canny, A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. Vol. 6, pp. 679–698, 1986. [22] M. D. Ansari, A. R. Mishra, and F. T. Ansari, “New Divergence and Entropy Measures for Intuitionistic Fuzzy Sets on Edge Detection", Int. J. Fuzzy Syst. , 2017. [23] M. D. Ansari, A. R. Mishra, F. T. Ansari, and M. Chawla, “On edge detection based on new intuitionistic fuzzy divergence and entropy measures.” IEEE 4th International Conference on Parallel, Distributed and Grid Computing (PDGC), pp. 689-693, 2016. [24] K. T. Atanassov, Intuitionistic fuzzy sets. Fuzzy Sets Syst. vol 20 , pp. 87–96, 1986.