<?xml version="1.0" encoding="UTF-8"?>
<article xmlns:xlink="http://www.w3.org/1999/xlink">
<front><article-meta>
<title-group><article-title>Some Matlab Applications of Distance and Similarity Measures for Fuzzy Sets</article-title></title-group>
<contrib-group>
<contrib contrib-type="author"><name><surname>Gülle</surname><given-names>Esra</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<contrib contrib-type="author"><name><surname>Kaya</surname><given-names>Özge</given-names></name><xref ref-type="aff" rid="aff1"/></contrib>
<aff id="aff1">Department of Mathematics, Faculty of Science and Literature, Afyon Kocatepe University, Afyonkarahisar, Turkey.</aff>
</contrib-group>
<abstract><p>The aim of this study is to compare the similarity ratios between the Sobel, Prewitt, Laplacian, Canny and Robert-Cross edge detection filters, which are frequently used in edge detection, and the fuzzy edge detection filter obtained using fuzzy logic with the help of Hamming, Euclidean and Minkowski distance measures in Matlab.</p></abstract>
<kwd-group kwd-group-type="author"><kwd>Fuzzy set</kwd><kwd>Fuzzy distance measures</kwd><kwd>Fuzzy similarity measures</kwd><kwd>Matlab</kwd></kwd-group>
</article-meta></front>
<body>
<sec id="sec-1"><label>1</label><title>Introduction</title>
<p>In classical (Aristotelian) logic, which is a system of logic with two truth values, the classical concept of set is based on whether an object is an element of that set or not. There can never be partial membership. If the membership value of the object is 1, it is an element of the set, and if it is 0, it is not an element. The transition between linguistic concepts frequently used in daily life is not as sharp as in classical logic, so classical logic is not suitable for describing these expressions numerically. However, with fuzzy logic, these words can be easily defined without the need for much additional information and can be more accurately characterised by fuzzy sets.</p>
<p>The basic definitions of fuzzy logic and fuzzy set theory, which is an extension of multivalued logic and uses the rules of classical logic, were introduced by Zadeh in <xref ref-type="bibr" rid="ref-1">[1]</xref>. Subsequently, fuzzy logic has provided a new dimension for dealing with uncertain systems and has enabled many studies in numerous fields <xref ref-type="bibr" rid="ref-2">[2]</xref>–<xref ref-type="bibr" rid="ref-4">[4]</xref>. A fuzzy set A in a non-empty set X is characterised by a mapping</p>
<p>uA: X → [0,1], where uA is called membership function and uA(x) is called degree of membership of the element x. That is, a fuzzy set A is shown as A = {(x, uA(x)): x ∈ X and uA(x) ∈ [0,1]}.</p>
<p>Throughout the paper, FX is regarded as the class of all fuzzy sets of X and A is regarded as the complement of the fuzzy set A.</p>
<p>Image filtering, a technique used in image processing, is used to reduce noise in the image, sharpen edges, sharpen the image and obtain a clearer image. Image filters are usually expressed as a matrix or kernel. Edge detection filters, which have become the most active area of image processing in recent years, are image filters used to detect edges (i.e., points where two regions with different pixel values meet) in an image. These filters work by calculating the difference between a pixel and other pixels around it.</p>
<p>Edge detection operators are generally divided into two. The first one is the gradient-based edge operators using first order derivatives, such as Sobel, Prewitt and Robert operators. The other one is the edge operators using second order derivative based methods and Laplacian can be given as an example.</p>
<p>Sobel edge detection: The edges in this technique are found using 3 × 3 neighbourhood image filter. Prewitt edge detection: The edge detection in this technique is estimated using simplified 3 × 3 neighbourhood image filter.</p>
<p>Roberts-Cross edge detection: In this type of edge detection technique, the image filter is a 2 × 2 image gradient measurement applied on the image matrix.</p>
<p>Canny edge detection: In this technique, an objective function to be optimized is developed. The solution to this problem is an exponential function, which could be approximated and optimizes the edge.</p>
<p>Laplacian edge detection: In this type of edge detection technique, the image filter is a 3 × 3 Laplacian core matrix applied on the image filter.</p>
<p>The use of fuzzy logic in image edge detection techniques has an important place in the literature. When fuzzy logic is used for edge detection, softer, blurred edges can be obtained instead of sharp edges.</p>
<p>Fuzzy edge detection: In this type of edge detection technique, general steps are summarized as follows: 1) the input image is blurred using a blurring process, 2) gradient is calculated on the blurred image, and 3) thresholding is used to sharpen the edges and suppress transitions to the background.</p>
<p>Readers interested in edge detection can check out <xref ref-type="bibr" rid="ref-5">[5]</xref>–<xref ref-type="bibr" rid="ref-7">[7]</xref> articles for more information.</p>
<p>Xuecheng <xref ref-type="bibr" rid="ref-8">[8]</xref> introduced the basic axioms of distance and similarity measures and analysed the relationship between these measures with examples. Then, many researchers <xref ref-type="bibr" rid="ref-9">[9]</xref>–<xref ref-type="bibr" rid="ref-13">[13]</xref> have generalised distance and similarity measures using the concept of fuzzy logic. The distance measure of two fuzzy sets is a measure that describes the difference between the fuzzy sets. Also, the similarity measure of two fuzzy sets shows the similarity between the fuzzy sets. The higher value of similarity measure indicates that the images using two of the edge detection techniques are similar.</p>
<p>A function d ∶ FX × FX → ℝ is said to be a distance function if the following properties are satisfying:</p>
<p>I. d(A, B) = d(B, A), for all A, B ∈ FX.</p>
<p>II. d(A, A) = O, for all A ∈ FX.</p>
<p>III. d(D, D ) = maxA,B∈F d(A, B) for all D ∈ X (The power set).</p>
<p>IV. If A ⊂ B ⊂ C, then d(A, B) ≤ d(A, C) and d(B, C) ≤ d(A,C) for all A, B, C ∈ FX.</p>
<p>The Hamming distance, used for discrete data such as binary values, calculates the number of different positions of the corresponding symbols. It is shown as follows:</p>
<p>d(x, y) = ∑(xi ≠ yi).</p>
<p>The Euclidean distance is used to compare features of images and identify similar images. It is shown as follows:</p>
<p>( ) √ ( )2 d x, y = ∑ xi − yi .</p>
<p>The Minkowski distance, is a generalization of the Euclidean distance, compare two images by measuring the similarity of their pixel values. It is shown as follows:</p>
<p>p p p p</p>
<p>d(x, y) = (|x1 − y1| + |x2 − y2| + ⋯ + |xn − yn| ) .</p>
<p>A function S ∶ FX × FX → ℝ is said to be a similarity function if the following properties are satisfying:</p>
<p>I. S(A, B) = S(B, A) for all A, B ∈ FX.</p>
<p>II. S(A, A ) = O for all A ∈ X.</p>
<p>III. S(C, C ) = maxA,B∈F S(A, B) for all C ∈ FX.</p>
<p>IV. If A ⊂ B ⊂ C, then S(A, B) ≥ S(A, C) and S(B, C) ≥ S(A, C) for all A, B, C ∈ FX.</p>
</sec>
<sec id="sec-2"><label>2</label><title>Experimental Results</title>
<p>In this section, we compare the similarities for image comparison. To do this, for an image, Sobel, Prewitt, Laplacian, Canny, Robert Cross edge detection filters and fuzzy edge detection filter are used. We compare the similarity ratios of these with the help of Hamming, Euclidean and Minkowski distance measures. The chosen original image and the images obtained after using edge detection filters are given below:</p>
<fig id="fig1"><label>Figure 1</label><caption><p>Original image.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-1-4a00f4f7ac3f.jpg"/></fig>
<fig id="fig2"><label>Figure 2</label><caption><p>Result obtained by Sobel method.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-2-521bba3af5ea.jpg"/></fig>
<fig id="fig3"><label>Figure 3</label><caption><p>Result obtained by Prewitt method.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-3-10253fc3c0ad.jpg"/></fig>
<fig id="fig4"><label>Figure 4</label><caption><p>Result obtained by Laplacian method.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-4-53216197461d.jpg"/></fig>
<fig id="fig5"><label>Figure 5</label><caption><p>Result obtained by Canny method.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-5-4f7e054b4e4b.png"/></fig>
<fig id="fig6"><label>Figure 6</label><caption><p>Result obtained by Robert Cross method.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-6-55f94bdcb354.png"/></fig>
<fig id="fig7"><label>Figure 7</label><caption><p>Result obtained by fuzzy edge operator.</p></caption><graphic xlink:href="https://scfa.reapress.com/public/journals/1/jats-figures/32/fig-7-7af2a34dbfab.png"/></fig>
<table-wrap id="tab1"><label>Table 1</label><caption><p>The similarity function was applied to the Hamming, Euclidean and Minkowski distances.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:4:66,616.2,537.1,752.8"/><p content-type="note">This table is shown in the PDF version of the article.</p></table-wrap>
<table-wrap id="tab2"><label>Table 2</label><caption><p>The similarity function was applied to the Hamming, Euclidean and Minkowski distances.</p></caption><graphic content-type="pdf-region" xlink:href="pdf-region:4:66,511.1,537.1,621.4"/><p content-type="note">This table is shown in the PDF version of the article.</p></table-wrap>
</sec>
<sec id="sec-3"><label>3</label><title>Conclusion</title>
<p>This study confirms that fuzzy edge detection filters are an effective approach in image processing. In fuzzy edge detection, the detection of edges in the image has shown successful results. While traditional edge detection techniques can detect sharp edges well, they cannot extract noisy and irregular edges properly. Therefore, fuzzy edge detection methods better handle objects and edges with more complex image structure.Also, in the first table, according to the Hamming distance, the similarity ratio between the Canny and fuzy methods is the highest. The similarity ratio determined according to Euclidean and Minkowski distances is the highest value between the Robert Cross and fuzzy methods.</p>
<p>In the second table, according to Hamming and Euclidean distances, the similarity ratio between the Laplacian and fuzzy methods is the highest. The similarity ratio determined according to Minkowski distance is the highest value between the Sobel and fuzzy methods.</p>
</sec>
<sec id="sec-4"><title>Author Contributaion</title>
<p>Conceptualization, E.G. and Ö.K.; Methodology, E.G. and Ö.K.; Validation, E.G. and Ö.K.; formal analysis, E.G.; investigation, Ö.K.; resources, Ö.K.; data maintenance, Ö.K.; writing-creating the initial design, E.G.; writing-reviewing and editing, E.G. All authors have read and agreed to the published version of the manuscript. Authorship must be limited to those who have made a significant contribution to the work reported.</p>
</sec>
<sec id="sec-5"><title>Funding</title>
<p>No funds, grants, or other support was received.</p>
</sec>
<sec id="sec-6"><title>Data Availability</title>
<p>Data sharing is not applicable to this article as no new data were created or analyzed in this study.</p>
</sec>
<sec id="sec-7"><title>Conflicts of Interest</title>
<p>The authors declare no conflict of interest.</p>
</sec>
</body>
<back><ref-list><title>References</title>
<ref id="ref-1"><label>1</label><mixed-citation>Zadeh, L. A. (1965). Fuzzy sets. Information and control, 8(3), 338–353. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/S0019-9958(65)90241-X">https://doi.org/10.1016/S0019-9958(65)90241-X</ext-link></mixed-citation></ref>
<ref id="ref-2"><label>2</label><mixed-citation>Atanassov, K.T. (1999). Intuitionistic fuzzy sets. Physica, Heidelberg. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1007/978-3-7908-1870-3_1">https://doi.org/10.1007/978-3-7908-1870-3_1</ext-link></mixed-citation></ref>
<ref id="ref-3"><label>3</label><mixed-citation>Goguen, J. A. (1967). L-fuzzy sets. Journal of mathematical analysis and applications, 18(1), 145–174. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/0022-247X(67)90189-8">https://doi.org/10.1016/0022-247X(67)90189-8</ext-link></mixed-citation></ref>
<ref id="ref-4"><label>4</label><mixed-citation>Pang, B. (2014). On (L, M)-fuzzy convergence spaces. Fuzzy sets and systems, 238, 46–70. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.fss.2013.07.007">https://doi.org/10.1016/j.fss.2013.07.007</ext-link></mixed-citation></ref>
<ref id="ref-5"><label>5</label><mixed-citation>Aborisade, D. O. (2010). Fuzzy logic based digital image edge detection. Global journal of computer science and technology, 10(14), 78–83. <ext-link ext-link-type="uri" xlink:href="https://computerresearch.org/index.php/computer/article/view/657">https://computerresearch.org/index.php/computer/article/view/657</ext-link></mixed-citation></ref>
<ref id="ref-6"><label>6</label><mixed-citation>Kushwaha, N. (2012). Edge detection using fuzzy logic in Matlab. International journal of advanced research in computer science and software engineering, 2(4), 38–40. <ext-link ext-link-type="uri" xlink:href="https://B2n.ir/ps1974">https://B2n.ir/ps1974</ext-link></mixed-citation></ref>
<ref id="ref-7"><label>7</label><mixed-citation>Muhammad Rizky Alditra Utama, K., Umar, R., &amp; Yuhdana, A. (2022). Edge detection comparative analysis using Roberts, Sobel, Prewitt, and Canny methods. Jurnal teknologi dan sistem komputer, 10(2), 67–71. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.14710/jtsiskom.2021.14209">https://doi.org/10.14710/jtsiskom.2021.14209</ext-link></mixed-citation></ref>
<ref id="ref-8"><label>8</label><mixed-citation>Xuecheng, L. (1994). Entropy, distance measure and similarity measure of fuzzy sets and their relations. Fuzzy sets and systems, 62(3), 377. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/0165-0114(94)90124-4">https://doi.org/10.1016/0165-0114(94)90124-4</ext-link></mixed-citation></ref>
<ref id="ref-9"><label>9</label><mixed-citation>Liu, H. W. (2005). New similarity measures between intuitionistic fuzzy sets and between elements. Mathematical and computer modelling, 42(1–2), 61–70. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/j.mcm.2005.04.002">https://doi.org/10.1016/j.mcm.2005.04.002</ext-link></mixed-citation></ref>
<ref id="ref-10"><label>10</label><mixed-citation>Setnes, M., Babuška, R., Kaymak, U., &amp; Van Nauta Lemke, H. R. (1998). Similarity measures in fuzzy rule base simplification. IEEE transactions on systems, man, and cybernetics, part b: Cybernetics, 28(3), 376–386. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1109/3477.678632">https://doi.org/10.1109/3477.678632</ext-link></mixed-citation></ref>
<ref id="ref-11"><label>11</label><mixed-citation>Omran, S., &amp; Hassaballah, M. (2006). A new class of similarity measures for fuzzy sets. International journal of fuzzy logic and intelligent systems, 6(2), 100–104. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.5391/IJFIS.2006.6.2.100">https://doi.org/10.5391/IJFIS.2006.6.2.100</ext-link></mixed-citation></ref>
<ref id="ref-12"><label>12</label><mixed-citation>Chen, S. M., Yeh, M. S., &amp; Hsiao, P. Y. (1995). A comparison of similarity measures of fuzzy values. Fuzzy sets and systems, 72(1), 79–89. <ext-link ext-link-type="uri" xlink:href="https://doi.org/10.1016/0165-0114(94)00284-E">https://doi.org/10.1016/0165-0114(94)00284-E</ext-link></mixed-citation></ref>
<ref id="ref-13"><label>13</label><mixed-citation>Beg, I., &amp; Ashraf, S. (2009). Similarity measures for fuzzy sets. Applied and computational mathematics, 8(2), 192–202. <ext-link ext-link-type="uri" xlink:href="https://www.researchgate.net/publication/228744370">https://www.researchgate.net/publication/228744370</ext-link></mixed-citation></ref>
</ref-list></back>
</article>