Applications of the Fuzzy Metrics in Image Denoising and Segmentation

: In this paper, the problem of removing the image noise in color ( RGB ) images is addressed as well as the problem of the image segmentation. A new filter is created on the basis of the new fuzzy metric composed of two other fuzzy metrics with necessary characteristics for quality noise elimination in the image. In addition, the algorithm applied for image segmentation also uses the fuzzy metric, created of two other metrics that have the necessary characteristics for high-quality pixels segmentation, in the stage of deciding into which segment the pixel belongs. For this purpose, the concepts of fuzzy T -metrics and fuzzy S -metrics are presented, as well as numerous examples of fuzzy metrics used in applications. Also, the procedure for constructing new fuzzy metrics is introduced. Compared with the results obtained with the use of a VMF (vector median filter) the proposed method process is of higher sharpness level. Tests also showed better segmentation values using the fuzzy metric instead of the standard metric in the FCM algorithm.


INTRODUCTION
In many applications in various science fields, color image processing has paramount importance. Various approaches have been proposed in order to improve the image quality especially through improving image sharpness and edge reconstruction accuracies. The choice of a specific approach depends on the context and purpose.
Fuzzy metric and fuzzy filtering have been used successfully in many engineering problems [2], [17]. Valentin et al. [9] constructed a fuzzy metric that at the same time looks at two different distance criteria and used it to filter noise in images. In paper [8] Gregori et al. propose a method that uses a filter named CFAF which reduces noise by means of a fuzzy averaging with additional step correction to resolve the robustness of the averaging. Ralevic et al. [20] introduced a type of fuzzy Tmetric which was applied in constructing an image filtering algorithm and showed good results in removing the image noise.
VMF (vector median filter) is probably the most commonly used vector filter. Our approach is designed for similar purposes as VMF, to calculate the difference among color pixel values and thus estimate the missing color component. A new filter is proposed on the basis of a recently introduced algorithm for removing the image noise presented in [20]. We created the new filter based on a novel fuzzy metric by combining the mentioned algorithm and novel fuzzy T-metrics created from two different fuzzy metrics. In the proposed procedure it is very important to choose a good criterion by which to replace noisy pixels with pixels without noise, which is precisely the choice of the right T-metric plays the most important role.
The rest of the paper is organized as follows: the concept of fuzzy S-metric and T-metric definitions and examples, which we need for further work, is introduced in Section 2. A property that provides the procedure for generating a new T-metric from several T-metrics in regard to the same norm is shown. In parallel, the same statements for the fuzzy S-metric are given. In Section 3, we describe the proposed algorithm for image filtering. For removing noise in the image, in order to decide which pixel should replace the noisy pixel, a new distance function (fuzzy metric) is used. The proposed algorithm is implemented using MATLAB tool and presented with obtained results and the related discussion. In Section 4, the Fuzzy C-means (FCM) image segmentation algorithm is presented. The distance for determining the pixels belonging to a particular segment is the fuzzy metric obtained by a method given in Section 2 of two fuzzy metrics. An FCM algorithm that uses a fuzzy metric for distance has shown better results than an algorithm that uses a standard (Euclidean) metric, which is shown in the concrete example. Finally, the main conclusions are given.

FUZZY METRICS
The methods that we present for image noise removal and image segmentation require defining new distancesfuzzy T-metric and fuzzy S-metric (see [9,10,20]), as well as providing examples that we use and an algorithm for constructing new fuzzy metrics, which are shown in this section. Definition 1. [12] The triangular norm, shorter t-norm (triangular conorm, shorter t-conorm) is a binary operation T: [0, 1] 2 → [0, 1] (S: [0, 1] 2 → [0, 1]) which satisfies: monotonicity, commutativity, associativity and neutral element is 1 (0). Definition 2. [12] The continuous non-increasing function c: such that X is a nonempty set, T(S) is a continuous t-norm (t-conorm) and t(s) is a fuzzy set defined on X × X × (0, +∞) that satisfies the following conditions for all , , , , 0 : is a continuous function.
The fuzzy set t (s) is called a fuzzy T-metric (fuzzy Smetric). If instead of 1), we write t(u, v, )  [0, 1], (s(u, v, )  [0, 1]) the fuzzy set t(s) is a fuzzy T-metric (fuzzy Smetric) in the broader sense, and (X, t, T) ((X, s, T)) is a fuzzy T-metric (fuzzy S-metric) space in the broader sense. If instead of the condition 2) the following equality holds: fuzzy T-pseudo metric (fuzzy S-pseudo metric).
Theorem 1. [20] If (X, s, S) is a fuzzy S-metric space and T is a t-norm dual to the t-conorm S with respect to the continuous involutive fuzzy complement c, then ( ) , , is a fuzzy T-metric space. If (X, t, T) is a fuzzy T-metric space and S is a t-conorm dual to the norm T with respect to a continuous involutive fuzzy complement c, then ( ) , , The theorem is also valid for fuzzy metric spaces in the broader sense. The triangular norm t and conorm S are dual with respect to the fuzzy complement c, if is a fuzzy T-metric with respect to multiplication and its dual (with respect to standard fuzzy complement) is a fuzzy S-metric with respect to algebraic sum. Example 2. If (X, d) is a metric space then the mapping : is a fuzzy T-metric with respect to multiplication and its dual (with respect to standard fuzzy complement) with respect to algebraic sum. Theorem 2. Let D: I n →I, I = (0, 1] (I = [0, 1)) be a continuous function such that the following conditions are satisfied: [ii] D is monotonically non-decreasing function, i.e.
fuzzy T-metrics (S-metrics) with respect to triangular norms T j (conforms S j ), jJ respectively, then the function If the function D is a strictly monotone increasing function, such that the condition D(1, 1, …, 1) = 1 holds, then 1 1

4) From the conditions [ii] and [iii], and axiom 4) for fuzzy T-metrics
In the case of fuzzy S-metric (noted in parenthesis for theorem) the proof is analogous. ( , , ) , of Theorem 2, so if they are tj: X j  X j → (0, 1], jJ fuzzy T-metrics with respect to a continuous triangular norms T j , jJ, respectively, then the function t: is the fuzzy T-metric with respect to the product. Indeed conditions [i]-[iii] are fulfilled as follows:

FILTERING IMAGES BY USING FUZZY METRICS
If we denote with P the set of all pixels of P in the image, then we can establish correspondence between it and the set I  F, where is a set of pixel brightness levels (the degree of pixel grayscale), and ( , ) ,T F τ will be T-fuzzy metric spaces with respect to t-norms T 1 and T 2, respectively. Sliding window W of dimension (2n − 1)  (2n − 1), nN is used for filtering. The new filter is based on a novel fuzzy metric created from combining two different fuzzy metrics using function D from Theorem 2. Using fuzzy metrics makes the computation simpler and permits adjustment of the center pixel privilege, giving a customizable nature to the filter.
The measurement of the middle pixel value in the W is carried out by determining the values of all the other pixels that are in W, by applying our metric as discussed below. Image determination is done according to the pixels P i , i.e.
with coordinates representing quantity of colors. It can be said that the gist of image filtering is replacing a pixel that represents noise with a pixel without noise. This can be reached by substituting the middle pixel in window W with a pixel that best represents the other pixels in window W. This means that a pixel the most similar in color and spatial distance to all other pixels in W is used. In the proposed procedure it is very important to choose a good criterion by which to replace pixels with noise with pixel without noise, which is precisely the reason why the choice of the right T-metric plays the most important role.
Next, the order relation on the set of all pixels in a particular W window will be established using fuzzy Tmetrics δ. We will use it for comparison of the pixels (i, f i ), ("position", "color") and selection of the pixel that is at least different from all other pixels in W, i.e. that is the most identical to other pixels in window (relative to color and distance). In this way we are changing the middle pixel in a particular window by the pixel chosen with algorithm.
where τ and t are fuzzy T-metrics regarding triangular norms. Theorem 2 implies that δ is a fuzzy T-metric, with appropriate choice of function D. Fuzzy T-metric τ is determined as and it measures similarity among colors (equivalence of colors quantity) of 2 pixels P i and P j , i.e. for similarity measuring of l-th color (l = 1, 2, 3) is used by fuzzy Tmetric τ l . Theorem 2 implies that τ is a fuzzy T-metric, with appropriate choice of function D 0 . Fuzzy T-metric t measures spatial distance between pixels P i and P j , i.e. spatial coordinates i and j.
Note that a parameter in the fuzzy T-metric has an influence on the sensitivity of fuzzy T-metric t.
In this paper, a special case of fuzzy T-metric δ is used. If we choose the function D to be the product, i.e. D (u, v) = uv, we have that δ is a fuzzy T-metric defined with: Fairly good results are obtained using fuzzy T-metric δ, since simultaneously use criterion of similarity of colors and spatial distance.
Further, this part of the section deals with results achieved by applying proposed approach using fuzzy metrics for color (RGB) image filtering. The new filter is based on a novel fuzzy metric presented in section 2. Proposed strategy is implemented using MATLAB® tool.
The VMF is probably the most commonly used vector filter. Our approach is designed for similar purposes as VMF, to calculate the difference among color pixel values and thus estimate the missing color component. For this reason, we will compare our model results with those obtained by applying a VMF to demonstrate difference in output results.
In order to determine the color similarity between pixels fuzzy T-metric τ is formulated as (see (2) and Example 1) And in order to treat spatial distance between pixels fuzzy T-metric t is formulated as (see Example 2)   We have further prepared quality comparison based on UIQI metric [23], to form 3-dimensional vector of the UIQI indexes in [−1, 1] for each (RGB) color. The quality index of each color together with image quality is viewed in relation to 1 that represents the value with the best quality. Sliding window technique is prepared on the window size 5 and using formula from [23], UIQI is calculated for each window. Result of the algorithm is the average value of all sliding windows.
In Fig. 1 is shown the original image Yellow lilly, in jpg format.  The metric δ is defined with (1), where  and t are defined by (3) and (4), respectively. The values of metric for the image quality UIQI for each color for the filtered image by applying the method proposed in this paper (see Fig. 3    The result was that our image has slightly lower values for corresponding UIQI image quality, but much higher sharpness. This is very important in cases where details in image are needed to be reproduced. We have used for measuring sharpness image quality metrics introduced in [16]. In paper [20] the authors have represented the application of metric-like functions defined by (1), where T-metric τ is given with (3), and distance between pixels is fuzzy T-metric t (4).
The filtered image (see Fig. 5) is contaminated with 10% salt and pepper noise. Values of metric of image quality UIQI for each color of image noised with 10% of noise are equal to: [0.4639, 0.4737, 0.5047]. It is concluded that for t [2.6, 3.0], K[640, 896] metric δ which is defined in this paper, gives better quality of image with respect to quality of image filtered by median filter, where the quality of image is compared with the metric for image quality UIQI. Image filtered by fuzzy metrics δ with parameters t = 2.6, K = 768 and window size 3 is prepared. The values of metric of image quality UIQI for each color for filtered image by our method are equal to: [0.5257, 0.5702, 0.5662]. Comparing index of metric for image quality UIQI for corresponding colors (respectively, red, green, blue), we conclude that all indices of image filtered by our method are greater than the corresponding indices of image filtered by median filter. As those indices are closer to one, we conclude that image quality is better. Figure 6 Lena, original image in jpg format In paper [11] the authors have represented the application of metric-like functions defined by (1), where T-metric τ is given with (3) and distance between pixels is fuzzy T-metric t, formulated as (4). Noise that we applied on original image is 10% of salt & pepper noise. The image (see Fig. 6) was filtered by using two metrics mentioned.
In this paper the authors compared image filtered with our metric-like function to image filtered by VMF. The result for image Lena was that our image has slightly lower values for corresponding UIQI image quality, but much higher sharpness.
For image filtered by VMF with window size 3, UIQI is equal to vector (calculated for all three colors): [0.546475813084152, 0.673989789093080, 0.525819221430506].
The sharpness for image filtered by VMF is 0.690730837789661.
The sharpness for image filtered by our metric is 0.927492447129909.
If we compare our results by UIQI for corresponding colors (respectively, red, green, blue), with results generated by VMF, we can notice that in some cases results processed by VMF are better, but in all cases results of sharpness from proposed method are much better. The advantage of these methods is in the possibility to choose parameter of the different variants of metrics and corresponding parameters until the best one is found for filtering images.

SEGMENTATION IMAGES BY USING FUZZY METRICS
Image segmentation, with and without supervision, is the process by which the digital image is divided into related sets of pixels, [7]. In this process each pixel in an image is individually placed in a class, i.e. pixels with the same visual characteristic are grouped into some objects of suitable shape and size.
Classical segmentation approaches involve sharp decisions in the process of allocating pixels to groups. But real images are characterized by a large heterogeneity of object classes, which creates major problems in classical segmentation, and often approaches the fuzzy segmentation, in which the observed pixels belong to some group to a certain extent.
The distance function is very important in image segmentation tasks because it is the criterion by which pixels are divided into groups. This criterion for dividing pixels into groups will be, in this section, a function with optimal characteristics, which has the properties of a fuzzy metric and is formed of the two corresponding fuzzy metrics. In order to clarify the choice of one of these fuzzy metrics, the notion pixel descriptor is given. Pixels descriptors can be described as the characteristics that carry information about the observed pixel and its environment. In this section, local binary descriptor (LBP [18,19]) is introduced, that will be used in the construction of the distance function for digital image segmentation. It serves to model the difference between two pixels and significantly affects the success of segmentation.
First, we will consider the (local) environment of a pixel and the simplest 3  3 pixel circle with 8 neighbors. It assigns to each of these adjacent pixels a value of 1 or 0, depending on the predefined value of a threshold  that in our case of luminance consideration takes value {0, 1, …, 255}. If the difference between the value of the considered characteristic (brightness) f i {0, 1, …, 255} of the observed pixel P i and its neighboring pixel n i (k){0, 1, …, 255}, k = 1, …, 8, is less than , we assign 0 to the adjacent pixel, otherwise 1. Thus, the value 1 of the indicator similarity function of the central pixel P i , i.e. (i, f i ), where i = (i 1 , i 2 )I spatial coordinates of pixel P i and each of its neighbors n i (k), k = 1, …, 8, indicates that the difference in the grey level between the observed pixels is greater than α, while 0 indicates the opposite, i.e. indicates that the pixels are similar to α set point For the pixel P i at the edge of the image and not having some of the 8 considered neighbors n i (k), we assume that choose that K = 10, t = 1. Looking at the results, we can observe increasing power degree in Example 3. for the metric (5).
In the first test we used parameter value =20, suggested in [6]. A good  parameter selection can cover most of the spatial relations of adjacent pixels. For large values of , the descriptor would not be able to manifest its properties. The dependence of the parameters  on  would be a good choice. It follows from [5] that it should depend on the standard deviation of the image. In the last three tests it was taken that  = const (the constant value from the interval [0, 1] was multiplied by the standard deviation of the image). The test output parameters are in Fig. 8, and Performance index: 7.5293e +03 .
The test output parameters are the figure in Fig. 9, and Performance index: 7.4905e +03 . Input  = 0.25. The test output parameters are in Fig. 10, and Performance index: 7.0988e +03 . Input:  = 0.15. The test output parameters are in Fig. 11, and Performance index: 4.4572e +03 . Input:  = 0.05. As the results show, using the fuzzy metric instead of the standard metric in the FCM algorithm, less Performance index values are obtained, i.e. better segmentation.

CONCLUSION
Novelty of this work is filtering based on the new fuzzy T-metric introduced for image denoising. In the proposed procedure it is very important to choose a good criterion by which to replace pixels with noise with pixel without noise, which is precisely the choice of the right T-metric. The advantage of this method is in the variant of metrics and corresponding parameters until the best one is found for filtering images. To illustrate the performance of proposed algorithm experiments have been conducted on different general images of Yellow lilly, Lena and Mandrill. If we compare our results by UIQI for corresponding colors (respectively, red, green, blue), with results generated by VMF, we can notice that in some cases results processed by VMF are better, but in terms of sharpness in all cases results generated from proposed method are much better.
Our image segmentation method uses the fuzzy segmentation approach. A distance function that divides pixels into groups is a function with optimal characteristics formed by two corresponding metrics. The first metric measures the difference in brightness between the two pixels observed. The second is defined by the pixel descriptor (in our case the Local Binary Descriptor) as a characteristic that carries information about the observed pixel and its environment. Four tests were performed that showed that better segmentation values were obtained using the fuzzy metric instead of the standard metric in the FCM algorithm.
The possibility of applying this algorithm in different fields is great given that different t-norms can be selected depending on the problem observed.