Using Fuzzy Logic In Image Matching

Fuzzy logic is one of the main branches of artificial intelligence as a representative of the theories and techniques used fuzzy groups and groups that are no definite boundaries, and is considered by this logic to describe and represent the human experience as it is through the development of practical solutions to various problems. In this research was to use Fuzzy logic in matching images, as it has been working with images


Introduction
Fuzzy logic (FL) is a superset of conventional (Boolean) logic, was initiated in 1965, by Lotfi A. Zadeh, professor for computer science.Basically, FL is a multi valued logic, that allows intermediate values to be defined between conventional evaluations like true/false, yes/no, high/low, etc. Notions like rather tall or very fast can be formulated mathematically and processed by computers, in order to apply a more human-like way of thinking in the programming of computers.Fuzzy systems is an alternative to traditional notions of set membership and logic that has its origins in ancient Greek philosophy.[1] [2] FL is a simple yet very powerful problem solving technique with extensive applicability.It is currently used in the fields of business, systems control, electronics and traffic engineering.[3] It provide an appropriate technique for describing the behavior of systems which are too imprecisely or ill defined to be amenable to formal mathematical analysis.It allows non liners input/output relationship to be expressed by a set of qualitative if then rules.It is easy to setup and provide accurate responses to ambiguous data.[4]

Crisp set and Fuzzy set
Classical sets are also called crisp sets so as to distinguish them from fuzzy sets.In fact, the crisp sets can be taken as special cases of fuzzy sets.Let A be a crisp set defined over the universe X.Then for any element x in X, either x is a member of A or not.In fuzzy set theory, this property is generalized.Therefore, in a fuzzy set, it is not necessary that x is a full member of the set or not a member.It can be a partial member of the sets.[5] The generalization is performed as follows: For any crisp set A, it is possible to define a characteristic function µ x = {0,1}.i.e. the characteristic function takes either of the values 0 or 1 in the classical set.For a fuzzy set, the characteristic function can take any value between zero and one.[6] [7]

Membership function (MF)
MF is the mathematical function which defines the degree of an element's membership in a fuzzy set.MF is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1.The input space is sometimes referred to as the universe of discourse.[8] If X is the universe of discourse and its elements are denoted by x, then a fuzzy set A in X is defined as a set of ordered pairs as shown in equation ( 1 µ A (x) is called the MF of x in A. The MF maps each element of X to a membership value between 0 and 1. [9]

Type of MFs
The type of MFs is: 1-Numerical definition (discrete MFs) as shown in equation ( 2):

4-Product of two fuzzy sets
The product of two fuzzy sets in the same universe of discourse is the new fuzzy set A•B with a MF that equals product of the MF of A and the MF of B. as shown in equation (7):

5-Multiplying a fuzzy set by a crisp number
When a fuzzy set is multiplied by a crisp number, then its MF is shown in equation ( 8):

6-Equality of fuzzy sets
The fuzzy sets A and B are equal if the fuzzy set of A is equal to the fuzzy set B. as shown in equation ( 9):

7-Normal fuzzy set
The fuzzy set is called normal if there is at least one element x 0 in the universe of discourse X where the MF equals 1.shown in equation 10

If-Then rules
Fuzzy sets and fuzzy operators are the subjects and verbs of fuzzy logic.Usually the knowledge involved in fuzzy reasoning is expressed as rules in the form: If x is A Then y is B where x and y are fuzzy variables and A and B are fuzzy values.The ifpart of the rule "x is A" is called the antecedent or premise, while the then-part of the rule "y is B" is called the consequent or conclusion.[13] Statements in the antecedent (or consequent) parts of the rules may well involve fuzzy logical connectives such as 'AND' and 'OR'.In the if-then rule, the word "is" gets used in two entirely different ways depending on whether it appears in the antecedent or the consequent part.[14] [15]

Fuzzy Number
If a fuzzy set is convex and normalized, and its MF is defined in R and piecewise continuous, it is called as fuzzy number.So fuzzy number (fuzzy set) represents a real number interval whose boundary is fuzzy.
Fuzzy number is expressed as a fuzzy set defining a fuzzy interval in the real number R. Since the boundary of this interval is ambiguous, the interval is also a fuzzy set.Generally a fuzzy interval is represented by two end points a1 and a3 and a peak point a2 as (a1, a2, a3) (Figure 7).[16] Fuzzy numbers are used in statistics, computer programming, engineering, and experimental science.The arithmetic operators on fuzzy numbers are basic content in fuzzy mathematics.

Fuzzy Inference Systems
Fuzzy inference is the actual process of mapping from a given input to an output using FL. Figure (8), The process involves MFs, FL operators, and if-then rules.there are five parts of the fuzzy inference process: [10] [12] [17]

1-Fuzzification of the input variables
The first step is to take the inputs and determine the degree to which they belong to each of the appropriate fuzzy sets via membership functions.The input is always a crisp numerical value limited to the universe of discourse of the input variable and the output is a fuzzy degree of membership (always in interval between 0 and 1).

2-Application of the fuzzy operator (AND or OR) in the antecedent
If the antecedent of a given rule has more than one part, the fuzzy operator is applied to obtain one number that represents the result of the antecedent for that rule.This number will then be applied to the output function.Any number of well-defined methods can fill in for the AND operation or the OR operation.

3-Implication from the antecedent to the consequent
The implication method is defined as the shaping of the consequent (a fuzzy set) based on the antecedent (a single number).The input for the implication process is a single number given by the antecedent, and the output is a fuzzy set.Implication occurs for each rule.Two built-in methods are supported, min (minimum) which truncates the output fuzzy set, and prod (product) which scales the output fuzzy set.

4-Aggregation of the consequents across the rules
Unify the outputs of each rule

5-Defuzzification
Input for defuzzification phase is unified fuzzy set formed by aggregation of consequents and output is crisp number.If there are more than one output variables, final output for each variable is a crisp number.The most popular defuzzification method is the centroid calculation, which returns the center of area under the curve

Image matching
The process of image matching plays an important role in the number of the modern application related to process digital images in the scientific modern fields such as: (multi modularity medical imaging) and (multi spectral image analysis).[18] [19] [20] The process of image matching needs a scanning for the images to make sure of matching and the degree of matching between the two images.[21] [22] As well as can be used in areas of science and technology various related branches of knowledge different physics and engineering s well as images in the geological and biological comparisons of microscopic images to determine the levels of matching and difference between them.[23] [24] [25]

Suggested Algorithm
The suggested algorithm is: (Fuzzification of the input variables) 6-Calculate the parameters (sum, mean, median, max, min, range (range = max-min)) of image1 and image2 7-Check the matching case: (Application of the fuzzy operator (AND or OR) in the antecedent), (Implication from the antecedent to the consequent) and (Aggregation of the consequents across the rules) a-if each pixel in image1 is equal the pixel in image2 in the same location then the result is the array that name resfm (75 row and 75 column) take the value 1 else the array that name resfm take the value zero.go to 8 b-if the parameters (sum, mean, median, max, min, range) of image1 is equal the parameters (sum, mean, median, max, min, range) of image2 and each pixel in image1 is equal the pixel in image2 (image1 is equal image2 after rotate 90 degree) then the result is the array that name resfm take the value 1. go to 8 c-if the parameters (sum, mean, median, max, min, range) of image1 is equal the parameters (sum, mean, median, max, min, range) of image2 and each pixel in image1 is equal the pixel in image2 (image1 is equal image2 after rotate 180 degree) then the result is the array that name resfm that take the value 1. go to 8 d-if the parameters (sum, mean, median, max, min, range) of image1 is equal the parameters (sum, mean, median, max, min, range) of image2 and each pixel in image1 is equal the pixel in image2 (image1 is equal image2 after rotate 270 degree) then the result is the array that name resfm take the value 1. 8-Find the number of ones in resfm and put in the variable z. 9-Find the number of zeros in resfm and put in the variable x (x=5625-z).10-Find the Matching Rate MR(MR=(z/5625)*100) 11-Find the Difference Rate DR(DR=100-MR) 12-If MR=100 then print very high matching else if MR between 55 to 99.9 then print high matching else if MR between 50 to 74.9 then print medium matching else if MR between 25 to 49.9 then print low matching else if MR between 0.1 to 24.9 then print very low matching else if MR=0 then print no matching 13-end

Execution of Suggestion Algorithm
In this research, the suggested algorithm has been applied in thirty cases, in each case, two gray level images have been inserted to find the matching rate and difference rate between them as it shown in Figure (9), Table (1) and Table (2).Sixty gray level images is used, that performed in simple of execution and calculation.
Table (1) represents the results obtained after implementation of the program and shows the values of matching and the values of the difference between the two images and find a matching type depending on the suggested algorithm.

Conclusion
Fuzzy systems, including FL and fuzzy set theory, provide a rich and meaningful addition to standard logic.The mathematics generated by these theories is consistent, and FL may be a generalization of classic logic.The applications which may be generated from or adapted to FL are wide-ranging, and provide the opportunity for modeling of conditions which are inherently imprecisely defined, despite the concerns of classical logicians.
In this research, image matching algorithm has been suggested by using FL. in each case, two images has been input and find matching and difference rate between the two images.some statistical variables (sum, mean, median, max, min, range) have been found to use in image matching.
FL is a very powerful tool that is pervading every field and signing successful implementation.Although the FL is relatively young theory, the areas of applications are very wide: process control, management and decision making, operations research and economies

Figure ( 8 )
Figure (8): Fuzzy inference system -A general case -The size of each image is (75 row and 75 column) (75*75=5625) 4-Show image1, image2 Input Output Input terms (interpret) Output terms (assign) Rules (if-then) If <antecedent> then <consequent> 5-Find the membership function of each image (image normalization) by divide each pixel in the two images to 255.

Table ( 1): The Result Of Suggestion Algorithm after execution to Selection Images
Table2represents the values of statistical parameters that have been obtained and used to help get the results to match the images.
In Table1 and Table2, the cases of (F,G,H,J,O,Q,X

Parameters that can be used in algorithm SUM: sum
of elements .For vectors, SUM(X) is the sum of the elements of X MEAN: Average or mean value.For vectors, MEAN(X) is the mean value of the elements in X MEDIAN: Median value.For vectors, MEDIAN(X) is the median value of the elements in X MAX: Largest component.For vectors, MAX(X) is the largest element in X MIN: Smallest component.For vectors, MIN(X) is the smallest element in X RANGE: The range is the difference between the maximum and minimum values