Computers, Materials & Continua
DOI:10.32604/cmc.2023.032760
images

Article

Color Edge Detection Using Multidirectional Sobel Filter and Fuzzy Fusion

Slim Ben Chaabane1,2,* and Anas Bushnag1

1Computer Engineering Department, Faculty of Computers and Information Technology, University of Tabuk, Tabuk 47512, Saudi Arabia
2Electrical Engineering Department University of Tunis, CEREP, ENSIT 5 Av, Taha Hussein, 1008, Tunis, Tunisia
*Corresponding Author: Slim Ben Chaabane. Email: s.chaabane@ut.edu.sa
Received: 28 May 2022; Accepted: 30 June 2022

Abstract: A new model is proposed in this paper on color edge detection that uses the second derivative operators and data fusion mechanism. The second-order neighborhood shows the connection between the current pixel and the surroundings of this pixel. This connection is for each RGB component color of the input image. Once the image edges are detected for the three primary colors: red, green, and blue, these colors are merged using the combination rule. Then, the final decision is applied to obtain the segmentation. This process allows different data sources to be combined, which is essential to improve the image information quality and have an optimal image segmentation. Finally, the segmentation results of the proposed model are validated. Moreover, the classification accuracy of the tested data is assessed, and a comparison with other current models is conducted. The comparison results show that the proposed model outperforms the existing models in image segmentation.

Keywords: Segmentation; edge detection; second derivative operators; data fusion technique; fuzzy fusion; classification

1  Introduction

Image segmentation [1,2] is one of the primary challenges in image processing and computer vision [3,4]. In addition, many applications in different fields use image segmentation [5,6]. Therefore, several image segmentation techniques have been developed [7].

The main aim of the segmentation is to convert any given image into homogeneous regions [8,9] relevant to a specific application. Another aim is to detect edges in digital images where some areas have high-intensity contrasts or a massive difference in intensity between neighboring pixels, which could cause variation in image quality and segmentation.

Several image segmentation techniques, such as discontinuity, divide the image based on isolated points detection and abrupt change in grayscale [10,11]. Another technique is edge detection, a fundamental model that delivers information about the boundaries of different objects within the image [11]. Hence, selecting the proper technique is essential to reach the best segmentation results [12,13].

We focus on segmenting color images that use RGB color space in the proposed model. The main challenge is detecting the actual limits of a region with closed curves. Chaabane et al. [14] have proposed a model for combining statistical features of color edges using thresholding techniques. In the first phase, the counter of the image attribute for each of the three different primary colors is identified by a thresholding operation. Then, the three color components' edge results are integrated using fuzzy combination rules.

Having the objective as the previous paper, Zhuo et al. [15] have proposed a model that detects color edges based on CDEDA, which measures the color differences. In the first step, the authors use a color separation operation, which might provide information about the color difference. Then, the color separations are computed in all four directions for the pixel neighbors to detect the edges.

In [16], Sengupta et al. introduced the color space-based edge detection method (CSEDM), including a linear structural element. In the first phase, the image is transformed into red space. Then, the Sobel operator is applied to detect edges. Finally, the linear structuring elements are presented in the second phase, and hole filling is applied for suitable image segmentation. However, in [17], El-Sayed et al. exploited the Shannon entropy to achieve the process of edge detection and image segmentation. The authors introduced a new model based on multilevel thresholding and Shannon entropy. To successfully create a two-dimensional histogram, their model uses the gray value of the pixel and the average gray value of the entire image. Their proposed model's results show that it performs better in capturing moderate quality and execution time than existing models, especially regarding large-size images.

In [18], Wei-Chun et al. developed a quasi-high-pass filter for edge detection (QFEDM) that is used in medical images. The proposed kernel-based detector technique was compared to conventional edge detectors. The proposed operator significantly reduced the frequent problems with edge detection, including thinness loss, fragmentation, and position dislocation.

However, most of the current image edge detectors provide only candidates for the region's boundaries. The main reason is that they usually obtain color edges over-detected or discontinuous. On the other hand, edge detection using Sobel and data fusion does not require any before or after processing methods, which makes it a suitable solution for these disadvantages.

This work proposes a hybrid image segmentation technique using the new Sobel edge detection and data fusion technique. After determining the local strength of the maximum edge in all three RGB color components, the thresholding technique is implemented to find the optimal threshold automatically. This process will lead to the region boundaries of each color component. Eventually, once the edges are determined, the three primitive colors are fused using the combination rule and decision to get the final image segmentation.

The proposed model is discussed in Section 2. Section 3 shows the results and compares the proposed model to the existing techniques in the literature. Finally, Section 4 concludes the paper.

2  The Proposed Method

In color edge detection that uses RGB representation, the pixel has three color components: red, green, and blue. Since the correlation among these color components is high, It became suitable for color display but not for analysis and segmentation [2,6,15]. If the correlation is high, any intensity changes will change RBG components accordingly. In this context, color edge detection using the data fusion technique is an interesting method.

In this study, each RGB component has an edge detection based on a new Sobel edge detection. In addition, a thresholding mechanism is utilized to determine the region's boundaries for each component color to achieve this. The proposed method combines two segmentation techniques [19] to achieve a good consistency edge instead of developing a better-designed segmentation model.

Once the edge detection of each component color is calculated, the combination rule is used to achieve the final results of the segmentation. A flowchart depicting the proposed model is shown in Fig. 1.

Figure 1: The flowchart of the proposed technique

2.1 Compute of Local Maximum Edge Strengths

The edge strengths of each component color are specified using the connection between the current pixel and neighbors, as shown in Fig. 2a. To solve this issue, the second-order neighborhood describes each component color of the input image to be combined. For example, an edge overlaps with other neighboring pixels in one of the four representative patterns shown in Fig. 2b.

Figure 2: The four edge strengths. (a) The neighborhood of the current pixel  QUOTE (x,y) (b) The weight coefficients used to calculate the edge strengths

As shown in Fig. 2a, these edge strengths: ES1, ES2, ES3, and ES4 are computed using the weighted sum method of neighboring pixels, N(x,y) of the current pixel (x,y), with the coefficients given in Fig. 2b.

For each pixel, the edge patterns, as shown in Fig. 2b, present the edge strengths ES1, ES2, ES3, and ES4, which are calculated using the two-dimensional digital convolution matrices with coefficients (Wxy) as shown in Fig. 2b.

For a pixel p(x,y) at the location (x,y), edge strengths ES1, ES2, ES3 and ES4, are defined respectively as:

ES1(x,y)=I(x−1,y−1)+2I(x−1,y)+I(x−1,y+1)−I(x+1,y−1)+2I(x+1,y)−I(x+1,y+1)(1)

ES2(x,y)=I(x−1,y−1)−I(x−1,y+1)+2I(x,y−1)−2)+I(x+1,y−1)−I(x+1,y+1)(2)

ES3(x,y)=2I(x−1,y−1)−I(x−1,y)+I(x,y−1)−I(x,y+1)−I(x+1,y)−2I(x+1,y+1)(3)

ES4(x,y)=I(x−1,y)+2I(x−1,y+1)−I(x,y−1)+I(x,y+1)−2I(x+1,y−1)−I(x+1,y)(4)

where I(x,y) indicates the value of the pixel p(x,y) at the location (x,y) of one of the three component color R, G and B.

Fig. 3 shows the edge strengths performance based on image Cameraman. The local maximum edge strength of pixel p(x,y), LMES(x,y) is defined as the maximum of the four edge strengths:

Figure 3: Edge strengths performance based on image “Cameraman”, (a) Original image, (b) (c) (d) and (e) Edge strength induced by ES1, ES2,ES3 and ES4 respectively

LMES(x,y)=max{ES1(x,y), ES2(x,y), ES3(x,y), ES4(x,y)(5)

Given an optimal threshold T, the function ELMES of each component color classifies the pixel on the local maximum edge strength into two different classes: edge pixels vs. non edge pixels. The Two Stage Otsu Method (TSOM) technique, as discussed in the following section, automatically determines the optimal threshold T.

In practice, a pixel is identified as an edge pixel and set to 1 if the local maximum edge intensity of any of its three component colors is greater than the ideal threshold automatically established using the TSOM method. Otherwise, it is called a non-edge pixel and its value is set to 0.

2.2 Automatic Thresholding using a Two Stage Optimization Approach

The proposed model uses Otsu's two-stage multi-threshold method to select the best threshold for both models (unimodal and bimodal). In addition, the shortcomings of the Otsu method, such as the selection of multivalued thresholds, have been greatly improved. The general concept of the TSMO scheme is described in [20].

This technique is used to reduce significantly the iterations needed for computing the zeroth and first-order moments of a class. Therefore, we design two-stage thresholding technique to automatically classify the pixels into the predefined categories: edges and nonedges.

In the first stage, the histogram of the image with L gray levels is split into Mk groups which contain Nk gray levels.

Let Ω = {Ωj∖j=0,1,2,…Mk−1} denotes the groups of the total image space, where j represents the group number. Each group has different gray levels as follows:

{Ω0={0,1,2,…,Nk−1}Ω1={Nk,Nk+1,…,2Nk−1}……Ωq={qNk,qNk+1,…,(q+1)Nk−1}…ΩMk−1={(Mk−1)Nk,(Mk−1)Nk+1,…,MkNk−1}(6)

The zeroth-order cumulative moment in the qth group denoted by GΩq which represents the number of cumulative pixels, can be calculated as:

GΩq=∑i=q×Nk(q+1)×Nk−1fi(7)

where: fi represents the number of pixels with gray level i.

The first-order cumulative moment in the qth group denoted by iΩq can be calculated as:

iΩq=∑i=q×Nk(q+1)×Nk−1i.fi∑i=q×Nk(q+1)×Nk−1fi(8)

The optimal threshold j∗ is considered as the number of groups that maximizes the variance between the classes σB2. The optimal threshold j∗ is defined as:

j∗=argmax0≤j≤Mk−1(σB2(j))(9)

However, in our application we are interested to segment the input image into two classes: eye and non-eye classes. The image is divided into two classes C1 and C2 by Ωj∗, where the class C1 consists of the group from Ω0 to Ωj∗ and the class C2 contains the other groups with Ωj∗+1 to ΩMk−1.

The numbers of the cumulative pixels (W1,W2) and the means (μ1,μ2) for the two classes (C1,C2), respectively, are given by:

W1(j∗)=∑j=0j∗GΩj(10)

W2(j∗)=∑j=j∗+1Mk−1GΩj(11)

and

μ1=∑j=0j∗iΩj.GΩjW1=S1W1(12)

μ2=∑j=j∗+1Mk−1iΩj.GΩjW2=S2W2(13)

where S1=∑j=0j∗iΩj.GΩj and S2=∑j=j∗+1Mk−1iΩj.GΩj are the first-order cumulative moments for classes C1 and C2.

For a bi-level thresholding (M=2), the between-class variance maximal is defined as:

(σB2)max=∑k=1MWkμk2=W1μ12+W2μ22=S12W1+S22W2=S12W1+(ST−S1)2N−W1(14)

where M is the number of classes in an image, ST is the sum of S1 and S2 and N is the total number of pixels in an image. That is:

ST=S1+S2N=W1+W2(15)

At the second stage of multilevel thresholding technique, to determine the optimal threshold T, Otsu’s method is applied again to the group Ωj∗ with gray levels {j∗Nk,j∗Nk+1,…,(j∗+1)Nk−1} in which ((σB2)′j∗) has already been found at the first stage.

The optimal threshold T is defined as:

T=argmaxj∗Nk≤t≤(j∗+1)Nk−1((σB2)′(t))(16)

The ELMES function divides the pixels of the input image into two opposite classes: objects and background by using the optimal threshold that was automatically established by the two-stage Otsu optimization approach, as follows:

ELMES(x,y)={1edgepixelifLMES(x,y)≥T0nonedgepixelifLMES(x,y)<T(17)

Given the optimal thresholds for the three primary colors red, green, and blue (TR, TG and TB) respectively, the (ER, EG and EB) function classifies the pixels of the red, green, and blue components into two different classes: Edge and non-edge pixels, using:

ER(x,y)={1edgepixelifLMESR(x,y)≥TR0nonedgepixelifLMESR(x,y)<TR(18)

EG(x,y)={1edgepixelifLMESG(x,y)≥TG0nonedgepixelifLMESG(x,y)<TG(19)

EB(x,y)={1edgepixelifLMESB(x,y)≥TB0nonedgepixelifLMESB(x,y)<TB(20)

2.3 Color Edge Detection

Data fusion is a strategy for associating, correlating, and combining information from single and multiple sources in order to make exact decisions.

In color edge detection, the technology of multichannel data fusion could enhance the algorithm's validity. Hence, to produce a consistent and accurate color edge, the edge information from the three gradient images may be integrated using a data fusion technique. In this work, the joint edge is calculated using the following fuzzy rule:

ERG(x,y)={ER(x,y)∧EG(x,y)ifER(x,y)=EG(x,y)ER(x,y)∨EG(x,y)otherwise(21)

E(x,y)={ERG(x,y)∧EB(x,y)ifERG(x,y)=EB(x,y)ERG(x,y)∨EB(x,y)otherwise(22)

A pixel p(x,y) is therefore classified as either an edge pixel or a non-edge pixel. For edge pixels, they are classified by their tricolor component. For edge pixels, E(x,y) is set to 1. Otherwise, it is classified as a non-edge pixel and E(x,y) is set to 0.

3  Experimental Results and Discussion

In order to evaluate the proposed edge detection algorithm, 100 color synthetic images stored in RGB format are used. The RGB image represents the combination of Red, Green, and Blue primitive colors. Each of the three primitive colors uses 8 bits with integer values between 0 and 255.

Various segmentation results were presented to assess the efficiency and accuracy of the proposed method. In addition, the results are compared vs. existing methods including Prewitt, Canny, Sobel, CDEDA Method [9], CSEDM Method [10] and QFEDM Method [11]. The experiments are carried out on the MATLAB software 10. Example of synthetic images of size (100×100) pixels are shown in Fig. 4. First, we present the segmentation results obtained by applying the proposed method to the primitive colors red, green and blue, independently. Fig. 5 presents the segmentation result.

Figure 4: Samples of synthetic images

Figure 5: Edge detection results. (a) Original image of size (100×100×3) with integer values from 0 to 255, (b) Edge detection by the proposed algorithm applied to Red component, (c) Edge detection by the proposed algorithm applied to Green component, (d) Edge detection by the proposed algorithm applied to Blue component

Fig. 5a presents the original image. The segmentation results obtained by the proposed algorithm applied to Red, Green and Blue component are shown in Figs. 5b–5d, respectively. Nevertheless, the edges are well identified in one component and unrecognized in the others. This shows that the use of a single information source does not give good segmentation results, and this can be explained by the high degree of correlation between the three components of the RGB color space. Hence, the fusion process appears as interesting technique for color edge detection.

However, the new proposed algorithm is used to produce the estimates of the first derivative of an image by doing a convolution between the original image and the proposed special kernels, ES1,ES2,ES3 and ES4. The edge results are then combined using the fuzzy fusion rules. The edge results obtained by the proposed algorithm are compared with other existing techniques applied for edge detection, including Prewitt, Canny, Sobel Standard Operators [21].

The accuracy which represents the ratio of correct edge detection results over total edge detection results is calculated as:

Accuracy=TP+TNTP+TN+FP+FN(23)

where:

TP: True positives represent the pixels of the edge that are detected as edge.

TN: True negative represent the pixels of nonedge that are detected as nonedge.

FP: False positive represent the pixels of nonedge that are detected as edge.

FN: False negative represent the pixels of edge that are detected as nonedge.

The accuracy of the existing methods such as Prewitt, Canny, Sobel and the proposed algorithm is presented in Tab. 1. It can be seen from Tab. 1, the image 1 has a percentage of incorrectly segmented pixels equal to 8.75%, 8.02%, 7.94% and 3.29% which are obtained by Prewitt, Canny, Sobel operators and the proposed method, respectively. Experimental results show that the proposed edge algorithm is more accurate than existing techniques in terms of edge quality.

Also, compare the performance of the proposed method with other existing methods, including Sengupta et al. (CSEDM) [11], Zhuo et al. (CDEDA) [15], Chun et al. (QFEDM) [18]. Fig. 6 shows edge detection results.

Figure 6: Color edge detection results. (a) Original image of size (100×100×3) with integer values from 0 to 255, (b) Edge detection using CDEDA algorithm, (c) Edge detection using CSEDM algorithm, (d) Edge detection using QFEDM algorithm, (e) Edge detection using the proposed algorithm

Regarding the precision, Tab. 2 presents the precision of the different methods applied to the color synthetic images used in the experiment. Bhatt et al. [22] have used the precision criteria to assess the efficiency of the segmentation approach in the biomedical application [23]. In our application, the precision criteria is used to evaluate the proposed method applied to color synthetic images.

The precision is defined as:

precision=TPTP+FP(24)

From Tab. 2, we can see that the proposed edge detector can provide more potential edges compared to these other published techniques. Therefore, the results obtained show that the proposed edge technique using local maximum edge intensities in four different directions and fuzzy combination is more accurate in terms of accuracy and quality than existing methods.

4  Conclusion

This paper introduced a new color edge detection approach based on the fuzzy fusion and a new Sobel edge detection algorithm. The proposed method comprises two main phases. In the first phase, the local maximum edge strengths in four different directions and the automatic thresholding techniques are used to detect the edges of each component color. In the second phase, the fuzzy fusion rule is used to join the edge results for the three primitive color. The proposed method combines two segmentation techniques to achieve a good consistent edge.

The results show that the proposed technique can effectively detect edges and suppress the effect of noise on the results while maintaining edge consistency. The proposed approach has a lot of potential, according to extensive testing results. It's a good tool for detecting color edges.

Acknowledgement: The authors thank the faculty of computers and information Technology and he Industrial Innovation and Robotics Center, University of Tabuk for supporting the study.

Funding Statement: This research is supported by the faculty of computers and information Technology and the Industrial Innovation and Robotics Center, University of Tabuk.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.

References

 1.  S. Arumugadevi and V. Seenivasagam, “Color image segmentation using feedforward neural networks with FCM,” International Journal of Automation and Computing, vol. 13, no. 2, pp. 491–500, 2016.

 2.  P. J. Baldevbhai and R. S. Anand, “Color image segmentation for medical images using L*a*b* color space,” IOSR Journal of Electronics and Communication Engineering, vol. 1, no. 2, pp. 24–45, 2012.

 3.  D. Khafaga, A. Alhussan, E. M. Elkenawy, A. E. Takieldeen, T. M. Hassan et al., “Meta-heuristics for feature selection and classification in diagnostic breast cancer,” CMC-Computers, Materials and Continua, vol. 73, no. 1, pp. 749–765, 2022.

 4.  L. Li, X. Huang, S. Qian, Z. Li, S. Li et al., “Fuzzy hybrid coyote optimization algorithm for image thresholding,” CMC-Computers, Materials and Continua, vol. 72, no. 2, pp. 3073–3090, 2022.

 5.  A. S. Puri and S. Singh, “A hybrid agglomerative method for colour image segmentation,” Advances in Data and Information Sciences, vol. 1, no. 3, pp. 583–592, 2022.

 6.  S. B. chaabane, M. Sayadi and F. Fnaiech, “Color image segmentation using homogeneity method and data fusion techniques,” EURASIP Journal on Advances in Signal Processing, vol. 10, no. 6, pp. 1–11, 2010.

 7.  A. Sharma, D. Prashar, A. A. Khan, F. A. Khan and S. Poochaya, “Automatic leukaemia segmentation approach for blood cancer classification using microscopic images,” CMC-Computers, Materials and Continua, vol. 73, no. 2, pp. 3629–3648, 2022.

 8.  S. B. Chaabane, M. Sayadi, F. Fnaiech, E. Brassart and F. Betin, “A new method for the estimation of mass functions in the Dempster-Shafer’s evidence theory: application to color image segmentation,” Circuits, Systems, and Signal Processing, vol. 3, no. 11, pp. 55–71, 2011.

 9.  R. Harrabi and E. B. Braiek, “Color image segmentation using multi-level thresholding approach and data fusion techniques: Application in the breast cancer cells images,” EURASIP Journal on Image and Video Processing, vol. 12, no. 11, pp. 1–11, 2012.

10. S. Sengupta, N. Mittal and M. Modi, “Improved skin lesions detection using color space and artificial intelligence techniques,” Journal of Dermatological Treatment, vol. 5, no. 31, pp. 511–518, 2020.

11. S. Sengupta, N. Mittal and M. Modi, “Improved skin lesion edge detection method using ant colony optimization,” Skin Research and Technology, vol. 6, no. 25, pp. 846–856, 2019.

12. M. A. Masni and M. A. Antari, “Skin lesion segmentation in dermoscopy images via deep full resolution convolutional networks,” Computer Methods and Programs in Biomedicine, vol. 162, no. 8, pp. 221–231, 2018.

13. P. Sahni and N. Mittal, “Breast cancer detection using image processing techniques,” Oriental Journal of Computer Science and Technology, vol. 10, no. 2, pp. 391–399, 2019.

14. S. B. Chaabane and F. Fnaiech, “Color edges extraction using statistical features and automatic threshold technique: Application to the breast cancer cells,” BioMedical Engineering OnLine, vol. 13, no. 4, pp. 1–18, 2014.

15. L. Zhuo, X. Hu, L. Jiang and J. Zhang, “A color image edge detection algorithm based on color difference,” Sensing and Imaging Springer, vol. 17, no. 16, pp. 1–13, 2016.

16. S. Sengupta, N. Mittal and M. Modi, “Morphological transformation in color space based edge detection of skin lesion images,” Innovations in Cyber Physical Systems, vol. 21, no. 1, pp. 265–273, 2021.

17. M. A. ElSayed, A. Abdelmgeid, M. E. Hussien and H. A. Sennary, “A multi-level threshold method for edge detection and segmentation based on entropy,” CMC Computers, Materials and Continua, vol. 63, no. 1, pp. 1–16, 2020.

18. L. W. Chun and W. J. Wein, “Edge detection in medical images with quasi high-pass filter based on local statistics,” Biomedical Signal Processing and Control, vol. 39, no. 1, pp. 294–300, 2018.

19. X. R. Zhang, W. Z. Zhang, W. Sun, H. L. Wu and A. G. Song, “A real-time cutting model based on finite element and order reduction,” Computer Systems Science and Engineering, vol. 43, no. 1, pp. 1–15, 2022.

20. C. Huang and C. Wang, “Optimal multi-level thresholding using a two-stage Otsu optimization approach,” Pattern Recognition Letters, vol. 30, no. 3, pp. 275–284, 2009.

21. F. A. Ferhat, L. A. Mohamed, O. Kerdjidj, K. Messaoudi, A. Boudjelal et al., “Implementation of Sobel, Prewitt, Roberts edge detection on FPGA,” World Congress in Computer Science, Computer Engineering, and Applied Computing Las Vegas, Nevada, USA, vol. 13, no. 7, pp. 1–5, 2013.

22. A. R. Bhatt, A. Ganatra and K. Kotecha, “Cervical cancer detection in pap smear whole slide images using convNet with transfer learning and progressive resizing,” Peer Journal Computer Science, vol. 21, no. 7, pp. 1–18, 2021.

23. X. R. Zhang, H. L. Wu, W. Sun, A. G. Song and S. K. Jha, “A fast and accurate vascular tissue simulation model based on point primitive method,” Intelligent Automation & Soft Computing, vol. 27, no. 3, pp. 873–889, 2021.

images
This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.