Professional Documents
Culture Documents
byGlebV.Tcheslavski:gleb@ee.lamar.edu http://ee.lamar.edu/gleb/dip/index.htm
Spring 2008 ELEN 4304/5365 DIP 1
Preliminaries
Fuzzy sets are used to incorporate knowledge in the solutions of problems, whose formulation is based on imprecise concepts Let Z be a set of elements (objects) with a generic element of Z denoted as z; that is Z = {z}. This set is called a universe or discourse. A fuzzy set A in Z is characterized by a membership function A(z) that associates a real number in [0 1] with each element of Z. The value of A(z) at z is a grade of membership of z in A: the closer it is to one, the higher the grade of membership is. In ordinary (crisp) sets, an element either belongs or does not belong to a set.
Spring 2008 ELEN 4304/5365 DIP 2
4/28/2008
Preliminaries
In fuzzy sets, however, we say that all members for which A(z) = 1 are full members of the set. All members for which A( (z) ) = 0 are not members of the set. The members for which A(z) is between 0 and 1 are partial members of the set. Therefore, a fuzzy set is an ordered pair consisting of values of z and a corresponding membership function:
A = {z , A ( z ) | z Z }
For continuous variables, the set A can be infinitely large. For discrete values of z, the elements of A are shown explicitly.
Spring 2008
Preliminaries
Spring 2008
4/28/2008
Preliminaries/Definitions
A fuzzy set is empty iff its membership function is identically zero in Z. Two fuzzy sets are equal (A = B) iff A(z) = B(z) for all z Z. The complement (NOT) of a fuzzy set A denoted by or NOT(A) is a set whose membership function is (z) = 1 - A(z) for all z Z. A fuzzy set A is a subset of a fuzzy set B iff A(z) B(z) for all z Z. The union (OR) of two fuzzy sets A and B denoted as AB or A OR B is a fuzzy set U with membership function U(z) = max[A(z), B(z)] for all z Z. The intersection (AND) of two fuzzy sets A and B denoted as AB or A AND B is a fuzzy set I with membership function I(z) = min[A(z), B(z)] for all z Z.
Spring 2008
Preliminaries
Spring 2008
4/28/2008
Preliminaries
Although fuzzy logic and probability may seem as similar concepts concepts, there is a significant difference between them While the probability states: There is a 50% chance that the person is young (assuming that the person is either young or not), the fuzzy statement would be A persons degree of membership among the young people is 50% 50% (meaning that the person is young to some degree).
Spring 2008
Trapezoidal:
Sigma:
Spring 2008
4/28/2008
Bell-shape:
( z) =
S ( z; c b, c b 2 , c) 1 S ( z; c b, c b 2 , c)
2
zc c<z
Truncated Gaussian:
( z a2) ( z ) = e 2 b 0
ac z a+c otherwise
9
Spring 2008
Crossover p point
Bandwidth
Spring 2008 ELEN 4304/5365 DIP 10
4/28/2008
4/28/2008
Spring 2008
13
4/28/2008
Assuming that
red ( z0 ) = c
We can find the membership function of maturity (for the class mature) for the specific input (color)
Spring 2008 ELEN 4304/5365 DIP 15
Q = Q1 OR Q2 OR Q3
Or, in general:
r
}
16
4/28/2008
Spring 2008
17
v0 =
vQ(v)
v =1 k
Q (v )
v =1
Here k indicates the number of possible values of Q(v). ) In our example, v0 = 72.3, which indicates that a fruit is approximately 72% mature.
Spring 2008
18
4/28/2008
10
4/28/2008
... IF ( z1 , AM 1 ) AND ( z2 , AM 2 ) AND ... AND ( z N , AMN ) THEN (v, BM ) ELSE (v, BE )
where Aij is the fuzzy set associated with the ith rule and the jth input variable and Bi is the fuzzy set associated with the output of the ith rule.
Spring 2008 ELEN 4304/5365 DIP 21
i = min A ( z j ); j = 1, 2,...N
ij
i = 1, 2, M
A membership function of a fuzzy set Aij evaluated at the value of the jth input.
E = min i {1 i ; i = 1, 1 2,..., 2 M}
When instead of AND, the OR logic is used, min should be replaced by max in the expression for i but not for E.
Spring 2008 ELEN 4304/5365 DIP 22
11
4/28/2008
IF a pixel is dark, THEN make it darker. IF a pixel is gray, THEN make it gray. IF a pixel is bright, THEN make it brighter.
Then, the input and output membership functions are:
Spring 2008
23
v0 =
Fuzzy image processing is computationally intensive, since the fuzzification, processing conditions for all rules, implication, aggregation, and defuzzification must be applied to every pixel in the input image!
Spring 2008 ELEN 4304/5365 DIP 24
12
4/28/2008
Result of histogram Result of a rule-based equalization contrast modification contrast is increased approach but there are areas with overexposed appearance
ELEN 4304/5365 DIP 25
Spring 2008
The output singletons were vd = 0 (black); vg = 127 (mid gray); vb = 255 (white)
Output histogram
13
4/28/2008
14
4/28/2008
Spring 2008
29
Spring 2008
30
15