^{1}

^{1}

Edge detection is an important aspect to improve image edge quality in image processing. The purpose of edge detection is to identify the points in digital images with great brightness variation. However, the accuracy of traditional edge detection methods in edge extraction is low. For the actual image, the grey edge is sometimes not very clear, the image also contains noise. The detection result of the traditional Sobel operator is relatively accurate, but the detection result is rough and sensitive to noise. To solve the above problems, this paper proposes an improved eight-direction Sobel operator based on grey relevancy degree, which combines 5 × 5 Sobel operator with a grey relational degree and a new eight-direction grey relevancy method. The results show that this method can detect the useful information of edge more accurately and improve the anti-noise performance. However, the drawback is that the algorithm is not automatic.

Edge is one of the most basic and important features of an image. In a digital image, edge refers to the collection of pixels with a step-change in the greyscale of surrounding pixels, which exists in the target and background, target and target, region and region, elements and elements [

In recent years, a variety of new edge detection theories and methods have emerged in an endless stream, and academic ideas have been very active. Traditional edge detection methods include differential algorithm, Robert operator, Sobel operator, Prewitt operator, Kirsch operator, etc. Prewitt and Sobel’s operators are examples of gradient-based edge detectors [

In this paper, a new edge detection algorithm based on an improved eight- direction Sobel operator combined with a grey relevancy degree is proposed. This algorithm firstly improves and expands the traditional Sobel, and then uses the improved Sobel operator as a reference sequence to calculate the relevant degree of each point in the image for edge detection. The experimental results show that this method can accurately detect useful edge information, and has a certain anti-noise ability, and is an effective new edge detection method.

This paper is divided into the following parts. Section 1 introduces the research background, significance, and innovation points. Section 2 introduces traditional Sobel operators. Section 3 introduces how to improve and extend the Sobel operator. Section 4 introduces the concept of grey relevancy degree. Section 5 introduces how to combine the improved Sobel operator and grey relevancy degree. Section 6 compares and analyzes the method of this paper with other traditional detection methods. Section 7 introduces the feasibility and disadvantage of the edge detection method based on the Sobel eight-direction operator and grey relevancy degree.

Sobel proposed the Sobel edge detection method in 1970. In 2012, HE et al. [

The operator uses two 3 × 3 kernels, which are convolved with the original image to calculate approximations of the derivatives one for horizontal changes and one for vertical. If we define A as the source image, and G x and G y are two images which at each point contain the horizontal and vertical derivative approximations respectively, the computations are as follows [

G y = − 1 − 2 − 1 0 0 0 1 2 1 × A , G x = − 1 0 1 − 2 0 2 − 1 0 1 × A (1)

The corresponding calculation process is as follows:

G y = [ f ( x − 1 , y − 1 ) + 2 f ( x , y − 1 ) + f ( x + 1 , y − 1 ) ] − [ f ( x − 1 , y + 1 ) + 2 f ( x , y + 1 ) + f ( x + 1 , y + 1 ) ] G x = [ f ( x + 1 , y − 1 ) + 2 f ( x + 1 , y ) + f ( x + 1 , y + 1 ) ] − [ f ( x − 1 , y − 1 ) + 2 f ( x − 1 , y ) + f ( x − 1 , y + 1 ) ] (2)

where, f ( x , y ) is the grey value at ( x , y ) in image A.

The Sobel operator is the magnitude of the gradient computed by

G = G x 2 + G y 2 (3)

The gradient direction is calculated as follows:

θ = arctan ( G y G x ) (4)

Edge detection is similar to difference operation, its essence is to detect the change of image brightness, so noise will inevitably affect the detection effect. To avoid the influence of noise, not only difference processing but also smoothing processing should be considered when constructing edge detection operators. Similar to the first-order difference template, the Roberts crossover operator only considers difference factors. The Prewitt operator expands the first-order difference template to size 3 × 3, introducing the mean operation. In the edge detection algorithm, the Sobel operator is used as the detection template, which considers both the difference factor and the optimal smoothing coefficient [

The theoretical basis of constructing the Sobel operator is a pascal triangle. The pascal’s triangle can calculate a set of coefficients of the smoothing operator, which is roughly the same as that of the gaussian smoothing operator in the limit case [

For different counts, the coefficient of position k is Pascal ( k , n ) :

Pascal ( k , n ) = n ! ( n − k ) ! ⋅ k ! , ( 0 ≤ k ≤ n ) (5)

Pascal ( k , n ) = 0 , otherwise (6)

For the template window size of winsize, the smoothing coefficient is:

S ( k ) = Pascal ( k , winsize − 1 ) , ( 0 ≤ k ≤ winsize − 1 ) (7)

For the template window size of winsize, the difference coefficient is:

D ( k ) = Pascal ( k , winsize − 2 ) − Pascal ( k − 1 , winsize − 2 ) ( 0 ≤ k ≤ winsize − 1 ) (8)

i.e.

Sobel X ( x , y ) = ∑ x = 0 winsize − 1 ∑ y = 0 winsize − 1 Smooth ( y ) ⋅ Diff ( x ) (9)

Sobel Y ( x , y ) = ∑ y = 0 winsize − 1 ∑ x = 0 winsize − 1 Smooth ( x ) ⋅ Diff ( y ) (10)

A new Sobel operator is calculated by using Pascal’s triangle to obtain a significant image detection effect. An eight-direction 5 × 5 edge detection template is reconstructed. The weight of each position in the template is determined by the distance from the position to the centre point and the direction in which the position is located in the template. Equidistant points have the same weight. The eight-direction 5 × 5 edge detection template of the improved Sobel operator is respectively:

G 0 ∘ = [ 1 4 6 4 1 2 8 12 8 2 0 0 0 0 0 − 2 − 8 − 12 − 8 − 2 − 1 − 4 − 6 − 4 − 1 ] (11)

G 45 ∘ = [ 1 4 8 2 0 4 12 8 0 − 2 8 8 0 − 8 − 8 2 0 − 8 − 12 − 4 0 − 2 − 8 − 4 − 1 ] (12)

G 90 ∘ = [ 1 2 0 − 2 − 1 4 8 0 − 8 − 4 6 12 0 − 12 − 6 4 8 0 − 8 − 4 1 2 0 − 2 − 1 ] (13)

G 135 ∘ = [ 0 − 2 − 8 − 4 − 1 2 0 − 8 − 12 − 4 8 8 0 − 8 − 8 4 12 8 0 − 2 1 4 8 2 0 ] (14)

G 180 ∘ = [ − 1 − 4 − 6 − 4 − 1 − 2 − 8 − 12 − 8 − 2 0 0 0 0 0 2 8 12 8 2 1 4 6 4 1 ] (15)

G 225 ∘ = [ − 1 − 4 − 8 − 2 0 − 4 − 12 − 8 0 2 − 8 − 8 0 8 8 − 2 0 8 12 4 0 2 8 4 1 ] (16)

G 270 ∘ = [ − 1 − 2 0 2 1 − 4 − 8 0 8 4 − 6 − 12 0 12 6 − 4 − 8 0 8 4 − 1 − 2 0 2 1 ] (17)

G 315 ∘ = [ 0 2 8 4 1 − 2 0 8 12 4 − 8 − 8 0 8 8 − 4 − 12 − 8 0 2 − 1 − 4 − 8 − 2 0 ] (18)

In the above improved Sobel operator detection template, each template is composed of symmetric numbers that are opposite to each other and equal in absolute value. The current pixel in the original image is convolved with a certain template in the eight-direction Sobel operator detection template to obtain the grayscale value of the image in all directions [

Improved Sobel operator 0 ∘ edge template:

After convolution calculation of G 0 ∘ and the grey value of pixel point on the image, the form is H 0 ∘ , and each element in this form is the corresponding weight on the 0 ∘ edge template G 0 ∘ is the product of the value and the grey value f i j of the corresponding pixel in the image, where

G 0 ∘ = [ f 11 4 f 12 6 f 13 4 f 14 f 15 2 f 21 8 f 22 12 f 23 8 f 24 2 f 25 0 0 0 0 0 − 2 f 41 − 8 f 42 − 12 f 43 − 8 f 44 − 2 f 45 − f 51 − 4 f 52 − 6 f 53 − 4 f 54 − f 55 ] (19)

Grey system theory [

Grey relevancy calculation procedure [

1) Select the reference sequence y ( k ) , and find the conversion sequence of the sequence X i = ( x i ( 1 ) , x i ( 2 ) , ⋯ , x i ( n ) ) ( i = 0 , 1 , ⋯ , n ) .

2) Because the data in each factor column in the system may differ in dimension, it is not easy to compare, or it isn’t easy to get the correct conclusion when comparing. In grey relevancy analysis, and data should be processed dimensionless. [i)]

i) Initial value processing: x i ( k ) = x i ( k ) x i ( 1 ) , k = 1 , 2 , ⋯ , n ; i = 0 , 1 , 2 , ⋯ , m .

ii) Averaging treatment: x i ( k ) = x i ( k ) x ¯ i , k = 1 , 2 , ⋯ , n ; i = 0 , 1 , 2 , ⋯ , m .

where k corresponds to a time period, and i corresponds to a column in the comparison sequence.

3) Calculated correlation coefficient:

ξ i ( k ) = min i min k Δ i ( k ) + ρ max i max k Δ i ( k ) Δ i ( k ) + ρ max i max k Δ i ( k )

where Δ i ( k ) = | y ( k ) − x i ( k ) | .

For ρ ∈ ( 0, ∞ ) , which is called the resolution coefficient, the smaller ρ , the greater the resolution, The value range of ρ is generally ( 0,1 ) , The specific value depends on the situation. When ρ ≤ 0.5463 , the resolution is the best. Usually ρ = 0.5 .

4) Calculate the grey correlation degree r i between the comparison sequence formed with each pixel as the centre and the reference sequence and r i is the overall correlation the degree between the reference sequence y ( k ) and the comparison sequence x i ( k ) at each moment

r i = 1 n ∑ k = 1 n ξ i ( k ) , k = 1 , 2 , ⋯ , n .

5) The judgment method of edge points is as follows: when r i is higher than θ given threshold of correlation degree, it indicates that this point has the same characteristics as the reference sequence and is not an edge point. Otherwise, it’s the edge point.

The edge extracted by the traditional Sobel operator has noise interference, the boundary between the edge and the background is fuzzy, and the continuity of the detected image edge is poor. The improved Sobel operator has enhanced noise resistance, the boundary between the edge contour and the background is clear, and the overall edge continuity is good. However, there still exists a phenomenon of too thick edge texture. In the improved Sobel operator, grey relevancy is introduced to solve the problem of edge thickness, so that the contour and texture details of the image can be improved [

In the Grey relevancy method of image edge detection, the grey values of pixels as reference sequences are equal. This paper presents a new method based on grey relevancy degree and eight-direction Sobel operator. It is mainly divided into the following steps:

1) Select eight templates of Sobel operator as the reference sequence and the behavioral sequence which consists of each pixel and neighborhood pixels as the comparative sequence.

2) Calculating the grey relevancy degree of the eight-direction for each pixel, for the R i .

3) Setting the threshold θ , when R i > θ , then the pixel X i is the edge point, and the grey value is defined as 255; Otherwise, X i is not the edge point and the grey value is defined as 0.

4) It can get the edge point of the whole image with a 5 × 5 window over the entire image sequence, and then connect the edge points to get the edge of the image.

The feasibility of the proposed algorithm is verified by qualitative and quantitative analysis. The peak signal-to-noise ratio, average gradient and structural similarity index were used for quantitative comparison.

Peak signal to noise ratio (PSNR): provides an objective standard to measure image distortion or noise level. It is often used to evaluate image degradation before and after compression in areas such as image compression. It is often defined simply by mean square error (MSE). If one of the two M × N monochromatic images I and K is the noise approximation of the other, then their mean square error is defined as:

M S E = I M × N ∑ i = 0 M − 1 ∑ j = 0 N − 1 [ I ( i , j ) − K ( i , j ) ] 2 (20)

The PSNR is defined as:

PSNR = 10 × lg MAX I 2 MSE (21)

where MAX_{I} is the maximum value representing the colour of the image points, if each sampling point is represented by 8 bits, then it is 255.

Average Gradient: also known as sharpness, it reflects the contrast and texture variations of tiny details in the image, as well as the sharpness of the image, the bigger, the better.

∇ g ¯ = ∑ i = 0 M − 1 ∑ j = 0 N − 1 ( Δ I x 2 + Δ I y 2 ) / 2 M × N (22)

Structural similarity index (SSIM): is a measure of the similarity between two images.

1) To verify the effectiveness of the algorithm, we take Lena image with a size of 256 × 256 as an example to set the optimal threshold T = 0.54 for edge detection in the new method proposed in this paper. The test results are shown in

It can be seen from

eight-direction Sobel operators are relatively thick and the edge details are obvious. The algorithm based on the grey relevancy degree has poor edge continuity and some real edge missing. The algorithm based on grey relevancy degree and eight-direction Sobel operator has better edge continuity and fewer non- edge points. Although the new algorithm has the missing phenomenon of the boundary image, the integrity of the main image edge is better than that of the traditional algorithm.

2) The algorithm can detect the edges of Lena images with different parameters. In the experiment, a threshold value is used for segmentation. If the threshold value is set too large, the edge contour may be discontinuous or not smooth enough. An initial threshold value is selected and continuously adjusted during the experiment to obtain the best threshold value. First, select T = 0.48. With the increase of the threshold, the extracted texture details gradually increase, as shown in

Threshold value | SSIM | Average Gradient |
---|---|---|

T = 0.48 | 0.6979 | 3.5819 |

T = 0.50 | 0.6986 | 4.0220 |

T = 0.52 | 0.6989 | 4.5861 |

T = 0.54 | 0.6997 | 5.2440 |

T = 0.55 | 0.6995 | 5.5592 |

gradient is the clarity, and the greater the value, the higher the clarity. Through experimental results and quantitative analysis, the optimal threshold value of this algorithm is T = 0.54.

3)

4) Firstly, a building image with rich texture is selected. Then, the traditional algorithm and the algorithm proposed in this paper are respectively used for edge detection to verify the effectiveness of the proposed algorithm. In order not to lose fairness, the parameter selection of each algorithm in the experiment is adjusted to the best value.

and Figures 4(b)-(i) shows the extraction effects of different algorithms.

5)

Method | PSNA | SSIM |
---|---|---|

Robert | 69.9174 | 0.7599 |

Sobel | 67.4437 | 0.6956 |

Prewitt | 66.6276 | 0.6657 |

LoG | 70.6323 | 0.7239 |

Canny | 66.3004 | 0.7563 |

E-d Sobel | 66.1077 | 0.7491 |

Grey correlation | 66.9534 | 0.8724 |

Proposed method | 73.0522 | 0.9746 |

This paper mainly introduces the research background of digital image edge detection and introduces various researches on edge detection in recent years. The traditional edge detection operator is improved to achieve a better detection effect.

In this paper, a new image edge detection algorithm is constructed by combining grey correlation degree and eight-direction Sobel operator. The eight-direction Sobel operator is used as the reference sequence, and the grey value of the central pixel and the surrounding 25 pixels is used as the comparison sequence of 5 × 5 pixels in the template. The experimental results show that this method can accurately extract useful edge information compared with the traditional Prewitt, Sobel, and LOG operators, which have strong anti-noise performance, can improve the image edge PSNR, and has a better adaptive ability.

The authors declare no conflicts of interest regarding the publication of this paper.

Yang, Y. and Wei, L.X. (2021) Grey Relevancy Degree and Improved Eight-Direction Sobel Operator Edge Detection. Journal of Signal and Information Processing, 12, 43-55. https://doi.org/10.4236/jsip.2021.122002