Digital Image Enhancement Using Hybrid Fuzzy Techniques Based on LabVIEW

In this paper, two LabVIEW based hybrid fuzzy filters combining fuzzy logic with simple filtering techniques for image de-noising are presented. LabVIEW is widely adopted for the design of real time systems and their realization in hardware due to the facilities available for performance simulation and measurements under different conditions. The main feature of the filters is that they try to determine the corrupted pixels using fuzzy rules and then treat them by utilizing the classical filters. To measure the performance of the designed filters, several corrupted images with Gaussian noise are processed. An objective criterion such as the Mean Square Error (MSE), and visual observation prove the effectiveness of the hybrid technique compared with the classical filters and several modern filters


1-Introduction
Noise can be generated during image capture, transmission, storage, as well as during image copying, scanning, and display.The most common type of noise in images is random (or Gaussian) noise.Random noise can be generated for example, during film exposure and development.Noise reduction in images has been one of the common tasks in image processing [1].Conventional image enhancement techniques such as mean and median filtering have been employed in various applications in the past and are still being used.However, techniques using Fuzzy Logic (FL), which mimics human reasoning and tolerates ambiguities well are increasingly being looked into as alternatives to these conventional techniques [2], where this approach can be used to enhance the performance of classical filters.In noise reduction, the gray-level value of every pixel in the image is replaced with a new value depending on the local context.Ideally, the filtering algorithm outcome should vary from pixel to pixel based on the local context where a fuzzy technique can be adopted to achieve this goal.Already several fuzzy filters for noise reduction have been developed, e.g., the weighted fuzzy mean filter, the adaptive fuzzy weighted mean filter [3][4], and the iterative fuzzy control based filter [5].However, most fuzzy techniques, in image noise reduction, mainly deal with impulse noise as in [6].
In real time image processing applications, the execution speed is critical.LabVIEW is the a graphical programming system with a compiler that generates optimized code with execution speeds comparable to compiled C programs.Thus, LabVIEW has the ability to create stand-alone executable applications, which run at compiled execution speeds [7].For this reason LabVIEW environment is used in this paper to build and execute two hybrid fuzzy filters utilizing the fuzzy system designer and NI vision and motion toolkits.On the other hand, this paper modifies the fuzzy procedure presented in reference [8] with different threshold values and different rules, and combines this procedure with the classical mean and median filters to form a hybrid method to achieve better denoising.
In addition to this introduced the rest of this paper is organized as follows: section 2 presents the first and the second hybrid filters.In section three the experimental tests and results are presented.The conclusions and future works are stated in section 4.

2-Fuzzy Image processing (FIP)
Fuzzy techniques have been adapted to be applied in the field of image processing to perform a new field, which is called Fuzzy Image Processing (FIP).Indeed, many concepts associated with image processing are inherently fuzzy; one can easily observe that grayscale images and fuzzy sets are represented in the same way, allowing the exchange of techniques between both fields.Image processing also intrinsically encounters uncertainty and imprecision, e.g. to determine whether a pixel is an edge-pixel or not, or whether a pixel is contaminated with noise or not.Another example concerns similarity measures, which measure the degree to which two images are similar to each other [9] [10].In fuzzy image processing (FIP), expert knowledge can be incorporated to overcome the problems, which are difficult to solve by conventional image processing.FIP is a powerful set of tools to represent and process human knowledge in form of fuzzy if-then rules.In addition, many difficulties in image processing, which are not always due to randomness but rather due to ambiguity and vagueness, can be managed by FIP [11].

2.1-The First Hybrid Fuzzy Filter (FF1)
The filter consists of two stages; the first stage is fuzzy noise detection stage where the degree of noise for each pixel is computed using fuzzy rules (see Figure (1)).In the second stage the new gray level value of a pixel is obtained using a certain equation described later in details.A fuzzy rule based system is used to determine a degree of noise for each pixel of the image.The degree is a real number in the range [0, 1] instead of being a crisped value 0 or 1 as in conventional image de noising techniques.The fuzzy rule is used to decide if a pixel is a noisy one or not and how much its noise.The result of this decision is the degree of noise (N d ) for each pixel, where if the pixel is noisy, the degree of noise is nearest to 1, while if the pixel is not corrupted, its degree will be nearest to 0. These values between [0, 1] do not depend on a threshold value, like other filters, but they are determined by means of fuzzy rules.This criterion certainly improves the performance of the filter.
To determine the value of N d for each pixel, two parameters are considered as antecedents for the fuzzy rule based system, as shown in Figure (1), these parameters are as follow:  For a 3×3 sliding window for an image, the minimum gray level differences between the central pixel and its 8-nighbourhood is considered as a first parameter for a fuzzy controller to decide the noisiness of a pixel mindif = min ( f (x, y) − f (x′, y′)) (1) Where (x′, y′) is an 8-neighborhood pixel of (x, y).
 The number of similar pixels (NOS) is countered according to a predefined threshold.This is the second important parameter to decide the noisiness.
Where th : Threshold In this paper two threshold values are set statically equal to 6 and 20 depending on the noise level in the image, in another word if the noise is high larger threshold value is used, and if the image is corrupted with low noise the threshold value is set to 6. also it may be determined dynamically to gain better results.The fuzzy membership functions and system rules are designed in LabVIEW fuzzy system designer model 2009.The output of the fuzzy system is a degree of noise (N d ) associated to each pixel which is a real number between 0 and 1. Figure (2) shows the MFs of the system where these functions are adopted from references [8] [12].The rules of the fuzzy system are set according to the human intuition and experiences as:  The median values for each 9 pixels of these sub-regions are determined as follow:

2.2-The Second Hybrid Fuzzy Filter (FF2)
In this filter, the algorithm of the fuzzy noise detection in reference [8], is used after modifications on the rules and the universe of discourse, which has been explained in the previous section.The using of this stage was to obtain the degree of noise for the processed pixel, but the mean values for each sub-regions in a 5×5 sliding window is calculated instead of the median values.This means that R value is obtained from the matrix of the eight mean values by taking the mean instead of median.The designed structure for that is shown in the LabVIEW block diagram in Figure (6).

3-Experimental Results
The filters are applied to grayscale test images (8-bit) after adding a Gaussian noise of different levels.Such a procedure allows comparing and evaluating the filtered image against the original one.Three representative test images, "Cameraman", "House" and "Bridge" are used.The proposed filters have been compared with the classical mean and median filters and several other modern filtering techniques proposed in [3] and [5].For this, the "Cameraman" image is corrupted with a Gaussian noise with μ=0, (σ=5, σ=10 and σ=20).Table (I) summarizes the results of FF1/FF2 filters, the adaptive weighted fuzzy mean filters (AWFM1 and AWFM2) [3], and the iterative fuzzy filter (IFC) [5].Table (II) summarizes results for a "House" test image and Table (III) for a "Bridge" test image.Figure (7) shows the front panel results of the program for the tested image "Cameraman" .In this figure the noisy image is corrupted by Gaussian noise with σ=20, the results of the proposed fuzzy filters are compared with that of classical filters (mean and median filters).

4-Conclusions and Future work
In this paper, a new hybrid image fuzzy denoising and filtering has been proposed and implemented based on LabVIEW.The hybrid filters FF1 and FF2 enhanced the performance of the classical arithmetic filters (mean and median).A numerical measure, the MSE, is used to evaluate experimental results.From these results it can be observed that: 1-FF1 and FF2 perform better at th=6 for low noise level (σ = 5 or 10) while at high level of noise (σ = 20) the performance is better at th=20.The conclusion drawn is that (th) should be increased when the noise level is increased.2-FF1 succeeded to remove the noise more than FF2 at both th-values and for all levels of noise for the three test images.The conclusion drawn is that FF1 is recommended as the best denoising filter for most cases considered in this paper.

4 )
is a central processed pixel of a 3×3 window.R value = median (M j ) for j=1, 2, 3, … , 8 (1-N d ): the degree of the processed noisy pixel.R value is the reconstructed value of the new pixel; Mj represents the median values of 3×3 neighborhood windows for the processed central pixel in a 5×5 window as follow: The source image is partitioned into overlapping 2D blocks of size 5×5, which are processed sequentially in a raster scan fashion, left to right and top to bottom.Suppose that the processed pixel is W 00 the sliding window of 5×5 is shown below: (To calculate the median value for the central pixel W 00 , this region is divided into 8 sub regions of 3×3 windows each containing nine pixels as shown in Figure(3).

Table ( I
) Results of the test image "Cameraman"

Table III
Results of the test image "Bridge"