Multiscale Anisotropic Morphological Directional Derivatives for Noise-Robust Image Edge Detection

Different types of noise interference lead to low accuracy of image edge detection and severe loss of feature extraction details. A new noise-robust edge detection method is proposed, which uses a set of multiscale anisotropic morphological directional derivatives to extract the edge map of an input image. The main advantage of the method is that high edge resolution is maintained while reducing noise interference. The following five parts form the whole framework of this paper. First, multiscale anisotropic morphologic directional derivatives (MSAMDDs) are proposed to filter and obtain the local gray value of the image. Second, the edge strength map (ESM) is extracted by using spatial matching filters. In the third stage, multiscale edge direction maps (EDMs) based on the directional matched filters are fused, and the new EDM is constructed. Fourth, edge contours are obtained by embedding the ESM and the EDM into the standard route of Canny detection. Finally, the precision-recall curve and Pratt’s figure of merit (FOM) are used to evaluate the proposed method against eight state-of-the-art methods on three data sets. The experimental results show that the proposed method can perform better for noise-free (F-measure value of 0.776) and Gaussian noise (FOM value of 95.75%) and attains the best performance in impulse noise images (highest FOM value of 98.90%).


I. INTRODUCTION
E DGES in images are widespread. They convey most of the information and forcefully delineate the essential outline of objects. Therefore, edge detection is a fundamental operation and has been widely used in computer vision and image processing, such as image segmentation [1], image retrieval [2], [3], and corner detection [4]- [6].
During the development of edge detection, the existing edge detection methods can be roughly classified into three groups [7]: handcrafted-based methods [8]- [11], classical learning-based methods [12]- [14], and deep learning-based methods [15]- [17]. The handcrafted-based methods introduced edge detection first. These methods can extract edge maps quickly and exhibit multiscale characteristics of the edge but do not ensure the acquisition of closed and continuous contours in the end. The second type of method starts from the regional analysis and has high efficiency. Nevertheless, it is limited to varying degrees of noise influence.
The last group is represented by the method of holistically nested edge detection [17], which has a considerable amount of calculation and is greatly affected by the data set, but the detection is accurate.
The handcrafted-based edge detection methods [8]- [11] process the pixel's gray value through the first-order or second-order differential operation. However, this type of method is noise-sensitive, for which prepositive smoothing is indispensable. The pioneering researcher Canny [10] copiously quoted authoritative works, cascading the isotropic Gaussian kernel and gradient calculation to smooth images before differentiation. However, the isotropic Gaussian kernel cannot alleviate the conflict between noise suppression and spurious edges. Bao et al. [18] proposed scale multiplication technology, which reduces a few details in exchange for an improvement in noise suppression ability. To address the problem of isotropic filters and improve noise robustness, Zhang et al. [19] developed the denoising method of the VOLUME 4, 2016 anisotropic partial differential equation based on the fringe feature, which has a smoothing effect and edge sharpening, but it is not applicable for images with high noise density. Moreover, it takes an extensive amount of time. On the basis of the random forest algorithm and decision tree theory, Dollár et al. [14] proposed a fast structure forest method based on classical learning. Its advantage is that the detection speed is fast, but the extracted features and details are not rich enough. Kelm et al. [20] analyzed the reasons for the fast structure forest method and proposed a multipath refined CNN model based on the holistically nested edge detection method [17]. The model is used to obtain better contours, but the amount of calculation is large. Wibisono et al. [21] proposed a traditional method-inspired framework to produce good edges with minimal complexity. This method simplifies the network architecture and is a small model, but the effect of training is directly affected by the size of the data set. Soria et al. [22] proposed a network architecture model that generates thin edges. This method can be used to better realize the edge extraction of images, but it is susceptible to different noise interferences.
The remaining sections of this paper are presented as follows. In section II, the anisotropic morphological directional derivatives are given. Moreover, their parameters and properties are analyzed. In section III, an improved edge strength map (ESM) and edge direction map (EDM) are presented, and a new edge detection method is proposed. The process of edge detection using the multiscale anisotropic morphologic directional derivatives (MSAMDDs) edge detector is introduced. In section IV, the performance results of the MSAMDD edge detector with different parameters are obtained, and a comparison with state-of-the-art edge detection methods on various indicators is shown. A full text is summarized, and conclusions are drawn in section V.

II. ANISOTROPIC MORPHOLOGICAL DIRECTIONAL DERIVATIVES
Zhang and Shui [23] used the anisotropic Gaussian directional derivative (AGDD) to solve the contradiction among edge resolution, edge stretch, and noise robustness. Shui and Wang [24] proposed the anisotropic morphological directional derivative (AMDD) filter, which depends on the rotating double window and weighted median filter [25] to effectively reduce impulse noise. In the differential-based edge detection methods [6], [8]- [11], the rotating double window structure is used to reduce the redundancy of the edge detection and represents the gradient or the differential operator. According to the early Prewitt gradient operator [9] and Canny operator [10], combined with the general rotating double window structure, the AGDD double window structure can be expressed as: I(n) represents a grayscale image. σ is the scale parameter, and ρ ≥ 1 is the anisotropic factor. n = [n x , n y ] T represents the pixel coordinates in the image, and i and j represent unit vectors in the horizontal and vertical directions, respectively. The horizontal partial derivative G h is calculated according to equations (2), (4) and (5), and the vertical partial derivative G v is obtained by rotating the double window by 90 degrees.
Gv(ny) = ny >0 wR,σ,ρ(ny)I(ny) − ny <0 wL,σ,ρ(ny)I(ny), Among them, ζ(n x ) is an indicator function representing elements from a subset of the set n x . w R,σ,ρ (n) is defined as the double window function on the right half, and w L,σ,ρ (n) is a left double window function. All of these functions are nonnegative. The biwindow structure of AGDD not only compromises noise robustness and edge resolution but also precisely provides the local intensity information of the image. As a nonlinear filter, it is acknowledged that the median filter suppresses impulse noise. For the consideration of image details, the weighted median filter (WMF) can catch abundant local features in images while reducing impulse noise [25]. A weighted median filter with a weight of w(n) that satisfies Set(n) can be defined as: WMF(Set(n) |w(n) ) ≡ median {w(n) Set(n), n ∈ Ω} . (6) The vertical diamond symbol " " indicates repetitive operation. Combining the generation function {w R (x), w L (x)}, the anisotropic morphological directional derivative in the image I(n) can be derived as: The biwindow w R (R −θ k n) is generated by the generating function of the right half-plane, which is numerically equal to the biwindow structure w L (R −(θ k +π) n) of the left-half plane rotated by 180°. Thus, the AMDD response of the θ k angle and its response in the θ k ± π direction are reciprocally opposite. By a weighted median filter combined with a biwindow structure, it is proven in [24] that the AMDD detector can reduce the influence of noise and detect edges minutely. In this paper, the proposed method is based on AGDD and AMDD. The edge strength map (ESM) and the edge direction map (EDM) extracted by small-scale AGDD have high edge resolution and accuracy but are sensitive to noise. Instead, large-scale extractions of ESM and EDM can counteract noise, but the edge stretch effect is pronounced. For this reason, three scales can be complementary in terms of performance attributes and reconcile the discrepancy between edge accuracy and noise robustness. Therefore, scale fusion technology is used to integrate edge maps from multiple scales to form a new EDM. The ESM, at the same time, is extracted by the space matching filter based on the multiscale anisotropic morphologic directional derivative (MSAMDD) matrices, embedding the ESM and EDM into a routine Canny edge detection process. Finally, an MSAMDDs edge detector is constructed. These attributes will help us to propose a new edge detection method in the following section.

III. A NEW EDGE DETECTION METHOD
In this section, the edge strength map (ESM) is extracted by the anisotropic morphology direction derivative (AMDD) space matching filter. Simultaneously, multiscale technology is combined with multiscale anisotropic morphologic directional derivatives (MSAMDDs) to obtain the edge direction map (EDM). Then, the new edge map (EM) is derived from fusing the ESM and EDM with a specific strategy and embedding it into the optimal Canny edge detection framework. Finally, a new edge detection method is presented.

A. FUSED EDGE MAPS
For the given input image I(n), the AMDD expression is obtained from equation (7). Then, the spatial matched filter f SM k is used to locate the edge in the k directions. The spatial response ∇ SMF I(n |k ) in multiple directions is obtained. According to the equation corresponding to the maximum AMDD amplitude response, the ESM is extracted.
As shown in equation (8), ∇ SMF I(n |k ) denotes the sum, which is the product of k spatially matched filters f SM k and the AMDD amplitude response ∇ σ k ,ρ AMDD I(n |k ). In equation (9), b is the width of the biwindow, and s is the distance between the two windows. tg(θ k ) and cot(θ k ) represent the tangent and cotangent trigonometric functions in mathematics, respectively. Let the image I(n) enter a set of AMDD filters and then receive different edge responses by adjusting the scale σ to three small, intermediate, and large ranges. The maximum argument response is found to obtain the EDM through the scale fusion method, as shown in equation (10).
The spatial matched filter in capturing ESM improves the accuracy of edge positioning and the resolution of edge detection. In the acquisition of EDM, the effect of edge elongation can be reduced, and the robustness of the edge detector is improved by using scale fusion technology. Three test images in different scenes were selected, and their ESMs and EDMs were obtained, as illustrated in Fig.1.
The original images are in Fig.1(a). Fig.1(b) is the grayscale of the test images, and they add Gaussian white noise with a variance of 20 and impulse noise with a variance of 25.5. Fig.1(c) and Fig.1(d) are the ESMs and the EDMs of the corresponding images. The noise is reduced, and the edges are revealed.

B. LOCAL CONTRAST EQUALIZATION
Although some pixel edges correspond to large ESM values in a particular image area where the texture is detailed and relatively rough, they are not actual edges. However, the ESM value is tiny at the junction of an area with little grayscale difference, but this is a real edge pixel. Therefore, the local contrast equalization method of the image has been manipulated to reduce false edges.
The average variation of a given image can be shown as: where MN represents the size of the input image. The grayscale change values of the areas that contain edge pixels and nonedge pixels are often inconsistent. For pixel n, the expression of the locally average variation is measured by: W is a square window centered on the origin, and τ is the distance change value in the window. According to the VOLUME 4, 2016 γ is a constant, which is a compromise between the absolute magnitude and the relative amplitude. When the value of γ is equal to 0 or even smaller than 0, this value matches the absolute magnitude. Otherwise, it is equivalent to the relative amplitude value.

C. EDGE DETECTION PROCESS
For an image I(n) corrupted by noise with a variance of ε 2 dB and a set of parameters σ, ρ, and P assumed, several multiscale anisotropic morphologic directional derivatives (MSAMDDs) are obtained. The flow chart of the MSAMDD edge detection is demonstrated in Fig.2.
Aiming at the contradiction between noise robustness and edge resolution, a new edge detection method is proposed. The above figure gives the specific edge detection process: (i) Calculation of the fused edge maps (EMs): The edge strength map (ESM) and the multiscale edge direction maps (EDMs) are obtained by equations (8), (9) and (10), respectively. Under the premise that the change information of each intensity map is consistent, the same matrix vectors are merged to obtain the new EMs.
(ii) Contrast equalization: For the generation of false edges, the average pixel changes and the local average variation of the images Local are calculated and substituted into equation (13) to obtain an improved edge map.
(iii) Non-maximum suppression: For each pixel of an image, combining the new EM and the gradient direction θ k , if the gradient amplitude on either side of it is less than the gradient at the pixel in θ k , the pixel will be retained; otherwise, it will be set to zero. Then, all pixels constitute a maximum point set, which is the set of candidate edge pixels, described by Λ max .
(iv) High and low thresholds: Hysteresis processing is considered the most critical step in edge detection, whereas it is inseparable from the high and low thresholds. The following equations solve the values of the high threshold T h and the low threshold T l : where R represents the cardinality of a finite set, the value of δ h is in the interval [0.5,1], and δ l = 0.4δ h . The low threshold is not only related to noise robustness but also depends on spatial variation. This is because the contrast equalization method affects the robustness of the noise response.
(v) Hysteresis thresholds: This step is used to select edge pixels, which generally include two parts. First, the set after non-maximum suppression is compared with the high threshold T h , and then edge pixels that are larger than T h are regarded as strong edge pixel sets S edge ≡ {n : (Λ(n) ∈ Λ max (n)) ≥ T h }. Second, the pixel set satisfied W edge ≡ {n : T l ≤ (Λ(n) ∈ Λ max (n)) < T h }. When a path connects the pixel set and a strong edge pixel (customarily four neighborhoods or eight neighborhoods), the pixels in the set are determined to be weak edge pixels, described by  W edge . In this case, the edge contour map is composed of S edge and W edge .

IV. EXPERIMENTAL CONFIGURATION
This section gives evaluation indicators and complete performance evaluation results. Regardless of the presence or absence of noise, the aggregate precision-recall curve (PR) [26] and experimentally based figure of merit (FOM) [27] are used to compare and evaluate the proposed method with eight state-of-the-art methods [10], [20]- [24], [28], [29]. The experiment of edge detection exactness and noise robustness is completed in three data sets: the BSDS500 data set, the NYUDv2 data set, and the challenging PASCAL VOC 2007 data set [30]- [32].

PR curve evaluation and F-measure index
The PR curve [26], which is an indicator function that highlights sensitivity and specificity, is fitted by a series of corresponding coordinate points, which are found by setting the critical values of different continuous variables. They can be calculated by: TP means that the number of edge points is correct and matched, whereas FN is the number of incorrectly matched edge points. To understand from the macro level, TN represents the number of correctly matched non-edge points, and FP describes the number of edge points that are matched but not correct. It is far from sufficient to obtain these variables to evaluate the quality of an edge detection method. Therefore, a graph drawn with R on the horizontal axis and P on the vertical axis needs to be created. The F-measure indicator, which is calculated by the weight harmonic average of the precision and recall, was introduced.
where the value of the parameter λ is 1. In general, the area under the PR curve tends to be richer, with higher accuracy. Ideally, the result is better if the F-measure value is closer to 1, specifically, TPR=1 and P=1 on the graph.

FOM index
The PR curve is replaced by Pratt's FOM [27] when the training image does not have a corresponding ground truth (GT). According to the three elements of false edges, positioning error, and edge loss, a FOM definition of the edge map is given: where υ represents the loss factor of the offset from the edge pixel position and generally takes 0.25. N e , in the ideal edge map, is the number of edge pixels. The number of edge pixels detected is N d . Furthermore, d(i) denotes the distance between the ith detected pixel and the ideal edge pixel position. In all cases, a FOM equal to 1 indicates an ideal situation.

B. COMPARATIVE RESULTS AND EVALUATIONS
GT images are generally hand-sketched by experts and used as references for comparative evaluation [33]. They contain the edge areas of interest and edge areas that should not be detected and are not considered. This paper compares the proposed method with eight state-of-the-art edge detection methods (Canny [10], RCN [20], TIN [21], DexiNed [22], IAGK [23], AMDD [24], AAGK [28], and MAGK [29]). PR curve evaluation. If the distance between the detected edge pixel and the edge pixel in the GT image is within a specified tolerance of three pixels, then the edge pixel is VOLUME 4, 2016 considered a real edge pixel, expressed as o T P . In contrast, the set of these pixels is counted as o F P if it reports outside of three pixels. Eventually, the precision and recall rates are obtained through o T P and o F P in equations (15) and (16). Each detection method has adjustable parameters to compare the performance of different methods.
Three image sets and their GT images are picked from the Berkeley University database website for training and testing [32] to draw the PR curve. In calculating the PR curve, the acceptable threshold value range of the nine detection methods is T l = 0.01, 0.02, . . . , 0.4, T h = 0.41, 0.42 , . . . , 0.99. The parameters of each method are set as follows: 1. The Canny [10] method. The only scale parameter is taken as √ 2. 2. The RCN [20] method. This method uses an edge detection model and an optimization algorithm of non-maximum suppression for the extracted feature map.
3. The TIN [21] method. This method trains the edge detection model of the data set on the Linux system.
5. The IAGK [23] method. The scale, direction number, and anisotropic factor take 2 √ 2, 16, and 2 √ 2, respectively. 6. The AMDD [24] method. The parameter scale and anisotropic factor are equal to √ 6. 7. The AAGK [28] method. Similarly, the kernel direction number is 8. The scale takes the value √ 7, and the anisotropic factor is √ 7. 8. The MAGK [29] method. This method's three scale values can be selected in the range of [1,6], and the general values are 1, √ 3, and √ 6. In contrast, the anisotropic factor and directions are √ 1.5 and 8, respectively. 9. The proposed method. The number of directions is 16, and the optimal anisotropic factor is selected as 3.1864. In addition, the three scale parameters are 1, √ 3, and √ 7. Fig.3, combined with the selection of parameters, illustrates the PR curves of nine edge detection methods under different noise ratios.
As shown in Fig.3, the proposed method is clearly distinguished from the Canny [10] and IAGK [23] detection methods in the absence of noise. Its F-measure value is 17.5% and 14.7% higher than these two detection methods. Additionally, in the case of impulse noise, Gaussian noise, and speckle noise, TIN [21] has the best performance in the BSDS500 dataset, and the average F-measure value reaches 0.7973. From a holistic perspective, the Canny detection method is destitute, mainly because its noise reduction is at the expense of edge resolution. Moreover, in the four cases, the F-measure value of the proposed method is 7.725%, 7.500%, 6.088%, and 7.300% higher than the average Fmeasure value of the eight other edge detection methods, respectively.
In the experiment, a total of six original representative images were selected from the three data sets. The results of the nine edge detection methods for noise-free impulse noise with a variance of 5, Gaussian noise with a variance of 10, and speckle noise with a variance of 15 are given in Fig.4.
The first row in Fig.4(a) shows six test images, and the second to fourth rows show noise images with different variances. The last row shows the GT images corresponding to each test image. However, the order of the results in Figs. 4(b)-4(e) are arranged. The earliest method, classic Canny [10], is in the first places, then RCN [20], TIN [21], DexiNed [22], IAGK [23], AAGK [28], AMDD [24], and MAGK [29] are illustrated in the second, third, fourth, fifth, sixth, seventh, and eighth rows, respectively. The proposed method is shown in the end row. The noise-free result of Fig.4(b) shows that the TIN [21] and DexiNed [22] methods extract the edge feature very well. The edge map obtained by the proposed method is better, and the interest edge points are wholly acquired. Fig.4(c)-4(e) of the results with noise show that the Canny [10] detection method is the poorest, and other methods are affected by noise to varying degrees, whereas the proposed detection method shows moderately satisfactory performance.
FOM index calculation [27]. Three test images (containing images of space and objects, which do not have GT images) are selected in the PASCAL VOC 2007 data set and the NYUDv2 data set to obtain the FOM values of nine detection methods. Similar to the same method adopted in [34], [35], nine methods are used to perform regular fusion ('or' in the programming language) to form a candidate edge set close to the GT truth image.
First, in terms of parameter selection in the FOM calculation, the proposed method, except for the threshold change, is identical to the other eight methods, that is, K = 16, σ 2 = ρ 2 = 7. Second, different types of noise with different numerical variances are added to calculate the FOM value. Third, isometric sampling is conducted within the range of [0.65,0.95] at 0.002 intervals to make a better comparison. Finally, the maximum FOM value is computed according to equation (18) and filled in Table 1.
As seen from Table 1, the Canny [10] and IAGK [23] detection methods are prodigiously affected by impulse and speckle noise. For example, for the "Aircraft" test image, in the case of speckle noise with a noise variance of 15, the number of edge pixels detected in the GT image is 4433, whereas the Canny [10] and IAGK [23] methods detect 3810 and 3765, respectively, and the FOM values reach 0.8594 and 0.8494, which are 5.99% and 6.99% lower than the proposed method. This is because the contradiction between an accurate edge location and noise robustness cannot be eliminated through the limited isotropic Gaussian kernel in selecting parameters. The detection performance of the exemplary RCN method [20] relies on the optimized algorithms for the NMS. The TIN [21] and DexiNed [22] methods are affected by different data sets, such as "Aircraft" and "Bridge". For the "Bridge" test image, if there is no NMS in the case of Gaussian noise with a noise variance of 10, the number of edge pixels detected by the RCN method [20], the TIN [21] method and the DexiNed [22] method are 8992,  To verify the effectiveness of the proposed method, experiments are carried out on the "Bridge" test image. First, the impulse noise, Gaussian noise, and speckle noise are mixed, and the noise variance is taken in the range of [0, 40] at intervals of 5. Then, the noise variance is added to the "Bridge" test image. Finally, the FOM value is calculated, as shown in Table 2. Table 2 shows that in the absence of noise, ψ GT is 15814, and the highest and lowest number of edge pixels detected by the eight other methods is 15480 (MAGK [29] method) and 12379 (TIN [21] method), respectively. However, the proposed method detects 15694 edges, which is 3315 and 214 higher than the TIN [21] and MAGK [29] methods, respectively. In addition, the FOM value of the proposed method is 7.8688% higher than the average FOM value of the eight other methods. In the case of mixed noise, the FOM value of the proposed method is 2.327% higher than the average FOM value of the second-best method (MAGK [29] method), and the number of detected edges is 2740 more than that of the MAGK [29] method. In summary, VOLUME 4, 2016 (a) Three noise output results of six test images and the corresponding GT image (b) Edge detection results of nine different methods without noise the excellent noise robustness of the proposed method is due to its excellent filter bank and matching morphological denoising ideas.

V. CONCLUSIONS
In this paper, a new fusion edge detection method is disclosed, which extracts the edge strength map (ESM) through the idea of a spatially responsive filter combined with anisotropic morphology. Moreover, it relies on the expression of the anisotropic morphology of the directional matched filter to gain the maximum value from the argument group, and the edge direction map (EDM) is obtained. Finally, the local contrast equalization method is merged into the ESM and EDM to create the new edge map (EM). The evaluation indices, such as the precision-recall curve and the figure of merit value, confirm that the proposed method is superior to eight previously reported state-of-the-art methods. Furthermore, the experimental results demonstrate that the method has multiple performance advantages, such as high accuracy, low error, and noise robustness. Unfortunately, the proposed (c) In the case of impulse noise with a variance of 5, the edge detection results of nine different methods (d) In the case of Gaussian noise with a variance of 10, the edge detection results of nine different methods VOLUME 4, 2016 (e) In the case of speckle noise with a variance of 15, the edge detection results of nine different methods Each test image has a FOM value and the number of edge pixels detected under three noise conditions. The second, third, and fourth columns show the results of impulse noise with a noise variance of 5, Gaussian noise with a noise variance of 10, and speckle noise with a noise variance of 15, respectively).

Image
Aircraft Bridge Table   ψ GT  6154  3797  4433  16450  11388  15347  14618  7738  11267 Noise  method is limited to grayscale images and is not suitable for color images. Additionally, the effect of edge extraction and high-density noise suppression for complex backgrounds is not very good. These shortcomings are future research directions for us.