# Improvement of Fuzzy Image Contrast Enhancement Using Simulated Ergodic Fuzzy Markov Chains

Authors: Behrouz Fathi-Vajargah; Maryam Gharehdaghi
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

This paper presents a novel fuzzy enhancement technique using simulated ergodic fuzzy Markov chains for low contrast brain magnetic resonance imaging (MRI). The fuzzy image contrast enhancement is proposed by weighted fuzzy expected value. The membership values are then modified to enhance the image using ergodic fuzzy Markov chains. The qualitative performance of the proposed method is compared to another method in which ergodic fuzzy Markov chains are not considered. The proposed method produces better quality image.


---

## Body

## 1. Introduction

Fuzzy set theory is useful in managing various uncertainties in computer vision and image processing applications. Fuzzy image processing is a collection of different fuzzy methods to image processing that can comprehend, characterize, and process the images. It has two main phases, namely, image fuzzification and modification of membership values.Image enhancement for brightness transformation valid in many practical cases can be position brightness correction and gray-scale transformation. Position brightness correction adjusts the pixel brightness by taking into account the pixel position in the image. Gray-scale transformation changes the pixel brightness, but it does not take into account the position of the pixels in the image. Gray-scale transformation is just a transformation of the gray scale to another scale to increase the contrast. The purpose of the transformation is to improve the visual appearance of an image.There are many research works on image enhancement [1, 2], but in this paper we focus on ergodic fuzzy Markov chains for image enhancement.Avrachenkov and Sanchez [3] introduced fuzzy Markov chains with a transition possibility measure and a general state space. Also, Kalenatic et al. [4] presented a simulation study on fuzzy Markov chains to identify some characteristics about their behavior, based on matrix analysis. All the aforementioned investigations show that fuzzy Markov chains have a periodic behavior. We improved behavior of fuzzy Markov chains using Halton sequences and simulated ergodic fuzzy Markov chains [5]. In this paper, we apply our technique of simulating ergodic fuzzy Markov chains for generating membership values of pixels. Enhancement using ergodic fuzzy Markov chains will improve the quality of the image and provide a clear image to the human observer.The overall approach of the paper follows. We consider a low quality fuzzy image withM×N pixels (xij;i=0,1⋯M-1,j=0,1⋯N-1). We then obtain the value of threshold T of the fuzzy image. The main and novel idea to enhance the image contrast is to consider a pixel as a new image and subdivide it to n×n pixels. To simulate these n×n pixels we employ the ergodic fuzzy Markov chains and their transition matrix. For a particular pixel, its related n×n matrix entries represent membership values of gray levels of the pixel. To increase the image contrast of each pixel using subdivided pixel we use the weighted fuzzy expected value approach based on transition matrix entries of ergodic fuzzy Markov chain. We show that proposed method produces better quality images compared to the fuzzy expected value method given in [1].In Section2, we discuss the fuzzy image contrast enhancement. In Section 3, we define the similarity measure and distance measure, and then in Section 4 we review ergodic fuzzy Markov chains. The main result of this paper is presented in Section 5 followed by a simulation study in Section 6. Section 7 shows the performance of our new results based on fuzzy image contrast enhancement using simulated ergodic fuzzy Markov chains. Comparison of our result with original MR image is also presented.


## 2. Image as a Fuzzy Set, Threshold Technique, and Fuzzy Image Contrast Enhancement

The application of fuzzy set theory in image processing took formal shape only in the 1980s with the pioneering research carried out by Pal et al. [6] and Pal and Rosenfeld [2].


### 2.1. Image as a Fuzzy Set

The pixel values, which establish an image, may not be accurate and there is basically an intrinsic imprecision or uncertainty embedded in a digital image. While trying to design automated systems for scene analysis and explanation, it may be a good idea to consider the fact that a computer vision system is usually embedded with uncertainty and vagueness, which needs to be taken care of suitably. Proper modeling of this imprecision appearing in a physical phenomenon is an important mission in many applications of image processing.LetA be an image of size M×N having L levels and xij the gray level at the pixel position value of the pixels of the image A with 0≤μA(xij)≤1, where μA(xij)=1 denotes full membership and μA(xij)=0 denotes nonmembership. Intermediate degrees are graded accordingly. Membership values represent the information, say, for example, the brightness, of the pixel at position (i,j). In fuzzy set theory, an image can be represented as [7]
(1)∑i=0M-1∑j=0N-1[xij,μA(xij)],∀xij∈A,i=0,1,2,…,M-1,j=0,1,2,…,N-1.Equation (1) interprets the characteristics of an image with M×N pixels. The double summations in (1) just refer to a collection of pixels and their membership values not a crisp mathematical summation.


### 2.2. Fuzzy Threshold Technique

Thresholding is an operation that involves tests against a functionT of the form
(2)T=T(i,j,μ(i,j),f(i,j)),
wheref(i,j) is the gray level of pixel (i,j) and μ(i,j) denotes some local property of this point. A threshold image g(i,j) is defined as
(3)g(i,j)={1iff(i,j)>T,0iff(i,j)≤T.
Thus, pixels label 1 (or any other gray level) correspond to objects. However pixels label 0 (or any other gray level not assigned to objects) correspond to the background. When T depends only on f(i,j) (that is, only on gray level values) the threshold is called global. If T depends on both f(i,j) and μ(i,j), the threshold is called local. If, in addition, T depends on the spatial coordinates i and j, the threshold is called dynamic or adaptive [7].Figure1 captures an MR image, which is not transparent. Its histogram drawn in MATLAB by using pixels properties and their gray levels is also given in this figure. Figures 2 and 3 demonstrate tumor and abdomen images and their related histograms, respectively. As shown in the histograms, in all the cases the ratio of bright pixels to dark ones is low [8, 9].Figure 1
Brain MRI and its histogram of gray levels.Figure 2
Tumor image and its histogram of gray levels.Figure 3
Abdomen image and its histogram of gray levels.


### 2.3. Fuzzy Image Contrast Enhancement

Fuzzy image contrast enhancement is established on gray level mapping from a gray plane into a fuzzy plane using a membership value. It uses the principle of contrast stretching where the image gray levels are transformed in such a way that dark pixels appear much darker and bright pixels appear much brighter. The principle of contrast stretching depends on the selection of threshold,T, so that the gray levels below the threshold T are reduced and the gray levels above the threshold T are increased in a nonlinear manner. This stretching operation induces saturation at both ends (gray levels):
(4)CONT(x)={(1-b)xx>t,xx=t,(1+a)xx<t.CONT(x)is an intensifier stretching that transforms a gray level x to an intensified level. a,b are the levels between 0 and 1 that decide the percentage stretching of gray level x for a certain threshold “t.”Fuzzy methods for contrast enhancement employ membership valuesμ(x) to know the degree of brightness or darkness of the pixels in an image. So, ergodic fuzzy Markov chains are used to find the membership values of the pixels in an image that lies in the interval [0,1] using any membership value. Then, elements of transition possibility matrix of ergodic fuzzy Markov chains are applied on the membership values to generate new membership values of the pixels in the image [1].


## 2.1. Image as a Fuzzy Set

The pixel values, which establish an image, may not be accurate and there is basically an intrinsic imprecision or uncertainty embedded in a digital image. While trying to design automated systems for scene analysis and explanation, it may be a good idea to consider the fact that a computer vision system is usually embedded with uncertainty and vagueness, which needs to be taken care of suitably. Proper modeling of this imprecision appearing in a physical phenomenon is an important mission in many applications of image processing.LetA be an image of size M×N having L levels and xij the gray level at the pixel position value of the pixels of the image A with 0≤μA(xij)≤1, where μA(xij)=1 denotes full membership and μA(xij)=0 denotes nonmembership. Intermediate degrees are graded accordingly. Membership values represent the information, say, for example, the brightness, of the pixel at position (i,j). In fuzzy set theory, an image can be represented as [7]
(1)∑i=0M-1∑j=0N-1[xij,μA(xij)],∀xij∈A,i=0,1,2,…,M-1,j=0,1,2,…,N-1.Equation (1) interprets the characteristics of an image with M×N pixels. The double summations in (1) just refer to a collection of pixels and their membership values not a crisp mathematical summation.


## 2.2. Fuzzy Threshold Technique

Thresholding is an operation that involves tests against a functionT of the form
(2)T=T(i,j,μ(i,j),f(i,j)),
wheref(i,j) is the gray level of pixel (i,j) and μ(i,j) denotes some local property of this point. A threshold image g(i,j) is defined as
(3)g(i,j)={1iff(i,j)>T,0iff(i,j)≤T.
Thus, pixels label 1 (or any other gray level) correspond to objects. However pixels label 0 (or any other gray level not assigned to objects) correspond to the background. When T depends only on f(i,j) (that is, only on gray level values) the threshold is called global. If T depends on both f(i,j) and μ(i,j), the threshold is called local. If, in addition, T depends on the spatial coordinates i and j, the threshold is called dynamic or adaptive [7].Figure1 captures an MR image, which is not transparent. Its histogram drawn in MATLAB by using pixels properties and their gray levels is also given in this figure. Figures 2 and 3 demonstrate tumor and abdomen images and their related histograms, respectively. As shown in the histograms, in all the cases the ratio of bright pixels to dark ones is low [8, 9].Figure 1
Brain MRI and its histogram of gray levels.Figure 2
Tumor image and its histogram of gray levels.Figure 3
Abdomen image and its histogram of gray levels.


## 2.3. Fuzzy Image Contrast Enhancement

Fuzzy image contrast enhancement is established on gray level mapping from a gray plane into a fuzzy plane using a membership value. It uses the principle of contrast stretching where the image gray levels are transformed in such a way that dark pixels appear much darker and bright pixels appear much brighter. The principle of contrast stretching depends on the selection of threshold,T, so that the gray levels below the threshold T are reduced and the gray levels above the threshold T are increased in a nonlinear manner. This stretching operation induces saturation at both ends (gray levels):
(4)CONT(x)={(1-b)xx>t,xx=t,(1+a)xx<t.CONT(x)is an intensifier stretching that transforms a gray level x to an intensified level. a,b are the levels between 0 and 1 that decide the percentage stretching of gray level x for a certain threshold “t.”Fuzzy methods for contrast enhancement employ membership valuesμ(x) to know the degree of brightness or darkness of the pixels in an image. So, ergodic fuzzy Markov chains are used to find the membership values of the pixels in an image that lies in the interval [0,1] using any membership value. Then, elements of transition possibility matrix of ergodic fuzzy Markov chains are applied on the membership values to generate new membership values of the pixels in the image [1].


## 3. Fuzzy Similarity and Distance Measure

In this section, fuzzy distance measure is described using fuzzy set theory. Fuzzy distance measure is studied by many authors [10, 11]. We consider a universal set X and F(X) to be a fuzzy set. Let P(X) be the class of all crisp sets of X. Also, consider two fuzzy sets, A and B, such that A,B∈F(X). The properties of distance measure between two fuzzy sets A and B with membership values μA(x) and μB(x) are given as follows [10].


### 3.1. Distance Measure

A functionD:F(X)2→[0,∞] is called a distance measure if it satisfies the following properties.(1)
One hasD(A,B)=D(B,A),∀A,B∈F(X).(2)
For three fuzzy setsA,B,C∀A,B,C∈F(X), if A⊂B⊂C then D(A,B)≤D(A,C) and D(B,C)≤D(A,C).(3)
One hasD(A,A)=0,∀A∈F(X).(4)
One hasD(C,C-)=max⁡A,B∈F(X)D(A,B),∀C∈P(X).For example, consider two fuzzy sets A and B in a finite X={x1,x2,…,xn} with μA(x) and μB(x) as the membership value of sets A and B, respectively. The distance measures are as follow.Hamming Distance.The Hamming distance between two fuzzy sets A and B is given as
(5)d(A,B)=∑i=1n|μA(xi)-μB(xi)|.Euclidean Distance.The Euclidean distance between two fuzzy sets A and B is given as
(6)d(A,B)=∑i=1n(μA(xi)-μB(xi))2.


## 3.1. Distance Measure

A functionD:F(X)2→[0,∞] is called a distance measure if it satisfies the following properties.(1)
One hasD(A,B)=D(B,A),∀A,B∈F(X).(2)
For three fuzzy setsA,B,C∀A,B,C∈F(X), if A⊂B⊂C then D(A,B)≤D(A,C) and D(B,C)≤D(A,C).(3)
One hasD(A,A)=0,∀A∈F(X).(4)
One hasD(C,C-)=max⁡A,B∈F(X)D(A,B),∀C∈P(X).For example, consider two fuzzy sets A and B in a finite X={x1,x2,…,xn} with μA(x) and μB(x) as the membership value of sets A and B, respectively. The distance measures are as follow.Hamming Distance.The Hamming distance between two fuzzy sets A and B is given as
(5)d(A,B)=∑i=1n|μA(xi)-μB(xi)|.Euclidean Distance.The Euclidean distance between two fuzzy sets A and B is given as
(6)d(A,B)=∑i=1n(μA(xi)-μB(xi))2.


## 4. Ergodic Fuzzy Markov Chains

LetS={1,2,…,n}. A finite fuzzy set on S is defined by a mapping x from S to [0,1] represented by a vector x={x1,x2,…,xn}, with 0≤xi≤1, i∈S. Here, xi is the membership function that a state i has regarding a fuzzy set S, i∈S. A fuzzy transition possibility matrix P is defined in a metric space S×S by a matrix {μij}i,j=1n with 0≤μij≤1, i,j∈S. μij is the membership value [5].We note that it does not need elements of each row of the matrixP to sum up to one. This fuzzy matrix P allows defining all relations among the m states of the fuzzy Markov chain at each time instant t, as follows [3].At each instantt, t=1,2⋯l, the state of system is described by the fuzzy set x(t). The transition law of a fuzzy Markov chain is given by the fuzzy relational matrix P at instant t, t=1,2⋯l, as follows:
(7)xj(t+1)=max⁡i∈S⁡{min⁡⁡{xj(t),μij}},j∈S,x(t+1)=x(t)∘P,
where i and j, i,j=1,2,…,n, are the initial and final states of the transition and x(0) is the initial distribution. Also,
(8)μijt=max⁡k∈S⁡{min⁡⁡{μik,μkjt-1}},i,j∈S,Pt=P∘Pt-1.Thomason in [12] shows that the powers of a fuzzy matrix are stable over the max-min operator. More information about powers of a fuzzy matrix can be found in [13]. Now, a stationary distribution of a fuzzy matrix is defined as follows.Definition 1.
Let the powers of the fuzzy transition matrixP converge in τ steps to a nonperiodic solution; then the associated fuzzy Markov chain is called aperiodic fuzzy Markov chain and P*=Pτ is its stationary fuzzy transition matrix.Definition 2.
A fuzzy Markov chain is called strong ergodic if it is aperiodic and its stationary transition matrix has identical rows.
A fuzzy Markov chain is called weakly ergodic if it is aperiodic and its stationary transition matrix is stable with no identical rows.We simulated ergodic fuzzy Markov chains using Halton sequences [5] and make use of them to simulate fuzzy image enhancement. Elements of transition possibility matrix of ergodic fuzzy Markov chains are applied on the membership values to generate new membership values of the pixels in the image. For example μ45=0.5 in transition possibility matrix of ergodic fuzzy Markov chains corresponding to image means that the membership value of gray pixel (4,5) is 0.6.Note. Every pixel xij in (1) is considered again as an image with n×n pixels and is simulated by using transition matrix of ergodic fuzzy Markov chains. For examples the matrix of a pixel is shown as follows.In Figure4 we have 8×8 pixels represented by 8×8 matrix.Figure 4


## 5. Fuzzy Image Contrast Enhancement Using Ergodic Fuzzy Markov Chains

In recent years, many researchers have applied various fuzzy methods for contrast enhancement [1]. In this paper, we discuss fuzzy expected value method. Fuzzy expected value replaces the mean and median value when treating fuzzy sets. Instead of calculating the average value of a set of numbers, we evaluated a more representative value of a set. This value would indicate a typical grade of membership of a fuzzy set.Consider a fuzzy setA in a finite set X={x1,x2…,xn} with a membership value μA:[0,1].LetξT={x∣μA(x)≥T}, 0≤T≤1, represent a subset whose elements are above or equal to the value of the threshold T [7]. Then the fuzzy measure defined on the fuzzy subset is
(9)ψ(ξT)={numberofelementsx:μA(x)≥T}N,
where N is the number of elements in a set. The fuzzy expected value of μA(x) over the fuzzy set is
(10)fuzzyexpectedvalue=FEV=sup⁡0≤T≤1⁡{min⁡⁡{T,ψ(ξT)}}.But FEV does not generate a typical value in some cases. We suggested weighted fuzzy expected value [14] using ergodic fuzzy Markov chains, which gives most typical value of the membership value μ, where weights are applied. The weight is calculated as follows.Consider the two pixels in Table1, where μk is the membership value of the kth gray level and mk is the frequency of occurrence of kth gray level.Table 1
Pixel number
μ
m
i
μ
i
m
i
j
μ
j
m
jSuppose a variational sampling((x1,x2,…,xn)(m1,m2,…,mn)) is given, μi=μA(xi), i=1,2,…,n are the membership values of some fuzzy set A⊂X, ω(x) is a nonnegative monotonically decreasing function defined over the interval [0,1], and λ>1 is a real number. Consider the following equation with respect to s:
(11)s=(μ1ω(|μ1-s|)m1λ+μ2ω(|μ2-s|)m2λ+⋯+μnω(|μn-s|)mnλ)×(ω(|μ1-s|)m1λ+ω(|μ2-s|)m2λ+⋯+ω(|μn-s|)mnλ)-1.The solution of (11) is called the weighted fuzzy expected value (WFEV) of order λ with the attached weight function ω of membership values (μ1,μ2…μn). The parameter λ measures the dependence of frequencies of population pixels on the WFEV.Now, we apply WFEV and simulated ergodic fuzzy Markov chains corresponding to image. Each element of transition possibility matrix of ergodic fuzzy Markov chains isμi.Suppose that the WFEV forω(|μi-s|)=e-|μi-s|, λ=2, s0=FEV is given by the following form:
(12)s=∑i=0L-1μie(-|μi-s|)miλ∑i=0L-1e(-|μi-s|)miλ,
where i=0,1,2,…,L-1 is the gray levels. The equation for “s” is in the form x=F(x) and is solved iteratively starting with xn+1=F(xn)(sn+1=F(sn)), where x0=FEV. This WFEV is used for image enhancement, and when applied on the gray level represents the most typical gray level. For μi, we use ergodic fuzzy Markov chains, which in the last simulated by Halton sequences in [5] and use their fuzzy transition matrix corresponding to each pixel of the image. We note that elements of fuzzy transition possibility matrix are membership values of gray levels.Ifψ is a simulated gray level corresponding to the WFEV or the FEV and gi is the gray level, then the distance measure between ψ and gray level gi is given by
(13)Di=(ψ)2-(gi)2.
The new gray level gi′ is computed as
(14)gi′={max⁡(0,ψ-Di),gi<ψ,i=0,1,2,…,ψ-1min⁡⁡(L-1,ψ+Di),gi>ψ,i=ψ+1,…,L-1ψotherwise
where gi′ are the final contrast enhanced image using WFEV and ergodic fuzzy Markov chains.


### 5.1. Algorithm

The algorithm of our approach is as follows.(1)
Read the original image.(2)
Represent image as a fuzzy set using (1).(3)
Represent each pixelxij as a n×n matrix.(4)
Simulate the membership values, that is, matrix entriesμi, by using ergodic fuzzy Markov chains implemented in [5].(5)
Obtain the value of thresholdT using [15].(6)
Compute FEV; then sets0:=FEV.(7)
Putsn+1=F(sn), in which F(sn)=∑i=0L-1μie(-|μi-sn|)miλ/∑i=0L-1e(-|μi-sn|)miλ, (WFEV).(8)
Obtainψ(ξT) using (9).(9)
Using (13) simulate the new gray level gi′.


## 5.1. Algorithm

The algorithm of our approach is as follows.(1)
Read the original image.(2)
Represent image as a fuzzy set using (1).(3)
Represent each pixelxij as a n×n matrix.(4)
Simulate the membership values, that is, matrix entriesμi, by using ergodic fuzzy Markov chains implemented in [5].(5)
Obtain the value of thresholdT using [15].(6)
Compute FEV; then sets0:=FEV.(7)
Putsn+1=F(sn), in which F(sn)=∑i=0L-1μie(-|μi-sn|)miλ/∑i=0L-1e(-|μi-sn|)miλ, (WFEV).(8)
Obtainψ(ξT) using (9).(9)
Using (13) simulate the new gray level gi′.


## 6. Simulation

Consider a low contrast image. We apply FEV and WFEV methods to improve the image contrast. These methods are presented in the last section. In our proposed approach, considering each pixel as a new image and simulating membership values of pixel using the transition matrix of ergodic fuzzy Markov chain and applying WFEV method, we would enhance the image contrast. Figure5 and its related histogram depict the contrast enhancement of the image using FEV method. Figure 6 also shows the same improvement in image contrast using WFEV and ergodic fuzzy Markov chains. As shown in histograms, the number of dark pixels in Figure 5 is less than those in Figure 2, and the number of dark pixels in Figure 6 is less than those in Figure 5, exhibiting that using ergodic fuzzy Markov chain along with employing WFEV method is a superior approach compared to the others. The same inference results from Figures 7 and 8 as well as Figures 9 and 10. We have employed MATLAB software to implement this approach.Figure 5
Contrast enhancement of brain MRI using FEV and its histogram.Figure 6
Contrast enhancement of brain MRI using WFEV and ergodic fuzzy Markov chains and its histogram.Figure 7
Contrast enhancement of tumor image using FEV and its histogram.Figure 8
Contrast enhancement of tumor image using WFEV and ergodic fuzzy Markov chains and its histogram.Figure 9
Contrast enhancement of abdomen image using FEV and its histogram.Figure 10
Contrast enhancement of abdomen image using WFEV and ergodic fuzzy Markov chains and its histogram.


## 7. Conclusion

In this paper, using simulated ergodic fuzzy Markov chains given in [5] and WFEV method we not only enhance the (MRI) low image in Figures 6, 8, and 10 but we also obtain better results than those resulted from FEV approach without considering ergodic fuzzy Markov chains for μi. This can be seen from simulation study of Section 6. As we subdivide pixels to smaller pixels and treating each new smaller pixel as an image and employing the simulation phase for the image, we would improve the quality of the original image. We hope to employ ergodic fuzzy Markov chains for contrast improvement using an intensification operator (INT approach).



---

*Source: 343514-2014-06-26.xml*