electronics

Article Sobel Based on Weighted Nuclear Norm Minimization Image Denoising

Run Tian , Guiling Sun *, Xiaochao Liu and Bowen Zheng

College of Electronic Information and Optical Engineering, Nankai University, Tianjin 300350, China; [email protected] (R.T.); [email protected] (X.L.); [email protected] (B.Z.) * Correspondence: [email protected]

Abstract: As a classic and effective edge detection operator, the Sobel operator has been widely used in image segmentation and other image processing technologies. This operator has obvious advantages in the speed of extracting the edge of images, but it also has the disadvantage that the detection effect is not ideal when the image contains noise. In order to solve this problem, this paper proposes an optimized scheme for edge detection. In this scheme, the weighted nuclear norm minimization (WNNM) image denoising algorithm is combined with the Sobel edge detection algorithm, and the excellent denoising performance of the WNNM algorithm in a noise environment is utilized to improve the anti-noise performance of the Sobel operator. The experimental results show that the optimization algorithm can obtain better detection results when processing noisy images, and the advantages of the algorithm become more obvious with the increase of noise intensity.

Keywords: Sobel operator; weighted nuclear norm minimization; image denoising; edge detection

 

Citation: Tian, R.; Sun, G.; Liu, X.; 1. Introduction Zheng, B. Sobel Edge Detection Based Image edge means the end of one area and the beginning of another area in an image. on Weighted Nuclear Norm The collection of pixels at the junction of adjacent areas in the image constitutes the edge of Minimization Image Denoising. the image [1]. Because the grayscale difference of pixels between different areas is often Electronics 2021, 10, 655. https:// very large, the purpose of edge detection is to identify pixels with obvious brightness doi.org/10.3390/electronics10060655 changes in the image. The significance of edge detection is that it greatly reduces the amount of data that need to be processed. It removes the data that carry less information Academic Editor: Luca Mesin and retains the important structural information of the image, so it is an important research direction in the field of image processing and , especially in the area of Received: 9 February 2021 feature extraction. Accepted: 9 March 2021 Published: 11 March 2021 With the development of edge detection technology, there are some mature classical edge detection operators, including the Roberts operator, the , the Sobel

Publisher’s Note: MDPI stays neutral operator and the Laplacian operator. On this basis, many scholars have conducted in- with regard to jurisdictional claims in depth research on the above operators over the years and proposed a series of improved published maps and institutional affil- algorithms with much superior performance. For example, Zhang et al. proposed a fusion iations. edge detection algorithm based on an improved Sobel operator, using a fusion algorithm that combines an improved Sobel operator, a Canny operator and a Laplacian-of-Gaussian operator to optimize the edge detection result [2]. Topno et al. proposed an improved edge detection method based on median filtering. After edge detection, the median filter is used to protect the edge from salt and pepper noise [3]. Yoon et al. proposed an edge Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. detection method based on the Bhattacharyya distance with adjustable block space. In This article is an open access article this algorithm, in order to calculate the Bhattacharyya distance, a pair of blocks were distributed under the terms and extracted for each pixel. The Bhattacharyya distance was used to detect edges, which conditions of the Creative Commons was calculated from the mean vector and covariance matrix of each block. By adjusting Attribution (CC BY) license (https:// the block space, weak edges can also be accurately detected [4]. Chetia et al. proposed a creativecommons.org/licenses/by/ quantum-improved Sobel edge detection algorithm with nonmaximum suppression. In ◦ ◦ 4.0/). this algorithm, the Sobel operator with 45 and 135 direction masks was used for quantum

Electronics 2021, 10, 655. https://doi.org/10.3390/electronics10060655 https://www.mdpi.com/journal/electronics Electronics 2021, 10, 655 2 of 14

edge extraction, and then the non-maximum suppression technique with dual thresholds was used to sharpen the edges. This algorithm can significantly improve edge information and circuit complexity [5]. Sung et al. proposed an edge detection method based on the edge-preserving filter. The algorithm used an edge-preserving filter to smooth the image, and then used the Canny operator and morphological operations to detect edges, which can detect the edge of the image more accurately [6]. Xie et al. proposed an improved subpixel edge detection algorithm combining coarse and precise locations. The algorithm used an improved Roberts operator to detect pixel-level edges and used the Zernike moment method to locate subpixel edges, which effectively improved the detection efficiency and the detection accuracy [7]. Raheja et al. proposed a fuzzy-logic-based edge detection method. The algorithm used a sharpening guided filter to enhance the edge quality and a Gaussian filter to remove noise, which can obtain a significant improvement in the detected edges [8] and so on. However, in general, the existing edge detection algorithms have problems such as poor anti-noise performance and sensitivity to noise [9]. Based on this, this paper proposes a Sobel-operator-based edge detection optimization algorithm. This algorithm uses a low-rank image denoising algorithm to improve the traditional edge detection algorithm. The experimental results verified that the proposed algorithm has better anti-noise performance and can obtain clear and continuous edge information under high noise levels, thus confirming the effectiveness of the algorithm.

2. Sobel Edge Detection Operator The edge of an image is some continuous pixels in the image that have drastic changes in grayscale [10]. From the feature that the pixel at the edge of the image has the largest grayscale jump, the following information can be obtained: along the edge direction, the grayscale value changes slowly; perpendicular to the edge direction, the grayscale value jumps significantly. Based on this feature, the first-order derivative and the second-order derivative are usually used to detect edges. The Sobel operator is a typical first-order derivative edge operator, also known as a gradient edge operator [11].

2.1. The partial derivative of the image f (x,y) at the point (x,y); that is, the gradient of the image at that point, can be expressed by the vector shown in Equation (3):

∂ f (x, y) g = = f (x + 1, y) − f (x, y). (1) x ∂x ∂ f (x, y) g = = f (x, y + 1) − f (x, y). (2) y ∂y  T T ∂ f ∂ f ∇ f ≡ grad( f ) = g , g  = , . (3) x y ∂x ∂y its amplitude is: q 2 2 M(x, y) = mag(∇ f ) = gx + gy. (4) since the calculation amount of this equation is too large, Equation (5) is usually used as an approximate substitute:

M(x, y) ≈ |gx| + gy . (5)

its direction is:   gy α(x, y) = arctan . (6) gx

2.2. Sobel Operator The Sobel operator uses Equation shown in (7) to calculate the image gradient:

S(i, j) = |Gx| + |Gy|. (7) Electronics 2021, 10, 655 3 of 14

Gx = [ f (i + 1, j − 1) + 2 f (i + 1, j) + f (i + 1, j + 1)]− (8) [ f (i − 1, j − 1) + 2 f (i − 1, j) + f (i − 1, j + 1)]. Gy = [ f (i − 1, j + 1) + 2 f (i, j + 1) + f (i + 1, j + 1)]− (9) [ f (i − 1, j − 1) + 2 f (i, j − 1) + f (i + 1, j − 1)]. It can be seen that when using 8 surrounding pixels to estimate the central pixel gradient, the Sobel operator sets the weight of pixels in the neighborhood of the central pixel as 2 or −2 [12] to distinguish the influence of pixels of different distances on the central pixel, so as to make the edge contour more prominent and the detection and positioning more accurate. After calculating the gradient of the center pixel, we only need to set a threshold value and compare the gradient with it. If the gradient of this point is greater than the threshold value, it is considered the edge point of the image. In the traditional Sobel operator, the threshold can be customized, or the average of the grayscale values of all pixels can be used as the threshold. The Sobel operator can detect the edges of a noise-free image quickly and accurately; however, it is usual that the traditional Sobel operator wrongly marks the noise points as edges when it is used for edge detection of noisy images, resulting in low detection accuracy and a high error rate

3. Sobel Edge Detection Based on Weighted Nuclear Norm Minimization (WNNM) Image Denoising 3.1. WNNM Image Denoising Algorithm The WNNM image denoising algorithm is a kind of low-rank matrix recovery algo- rithm. It uses the low-rank property of the image to recover the original image from the noisy image. In the WNNM denoising algorithm, the image is first divided into blocks with overlapping pixels. By exploiting the nonlocal self-similarity prior [13] to the image, many nonlocal similar patches can be searched across the whole image for a given patch. By stacking those nonlocal similar patches into a matrix, denoted by Yj, the noisy image can be regarded as the model shown in Equation (10):

Yj = Xj + Vj. (10)

where Vj represents the additive noise matrix, and Xj represents the low-rank image to be restored. Therefore, the task of restoring the original image can be accomplished by solving the following inverse problem:

Xˆ = kY − X k2 + rankX  j arg min j j F j . (11) Xj

Equation (11) is an NP problem [14], so the objective function needs to be relaxed. In 2009, Candès and Recht proved that the nuclear norm minimization (NNM) is a convex optimization of the rank function [15], so Equation (11) can be relaxed to the following problem: Xˆ = = kY − X k2 + kX k j arg min j j F λ j ∗. (12) Xj k k where Xj ∗ is the nuclear norm, and λ is a positive number. The model can be solved in the following ways: T Yj = U ∑ V . (13) ! ( ) = − Sλ ∑ ii max ∑ λ, 0 . (14) ii ˆ T Xj = USλ(∑)V . (15) Electronics 2021, 10, 655 4 of 14

T The method is called the singular value threshold method (SVT), where Yj = U ∑ V is the singular value decomposition of matrix Yj, and Sλ(∑) is the soft threshold shrinkage of singular value ∑. This method has been widely used in many NNM-based problems [16]. However, this method shrinks all the singular values to the same degree, resulting in the loss of flexibility. For this reason, the concept of weight is introduced, and different singular values are given different weights [17]. Then, Equation (14) becomes: ! ( ) = − Sw ∑ ii max ∑ wi, 0 . (16) ii √ c n wi = . (17) σi(Xj) + ε

where c is a constant, n is the number of similar blocks in the block group and σi(Xj) is −16 the i-th singular value of Xj. ε = 10 , this is to avoid the situation that the denominator is 0. Since the singular value of Xj is unknown, σi(Xj) can be estimated by the following equation on the assumption that the noise energy is uniformly distributed in the noise space [18]: q  2  2  σˆi Xj = max σi Yj − nσn, 0 . (18)

where σi(Yj) is the i-th singular value of Yj. Finally,

ˆ  T Xj = USw ∑ V . (19) After the above processing for each block group, matrix X can be reconstructed; that is, the denoised image can be obtained.

3.2. Improved Sobel Edge Detection Operator At present, several classical edge detection operators widely used in image processing technology mostly have performance defects that are very sensitive to noise [19]; even the presence of a small amount of noise will affect the detection results. Therefore, it is of great practical significance to improve the anti-noise performance of edge detection operators. Taking the Sobel operator as an example, this paper proposes an improvement scheme that can enhance the anti-noise performance of edge detection operators. The specific process is as follows: 1. Dividing the noisy image into blocks. In order to eliminate the problem of seams when reconstructing an image, there needs to be some overlap between adjacent blocks. After block segmentation, similar image blocks are gathered according to the nonlocal similarity to form a low-rank matrix. The common criterion for judging whether blocks are similar is the Euclidean distance; that is, for blocks pi and pj, there is: m=n 2  Dij = ∑ pim − pjm . (20) m=1

where n represents the number of pixels in the block. The larger the value of Dij, the smaller the similarity between the two blocks, and vice versa. 2. Mathematical modeling and solving the objective function. Using the low-rank char- acteristic of the matrix obtained in the previous step to perform WNNM mathematical modeling of the image denoising problem, and using the singular value threshold method to solve the objective function to obtain the denoised block groups. 3. Reconstructing the image. In the process of reconstructing the image, due to the different selection of the center block of the block group, the same block may belong to multiple block groups at the same time, so it is necessary to average all the denoising results containing this block to get the final denoising result. Similarly, the averaging Electronics 2021, 10, 655 5 of 14

method is also used for the overlapping part between adjacent blocks to obtain a denoised complete image. 4. Obtaining the edge pixels of the image. After WNNM denoising, the interference factors of edge detection are greatly reduced. At this time, the Sobel operator is used to calculate the grayscale difference approximation of the horizontal and vertical directions of each pixel in the image, and then the estimated gradient value is obtained. Finally, these gradient values are compared with the preset threshold, and the edge pixels of the image are those that exceed the threshold.

4. Experimental Results and Analysis In order to verify the effectiveness of the algorithm in this paper, several images with a gray level of 256 and a BMP format are used for simulation experiments. The simulation software is MATLAB 2016a, and the running environment is the Windows 10 operating system with a 64-bit processor. As a contrast, the Sobel edge detection algorithm based on WNNM denoising pro- posed in this paper, the traditional Sobel edge detection algorithm and the improved edge detection algorithm based on median filtering proposed in Reference [3] will be applied to the Cameraman image, respectively. The experimental results and analysis are listed as follows. The first row in Figure1 shows the detection results of the three algorithms when no noise is added. It can be seen that there is no significant difference in the performance of the three algorithms. The second to fourth rows show the detection results of the three algorithms after adding Gaussian noise with standard deviations of 30, 40 and 80 to the original image. It can be seen from the second and third rows that under the low and medium intensity noise levels, the traditional Sobel edge detection operator detects more noise points, while the median filter-based method proposed in [3] can eliminate most of the noise points, but it causes obvious damage to the real edges. By contrast, the algorithm proposed in this paper retains the true edge of the image to the greatest extent while eliminating the noise and achieves better detection results. Finally, this paper also selects high-intensity noise with a standard deviation of 80 for the experiment, and the experimental results are shown in the fourth row of Figure1. At this time, the detection result of the traditional Sobel operator has been completely submerged in a large amount of noise, and the edge pixels cannot be distinguished. Similarly, after median filtering, the result of the algorithm in Reference [3] only has some isolated pixels, and both of them are difficult to achieve the purpose of extracting the edges of the image. The detection method in this paper can still obtain clear and relatively complete edges in this environment. In addition, this paper also compares the mean square error (MSE), peak signal-to- noise ratio (PSNR) and structural similarity index metric (SSIM) of the three algorithms under different noise levels (Tables1–3) and draws the corresponding line graphs for intuitive comparison (Figures2–4); “sigma” in the graph represents the standard deviation of added noise. As can be seen from the chart, the edges detected by the algorithm in this paper obtain smaller MSE, larger PSNR and SSIM values compared with other algorithms at various noise levels in the experiment, and the MSE decreases by 0.0014–0.0532, the PSNR increases by 0.5090–4.0472 dB and the SSIM increases by 0.0230–0.5833. It is worth noting that when the standard deviation of Gaussian noise is 80, compared with the original algorithm and the algorithm proposed in Reference [3], the PSNR of the algorithm in this paper increases by 3.2243 and 1.6941 dB, respectively, and the SSIM increases by 0.5029 and 0.5762, respectively. Combined with the previous qualitative analysis, it can be seen that the results de- tected by the algorithm in this paper have fewer noise points and more real edges, and the detection results are less affected by noise. Both the visual effect and objective evaluation index of the algorithm in this paper are superior to the traditional Sobel operator and the algorithm in Reference [3], indicating that the proposed algorithm has stronger anti-noise Electronics 2021, 10, x FOR PEER REVIEW 6 of 15

noise points, while the median filter-based method proposed in [3] can eliminate most of the noise points, but it causes obvious damage to the real edges. By contrast, the algorithm proposed in this paper retains the true edge of the image to the greatest extent while elim- inating the noise and achieves better detection results. Finally, this paper also selects high- intensity noise with a standard deviation of 80 for the experiment, and the experimental Electronics 2021, 10, 655 6 of 14 results are shown in the fourth row of Figure 1. At this time, the detection result of the traditional Sobel operator has been completely submerged in a large amount of noise, and the edge pixels cannot be distinguished. Similarly, after median filtering, the result of the performance,algorithm in Reference and the superiority[3] only has ofsome the isolated algorithm pixels, in this and paper both of is them more are obvious difficult in to the high-noiseachieve the environment. purpose of extracting the edges of the image. The detection method in this paper can still obtain clear and relatively complete edges in this environment.

Figure 1. Detection results of the Cameraman image by the tested algorithms at different noise levels. (Figurea) Experimental 1. Detection image, results and of Gaussianthe Cameraman noises withimage standard by the tested deviations algorithms of 0, 30, at 40different and 80 noise are added, respectively;levels. (a) Experimental (b) detection image, result and of the Gaussian traditional noises Sobel with operator; standard (c )deviations detection of result 0, 30, of 40 the and algorithm 80 are added, respectively; (b) detection result of the traditional Sobel operator; (c) detection result of proposed in Reference [3]; (d) detection result of the algorithm in this paper. the algorithm proposed in Reference [3]; (d) detection result of the algorithm in this paper.

TableIn 1. addition,Mean square this error paper (MSE) also of compares the three algorithms the mean forsquare the Cameraman error (MSE), image. peak signal-to- noise ratio (PSNR) and structural similarity index metric (SSIM) of the three algorithms under differentSigma noise levels Original (Tables Algorithm 1–3) and draws Reference the corresponding [3] line graphs Ours for in- tuitive comparison10 (Figures 2–4); 0.0131 “sigma” in the graph 0.0296 represents the standard 0.0117 deviation of added noise.20 As can be seen 0.0317from the chart, the edges 0.0366 detected by the algorithm 0.0175 in this paper obtain30 smaller MSE, larger 0.0381 PSNR and SSIM values 0.0428 compared with other 0.0271 algorithms at various40 noise levels in the experiment, 0.0529 and the MSE 0.0470 decreases by 0.0014–0.0532, 0.0275 the 50 0.0688 0.0563 0.0381 PSNR increases by 0.5090–4.0472 dB and the SSIM increases by 0.0230–0.5833. It is worth 60 0.0855 0.0624 0.0401 70 0.0951 0.0665 0.0467 80 0.1015 0.0714 0.0483

Electronics 2021, 10, 655 7 of 14

Table 2. Peak signal-to-noise ratio (SNR) of the three algorithms for the Cameraman image.

Sigma Original Algorithm Reference [3] Ours 10 18.8249 15.2867 19.3339 20 14.9842 14.3599 17.5616 30 14.1598 13.6870 15.6777 40 12.7665 13.2746 15.6097 50 11.6211 12.4980 14.1871 60 10.5320 12.0490 13.9669 70 10.2185 11.7732 13.3104 80 9.9340 11.4642 13.1583

Table 3. Structural similarity index metric (SIM) of the three algorithms for the Cameraman image.

Sigma Original Algorithm Reference [3] Ours 10 0.9204 0.8142 0.9434 Electronics 2021, 10, x FOR PEER REVIEW 20 0.8702 0.7874 0.9128 8 of 15 30 0.7988 0.7209 0.8771 40 0.6341 0.5984 0.8695 50 0.5233 0.5181 0.8457 60 0.3961 0.3275 0.8407 Electronics 2021, 10, x FOR PEER REVIEW 70 0.3586 0.2517 0.8350 8 of 15

80 0.3115 0.2382 0.8144

Figure 2. MSE line chart of the three algorithms for the Cameraman image.

Figure 2. MSE line chart of the three algorithms for the Cameraman image.

Figure 2. MSE line chart of the three algorithms for the Cameraman image.

Figure 3. PSNR line chart of the three algorithms for the Cameraman image. Figure 3. PSNR line chart of the three algorithms for the Cameraman image.

Figure 3. PSNR line chart of the three algorithms for the Cameraman image.

Figure 4. SSIM line chart of the three algorithms for the Cameraman image.

Figure 4. SSIM line chart of the three algorithms for the Cameraman image.

Electronics 2021, 10, x FOR PEER REVIEW 8 of 15

Figure 2. MSE line chart of the three algorithms for the Cameraman image.

Electronics 2021, 10, 655 Figure 3. PSNR line chart of the three algorithms for the Cameraman image. 8 of 14

Electronics 2021, 10, x FOR PEER REVIEW 9 of 15

Figure 4. SSIM line chart of the three algorithms for the Cameraman image. Figure 4. SSIM line chart of the three algorithms for the Cameraman image. In order order to to eliminate eliminate the the contingency contingency of of the the experimental experimental results, results, this this paper paper also also con- conductedducted experiments experiments on the on other the other two twoimages. images. The detection The detection results results of the of Monarch the Monarch image imageare as follows: are as follows: Figure Figure5 shows5 showsthe detection the detection results resultsof the tested of the algorithms tested algorithms under different under differentnoise levels. noise Tables levels. 4–6 Tables show4 the–6 show values the of valuesMSE, PSNR, of MSE, and PSNR, SSIM and of the SSIM tested of the algorithms, tested algorithms, and Figures6–8 are the corresponding line graphs, respectively. and Figures 6–8 are the corresponding line graphs, respectively.

. Figure 5. Detection results of the Monarch image by the tested algorithms at different noise levels. (Figurea) Experimental 5. Detection image, results and of Gaussian the Monarch noises image with standardby the tested deviations algorithms of 0, 30,at different 40 and 80 noise are added, levels. respectively;(a) Experimental (b) detection image, and result Gaussi of thean traditional noises with Sobel standard operator; deviations (c) detection of 0, result30, 40 of and the 80 algorithm are proposedadded, respectively; in Reference (b [)3 ];detection (d) detection result result of the of traditional the algorithm Sobel in operator; this paper. (c) detection result of the algorithm proposed in Reference [3]; (d) detection result of the algorithm in this paper.

Table 4. MSE of the three algorithms for the Monarch image.

Sigma Original Algorithm Reference [3] Ours 10 0.0220 0.0418 0.0157 20 0.0430 0.0489 0.0292 30 0.0659 0.0611 0.0353 40 0.0806 0.0740 0.0401 50 0.1018 0.0812 0.0507 60 0.1145 0.0850 0.0520 70 0.1376 0.0957 0.0588 80 0.1401 0.1020 0.0601

Electronics 2021, 10, 655 9 of 14

Table 4. MSE of the three algorithms for the Monarch image.

Sigma Original Algorithm Reference [3] Ours 10 0.0220 0.0418 0.0157 20 0.0430 0.0489 0.0292 30 0.0659 0.0611 0.0353 40 0.0806 0.0740 0.0401 Electronics 2021, 10, x FOR PEER REVIEW 10 of 15 50 0.1018 0.0812 0.0507 60 0.1145 0.0850 0.0520 70 0.1376 0.0957 0.0588 Table 5. PSNR80 of the three algorithms 0.1401 for the Monarch image. 0.1020 0.0601

Sigma Original Algorithm Reference [3] Ours Table 5. PSNR of the three algorithms for the Monarch image. 10 16.5764 13.7827 18.0344 Sigma20 Original Algorithm13.6733 Reference [13.10563] Ours15.3530 3010 16.576411.8100 13.782712.1381 18.034414.5241 4020 13.673310.9396 13.105611.3100 15.353013.9721 5030 11.81009.9215 12.138110.8973 14.524112.9486 6040 10.93969.4053 11.310010.7149 13.972112.8442 50 9.9215 10.8973 12.9486 70 8.6224 10.1948 12.3023 60 9.4053 10.7149 12.8442 8070 8.62248.5313 10.19489.9184 12.302312.2118 80 8.5313 9.9184 12.2118 Table 6. SSIM of the three algorithms for the Monarch image.

Table 6.SigmaSSIM of the three algorithmsOriginal for Algo the Monarchrithm image. Reference [3] Ours 10 0.8640 0.7217 0.8927 Sigma20 Original Algorithm0.7551 Reference0.6728 [3] Ours0.8204 3010 0.86400.6380 0.72170.6032 0.89270.7964 4020 0.75510.5044 0.67280.5162 0.82040.7778 30 0.6380 0.6032 0.7964 5040 0.50440.3493 0.51620.4008 0.77780.7334 6050 0.34930.3071 0.40080.2709 0.73340.7313 7060 0.30710.1879 0.27090.2341 0.73130.7069 8070 0.18790.1752 0.23410.1931 0.70690.7014 80 0.1752 0.1931 0.7014

Figure 6. MSE line chart of the three algorithms for the Monarch image. Figure 6. MSE line chart of the three algorithms for the Monarch image.

Figure 7. PSNR line chart of the three algorithms for the Monarch image.

Electronics 2021, 10, x FOR PEER REVIEW 10 of 15

Table 5. PSNR of the three algorithms for the Monarch image.

Sigma Original Algorithm Reference [3] Ours 10 16.5764 13.7827 18.0344 20 13.6733 13.1056 15.3530 30 11.8100 12.1381 14.5241 40 10.9396 11.3100 13.9721 50 9.9215 10.8973 12.9486 60 9.4053 10.7149 12.8442 70 8.6224 10.1948 12.3023 80 8.5313 9.9184 12.2118

Table 6. SSIM of the three algorithms for the Monarch image.

Sigma Original Algorithm Reference [3] Ours 10 0.8640 0.7217 0.8927 20 0.7551 0.6728 0.8204 30 0.6380 0.6032 0.7964 40 0.5044 0.5162 0.7778 50 0.3493 0.4008 0.7334 60 0.3071 0.2709 0.7313 70 0.1879 0.2341 0.7069 80 0.1752 0.1931 0.7014

Electronics 2021, 10, 655 Figure 6. MSE line chart of the three algorithms for the Monarch image. 10 of 14

Electronics 2021, 10, x FOR PEER REVIEW 11 of 15

FigureFigure 7. PSNR 7. PSNR line line chart chart of the of thethree three algorithms algorithms for forthe the Monarch Monarch image. image.

FigureFigure 8. SSIM 8. SSIM line line chart chart of the of thethree three algo algorithmsrithms for forthe theMonarch Monarch image. image. Similarly, in terms of visual effects, when Gaussian noise with standard deviations of Similarly, in terms of visual effects, when Gaussian noise with standard deviations 30 and 40 are added, compared with the traditional Sobel edge detection algorithm, there of 30 and 40 are added, compared with the traditional Sobel edge detection algorithm, are fewer noise points in the detection results of the proposed algorithm, which indicates there are fewer noise points in the detection results of the proposed algorithm, which in- that the proposed algorithm has a stronger anti-noise performance. Compared with the dicates that the proposed algorithm has a stronger anti-noise performance. Compared algorithm in Reference [3], the edge detection results obtained by the proposed algorithm with the algorithm in Reference [3], the edge detection results obtained by the proposed are clearer and more continuous, indicating that the proposed algorithm can preserve algorithmimage edges are clearer better. and In terms more ofcontinuous, objective evaluation indicating indicators,that the proposed the MSE algorithm of the proposed can preservealgorithm image decreases edges better. by 0.0063–0.0800, In terms of obje thective PSNR evaluation increases indicators, by 1.4580–4.2517 the MSE dB of and the the proposedSSIM increases algorithm by decreases 0.0287–0.5262. by 0.0063–0.080 With the increase0, the PSNR of noise increases intensity, by the1.4580–4.2517 competitiveness dB andof the the SSIM algorithm increases in this by paper0.0287–0.5262. is stronger. With the increase of noise intensity, the compet- itivenessThe of the edge algorithm detection in resultsthis paper of theis stronger. MIT image are as follows: Figure9 shows the detectionThe edge results detection of the results tested of algorithmsthe MIT image under are differentas follows: noise Figure levels. 9 shows Tables the7 –detec-9 show tionthe results values of ofthe MSE, tested PSNR, algorithms and SSIM under of di thefferent tested noise algorithms, levels. Tables and Figures 7–9 show 10– the12 areval- the uescorresponding of MSE, PSNR, line and graphs, SSIM respectively.of the tested algorithms, and Figures 10–12 are the corre- spondingIn thisline experiment,graphs, respectively. compared with the other algorithms listed, the MSE of the proposed algorithm decreases by 0.0138–0.0633, the PSNR increases by 1.5558–4.2135 dB and the SSIM increases by 0.0663–0.3909. The above experiments show that the proposed algorithm can effectively eliminate the influence of noise on edge detection and can retain the true edge of the image to a greater extent. The detection results are superior to other algorithms listed in this paper in terms of visual effect and objective evaluation index. The results are highly consistent after many comparative experiments.

Electronics 2021, 10, 655 11 of 14 Electronics 2021, 10, x FOR PEER REVIEW 12 of 15

. Figure 9. Detection results of the MIT image by the tested algorithms at different noise levels. (a) ExperimentalFigure 9. Detection image, results and Gaussian of the MIT noises image with by standardthe tested deviations algorithms of at 0, different 30, 40 and noise 80 are levels. added, (a) respectively;Experimental (b image,) detection and result Gaussian of the noises traditional with Sobelstandard operator; deviations (c) detection of 0, 30, result 40 and of the80 are algorithm added, proposedrespectively; in Reference (b) detection [3]; ( dresult) detection of the resulttraditional of the Sobel algorithm operator; in this (c paper.) detection result of the algo- rithm proposed in Reference [3]; (d) detection result of the algorithm in this paper. Table 7. MSE of the three algorithms for the MIT image. Table 7. MSE of the three algorithms for the MIT image. Sigma Original Algorithm Reference [3] Ours Sigma Original Algorithm Reference [3] Ours 10 0.0320 0.0482 0.0182 2010 0.05780.0320 0.05620.0482 0.0260 0.0182 3020 0.07770.0578 0.07180.0562 0.0385 0.0260 4030 0.08850.0777 0.08250.0718 0.0512 0.0385 5040 0.11150.0885 0.08650.0825 0.0533 0.0512 60 0.1174 0.0986 0.0554 7050 0.12640.1115 0.10270.0865 0.0719 0.0533 8060 0.13880.1174 0.11840.0986 0.0755 0.0554 70 0.1264 0.1027 0.0719 80 0.1388 0.1184 0.0755

Electronics 2021, 10, x FOR PEER REVIEW 13 of 15

Electronics 2021, 10, x FOR PEER REVIEW 13 of 15

Electronics 2021, 10, 655 Table 8. PSNR of the three algorithms for the MIT image. 12 of 14

Table 8. PSNRSigma of the three algorithmsOriginal for Algo the MITrithm image. Reference [3] Ours 10 14.9430 13.1743 17.3878 Sigma Original Algorithm Reference [3] Ours Table 8. PSNR20 of the three algorithms12.3753 for the MIT image. 12.5084 15.8518 1030 14.943011.0995 13.174311.4353 17.387814.1465 Sigma Original Algorithm Reference [3] Ours 2040 12.375310.5268 12.508410.8405 15.851812.9068 305010 14.943011.09959.5331 13.174311.435310.6306 17.387814.146512.7321 20 12.3753 12.5084 15.8518 4060 10.52689.2964 10.840510.0640 12.906812.5612 5030 11.09959.5331 11.435310.6306 14.146512.7321 7040 10.52688.9804 10.84059.8771 12.906811.4329 608050 9.53319.29648.5826 10.630610.06409.2709 12.732112.561211.2189 7060 9.29648.9804 10.06409.8771 12.561211.4329 Table 9. SSIM8070 of the three algorithms 8.9804 8.5826for the MIT image. 9.87719.2709 11.432911.2189 80 8.5826 9.2709 11.2189 Table 9. SSIMSigma of the three algorithmsOriginal for Algo the MITrithm image. Reference [3] Ours 10 0.8208 0.6921 0.8871 Table 9.SigmaSSIM of the three algorithmsOriginal forAlgo therithm MIT image. Reference [3] Ours 20 0.7136 0.6458 0.8511 Sigma1030 Original0.82080.6345 Algorithm Reference0.69210.5833 [3] Ours0.88710.7908 20 0.7136 0.6458 0.8511 4010 0.82080.5555 0.69210.5360 0.88710.7322 305020 0.71360.63450.4939 0.64580.58330.4426 0.85110.79080.7275 406030 0.63450.55550.3790 0.58330.53600.3851 0.79080.73220.7142 507040 0.55550.49390.2997 0.53600.44260.3320 0.73220.72750.6592 6050 0.49390.3790 0.44260.3851 0.72750.7142 8060 0.37900.2510 0.38510.2623 0.71420.6419 70 0.2997 0.3320 0.6592 70 0.2997 0.3320 0.6592 8080 0.25100.2510 0.26230.2623 0.64190.6419

Figure 10. MSE line chart of the three algorithms for the MIT image.

FigureFigure 10. 10.MSEMSE line line chart chart of the of the three three algorithms algorithms forfor the the MIT MIT image. image.

Figure 11. PSNR line chart of the three algorithms for the MIT image. Figure 11. PSNR line chart of the three algorithms for the MIT image.

Figure 11. PSNR line chart of the three algorithms for the MIT image.

Electronics 2021, 10, x FOR PEER REVIEW 14 of 15

Electronics 2021, 10, 655 13 of 14

Figure 12. SSIM line chart of the three algorithms for the MIT image. Figure 12. SSIM line chart of the three algorithms for the MIT image. 5. Conclusions In this experiment, compared with the other algorithms listed, the MSE of the pro- The conventional Sobel edge detection operator can quickly and accurately extract posed algorithm decreases by 0.0138–0.0633, the PSNR increases by 1.5558–4.2135 dB and the edge pixels of an image, which has been widely used in various image processing the SSIM increases by 0.0663–0.3909. fields. However, when there is noise in the image, there will be many noise points in The above experiments show that the proposed algorithm can effectively eliminate the detection results, which will affect the subsequent processing. In response to this the influence of noise on edge detection and can retain the true edge of the image to a problem, this paper proposes an improved algorithm, which combines WNNM image greater extent. The detection results are superior to other algorithms listed in this paper denoising with Sobel edge detection and utilizes the stable and excellent denoising ability in termsof the of WNNM visual imageeffect and denoising objective algorithm evaluation at various index. noiseThe results levels are to achievehighly consistent the purpose afterof many improving comparative the anti-noise experiments. performance of the Sobel operator. The experimental results verify the effectiveness of the algorithm. 5. Conclusions Compared with the conventional Sobel edge detection operator, the running time of theThe improved conventional algorithm Sobel proposed edge detection in this oper paperator increased. can quickly When and Gaussian accurately noise extract with a thestandard edge pixels deviation of an ofimage, 20 is which added, has the been running widely time used of the in three various algorithms image processing is showed in fields.the TableHowever, 10 as when follow: there is noise in the image, there will be many noise points in the detection results, which will affect the subsequent processing. In response to this problem, thisTable paper 10. proposesRunning time an improved of the three algorithm, algorithms. which combines WNNM image denoising with Sobel edge detection and utilizes the stable and excellent denoising ability of the Images Original Algorithm Reference [3] Ours WNNM image denoising algorithm at various noise levels to achieve the purpose of im- proving Cameramanthe anti-noise performance 2.1110 of the s Sobel operator. 3.4935 The s experimental results 80.5785 verify s Monarch 2.1198 s 3.6207 s 80.8722 s the effectiveness of the algorithm. MIT 2.2736 s 3.7955 s 79.2278 s Compared with the conventional Sobel edge detection operator, the running time of the improved algorithm proposed in this paper increased. When Gaussian noise with a standardThe deviation algorithm of 20 in thisis added, paper the improves running the time anti-noise of the three performance algorithms of is the showed Sobel oper-in theator, Table and 10 atas thefollow: same time, the running time of the algorithm also increases to a certain extent. Improving the anti-noise performance of the operator and the running speed of the Tablealgorithm 10. Running at the time same of the time three remains algorithms. to be further studied.

AuthorImages Contributions: Conceptualization,Original Algorithm R.T.; methodology,Reference R.T.; software,[3] R.T.; validation,Ours R.T.; formalCameraman analysis, R.T., G.S.; investigation, 2.1110 R.T.,s X.L.; resources, 3.4935 R.T., B.Z.; s data curation, 80.5785 R.T.; writing—s originalMonarch draft preparation, R.T.; 2.1198 writing—review s and editing, 3.6207 R.T., s G.S., X.L.; visualization, 80.8722 s R.T.; supervision,MIT G.S., B.Z.; project administration, 2.2736 s G.S.; funding 3.7955 acquisition, s G.S. All authors 79.2278 have s read and agreed to the published version of the manuscript. Funding:The algorithmThis work in this was paper supported improves by the the National anti-noise Natural performance Science Foundation of the Sobel of China opera- (No. tor,61771262), and at the Tianjin same Science time, andthe Technologyrunning time Major of Projectthe algorithm and Engineering also increases (No. 18ZXRHNC00140) to a certain extent.and TianjinImproving Key Laboratory the anti-noise of Optoelectronic performance Sensor of the and operator Sensor Network and the Technology. running speed of theAcknowledgments: algorithm at the sameThe authors time remains would liketo be to further thank all studied. the editors and anonymous reviewers for their careful reading and insightful remarks. Author Contributions: Conceptualization, R.T.; methodology, R.T.; software, R.T.; validation, R.T.; Conflicts of Interest: The authors declare no conflict of interest. formal analysis, R.T., G.S.; investigation, R.T., X.L.; resources, R.T., B.Z.; data curation, R.T.; writ- ing—original draft preparation, R.T.; writing—review and editing, R.T., G.S., X.L.; visualization,

Electronics 2021, 10, 655 14 of 14

References 1. Liu, Y.; Xie, Z.; Liu, H. An Adaptive and Robust Edge Detection Method Based on Edge Proportion Statistics. IEEE Trans. Image Process. 2020, 29, 5206–5215. [CrossRef] 2. Zhang, Y.; Han, X.; Zhang, H.; Zhao, L. Edge detection algorithm of image fusion based on improved Sobel operator. In Proceedings of the 2017 IEEE 3rd Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 3–5 October 2017; pp. 457–461. [CrossRef] 3. Topno, P.; Murmu, G. An Improved Edge Detection Method based on Median Filter. In Proceedings of the 2019 Devices for Integrated Circuit (DevIC), Kalyani, West Bengal, India, 23–24 March 2019; pp. 378–381. [CrossRef] 4. Yoon, J.; Lee, C. Edge Detection Using the Bhattacharyya Distance with Adjustable Block Space. Electron. Imaging 2020, 10, 349–362. [CrossRef] 5. Chetia, R.; Boruah, S.M.B.; Sahu, P.P. Quantum image edge detection using improved Sobel mask based on NEQR. Quantum Inf. Process. 2020, 1, 21–39. [CrossRef] 6. Sung, T.L.; Lee, H.J. Depth edge detection using edge-preserving filter and morphological operations. Int. J. Syst. Assur. Eng. Manag. 2020, 11, 812–817. [CrossRef] 7. Xie, X. An improved industrial sub-pixel edge detection algorithm based on coarse and precise location. J. Ambient Intell Humaniz. Comput. 2020, 11, 2061–2070. [CrossRef] 8. Raheja, S.; Kumar, A. Edge detection based on type-1 fuzzy logic and guided smoothening. Evol. Syst. 2019, 23, 349–360. [CrossRef] 9. Shui, P.; Wang, F. Anti-Impulse-Noise Edge Detection via Anisotropic Morphological Directional Derivatives. IEEE Trans. Image Process. 2017, 26, 4962–4977. [CrossRef][PubMed] 10. Zheng, Z.; Zha, B.; Yuan, H.; Xuchen, Y.; Gao, Y.; Zhang, H. Adaptive Edge Detection Algorithm Based on Improved Grey Prediction Model. IEEE Access 2020, 8, 102165–102176. [CrossRef] 11. Li, K.; Tian, Y.; Wang, B.; Qi, Z.; Wang, Q. Bi-Directional Pyramid Network for Edge Detection. Electronics 2021, 10, 329. [CrossRef] 12. Mittal, M.; Verma, A.; Kaur, I.; Kaur, B.; Sharma, M.; Goyal, L.M.; Roy, S.; Kim, T.H. An Efficient Edge Detection Approach to Provide Better Edge Connectivity for Image Analysis. IEEE Access 2019, 7, 33240–33255. [CrossRef] 13. Hou, L.; Qin, Y.; Zheng, H.; Pan, Z.; Mei, J.; Hu, Y. Hybrid High-Order and Fractional-Order Total Variation with Nonlocal Regularization for Compressive Sensing Image Reconstruction. Electronics 2021, 10, 150. [CrossRef] 14. Oh, T.; Matsushita, Y.; Tai, Y.; Kweon, I.S. Fast Randomized Singular Value Thresholding for Low-Rank Optimization. IEEE Trans. Pattern Anal. Mach. Intell. 2018, 40, 376–391. [CrossRef] 15. Candès, E.; Recht, B. Exact matrix completion via convex optimization. Commun. ACM 2012, 55, 111–119. [CrossRef] 16. Yang, H.; Park, Y.; Yoon, J.; Jeong, B. An Improved Weighted Nuclear Norm Minimization Method for Image Denoising. IEEE Access 2019, 7, 97919–97927. [CrossRef] 17. Gu, S.; Xie, Q.; Meng, D.; Zuo, W.; Feng, X.; Zhang, L. Weighted Nuclear Norm Minimization and Its Applications to Low Level Vision. Int. J. Comput. Vis. 2017, 121, 183–208. [CrossRef] 18. Gu, S.; Zhang, L.; Zuo, W.; Feng, X. Weighted Nuclear Norm Minimization with Application to Image Denoising. In Proceedings of the 2014 IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014; pp. 2862–2869. [CrossRef] 19. Tang, J.; Wang, Y.; Huang, C.; Liu, H.; Al-Nabhan, N. Image edge detection based on singular value feature vector and gradient operator. Math. Biosci. Eng. 2020, 17, 3721–3735. [CrossRef]