Next Article in Journal
Robust Multi-Sensor Fusion for Localization in Hazardous Environments Using Thermal, LiDAR, and GNSS Data
Previous Article in Journal
High-Concentration Time-Frequency Representation and Instantaneous Frequency Estimation of Frequency-Crossing Signals
Previous Article in Special Issue
Experimental Investigation on the Effect of Coil Shape on Planar Eddy Current Sensor Characteristic for Blade Tip Clearance
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Multiscale Gradient Fusion Method for Color Image Edge Detection Using CBM3D Filtering

1
School of Electronics and Information, Xi’an Polytechnic University, Xi’an 710048, China
2
School of International Business School Suzhou, Xi’an Jiaotong Liverpool University, Suzhou 215123, China
3
School of the Arts, Universitiy Sains Malaysia, Penang 11700, Malaysia
4
School of Digital Industry, Jimei University, Xiamen 361021, China
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(7), 2031; https://doi.org/10.3390/s25072031
Submission received: 4 March 2025 / Revised: 13 March 2025 / Accepted: 15 March 2025 / Published: 24 March 2025
(This article belongs to the Special Issue Digital Twin-Enabled Deep Learning for Machinery Health Monitoring)

Abstract

:
In this paper, we present a novel color edge detection method that integrates collaborative filtering with multiscale gradient fusion. The Block-Matching and 3D (BM3D) filter is utilized to enhance sparse representations in the transform domain, effectively reducing noise. The multiscale gradient fusion technique compensates for the loss of detail in single-scale edge detection, thereby improving both edge resolution and overall quality. RGB images from the dataset are converted into the XYZ color space through mathematical transformations. The Colored Block-Matching and 3D (CBM3D) filter is applied to the sparse images to reduce noise. Next, the vector gradients of the color image and anisotropic Gaussian directional derivatives for two scale parameters are computed. These are then averaged pixel-by-pixel to generate a refined edge strength map. To enhance the edge features, the image undergoes normalization and non-maximum suppression. This is followed by edge contour extraction using double-thresholding and a novel morphological refinement technique. Experimental results on the edge detection dataset demonstrate that the proposed method offers robust noise resistance and superior edge quality, outperforming traditional methods such as Color Sobel, Color Canny, SE, and Color AGDD, as evidenced by performance metrics including the PR curve, AUC, PSNR, MSE, and FOM.

1. Introduction

Edge detection in grayscale images has been a well-established area of research for several decades, with algorithms that are now considered relatively mature. However, with the rapid advancements in technology and computer science, the use of color images has become more widespread, sparking increased interest in color image processing in recent years. Color space processing has found diverse applications, including color style transfer [1], color image segmentation [2], and color image encryption [3], to name just a few. In color images, edges—representing abrupt color transitions at the pixel level—are key low-level features. While traditional edge detection techniques, such as Roberts [4], Prewitt [5], and Sobel [6], work effectively for grayscale images, color images contain richer visual information that can significantly enhance edge detection. Existing methods for detecting edges in color images, when incorporating different color spaces and filters, can be generally classified into three categories: vector-based output synthesis, filter-driven approaches, and component decomposition and synthesis.
Edge detection in color images has garnered increasing attention due to its vital role in various computer vision tasks such as object recognition, image segmentation, and scene analysis. While traditional methods have been effective for grayscale images, the richer color information in color images presents additional challenges and opportunities for enhancing edge detection performance. These challenges have motivated the exploration of advanced techniques in the field, including deep learning approaches, which have set new benchmarks in recent years. However, deep learning methods often rely heavily on large labeled datasets and substantial computational resources, making them less accessible for resource-constrained applications. Consequently, there remains a need for robust edge detection methods that effectively leverage both traditional and advanced techniques, striking a balance between accuracy and computational efficiency.
The first class of edge detection methods involves vector output synthesis, where pixels are expressed as vector fields in various color space representations. These methods use one-dimensional or multi-dimensional responses and apply Euclidean or cosine distance metrics to measure pixel distances. Edge maps are then constructed by analyzing the edges detected with different operators. For example, Yugander et al. [7] introduced a combined index for color image edge detection that improves edge stability by incorporating angle and amplitude measurements. Huang et al. [8] fused mathematical morphology with vector methods, incorporating vector color differences in edge detection, although at the cost of excessive smoothing and loss of fine details. Similarly, Arbelaez et al. [9] utilized generalized features to capture both local and global contour information, enhancing edge contour detection but leading to some blurring and brightness loss.
The second approach is based on filter-based methods. Canny et al. [10] pioneered the concept of preprocessing images with filters before edge extraction, a technique that remains foundational in contemporary edge detection. Tian et al. [11] proposed a fusion edge detection method based on an enhanced Sobel operator, combining wavelet transform filtering with various operators to improve edge detection accuracy. However, this approach can sometimes result in the loss of fine edge details. Sun et al. [12] extended the Canny operator to color images by applying a Gaussian filter for smoothing, followed by first-order and higher-order weighted averaging for edge detection. While effective, this method is particularly sensitive to noise due to its reliance on single-scale operations. Kumar et al. [13] introduced the BM3D filter into color imaging to enhance noise robustness while preserving image details and polarization characteristics.
The third approach, component decomposition and synthesis, decomposes color images into individual channels, applies edge detection to each channel, and then synthesizes the results. Han et al. [14] proposed this method, where the image is first decomposed into three color channels, and edge detection is performed on each channel separately before the results are fused. Dollár et al. [15] incorporated random forests and decision tree theory with multiscale detection and edge sharpening to improve edge quality, though the method still faces challenges in capturing detailed edge information. Wang et al. [16] combined anisotropic properties with Gaussian directional derivatives to perform three-channel decomposition for edge detection, showing good robustness to noise [17,18,19,20].
In this paper, we propose a novel color image edge detection algorithm based on multiscale gradient fusion using color BM3D filters. The specific innovation points can be divided into the following parts:
 
The proposed algorithm combines multiscale gradient fusion with color BM3D filters for edge detection, harnessing the benefits of sparse coding and image denoising to significantly improve edge quality.
 
By integrating the XYZ color space with anisotropic directional derivatives at multiple scales, a novel edge strength map (ESM) is generated, enhancing both the accuracy and robustness of edge detection.
 
The ESM is optimized through pixel-average fusion and morphological filling techniques, effectively balancing large-scale edge elongation with small-scale resolution accuracy to achieve improved edge detection performance.
 
The proposed algorithm is evaluated using standard metrics (PR curve, AUC, PSNR, MSE, FOM) and compared with leading edge detection methods, including Color Sobel, Color Canny, SE, and Color AGDD, showcasing its superior performance on both edge and non-edge detection datasets.
The structure of this paper is as follows: Section 2 provides an introduction to the RGB to XYZ color space conversion and discusses the Colored Block-Matching and 3D (CBM3D) filter. Section 3 presents the multiscale gradient fusion edge detection algorithm, along with the construction of the fused ESM. Section 4 compares the proposed method to other existing techniques, conducts ablation experiments, and analyzes the results. Finally, Section 5 concludes the paper with a summary of findings and suggestions for future work.

2. Related Work

In this section, the CIE XYZ color space was introduced, and the RGB to XYZ space conversion was calculated. Then, the color block-matching and 3D (CBM3D) filter is presented.

2.1. CIE XYZ Color Space

The CIE XYZ color space, defined by the International Commission on Illumination (CIE), is an ideal color model based on the three primary colors—red, green, and blue [21,22,23]. It was the first color space to be mathematically formulated [24,25]. In the XYZ color space, the three components (X, Y, and Z) do not directly correspond to the physiological responses of human vision to short, medium, and long wavelengths, but rather represent a linear combination of the color-matching functions that roughly align with red, green, and blue [26,27,28]. Specifically, the Y component, derived from the green tristimulus value, represents brightness, while the X and Z components correspond to the red and blue stimuli, respectively. These three primary components can be used to represent all perceivable colors with positive values.
Unlike the RGB color space, which relies on physical devices for brightness information, the XYZ color space incorporates brightness, with the Y component directly encoding it. In contrast, the RGB color space requires specific instruments for this calculation, while brightness in the XYZ space can be derived mathematically.
X Y Z = 0.412453 0.357580 0.180423 0.212671 0.715160 0.072169 0.019334 0.119193 0.950227 R G B
As shown in Equation (1), Z = 0.019334 · R + 0.119193 · G + 0.950227 · B , and the arithmetic sum of the three coefficients equal 1.088754, which is close to the integer 1. Assuming the coefficients sum to 1, the values of X, Y, and Z can be constrained to the range [0, 255]. By manually adjusting the sum of the coefficients to 1, the mapping between the XYZ and RGB color spaces can be made equivalent, ensuring both spaces have the same value range. However, based on the tristimulus values in the XYZ color space, there is a forward transformation of the XYZ and L · a · b color spaces. The specific formula is shown in Formula (2).
L = 116 f Y Y n 16 a = 500 f X X n f Y Y n b = 200 f Y Y n f Z Z n
where
f ( t ) = t 1 / 3 if t > 6 29 3 1 3 29 6 2 t + 16 116 if t 6 29 3
In Formula (3), the f ( t ) function has two domains to prevent infinite slope when t equals zero. At t = t 0 , f ( t ) is a linear function, that is t 0 1 / 3 = a t 0 + b , and its matching slope satisfies a = 1 3 t 0 2 / 3 . Figure 1 shows the difference in edge detection between XYZ, RGB, L · a · b and HSV color spaces.
Among the different color spaces, the HSV and RGB color spaces are more vivid and bright, while the XYZ chromaticity space is more complete, and the L · a · b space appears relatively blurred. When expanding the components of the XYZ and RGB color spaces, X, Y, and Z tend to be brighter than R, G, and B, and the color differences are not significant. In edge detection results across various color spaces, the RGB color space shows a tendency to miss details and have incomplete edges. On the other hand, the L · a · b and HSV color spaces exhibit some jaggedness and slight edge stretching, which can be observed in the green oval box. After edge detection, RGB, L · a · b , and HSV color spaces suffer from varying degrees of edge loss, as indicated by the red circle in Figure 1. However, the XYZ color space performs better in this regard. Comparatively, L · a · b produces false edges, while HSV generates more false edges, whereas the other two color spaces perform well, as highlighted in the blue rectangle.

2.2. The Color Block-Matching and 3D Filter (CBM3D)

An image in the XYZ color space with noise variance, ε dB 2 can be modeled as ϕ XYZ = I XYZ + μ XYZ , where I XYZ = [ I X , I Y , I Z ] is actual image or input image and μ XYZ = [ μ X , μ Y , μ Z ] is represented as multiplicative or additive noise. Following the existing BM3D algorithm [29,30], the color block-matching and 3D (CBM3D) algorithm can be introduced. First, the XYZ color space image is transformed into a luminance–chrominance space, represented by the Y, U, and V channels. Among these, the U and V channels predominantly contain low-frequency data, while the Y channel, which has the highest signal-to-noise ratio (SNR), carries the most valuable information, including texture, edges, and lines. Next, the 2D images of these channels are divided into groups, and the resulting blocks are represented as a 3D array. After the transformation, a hard threshold is applied to attenuate noise and shrink the transform spectrum. Finally, an inverse 3D transform is used to reconstruct the grouped blocks. A weighted average of the underlying estimated block channels is computed and aggregated to produce block-by-block estimates for the corresponding Y, U, and V channels. These estimates are then converted back into the XYZ color space.
The algorithm for denoising using the CBM3D filter mainly has the following four steps.
(1) Channel conversion. ϕ XYZ is transformed into ϕ YUV , and ϕ YUV = [ ϕ Y , ϕ U , ϕ V ] where the transformation matrix and opponent transformation satisfies. The specific formula is shown in Formula (4).
T = 0.3 0.59 0.11 0.17 0.33 0.5 0.5 0.42 0.08 T op = 1 3 1 3 1 3 1 6 0 1 6 1 3 2 2 3 2 1 3 2
(2) Collaborative hard thresholding and chroma grouping constraints are used for basic estimation, denoted by I YUV basic = [ I ˙ Y basic , I ˙ U basic , I ˙ V basic ] . For each block, a 2D Kaiser window is used for ϕ Y and block estimation aggregation, and a 3D numerical permutation matrix is obtained from the stacked blocks located at the ϕ Y , ϕ U , and ϕ V positions.
(3) Based on I YUV basic . The collaborative Wiener filtering and chroma grouping constraints are used to obtain final estimates. Block matching is used for finding the locations of block in I ˙ Y basic , and then a set of 3D arrays are constructed by stacking blocks in I ˙ Y basic and ϕ Y . Consequently, a 3D transformation is applied to these arrays, followed by 3D Wiener filtering on the noisy arrays using the energy spectrum derived from the base estimate.
(4) All grouped block estimates are calculated by inverse 3D transform. Additionally, the block estimates of the corresponding Y, U, and V channels are calculated by average weighting, denoted I ˙ Y final , I ˙ U final , I ˙ V final .

3. A New Color Image Edge Detection Method

After denoising with the CBM3D filter, the XYZ color space images are used to compute their color vector gradients and anisotropic Gaussian directional derivative gradients. Next, a pixel-by-pixel average fusion of multiple gradients is performed to generate a new edge strength map. Simultaneously, the edge map is normalized, and non-maximum suppression is applied. Double-threshold selection and morphological fill refinement are then utilized to extract the edge contours. Finally, a novel color image edge detection method is proposed.

3.1. Multiscale Gradient Fusion Approach

Assume that the input image in the XYZ color space is I xyz ( x ) , where x = u , v s . T , and the scale is σ . The expression of the two-dimensional Gaussian kernel function can be defined as Formula (5).
G σ ( x ) = 1 2 π σ 2 exp x T x 2 σ 2 = 1 2 π σ 2 exp u 2 + v 2 2 σ 2 = 1 2 π σ exp u 2 2 σ 2 × 1 2 π σ exp v 2 2 σ 2 = G σ ( u ) × G σ ( v )
where U and V are the coordinates of the pixel point, and T represents the transpose of the matrix. For XYZ color images, convolve with a Gaussian function and calculate the gradient magnitude. The concrete process is like the Formulas (6)–(8).
I xyz , σ ( x ) = I xyz ( x ) · G σ ( x ) = I x ( x δ ) G σ ( δ ) d δ I y ( x δ ) G σ ( δ ) d δ I z ( x δ ) G σ ( δ ) d δ
I xyz , σ ( x ) = u I xyz , σ ( x ) v I xyz , σ ( x ) = I x · G σ ( x ) I y · G σ ( x ) I z · G σ ( x )
where
G σ ( x ) = x σ 2 · G σ ( x ) = x 2 π σ 4 exp x T x 2 σ 2
After computing the gradient magnitude for each color space, the composite form is obtained by combining the results from each plane and their individual contributions. The concrete process is like the Formulas (9) and (10).
P ( x ) = P X Y ( x ) + P Y Y ( x ) + P Z Y ( x )
P X Y ( x ) = P X Y ( u , v ) = I x · G σ ( u ) 2 + I x · G σ ( v ) 2 P Y Y ( x ) = P Y Y ( u , v ) = I y · G σ ( u ) 2 + I y · G σ ( v ) 2 P Z Y ( x ) = P Z Y ( u , v ) = I z · G σ ( u ) 2 + I z · G σ ( v ) 2
The result in the composite form is compared with a threshold to obtain the final color gradient magnitude. For Formula (5), referring to the anisotropic factor ρ , the Gaussian function can be deformed to obtain the anisotropic Gaussian kernel function. The concrete process is like the Formulas (11) and (12).
G σ , ρ , θ ( x ) = 1 2 π σ 2 exp 1 2 σ 2 x T R θ ρ 2 0 0 ρ 2 ( R θ x )
R θ = cos θ sin θ sin θ cos θ
where R θ , a symbol representing the direction of rotation without affecting the result, denotes the rotation matrix, and θ is the rotation angle. To obtain the anisotropic Gaussian directional derivative (AGDD), we differentiate the anisotropic Gaussian kernel function. The details are shown in Formula (13) below.
G σ , ρ , θ ( x ) = ( cos θ , sin θ ) x σ 2 ρ 2 G σ , ρ , θ ( x ) , θ = ( N 1 ) π n , n = 1 , 2 , 3 , , N
N represents the number of directions for the anisotropic Gaussian directional derivative (AGDD). Based on Equations (5) and (13), the color gradient and the anisotropic Gaussian directional derivative gradient for the multiscale parameter are fused. Their average gradient value is computed to generate a new edge strength map (ESM). The concrete process is like the Formula (14).
ESM = max n = 1 , 2 , 3 , , N P ( x ) + I xyz · G σ 1 , ρ , θ ( x ) + I xyz · G σ 2 , ρ , θ ( x ) 3
The image in the XYZ color space is continuously represented, enabling a more precise analysis of its color components. After computing gradients at multiple scales, the gradient maps are fused by averaging pixel-by-pixel, effectively combining complementary scale information while reducing noise. The maximum gradient value at each pixel is then selected to create the Edge Strength Map (ESM), emphasizing the most significant edges. To ensure consistency across images, the ESM is normalized by dividing each pixel by the map’s largest value, standardizing the range and improving the accuracy and stability of subsequent edge detection steps.
The proposed method employs a multiscale framework for extracting edge strength maps (ESMs), where each scale offers complementary advantages: the small-scale ESM provides high edge resolution and accuracy but is prone to noise sensitivity; the large-scale ESM effectively suppresses noise, though it may cause excessive edge elongation; and the intermediate scale strikes a balance between resolution, accuracy, and noise robustness. By leveraging scale fitting techniques to combine these scales, the algorithm synthesizes a unified edge map (EM) that integrates the strengths of each scale while mitigating their respective limitations. This approach ensures enhanced adaptability to varying noise levels and image characteristics.

3.2. Color Image Edge Detection Process

Given a color image I RGB ( x ) , the XYZ space image is derived using Formula (1), along with the specified parameters σ , ρ and N. The color space gradient and the AGDD gradient are then computed using the Formulas (9)–(11). The flowchart for the multiscale gradient fusion edge detection algorithm, based on the CBM3D filter, is shown in Figure 2.
To achieve the effective denoising of color images, the CBM3D filter is applied for filtering. A new edge strength map (ESM) is then constructed using a multiscale gradient approach and gradient vector fusion. Finally, an optimized edge map is obtained. The specific edge detection process is outlined as follows, as illustrated in the figure above.
(1) XYZ Color Space Conversion and Filtering: Initially, the input RGB image is converted to the XYZ color space using Formula (1). Subsequently, channel conversion is performed as described in Formula (4), and the grouped block estimates are constructed. After applying 3D Wiener filtering, the estimated values for each block in the channel are obtained through a 3D inverse transformation followed by weighted averaging. Finally, the image is converted back to the XYZ color space.
(2) Average fusion for the New ESM: After applying CBM3D filtering, the vector gradient of the color image is computed using Formulas (9) and (10). Next, the anisotropic Gaussian directional derivative (AGDD) is calculated as per Formula (13), and the gradients for two scales are obtained by convolving the image with the corresponding filters. Finally, the three gradients are averaged to generate the new edge strength map (ESM).
(3) Normalization and non-maximum suppression. Based on the ESM, the largest pixel value is identified and used to normalize the image by dividing all pixel values by this maximum. Then, using the modulus value of the ESM and its gradient direction, pixels are retained if the gradient magnitude along any side of the pixel, in the direction of the gradient, exceeds the pixel’s magnitude; otherwise, the pixel is set to zero. This process results in a set of local maxima, which is commonly referred to as the candidate edge pixel set, denoted by Λ max .
(4) Double threshold selection. This step is essential for effective edge detection. Without it, the detected edges would only form feature maps, rather than distinct contour lines. Double thresholds named high threshold H th and low threshold L th can be calculated as (15) and (16).
ϕ x : Λ m a x x < H th = λ M
ϕ x : Λ m a x x < L th = μ λ M
where φ represents the set of finite candidate sets, M represents the image resolution size, λ is the parameter for calculating the high threshold, which ranges within the interval [ 0.6 , 0.95 ] , and 0.4 μ 0.6 . After non-maximum suppression, for the set Λ max , edge pixels with values greater than the threshold λ are classified as strong edge pixels, denoted by S edge . In the eight-neighborhood range of W edge , if a path is connected to the strong edge pixel S edge , these pixels are regarded as edge pixels, denoted as W S edge . The final edge contour map is then composed of the combined sets W edge , W edge , and W S edge .
(5) Morphological refinement and filling. To obtain finer edges that are closer to the ground truth (GT) image, a morphological optimization operation is applied. Unlike traditional methods that focus on edge thinning, the approach used here involves padding isolated inner voxels in the Edge Strength Map (ESM), where pixels with a value of 0 are filled with 1. This helps to enhance the continuity of edges. Finally, the refined edge map is produced as the output.

4. Experimental Results and Performance Analysis

In this section, the key findings of this study are presented. For simplicity, this section is divided into three. This section includes the experimental environment, the measurement indicator, and the analysis of results.

4.1. Experimental Results

To assess the performance and benefits of the color image edge detection algorithm using the CBM3D filter for multiscale gradient fusion, we compare the proposed method with several existing algorithms, including Color Sobel, Color Canny, SE, and Color AGDD. The comparison is performed on both edge and non-edge image sets. The edge detection datasets, such as BIPED and MDBD, include original RGB images as well as images modified through enhancement techniques like inversion translation. The non-edge datasets are sourced from the well-known BSDS500 dataset, the PASCAL 2007 challenge dataset, and natural scene images. To ensure a fair evaluation, the parameters for each algorithm are configured as follows.
(1) The color Sobel algorithm is manipulated in the RGB color space. The templates used 3 × 3 and 5 × 5. The 5 × 5 templates are given as follows:
0 0 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1
(2) The color Canny algorithm. It uses the RGB color space, and the scale parameter is selected as 2 .
(3) The SE algorithm adopts the RGB color space, and adds edge sharpening and thinning operations to optimize the edge effect.
(4) The color AGDD algorithm is completed at the RGB color space, and the scale and anisotropic factor are both 7, and the direction number is 16.
(5) The two scale parameters of the proposed algorithm are selected as 3 and 7 .
The XYZ color space is used for images without noise, and the RGB color space is used for noise images. Figure 3 presents five representative images selected from four datasets and natural scene images, along with corresponding zero-mean Gaussian white noise images with a noise density of 0.01, and their ground truth (GT) maps. For images without GT maps, results are obtained through the use of five different algorithms. (Note that a noise variance of 25.5 is numerically equivalent to a noise density of 0.01).
The images in the five datasets feature rich colors that broadly represent the diversity of available images. Additionally, they contain high-level semantic information, such as facial details, low-frequency sky information, and high-frequency object features. Figure 4 displays the detection results of the five algorithms on these images without noise.
As shown in Figure 4, the Color Sobel algorithm detects the general outlines of the images, but the results are cluttered due to the lack of smoothing filters. The Color Canny algorithm performs well in edge detection, aided by its Gaussian filter, particularly in low-frequency spatial images. However, using an isotropic filter causes some loss of detail, as it sacrifices image resolution or noise robustness to preserve edge information. The SE algorithm, though fast in detection, is significantly disturbed by noise, even with its multiscale factors and edge-sharpening operations. The Color AGDD algorithm performs better on face and object feature images but introduces false edges in low-frequency spatial images. In contrast, the proposed algorithm successfully detects edges in the noise-free images, showing superior performance in handling both low-frequency and high-level information. To evaluate the algorithm’s robustness to noise, a zero-mean Gaussian white noise with a density of 0.01 was added in subsequent experiments. The edge detection results of various algorithms under noisy conditions are shown in Figure 5.
For images with Gaussian white noise, the Color Sobel and SE algorithms are heavily affected by noise, resulting in a large number of stains. However, they have the fastest detection speeds. The Color Canny algorithm performs slightly better but remains less robust to high-density noise. The Color AGDD algorithm shows some noise robustness but loses edge details due to its strong smoothing filter. This is particularly evident in the “airplane” image, which contains low-frequency information, where false edges caused by noise appear. In contrast, the proposed algorithm performs well on both low-frequency and high-frequency images, such as face images, with accurate and detailed edge detection. Its robustness to noise can be attributed to the effective filter performance and the use of multiscale gradients.
For images with Gaussian white noise, both the Color Sobel and SE algorithms exhibit a large number of false edges, heavily influenced by noise. However, they offer the fastest detection speeds. The Color Canny algorithm performs slightly better, with fewer false edges, though it is less robust to high-density noise. The Color AGDD algorithm is more robust to noise but tends to lose edge details due to its strong smoothing filter, especially in aircraft images with low-frequency information, where false edges caused by noise are more prominent. In contrast, the proposed algorithm demonstrates excellent performance in both low-frequency and high-frequency face images, producing accurate and detailed edge detections. Its strong noise robustness is attributed to the effective filter design and the use of multiscale gradients.

4.2. Performance Analysis

To quantitatively evaluate five edge detection algorithms, the PR curve, AUC, PSNR, MSE, and FOM index are employed as performance metrics. Initially, the PR curve and AUC are used to assess the algorithm’s accuracy. In the PR curve, the x axis represents precision, while the y axis represents recall. Precision is defined as the proportion of correctly predicted positive edges among all predicted positive edges. Recall, on the other hand, reflects the proportion of true positive edges that are correctly identified. The precision and recall are calculated as follows. The details are shown in Formulas (17) and (18).
L p r e c i s i o n = η TP η TP + η FP
L r e c a l l = η TP η TP + η FN
where, η TP is the edge pixel of the true positive, η FN is the edge pixel of the false negative, and η FP indicates that it is not an edge but it is detected. In addition, AUC is defined as the area under PR curve, which can quantitatively reflect the algorithm performance measured based on the PR curve. The value of AUC can be integrated along the horizontal axis by the PR curve. The details are shown in Formula (19).
AUC = i = 1 N recall L precision ( i ) + L precision ( i + 1 ) L recall ( i + 1 ) L recall ( i ) 2
The experiments were conducted on several benchmark datasets, employing a uniform threshold of 0.001 within the range [0, 1] for the positive sequence values. Precision–recall (PR) curves were generated for five different edge detection algorithms, and the results are illustrated in Figure 6 and Figure 7. To further quantify the performance of each algorithm, the area under the curve (AUC) values were computed using Formula (19) and are clearly indicated in the figures. These AUC values provide a comprehensive measure of the algorithms’ ability to distinguish between positive and negative sequences across various thresholds, offering a detailed comparison of their overall effectiveness in edge detection tasks.
The straight line y = x in the figure serves as a reference for performance comparison. In the absence of noise, the five algorithms show minimal differences in their results, with the proposed method achieving the best performance and highest accuracy. Specifically, the AUC value for the proposed algorithm reaches 0.98622, which is 1.833% higher than that of the SE algorithm. However, when noise is introduced, a significant performance gap emerges among the algorithms. The Color Sobel algorithm demonstrates the poorest performance, as it is highly sensitive to noise, yielding an AUC value of only 0.91942. In contrast, the proposed algorithm maintains strong performance under noisy conditions, with an AUC value of 0.98367, which is 6.425% higher than that of the Color Sobel method. To further assess and compare the performance of the algorithms, additional evaluation metrics, such as peak signal-to-noise ratio (PSNR) and mean squared error (MSE), are incorporated. These metrics provide a more comprehensive understanding of the accuracy and robustness of the algorithms in different scenarios. The PSNR and MSE values are calculated using Formulas (20) and (21), respectively, and offer valuable insights into the algorithms’ ability to preserve image quality and minimize error during edge detection.
PSNR = 10 × log 10 ( 2 τ 1 ) 2 MSE
MSE = 1 H × W i = 1 H j = 1 W I detected ( i , j ) I GT ( i , j )
In Formula (20), τ represents the bit value of each pixel, which is generally 8, so that the gray level of the pixel is 256. For Formula (21), H and W represent the height and width of the image, respectively. I detected represents the output image of the algorithm to detect edges and I GT , the ground-truth image. According to the formula, the values of the five algorithms in the case of PSNR and MSE are obtained and filled in Table 1 and Table 2.
As shown in the data in Table 1, the SE algorithm exhibits the worst performance, with a PSNR of only 55.4221 and an MSE as high as 0.1880 on the Lena image. The PSNR and MSE values of the Color Sobel and Color Canny algorithms are similar, indicating comparable edge detection performance. The edges detected by the Color AGDD algorithm are of high quality, closely matching the ground-truth (GT) image and true edge levels. However, the proposed algorithm demonstrates superior performance on the PASCAL VOC 2007 dataset, achieving the highest PSNR of 60.5842 and the lowest MSE of 0.0573. This represents a PSNR improvement of 2.1935 over the SE algorithm and a 7.45% reduction in MSE on the Lena image.
Similarly, the Color Sobel and Color Canny algorithms perform poorly in the presence of noise, indicating that both are not robust to high levels of noise. Under the influence of intense noise, the average PSNR of the Color Sobel algorithm drops to 54.2675, showing a significant deviation from the GT image. The SE and Color AGDD algorithms exhibit minimal performance degradation under noisy conditions, maintaining competitive performance. However, the proposed algorithm stands out with an average PSNR of 58.8033, which is 4.5358 higher than that of the Color Sobel algorithm. In addition, the average MSE of the Color Sobel algorithm is 0.2463, which is 15.79% higher than the proposed algorithm.
Finally, the FOM (figure of merit) is used to evaluate the performance of the five algorithms. The FOM takes into account three key factors: false edge generation, inaccurate edge positioning, and edge loss, as well as noise robustness. Based on these criteria, the definition of FOM is given as follows as (22).
FOM = i = 1 E detected 1 / [ 1 + ν d 2 ( i ) ] Max E ideal , E detected
where, ϑ represents the loss factor on the edge pixels, and the general constant is 0.25. Additionally, d ( i ) represents the Euclidean distance between the i-th detected edge pixel and the true edge pixel at the corresponding position. Moreover, E ideal and E detected represent, respectively, the number of pixels in the ideal edge map, and the number of 0 to 1, and the best edge map gets FOM = 1. Furthermore, the FOM values of the five algorithms in the two cases are shown in Table 3 and Table 4.
For several key reasons, we chose the precision–recall (PR) curve and the Figure of Merit (FOM) as the primary evaluation metrics, rather than SSIM and RMSE. Firstly, the PR curve and FOM are widely acknowledged in edge detection research as they effectively capture the essential performance aspects of edge detection. The PR curve evaluates the trade-off between precision and recall, providing insights into how the algorithm balances false positives and false negatives. In contrast, the FOM metric is specifically designed for edge detection, assessing edge localization accuracy and noise robustness. It quantifies the alignment between detected and true edges, making it particularly suitable for comparing performance under varying noise conditions.
Although SSIM and RMSE are valuable for evaluating image quality and pixel similarity, they are less suitable for edge detection tasks. SSIM measures the structural similarity of the entire image, which, while useful for overall image quality assessment, does not provide specific insights into the accuracy or localization of the detected edges. RMSE, which evaluates pixel differences, may include irrelevant non-edge regions, thus reducing its relevance to edge detection tasks. Therefore, we selected the PR curve and FOM as the most intuitive and relevant metrics to effectively highlight the performance of the proposed method, demonstrating its superior edge detection capability.
According to the data in Table 3, the edge maps detected by the SE algorithm show poor performance, with the lowest FOM value at 0.9027 and only 796,326 edge pixels detected, resulting in significant edge detail loss. The FOM values for the Color Sobel and Color Canny algorithms are roughly similar, and their detected edge quality is also comparable. The Color AGDD algorithm performs best on the low-frequency “Airplane” image, achieving an FOM value of 0.9867 and detecting 159,350 edge pixels. However, many of these detected edges are false positives. In contrast, the proposed algorithm achieves the highest FOM value of 0.9873, which is very close to the ground truth image. When compared to the SE algorithm, the proposed algorithm’s average FOM is 3.698% higher.

4.3. Analysis of the Experimental Results

When noise is introduced, the performance of all algorithms decreases to varying extents, with corresponding fluctuations in the Figure of Merit (FOM) values. Among the algorithms tested, the Color Sobel method is the least robust under high-intensity noise, yielding an average FOM value of 0.82676 and detecting 351,487 edge pixels. Other algorithms show some advantages depending on the specific dataset, but their FOM values remain relatively similar.
In contrast, the proposed method demonstrates a superior performance, particularly in the low-frequency space, where it achieves a remarkable FOM value of 0.9871 and detects 159,993 edge pixels. The average FOM value of 0.973 is 14.624% higher than that of the Color Sobel algorithm and 1.808% higher than the next-best performing method, Color AGDD. Further experimental results underscore the effectiveness of the proposed algorithm, with outstanding AUC values of 0.98622 and 0.98367, outperforming existing methods in two distinct test scenarios. The algorithm also achieves the highest peak signal-to-noise ratio (PSNR) of 60.5842 and the lowest mean squared error (MSE) of 0.0573, further validating its robustness. Finally, the FOM evaluation solidifies the proposed method’s superiority in terms of edge detection accuracy when compared to state-of-the-art techniques.

5. Conclusions

This paper introduces a novel color edge detection method that combines the CBM3D filter with multiscale gradient fusion. The method begins with image segmentation to create a sparse matrix, followed by high-frequency noise removal using 3D transformations and collaborative filtering. Edge maps are generated through anisotropic directional derivatives and multiscale gradient vectors in the XYZ color space, and averaged to produce an Edge Saliency Map. The final edge map is refined through normalization, non-maximum suppression, double thresholding, and morphological processing. Experimental results show that the proposed method outperforms existing algorithms, demonstrating its robustness and effectiveness. Future work will explore hybrid approaches combining deep learning and traditional techniques to improve accuracy, robustness, and efficiency, with applications in dynamic video edge detection and real-time processing.

Author Contributions

Conceptualization, Z.F. and R.S.; methodology, Z.F., R.S., Y.J. and Y.H.; software, Z.F. and R.S.; validation, Z.F., R.S. and Y.R.; resources, Y.R.; data curation, Z.M., Y.J. and Y.R.; writing—original draft preparation, Z.F., Y.J. and Y.H.; writing—review and editing, Z.F., Z.M. and Y.H.; supervision, Y.R.; project administration, Z.F., Y.J. and Y.R. All authors have read and agreed to the published version of the manuscript.

Funding

The authors received no financial support for the research, authorship, and publication of this article.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Data will be made available upon request.

Acknowledgments

The authors would like to thank the anonymous reviewers for their valuable suggestions on this study. At the same time, we would like to thank Ren for their help and Ma for their insightful comments and suggestions in the process of writing this article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Mittal, P. A comprehensive survey of deep learning-based lightweight object detection models for edge devices. Artif. Intell. Rev. 2024, 57, 242. [Google Scholar] [CrossRef]
  2. Wang, S.; Zhao, Y. A Novel Patch-Based Multi-Exposure Image Fusion Using Super-Pixel Segmentation. IEEE Access 2020, 8, 39034–39045. [Google Scholar] [CrossRef]
  3. Li, X.; Wang, W.; Wu, L.; Chen, S.; Hu, X.; Li, J.; Tang, J.; Yang, J. Generalized focal loss: Learning qualified and distributed bounding boxes for dense object detection. Adv. Neural Inf. Process. Syst. 2020, 33, 21002–21012. [Google Scholar]
  4. Li, W.; Zhang, W.; Liu, Y.; Liu, C.; Jing, R. Pixel-patch combination loss for refined edge detection. Int. J. Mach. Learn. Cyber. 2025, 16, 1341–1354. [Google Scholar] [CrossRef]
  5. Keerativittayanun, S.; Kondo, T.; Kotani, K.; Phatrapornnant, T.; Karnjana, J. Two-layer pyramid-based blending method for exposure fusion. Mach. Vis. Appl. 2021, 32, 48. [Google Scholar] [CrossRef]
  6. Nguyern, Q.; Hoang, N. Metaheuristic Optimized Edge Detection for Recognition of Concrete Wall Cracks: A Comparative Study on the Performances of Roberts, Prewitt, Canny, and Sobel Algorithms. Adv. Civ. Eng. 2018, 2018, 7163580. [Google Scholar]
  7. Yugander, P.; Tejaswini, C.H.; Meenakshi, J.; Kumar, K.S.; Varma, B.V.N.S.; Jagannath, M. MR Image Enhancement using Adaptive Weighted Mean Filtering and Homomorphic Filtering. Procedia Comput. Sci. 2020, 167, 677–685. [Google Scholar] [CrossRef]
  8. Huang, Q.; Huang, J. Comprehensive review of edge and contour detection: From traditional methods to recent advances. Neural Comput. Appl. 2025, 37, 2175–2209. [Google Scholar] [CrossRef]
  9. Arbelaez, P.; Maire, M.; Fowlkes, C.; Malik, J. Contour Detection and Hierarchical Image Segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2010, 33, 898–916. [Google Scholar] [CrossRef]
  10. Canny, J. A Computational Approach to Edge Detection. IEEE Trans. Pattern Anal. Mach. Intell. 1986, 6, 679–698. [Google Scholar] [CrossRef]
  11. Tian, L.; Qiu, K.; Zhao, Y.; Wang, P. Edge Detection of Motion-Blurred Images Aided by Inertial. Sensors 2023, 23, 7187. [Google Scholar] [CrossRef] [PubMed]
  12. Sun, Z.-W.; Hua, Z.-X.; Li, H.-C.; Zhong, H.-Y. Flying Bird Object Detection Algorithm in Surveillance Video Based on Motion Information. IEEE Trans. Instrum. Meas. 2023, 73, 5002515. [Google Scholar] [CrossRef]
  13. Kumar, S.V.; Kondaveeti, H.K. Bird species recognition using transfer learning with a hybrid hyperparameter optimization scheme (HHOS). Ecol. Inform. 2024, 80, 102510. [Google Scholar] [CrossRef]
  14. Han, Y.; Cai, Y.; Cao, Y.; Xu, X. A new image fusion performance metric based on visual information fidelity. Inf. Fusion 2013, 14, 127–135. [Google Scholar] [CrossRef]
  15. Dollár, P.; Zitnick, C.L. Fast Edge Detection Using Structured Forests. IEEE Trans. Pattern Anal. Mach. Intell. 2014, 37, 58–1570. [Google Scholar] [CrossRef]
  16. Wang, F.-P.; Shui, P.-L. Noise-Robust Color Edge Detector Using Gradient Matrix and Anisotropic Gaussian Directional Derivative Matrix. Pattern Recognit. 2016, 52, 346–357. [Google Scholar] [CrossRef]
  17. Zhu, J.; Jin, W.; Li, L.; Han, Z.; Wang, X. Multiscale infrared and visible image fusion using gradient domain guided image filtering. Infrared Phys. Technol. 2018, 89, 8–19. [Google Scholar] [CrossRef]
  18. Sara, U.; Akter, M.; Uddin, M.S. Image Quality Assessment Through FSIM, SSIM, MSE, and PSNR—A Comparative Study. J. Comput. Commun. 2019, 7, 8–18. [Google Scholar] [CrossRef]
  19. Maksimovic, V.; Jaksic, B.; Milosevic, M.; Todorovic, J.; Mosurovic, L. Comparative Analysis of Edge Detection Operators Using a Threshold Estimation Approach on Medical Noisy Images with Different Complexities. Sensors 2025, 25, 87. [Google Scholar] [CrossRef]
  20. Wang, C.M.; He, C.; Xu, M.F. Fast exposure fusion of detail enhancement for brightest and darkest regions. Vis. Comput. 2021, 37, 1233–1243. [Google Scholar] [CrossRef]
  21. Oksuz, K.; Cam, B.C.; Kalkan, S.; Akbas, E. Imbalance problems in object detection: A review. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 43, 3388–3415. [Google Scholar] [CrossRef] [PubMed]
  22. Jing, J.; Liu, S.; Wang, G.; Zhang, W.; Sun, C. Recent advances on image edge detection:A comprehensive review. Neurocomputing 2022, 503, 59–271. [Google Scholar] [CrossRef]
  23. Ulucan, O.; Karakaya, D.; Turkan, M. Multi-exposure image fusion based on linear embeddings and watershed masking. Signal Process. 2021, 178, 107791. [Google Scholar] [CrossRef]
  24. Everingham, M.; Van Gool, L.; Williams, C.K.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes (VOC) Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef]
  25. Li, S.; Shen, Y.; Wang, Y.; Zhang, J.; Li, H.; Zhang, D.; Li, H. Pidinet-tir: An improved edge detection algorithm for weakly textured thermal infrared images based on pidinet. Infrared Phys. Technol. 2024, 138, 105257. [Google Scholar] [CrossRef]
  26. Liu, Y.; Liu, S.; Wang, Z. A general framework for image fusion based on multiscale transform and sparse representation. Inf. Fusion 2015, 24, 147–164. [Google Scholar] [CrossRef]
  27. Huang, L.; Li, Z.; Xu, C.; Feng, B. Multi-exposure image fusion based on feature evaluation with adaptive factor. IET Image Process 2021, 15, 3211–3220. [Google Scholar] [CrossRef]
  28. Qi, G.; Chang, L.; Luo, Y.; Chen, Y.; Zhu, Z.; Wang, S. A Precise Multi-Exposure Image Fusion Method Based on Low-level Features. Sensors 2020, 20, 1597. [Google Scholar] [CrossRef]
  29. Li, H.; Xu, K. Innovative adaptive edge detection for noisy images using wavelet and Gaussian method. Sci. Rep. 2025, 15, 5838. [Google Scholar] [CrossRef]
  30. Maranga, J.O.; Nnko, J.J.; Xiong, S. Learned active contours via transformer-based deep convolutional neural network using canny edge detection algorithm. Signal Image Video Process. 2025, 19, 222. [Google Scholar] [CrossRef]
Figure 1. Four different color spaces and their corresponding edge detection.
Figure 1. Four different color spaces and their corresponding edge detection.
Sensors 25 02031 g001
Figure 2. Flowchart of the color image edge detection via multiscale gradient fusion.
Figure 2. Flowchart of the color image edge detection via multiscale gradient fusion.
Sensors 25 02031 g002
Figure 3. Different dataset images and their corresponding GT images.
Figure 3. Different dataset images and their corresponding GT images.
Sensors 25 02031 g003
Figure 4. Results of different algorithms without noise.
Figure 4. Results of different algorithms without noise.
Sensors 25 02031 g004
Figure 5. Results of different algorithms with a noise density of 0.01.
Figure 5. Results of different algorithms with a noise density of 0.01.
Sensors 25 02031 g005
Figure 6. PR curve without noise.
Figure 6. PR curve without noise.
Sensors 25 02031 g006
Figure 7. PR curve with a noise density of 0.01.
Figure 7. PR curve with a noise density of 0.01.
Sensors 25 02031 g007
Table 1. PSNR and MSE values of the algorithms without noise.
Table 1. PSNR and MSE values of the algorithms without noise.
PSNR/MSEImages
CarHouseAirmanAircraftLena
Color Sobel58.3943/0.094957.9004/0.106357.8936/0.106459.4183/0.074956.6504/0.1417
Color Canny57.7694/0.109557.3236/0.121458.4272/0.094159.7929/0.068756.5378/0.1454
SE58.0964/0.101655.8104/0.172057.7789/0.109358.4296/0.094155.4221/0.1880
Color AGDD59.3272/0.076557.6517/0.112558.5668/0.091259.7459/0.069657.5576/0.1150
Proposed59.7834/0.068958.0976/0.101659.0649/0.081360.5842/0.057357.6156/0.1135
Table 2. PSNR and MSE values of the algorithms with noise density of 0.01.
Table 2. PSNR and MSE values of the algorithms with noise density of 0.01.
PSNR/MSEImages
CarHouseAirmanAircraftLena
Color Sobel54.4199/0.236954.5217/0.231454.7027/0.221954.0975/0.255153.5959/0.2470
Color Canny56.4167/0.149656.6361/0.142257.5770/0.114558.2821/0.097355.7158/0.1445
SE58.7171/0.158456.1659/0.158457.8254/0.108156.5962/0.143555.0543/0.1443
Color AGDD57.8259/0.108157.6514/0.101458.9112/0.084258.3481/0.095957.2148/0.1435
Proposed59.1469/0.079858.0410/0.102959.1629/0.079560.2004/0.062657.4664/0.1174
Table 3. FOM values of the algorithms without noise.
Table 3. FOM values of the algorithms without noise.
ImagesCarHouseAirmanAircraftLena
Color Sobel0.9369/8457220.9774/8621130.9259/1396950.9835/1061300.9803/509976
Color Canny0.9264/8367600.9927/8459960.9407/1419950.9851/1275510.9805/588674
SE0.9321/8416220.9027/7963620.9324/1396140.9847/1584060.9447/566613
Color AGDD0.9600/8669150.9703/8558330.9424/1425010.9867/1590530.9803/593848
Proposed0.9660/8721630.9832/8672930.9541/1439700.9873/1606910.9827/607784
Table 4. FOM values of the algorithms with noise density of 0.01.
Table 4. FOM values of the algorithms with noise density of 0.01.
ImagesCarHouseAirmanAircraftLena
Color Sobel0.7885/7120080.8314/7332440.8048/1241600.9002/1423120.8089/457610
Color Canny0.8851/7995860.9353/8249100.9193/1387440.9487/1755790.9479/567214
SE0.9472/8552640.9137/8096000.9259/1397720.9484/1502290.9524/522938
Color AGDD0.9343/8437330.9254/8161800.9519/1436660.9509/1531380.9185/592720
Proposed0.9546/8617970.9814/8656150.9558/1442240.9871/1791330.9861/599494
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Feng, Z.; Shi, R.; Jiang, Y.; Han, Y.; Ma, Z.; Ren, Y. A Multiscale Gradient Fusion Method for Color Image Edge Detection Using CBM3D Filtering. Sensors 2025, 25, 2031. https://doi.org/10.3390/s25072031

AMA Style

Feng Z, Shi R, Jiang Y, Han Y, Ma Z, Ren Y. A Multiscale Gradient Fusion Method for Color Image Edge Detection Using CBM3D Filtering. Sensors. 2025; 25(7):2031. https://doi.org/10.3390/s25072031

Chicago/Turabian Style

Feng, Zhunruo, Ruomeng Shi, Yuhan Jiang, Yiming Han, Zeyang Ma, and Yuheng Ren. 2025. "A Multiscale Gradient Fusion Method for Color Image Edge Detection Using CBM3D Filtering" Sensors 25, no. 7: 2031. https://doi.org/10.3390/s25072031

APA Style

Feng, Z., Shi, R., Jiang, Y., Han, Y., Ma, Z., & Ren, Y. (2025). A Multiscale Gradient Fusion Method for Color Image Edge Detection Using CBM3D Filtering. Sensors, 25(7), 2031. https://doi.org/10.3390/s25072031

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop