# Edge Detection Method Based on General Type-2 Fuzzy Logic Applied to Color Images

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Fuzzy Logic Systems

#### 2.1. Definition of General Type-2 Fuzzy Sets

#### 2.2. General Type-2 Fuzzy Sets Representation

## 3. Edge Detection Process Based on the Gradient Approach

#### Gradient Approach Edge Detection Applied on Color Format Images

Pseudocode to calculate the gradients for each channel of a color format image $\left(f\right)$. | |

Input. The color format image $\left({f}_{r,c,d}\right)$ where $\left(r\right)$ is the rows size of the image, $\left(c\right)$ the columns size and $\left(d\right)$ the channel number; d = 1, 2, 3. | |

Output. The gradients $\left(D{1}_{d},D{2}_{d},D{3}_{d},andD{4}_{d}\right)$, the gradient magnitude $\left({G}_{d}\right)$ for each channel of the image (f), and the output edge (Edge). | |

1: | Calculate the $D{1}_{d},D{2}_{d},D{3}_{d},andD{4}_{d}$ for each $\left(d\right)$ channel to obtain $\left({G}_{d}\right)$ |

2: | for d = 1 to 3 |

3: | for x = 2 to $r-1$ |

4: | for y = 2 to $c-1$ |

5: | $D{1}_{d}=\sqrt{{\left(f\left(x,y\right)-f\left(x,y-1\right)\right)}^{2}+{\left(f\left(x,y\right)-f\left(x,y+1\right)\right)}^{2}}$ |

6: | $D{2}_{d}=\sqrt{{\left(f\left(x,y\right)-f\left(x-1,y\right)\right)}^{2}+{\left(f\left(x,y\right)-f\left(x+1,y\right)\right)}^{2}}$ |

7: | $D{3}_{d}=\sqrt{{\left(f\left(x,y\right)-f\left(x-1,y-1\right)\right)}^{2}+{\left(f\left(x,y\right)-f\left(x+1,y+1\right)\right)}^{2}}$ |

8: | $D{4}_{d}=\sqrt{{\left(f\left(x,y\right)-f\left(x+1,y-1\right)\right)}^{2}+{\left(f\left(x,y\right)-f\left(x-1,y+1\right)\right)}^{2}}$ |

9: | end |

10: | end |

11: | ${G}_{d}=D{1}_{d}+D{2}_{d}+D{3}_{d}+D{4}_{d}$ |

12: | Normalize the Gradient ${G}_{d}$ in values between {0, 1} |

13: | ${G}_{d}={G}_{d}-min\left(min\left({G}_{d}\right)\right)/max\left(max\left({G}_{d}\right)\right)-min\left(min\left({G}_{d}\right)\right)$, where min and max represent the maximum and minimum pixel value of ${G}_{d}$, respectively |

14: | end |

15: | Calculate the output edge (Edge) |

16: | $Edge={\sum}_{d=1}^{d=3}{G}_{d}$ |

## 4. Edge Detection Process Based on the Gradient Approach and GT2 FS

_{i})

_{i})

_{1}= high

_{2}= m

_{1}+ (m

_{1}*FOU), where FOU is in (0, 1)

## 5. Experimental Results

#### Fuzzy Edge Detection Method Applied on the Synthetic Color Images

## 6. Conclusions

## Author Contributions

## Conflicts of Interest

## References

- Torre, V.; Poggio, T.A. On Edge Detection. IEEE Trans. Pattern Anal. Mach. Intell.
**1986**, 8, 147–163. [Google Scholar] [CrossRef] [PubMed] - Koschan, A.; Abidi, M. Detection and classification of edges in color images. IEEE Signal Process. Mag.
**2005**, 22, 64–73. [Google Scholar] [CrossRef] - Bhardwaja, S.; Mittalb, A. A Survey on Various Edge Detector Techniques. Procedia Technol.
**2012**, 4, 220–226. [Google Scholar] [CrossRef] - Biswas, R.; Sil, J. An Improved Canny Edge Detection Algorithm Based on Type-2 Fuzzy Sets. Procedia Technol.
**2012**, 4, 820–824. [Google Scholar] [CrossRef] - Bustince, H.; Barrenechea, E.; Pagola, M.; Fernandez, J. Interval-valued fuzzy sets constructed from matrices: Application to edge detection. Fuzzy Sets Syst.
**2009**, 160, 1819–1840. [Google Scholar] [CrossRef] - Melin, P.; Gonzalez, C.I.; Castro, J.R.; Mendoza, O.; Castillo, O. Edge-Detection Method for Image Processing Based on Generalized Type-2 Fuzzy Logic. IEEE Trans. Fuzzy Syst.
**2014**, 22, 1515–1525. [Google Scholar] [CrossRef] - Melin, P.; Mendoza, O.; Castillo, O. An improved method for edge detection based on interval type-2 fuzzy logic. Expert Syst. Appl.
**2010**, 37, 8527–8535. [Google Scholar] [CrossRef] - Tao, C.; Thompson, W.; Taur, J. A fuzzy if-then approach to edge detection. In Proceedings of the Second IEEE International Conference on Fuzzy Systems, San Francisco, CA, USA, 28 March–1 April 1993; pp. 1356–1360. [Google Scholar]
- Gonzalez, C.I.; Melin, P.; Castro, J.R.; Mendoza, O.; Castillo, O. An improved sobel edge detection method based on generalized type-2 fuzzy logic. Soft Comput.
**2016**, 20, 773–784. [Google Scholar] [CrossRef] - Zadeh, L.A. Fuzzy Sets; Academic Press Inc.: Amsterdam, The Netherlands, 1965; Volume 8. [Google Scholar]
- Zadeh, L.A. The concept of a linguistic variable and its application to approximate reasoning—I. Inf. Sci.
**1975**, 8, 199–249. [Google Scholar] [CrossRef] - Schulte, S.; De Witte, V.; Kerre, E.E. A Fuzzy Noise Reduction Method for Color Images. IEEE Trans. Image Process.
**2007**, 16, 1425–1436. [Google Scholar] [CrossRef] [PubMed] - Yuksel, M.E.; Basturk, A. Application of Type-2 Fuzzy Logic Filtering to Reduce Noise in Color Images. IEEE Comput. Intell. Mag.
**2012**, 7, 25–35. [Google Scholar] [CrossRef] - Teruhisa, S.; Futoki, S.; Hiroshi, K.; Toshiaki, O. Application of an edge detection method to satellite images for distinguishing sea surface temperature fronts near the Japanese coast. Remote Sens. Environ.
**2005**, 98, 21–34. [Google Scholar] - El Baf, F.; Bouwmans, T.; Vachon, B. Type-2 Fuzzy Mixture of Gaussians Model: Application to Background Modeling. Int. Sympos. Vis. Comput.
**2008**, 2008, 772–781. [Google Scholar] - Guo, Y.; Ji, Y.; Zhang, J.; Gong, S.; Liu, C. Robust Dynamic Background Model with Adaptive Region Based on T2FS and GMM. In International Conference on Knowledge Science, Engineering and Management; Springer: Cham, Cambodia, 2015; Volume 9403, pp. 764–770. [Google Scholar]
- Zhao, Z.; Bouwmans, T.; Zhang, X.; Fang, Y. A Fuzzy Background Modeling Approach for Motion Detection in Dynamic Backgrounds. Multimed. Signal Process. Commun. Comput. Inf. Sci.
**2012**, 346, 177–185. [Google Scholar] - Karnik, N.N.; Mendel, J.M.; Liang, Q. Type-2 fuzzy logic systems. IEEE Trans. Fuzzy Syst.
**1999**, 7, 643–658. [Google Scholar] [CrossRef] - Liang, Q.; Mendel, J. Interval type-2 fuzzy logic systems: Theory and design. IEEE Trans. Fuzzy Syst.
**2000**, 8, 535–550. [Google Scholar] [CrossRef] - Mendel, J. Uncertain Rule-Based Fuzzy Logic Systems: Introduction and New Directions; Prentice-Hall: Upper-Saddle, NJ, USA, 2001. [Google Scholar]
- Mendel, J.M. Advances in type-2 fuzzy sets and systems. Inf. Sci.
**2007**, 177, 84–110. [Google Scholar] [CrossRef] - Hao, M.; Mendel, J.M. Similarity measures for general type-2 fuzzy sets based on the α-plane representation. Inf. Sci.
**2014**, 277, 197–215. [Google Scholar] [CrossRef] - Liu, F. An efficient centroid type-reduction strategy for general type-2 fuzzy logic system. Inf. Sci.
**2008**, 178, 2224–2236. [Google Scholar] [CrossRef] - Mendel, J.M. General Type-2 Fuzzy Logic Systems Made Simple: A Tutorial. IEEE Trans. Fuzzy Syst.
**2014**, 22, 1162–1182. [Google Scholar] [CrossRef] - Wagner, C.; Hagras, H. Toward general type-2 fuzzy logic systems based on zSlices. IEEE Trans. Fuzzy Syst.
**2010**, 18, 637–660. [Google Scholar] [CrossRef] - Wagner, C.; Hagras, H. Employing zSlices based general type-2 fuzzy sets to model multi level agreement. In Proceedings of the IEEE Symposium on Advances in Type-2 Fuzzy Logic Systems (T2FUZZ), Paris, France, 11–15 April 2011; pp. 50–57. [Google Scholar]
- Mendel, J.M.; Liu, F.; Zhai, D. α-Plane representation for type-2 fuzzy sets: Theory and applications. IEEE Trans. Fuzzy Syst.
**2009**, 17, 1189–1207. [Google Scholar] [CrossRef] - Mendel, J.M. Comments on alpha-plane representation for type-2 fuzzy sets: Theory and applications. IEEE Trans. Fuzzy Syst.
**2010**, 18, 229–230. [Google Scholar] [CrossRef] - Kirsch, R. Computer determination of the constituent structure of biological images. Comput. Biomed. Res.
**1971**, 4, 315–328. [Google Scholar] [CrossRef] - Sobel, I. Camera Models and Perception. Ph.D. Thesis, Stanford University, Stanford, CA, USA, 1970. [Google Scholar]
- Prewitt, J.M.S. Object Enhancement and Extraction; Lipkin, B.S., Rosenfeld, A., Eds.; Picture Analysis and Psychopictorics; Academic Press: New York, NY, USA, 1970; pp. 75–149. [Google Scholar]
- Canny, J. A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell.
**1986**, 8, 679–698. [Google Scholar] [CrossRef] [PubMed] - Gonzalez, R.C.; Woods, R.E.; Eddins, S.L. Digital Image Processing Using Matlab; Prentice Hall: Upper-Saddle, NJ, USA, 2004. [Google Scholar]
- Kulkarni, A.D. Computer Vision and Fuzzy Neural Systems; Prentice Hall: Upper-Saddle, NJ, USA, 2001. [Google Scholar]
- Pratt, W.K. Digital Image Processing, 2nd ed.; John Wiley & Sons, Inc.: New York, NY, USA, 1991. [Google Scholar]
- Abdou, I.A.; Pratt, W. Quantitative design and evaluation of enhancement/thresholding edge detectors. Proc. IEEE
**1979**, 67, 753–766. [Google Scholar] [CrossRef]

**Figure 4.**Output color edge detection based on the gradient approach. (

**a**) Input image; (

**b**) edge detection output.

**Figure 5.**GT2 input membership function for the variables $D{1}_{1},D{2}_{1},D{3}_{1},\mathrm{and}D{4}_{1}$.

Fuzzy Rules |
---|

1. If (RD1 is HIGH) or (RD2 is HIGH) or (RD3 is HIGH) or (RD4 is HIGH) then (GR is EDGE) 2. If (RD1 is MIDDLE) or (RD2 is MIDDLE) or (RD3 is MIDDLE) or (RD4 is MIDDLE) then (GR is EDGE) 3. If (RD1 is LOW) and (RD2 is LOW) and (RD3 is LOW) and (RD4 is LOW) then (GR is BACKGROUND) 4. If (GD1 is HIGH) or (GD2 is HIGH) or (GD3 is HIGH) or (GD4 is HIGH) then (GG is EDGE) 5. If (GD1 is MIDDLE) or (GD2 is MIDDLE) or (GD3 is MIDDLE) or (GD4 is MIDDLE) then (GG is EDGE) 6. If (GD1 is LOW) and (GD2 is LOW) and (GD3 is LOW) and (GD4 is LOW) then (GG is BACKGROUND) 7. If (BD1 is HIGH) or (BD2 is HIGH) or (BD3 is HIGH) or (BD4 is HIGH) then (GB is EDGE) 8. If (BD1 is MIDDLE) or (BD2 is MIDDLE) or (BD3 is MIDDLE) or (BD4 is MIDDLE) then (GB is EDGE) 9. If (BD1 is LOW) and (BD2 is LOW) and (BD3 is LOW) and (BD4 is LOW) then (GB is BACKGROUND) |

Image Number | Synthetic Images | Reference Images | Resolution |
---|---|---|---|

1 | Type of file: PNG file | ||

Width: 420 pixels | |||

Height: 182 pixels | |||

2 | Type of file: PNG file | ||

Width: 143 pixels | |||

Height: 241 pixels | |||

3 | Type of file: PNG file | ||

Width: 219 pixels | |||

Height: 219 pixels | |||

4 | Type of file: PNG file | ||

Width: 307 pixels | |||

Height: 183 pixels | |||

5 | PNG file | ||

Width: 310 pixels | |||

Height: 207 pixels |

Image Number | T1 FSs Edge Detection | ||
---|---|---|---|

FOM | |||

Lab | HSV | RGB | |

1 | 0.9430 | 0.9380 | 0.9393 |

2 | 0.9504 | 0.9372 | 0.9478 |

3 | 0.9485 | 0.9403 | 0.9464 |

4 | 0.9493 | 0.9453 | 0.9491 |

5 | 0.9428 | 0.9353 | 0.9415 |

Mean | 0.9468 | 0.9392 | 0.9448 |

Image Number | IT2 FSs Edge Detection | ||
---|---|---|---|

FOM | |||

Lab | HSV | RGB | |

1 | 0.9437 | 0.9401 | 0.9401 |

2 | 0.9510 | 0.9478 | 0.9479 |

3 | 0.9491 | 0.9464 | 0.9470 |

4 | 0.9496 | 0.9491 | 0.9493 |

5 | 0.9430 | 0.9415 | 0.9417 |

Mean | 0.9473 | 0.9450 | 0.9452 |

Image Number | GT2 FSs Edge Detection | ||
---|---|---|---|

FOM | |||

Lab | HSV | RGB | |

1 | 0.9457 | 0.9416 | 0.9416 |

2 | 0.9523 | 0.9481 | 0.9481 |

3 | 0.9497 | 0.9472 | 0.9473 |

4 | 0.9503 | 0.9497 | 0.9497 |

5 | 0.9434 | 0.9419 | 0.9420 |

Mean | 0.9483 | 0.9457 | 0.9457 |

**Table 6.**Results achieved by T1FSs, IT2FSs, and GT2FSs edge detectors applied on Lab, HSV, and RGB format color images.

Fuzzy Edge Detector | FOM | ||
---|---|---|---|

Lab | HSV | RGB | |

T1 FSs | 0.9468 | 0.9392 | 0.9448 |

IT2 FSs | 0.9473 | 0.9450 | 0.9452 |

GT2 FSs | 0.9483 | 0.9457 | 0.9457 |

Canny | 0.8113 | 0.9264 | 0.8021 |

Sobel | 0.5343 | 0.4762 | 0.4396 |

T1 FSs | ||||
---|---|---|---|---|

Color Format | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

Lab | 0.8494 | 0.9489 | 0.9485 | 0.8972 |

HSV | 0.9367 | 0.9393 | 0.9392 | 0.9391 |

RGB | 0.8844 | 0.9461 | 0.9458 | 0.9457 |

IT2 FSs | ||||
---|---|---|---|---|

Color Format | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

Lab | 0.8597 | 0.9492 | 0.9485 | 0.9483 |

HSV | 0.9385 | 0.9394 | 0.9393 | 0.9393 |

RGB | 0.9081 | 0.9466 | 0.9458 | 0.9456 |

GT2 FSs | ||||
---|---|---|---|---|

Color Format | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

Lab | 0.8600 | 0.9496 | 0.9491 | 0.9489 |

HSV | 0.9392 | 0.9395 | 0.9393 | 0.9392 |

RGB | 0.9158 | 0.9563 | 0.9470 | 0.9460 |

**Table 10.**T1, IT2, and GT2 FS edge detection applied on Lab color format images with Gaussian noise.

Lab | ||||
---|---|---|---|---|

Fuzzy Edge Detection | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

T1 FSs | 0.8494 | 0.9489 | 0.9485 | 0.8972 |

IT2 FSs | 0.8597 | 0.9492 | 0.9485 | 0.9483 |

GT2 FSs | 0.8600 | 0.9496 | 0.9491 | 0.9489 |

Canny | 0.8306 | 0.8126 | 0.8113 | 0.8110 |

Sobel | 0.4824 | 0.4824 | 0.4824 | 0.4824 |

**Table 11.**T1, IT2, and GT2 FS edge detection applied on HSV color format images with Gaussian noise.

HSV | ||||
---|---|---|---|---|

Fuzzy Edge Detection | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

T1 FSs | 0.9367 | 0.9393 | 0.9392 | 0.9391 |

IT2 FSs | 0.9385 | 0.9394 | 0.9393 | 0.9393 |

GT2 FSs | 0.9392 | 0.9395 | 0.9393 | 0.9392 |

Canny | 0.8175 | 0.9261 | 0.9264 | 0.9264 |

Sobel | 0.4762 | 0.4762 | 0.4762 | 0.4762 |

**Table 12.**T1, IT2, and GT2 FS edge detection applied on RGB color format images with Gaussian noise.

RGB | ||||
---|---|---|---|---|

Fuzzy Edge Detection | FOM | |||

20 dBi | 30 dBi | 40 dBi | 50 dBi | |

T1 FSs | 0.8844 | 0.9461 | 0.9458 | 0.9457 |

IT2 FSs | 0.9081 | 0.9466 | 0.9458 | 0.9456 |

GT2 FSs | 0.9158 | 0.9563 | 0.9470 | 0.9460 |

Canny | 0.8302 | 0.8230 | 0.8220 | 0.8212 |

Sobel | 0.5343 | 0.5343 | 0.5343 | 0.5343 |

T1 FSs | IT2 FSs | GT2 FSs |
---|---|---|

© 2017 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Gonzalez, C.I.; Melin, P.; Castillo, O.
Edge Detection Method Based on General Type-2 Fuzzy Logic Applied to Color Images. *Information* **2017**, *8*, 104.
https://doi.org/10.3390/info8030104

**AMA Style**

Gonzalez CI, Melin P, Castillo O.
Edge Detection Method Based on General Type-2 Fuzzy Logic Applied to Color Images. *Information*. 2017; 8(3):104.
https://doi.org/10.3390/info8030104

**Chicago/Turabian Style**

Gonzalez, Claudia I., Patricia Melin, and Oscar Castillo.
2017. "Edge Detection Method Based on General Type-2 Fuzzy Logic Applied to Color Images" *Information* 8, no. 3: 104.
https://doi.org/10.3390/info8030104