Enhanced Color Filter Array Interpolation Using Fuzzy Genetic Algorithm

Covering sensor surface with a Color Filter Array (CFA) and enabling a sensor pixel sample only one of three primary color values, is how single sensor digital cameras capture imagery. An interpolation process, called CFA demosaicking estimates other two missing color values at every pixel to render a full color image. This study presents two contributions to CFA demosaicking: a new and improved CFA demosaicking method to ensure high quality color images and new image measures to quantify demosaicking performance. Though digital cameras are now more powerful and smaller, Charge-Coupled Device (CCD) sensors continue to associate only one color to a pixel. Called Bayer Pattern this color mosaic is processed to get a high resolution color image. Every interpolated image pixel includes a full surrounding pixels colors based color spectrum. This study uses an edge indicator function and edge directions are considered in the suggested interpolation method to avoid high frequency region artifacts and improve performance.


INTRODUCTION
Color Filter Array (CFA) is a distinctive hardware element in single-sensor imaging pipeline (Parulski and Spaulding, 2003).CFA, usually a Charge-Coupled Device (CCD) (Dillon et al., 1978) or Complementary Metal Oxide Semiconductor (CMOS) (Lulé et al., 2000) sensor is placed atop a monochrome image sensor to acquire image scene's low-resolution color information.Every sensor cell has its own spectrally selective filter and acquired CFA data constitutes a mosaic-like monochrome image (Fig. 1a) (Lukac and Plataniotis, 2005a).Information about color filters arrangement in CFA is known from camera manufacturers or it is got using Tagged Image File Format for Electronic Photography (TIFF-EP), where the gray-scale CFA image is re-arranged as a low resolution color image (Fig. 1b) (Lukac and Plataniotis, 2005a).This is the first operation in demosaicking (Lukac and Plataniotis, 2005b;Wu and Zhang, 2004;Gunturk et al., 2005) which use the spectral interpolation concept to estimate missing color components and produce a full-color image (Fig. 1c) (Lukac et al., 2005).
The color filters arrangement in the CFA is based on the manufacturer (Bayer, 1976;Yamanaka, 1977;Parmar and Reeves, 2004;Lukac and Plataniotis, 2005c).Consumer electronic devices, like image  that stores images in CFA format and use a companion personal computer to demosaick acquired image data, than for cameras which directly produce demosaicked images.Other construction differences are due to the intended application (consumer photography, surveillance, astronomy).Though mistakenly neglected in research, CFA choice influences single-sensor imaging pipeline accuracy (Lukac and Plataniotis, 2005c).
Both sharpness and color appearance of edges and the demosaicked image's fine details depend on CFA layout in edge area and its close neighborhood.If the captured image's signal structures size is smaller than an arbitrary color band's sampling frequency in CFA, demosaicking results in visual impairment like aliasing, more noise and color shifts (Lukac and Plataniotis, 2005a;Gunturk et al., 2005;Lukac and Plataniotis, 2004a).Thus, another CFA may eliminate artifacts in some areas of the demosaicked image while degrading image quality in others (Lukac and Plataniotis, 2005d).
Bayer pattern, also called CFA or a mosaic pattern, comprises of a repeating array of red, green and blue filter material atop each spatial location in the array (Fig. 2).These tiny filters enable a normally a blackand-white sensor to create color images.
By using 2 green filtered pixels for each red or blue, the Bayer pattern maximizes perceived sharpness in luminance channel which is usually of green information.But, as the image plane is under sampled, it does not lead to complete details.Also, color detail is lost due to the sensor's red and blue channels lower sampling density.Figure 3  Besides loss in sharpness due to under sampling, another factor contributes to image degradation: blur filters.Blur filters reduce color aliasing artifacts due to spatial phase differences among color channels (red, green and blue filters are next to each other).Two blur filters are placed in optical path: one to blur horizontally and the other vertically.Blur filters reduce color aliasing at the cost of image sharpness (Hubel et al., 2004).
Interpolation relevance is obvious in more advanced visualization contexts, like volume rendering, where it is common to apply texture to facets which compose a rendered object (Weinhaus and Devarajan, 1997).Though textures are given by models (procedural textures), it is usually limited to computer graphics applications; whereas in biomedical rendering, it is preferred to display texture produced by a map of true data samples.Due to geometric operations involved (perspective projection), this map has to be resampled and this involves interpolation.Also, volumetric rendering requires gradients computation best done by considering the interpolation model (Moller et al., 1997).
A more banal interpolation arises with images (as opposed to volumes) where a physician may want to inspect images at a coarse scale and study detail in fine scale for which interpolation operations like zooming-in and zooming-out are useful (Smith and Nichols, 1988;Unser et al., 1995).Related operations include (subpixel) translation or panning and rotation (Thévenaz and Unser, 1997).Less ordinary transformations involve a coordinate's change, for example polar-to-Cartesian, scan conversion function which converts acquired polar coordinate data vectors from an ultrasound transducer into a Cartesian raster image needed by display monitors.Another polar-to-Cartesian transform is in three-dimensional icosahedral virus's reconstruction (Fuller et al., 1996).
This study uses an edge indicator function where edge directions are considered in the proposed interpolation to avoid high frequency region artifacts and to improve performance.A mathematical model is suggested.Baranyi et al. (2004) proposed a generalized concept for fuzzy rule interpolation, i.e., an interpolation methodology, whose key idea was based on the interpolation of relations instead of interpolating α-cut distances and which offered a way to derive a family of interpolation methods capable of eliminating some typical deficiencies of fuzzy rule interpolation techniques.The proposed concept of interpolating relations was elaborated here using fuzzy-and semantic-relations, which presented numerical examples, in comparison with former approaches, to show the effectiveness of the proposed interpolation methodology.

LITERATURE REVIEW
Analysis of linear and non-linear interpolation techniques for three-dimensional rendering was proposed by Walia and Singh (1993) which presented a compared linear and non-linear interpolation techniques for shading of three-dimensional objects.It analyzed varied linear and non-linear interpolation techniques regarding differing shading parameters.It analyzed variation effect in specular highlight exponent on shading quality when linear and nonlinear interpolation techniques shaded objects.
Comparison of fuzzy interpolation and other interpolation methods in high accuracy measurements were proposed by Bai and Wang (2010), providing a comparison between a novel technique for pose error measurements and fuzzy error interpolation based robots compensations and other popular interpolation methods.By using the new fuzzy error interpolation technique, pose-error compensation accuracy was improved, as confirmed by simulation results compared to other interpolation methods.Simulation revealed that better accurate measurement and compensation results were possible through use of fuzzy error interpolation technique compared to its trilinear and cubic spline counterparts.
Size reduction by interpolation in fuzzy rule bases was proposed by Koczy and Hirota (1997) in which dense rule bases were reduced so that only minimal rules containing essential information in original base remain and other rules were replaced by an interpolation algorithm that recovered them with a certain accuracy prescribed prior to reduction.Lagrange method was used for the interpolation method, used for demonstration supplying best fitting minimal degree polynomial.The study concentrated on reduction technique which was independent from the interpolation model style, but is a tractable algorithm.An example illustrated potential results and the method's difficulties.
A color interpolation algorithm for Bayer pattern digital cameras based on green components and color difference space was proposed by Hua et al. (2010).The author suggested an interpolation algorithm that estimated green component first with adapted color plane interpolation algorithm and then computed color difference image to interpolate full resolution difference image with compensation of interpolated G and edge adaptive method.Edge blurring was addressed using edge judgment to estimate RGB.Color distortion was reduced using color difference interpolation process.Experiments showed that the new algorithm outperformed present interpolation methods regarding image quality and Peak Signal-to-Noise Ratio (PSNR).Computational complexity was also low.
A novel adaptive weighted color interpolation algorithm for single sensor digital camera images was proposed by Nallaperumal et al. (2007) where the new algorithm aimed at estimating missing G component in edge and texture regions while other color planes estimates were based on interpolated green plane value.When green plane was processed, for every missing green CFA component the algorithm performed a gradient test to identify edge direction and carried out interpolation in the direction of a smaller gradient to determine missing green component.The color differences variance is used as a supplementary criterion to determine green components interpolation direction.Based on sharpness, an adaptive weighted interpolation method was introduced.Experiments showed that the new method performed better than latest demosaicing techniques regarding CPSNR, correlation coefficient and SSIM.
A digital camera images design framework using edge adaptive and directionally weighted color interpolation algorithm was proposed by Thakur et al. (2009), where color interpolation or demosaicing of a raw image generated by digital still cameras with help of CFA was converted to a full color image by estimating each pixel's missing color components from neighbors.Empirical and visual results proved that the new method effectively produced a full color.
Local correlation based CFA interpolation was proposed by Aleksic and Lukac (2004), where the method produced restored full color image using edge adaptive interpolation and correction steps performed on color-difference planes.Correction steps improved interpolated color components initially in regions exhibiting correlation between blue/green and red/green channels higher than predetermined threshold.The scheme outperformed well-known CFA interpolation algorithms consistently, regarding both objective and subjective image quality measures producing visually pleasing images.
An adaptive CFA interpolation algorithm for digital camera was proposed by Chung and Chan (2006).By examining edge levels and color difference variance along different edge directions, missing green samples were estimated.Missing red and blue samples estimation was based on interpolated green plane.The algorithm reduced color artifacts.Compared to current state-of-art methods, the new algorithm ensured outstanding results regarding subjective and objective image quality measures.
An efficient CFA interpolation solution proposed by Lukac and Plataniotis (2004b), presented a scheme which suited single-sensor digital imaging devices.Using interpolation/correction steps along with a colordifference model and adaptive aggregated distances based edge-sensing mechanism; it produced excellent objective results and sharp, visually pleasing color outputs.The new method simultaneously outperformed well-known demosaicking solutions regarding objective and subjective image quality measures.
An adaptive weighting approach for image color and magnitude interpolation was suggested by Chen and Chen (2007) which presented a classification based weighting approach for Bayer pattern CFA image's color and magnitude interpolation.This approach's simplicity and effectiveness ensured demosaicing solution's fixed-point implementation on image processors.
Ricean code based compression method for Bayer CFA images as proposed by Chandrasekhar et al. (2010), where the new method exploited a context matching technique to rank neighboring pixels when predicting a CFA image pixel.It reordered neighboring samples so that closest neighboring samples of similar color were predicted on higher context similarity.Adaptive color difference estimation succeeded adaptive code word generation technique to adjust the rice code divisor to encode prediction residues.Simulation revealed the new algorithm getting improved compression performance compared to conventional lossless CFA image coding processes.Experimental results proved the new process as having best average compression ratio compared to latest lossless Bayer image compression algorithms using MATLAB, a technical computing language.

METHODOLOGY
This study uses an edge indicator function and edges directions are considered in the new interpolation method to avoid artifacts in high frequency regions and improve performance.

Adaptive CFA interpolation-smooth hue transition interpolation:
In adaptive CFA interpolation model, all pixels are divided into normal pixels and edge pixels.Smooth hue transition interpolation is used when pixel is not in an edge.Red hue is defined as a ratio between Red and Green colors and Blue hue is a ratio between Blue and green colors.Computation is carried out as stated below to interpolate missing blue value.
Case 1: If pixel location (m, n) has only green value and adjacent right and left pixels have blue color components, then information of blue color component at location (m, n) is calculated by: , Case 2: If pixel at location (m, n) has green value and adjacent top and bottom pixels have blue color component, then blue color component information at location (m, n) is calculated by: Case 3: If pixel at location (m, n) has only red value, then four diagonals are bluer.Blue color at location (m, n) is calculated by: Sobel and Canny edge detection methods are used for detection of edge pixels.But luminance or sharpness transition is not represented to perform interpolation.Edge transition based interpolation is used to avoid interpolation across edges and perform interpolation along edges direction.This study proposes a mathematical model at each edge pixel depending on surrounding pixel correlation.It defines two scenarios; one for horizontal directed edge and the other for vertical directed edge.Direction is determined by referring the next edge pixel (Naveen et al., 2013).The new mathematical model is explained using the Fig. 4 example.Assume that R is missing component.In the horizontal scenario, If G 1 >G 2 then: In the vertical scenario, If G 3 >G 4 then: Proposed fuzzy logic interpolation: Sustainable decision-making ensures complex and high uncertainty, ill-defined parameters due to issues of incomplete understanding.Socio-environmental system dynamics are not described by conventional mathematics due to inbuilt complexity and ambiguity (Andriantiatsaholiniaina et al., 2004).Also, sustainability is a polymorphous concept fraught with subjectivity.So, fuzzy logic is used for assessment as it is a scientific tool permitting modeling a system sans detailed mathematical descriptions with qualitative and quantitative data.Computations are with words, with knowledge being represented by IF-THEN linguistic rules.
Fuzzy logic is a multi-valued logic which quantifies uncertain statements, the idea being to replace two ''true'' and ''false'' boolean logical statements by continuous range of [0,..., 1], where 0 means ''false'' and 1 means ''true'' and values between 0 and 1 representing a transition between true and false.Fuzzy logic, avoiding sharp thresholds, approximates real world in its complexity better than simplifying Boolean systems.
Fuzzy logic models imprecise human thinking representing linguistic rules.Fuzzy rule-base combines fuzzy rules which combine different fuzzy sets.The simplest fuzzy rules depend on a fuzzy set.Fuzzy rules are ''if-then'' rules.When a condition is fulfilled, an action takes place.A fuzzy rule-base delivers fuzzy classification including a tuple of return values for each considered output classes whose values represent class assignment degree (Benz et al., 2004).
Based on correlation among surrounding pixels, a strategy to assign membership grades to surrounding horizontal and vertical pixels is formed.The four cases which follow are considered, where there is a possible edge horizontally.Likewise, where there are possible edges, vertical direction is considered.

Case 1: |G
Here assuming existence of a horizontal edge while horizontal neighboring pixels G 1 and G 2 have approximately same intensity (Tsai et al., 2002).
For horizontal scenario, if G 1 >G 2 then: If G 3 >G 4 then:

Fuzzy rule selection using genetic algorithms:
Genetic Algorithm (GA), an optimization method, is inspired by biological evolution and is an abstract model of sexual reproduction in a species population where data structure models genetic material, usually a string of symbols which is comparable to DNA.Fit population individuals survive to reproduce with their genetic material being recombined to form new individuals.Mutations introduce new genetic material resulting in successively better individuals of the breeding species.GA forms an electronic population, whose members adapts to the environment and fight for survival.GAs use genetic operations like selection, crossover and mutation to generate solutions that meet optimization constraints better.Surviving and crossbreeding possibilities are based on how well individuals fulfill target function.Best solutions set is kept in an array named population.GA needs no continuous or derivable optimized function to be a mathematical formula.This is why they are popular in practical technical optimizations.
Two GA operators, crossover and mutation define trial subset's size and structure accessible at each step.For example, when binary GA, implements a singlepoint crossover, possible offspring are limited to few choices on lines coinciding with hyper rectangle edges with two parents on opposite vertices.This hyper rectangle's size is based on distance between parents, while sampling density is proportional to crossing point's number.For example, potential offspring increases when a double-point crossover is resorted to, while uniform sampling is possible when implementing uniform crossover (Mantere and Alander, 2001).
Fuzzy rule-based systems were applied to many application areas like classification and control (Boriskin and Sauleau, 2010)  Roulette wheel selection (Lukac and Plataniotis, 2005d) selects n C chromosomes for operation.The chance on the roulette wheel is adaptive and given as: And J l is performance of model encoded in chromosome   ���⃗ .In this GA used is hybridized using local search to avoid local minima.
Local search: Local Search Procedures (LSPs) are optimization methods which maintain a solution, known as current solution and explore search space by steps in its neighborhood.They generally go from current solution to a better close solution, used in next iteration, as current solution (García-Martínez and Lozano, 2008).This process is repeated till a stop condition is fulfilled, e.g., there is no better solution in current solution's neighborhood.Three important LSPs are.
First improvement local search: Replaces current solution with randomly chosen neighboring solution with better fitness value.
Best improvement local search: Replaces current solution with best among neighboring solutions.

Randomized K-opt LSP (RandK-LS):
Looks for better solution by altering variable number of k components of current solution per iteration, i.e., dimension of explored neighborhood is variable.
Local search methods use local knowledge to improve solution's chances to propagate characteristics to the following generations.Due to the similarities in local search role within genetic search and role of learning in the evolution process, local search is viewed as a learning process (El-Mihoub et al., 2006).The way how information gained through local search is used in a hybrid GA impacts search process performance.Two basic biological learning models based approaches were adopted to use local information; the Lamarckian approach and Baldwinian approach.The third model, a mixture of basic models and its effectiveness, was proven in solving real-world problems.The pseudo code is (Tan et al., 2011): Begin Set control parameter µ = 4 and the number of chaotic local search k; generate a random number range 0 to 1 as y0 ∉ {0, 0.25, 0.75, 1.0}; generate chaotic sequences with the length of k according to x n = x j best + (-1)  Green plane interpolation: The green plane is sampled at a rate, twice as high as the red and blue planes in a Bayer CFA.The aliasing in green plane tends to be less than one in red and blue planes.But, using information from green plane, aliasing problems in red and blue planes are avoided.Green plane has the image's most spatial information and greatly influences image visual quality.For such reasons, green plane interpolation should be first.Referring to Fig. 5 where, A can be R or B and other K values, from K 3 to K 12 , are got similarly.Numbers of K are used for simple notation of K A in counter clockwise direction.To avoid artifacts in edges, specially fence region edges, weight functions are applied and edges directions are also considered.If only weight functions are used in fence regions where values change frequently, color artifacts are produced as interpolation carry out across edges due to undesirable similar weight values.This is avoided by considering edges directions.
By filtering degraded A ij values, denoised G ij value is estimated.The missing G value at A ij location is got by weighted sum of surrounding twelve K A values and given as: where, A ij is a denoised A value: and h denotes the support of w.D ij , a directional derivative of K, is defined as: There are 6 cases of D ij , minimum of D ij , is defined as:   , = � 1,7 ,  2,8 ,  3,9 ,  4,10 ,  5,11 ,  6,12 � Weighting constant of w, E k is obtained using index m, n in above Equation and given as: By introducing E k , Interpolation is performed along edge because undesirable pixels at different regions have similar weight values and do not participate in interpolation.w k A are weight functions for edge adaptive interpolation and expressed as: σ G is standard deviation of green channel and ∆G k and ∆A k represent absolute differences for every directional derivative of green channel and A channel at i, j pixel location respectively (Park and Kang, 2004).
For more accurate edge estimation, an edge indicator's harmonic mean function is used.When one channel indicates edge, weight function indicates edge due to harmonic mean's characteristic.So, edge information is reflected more accurately, as crosschannel correlation is considered in the new weight function.To filter degraded a value, a LLMMSE (Kuan et al., 1985) filter which is written as is used: where, h is support of local window and weight function is defined as: where, T is a predetermined threshold, not to calculate across edge.T is set to σA+2σn.An adaptive mean operator makes residual image whiter than when a simple square local window is used.With such a whitening procedure, NMNV model performs well to retain filtered images edge sharpness.By using Eq. ( 10 Here, K R is calculated directly using fully interpolated G channel values; w is similar to one in green plane except for different pixel location.Interpolation of B values is performed similar to R interpolation (Kim and Kang, 2005).

RESULTS AND DISCUSSION
In this study, a new adaptive CFA interpolation model is proposed.For the pixels in the normal regions of an image Hue transition interpolation technique is used whereas if pixel is not an edge then the estimation is done using adaptive CFA method.The fuzzy rule selection is based on Genetic algorithm and Hybrid GA which uses random local search is used for color interpolation.Figure 6 and 7 shows the sample image taken and interpolated image respectively.Figure 8 and 9 shows the original mange and reconstructed image after interpolation.Results are compared for two images by using Peak signal to noise ratio.PSNR is the subjective quality comparison method used in interpolation algorithms.Table 1 tabulates the PSNR achieved for the various techniques for sample image.
For the sample image used in Fig. 6, the proposed method gives average PSNR value of 43.12 for RGB  For the sample image 2 used, the proposed method achieves an average PSNR value 42.58 for RGB components.In proposed technique with edge direction and Hybrid Fuzzy GA PSNR increases by 5.41 and 0.87% compared to Adaptive CFA and Proposed technique with edge direction and fuzzy GA, respectively.

CONCLUSION
Single-sensor digital cameras capture images by covering sensor surface with CFA that each sensor pixel samples only one of 3 primary color values.An interpolation process, called CFA demosaicing is needed to estimate other two missing color values at pixels for a full color image.Conventional demosaicing techniques are bilinear interpolation, Bayer reconstruction and gradient-based reconstruction technique.This study uses fuzzy logic as in a pdf document and GA and Hybrid GA based fuzzy rule selection using random local search.Results reveal the efficiency of the new method.For sample image used, the new method achieves an average 42.85 PSNR value for RGB components.In the new technique with edge direction and Hybrid Fuzzy GA an improvement of 0.72 to 5.41% in PSNR is observed when compared to other techniques.
Fig. 1: Single-sensor imaging, (a) mosaic-like gray-scale CFA image, (b) color variant of the CFA image, (c) demosaicked full-color image enabled mobile phones, various digital still and video cameras and wireless personal digital assistants differ in the demosaicking solution used.Different cost and implementation constraints are expected for cameras

Fig. 2 :
Fig. 2: Typical bayer filter pattern showing the alternate sampling of red, green and blue pixels reveals a Bayer filter pattern decomposed into constituent colors, revealing sampling sparseness.Introduced in the 1970's, Bayer pattern improved state-of-the-art, but imposed constraints on digital camera design.Camera design should do the following: • Interpolate missing color data to create three complete color image planes (R, G and B) • Account for inherent reduction in sharpness of luminance and chrominance channels • Suppress color aliasing artifacts due to incomplete image data sampling

Case 2 :
|G 1 -G 2 | is small and |G 3 -G 4 | is arbitrary and G 1 ≈ G 2 ≈ G 4 .Here also there is a possible edge at the pixel location R and this edge's intensity depends on surrounding pixel values G 3 and G 4 .Case 3: This case is in connection with case 2, the difference here being pixels G 1 , G 2 and G 3 are approximately of similar pixel intensity, i.e., |G 1 -G 2 | is small and |G 3 -G 4 | is arbitrary and G 1 ≈G 2 ≈G 3 .Case 4: Here, all four connecting neighboring pixels G 1 , G 2 , G 3 and G 4 are considered as all are different then location R is interpolated as follows: i = (a il , b i1 , c i1 ... a in , b in , c in ) contains parameters of antecedent fuzzy sets A ij .j = 1...n.

Fig. 5 :
Fig. 5: The bayer pattern , KR and KB values around it should be calculated to estimate missing G values.As R or B values do not exist at the interpolation pixel's twelve neighbourhoods, KR and KB values are not calculated directly.Thus, R and B values average calculate KR and KB values in each direction and is given as:  1 =  −1,  =  −1, − � , + −2, � 2  2 =  −2, −1  =  −2, −1 − � −2, + −2, −2 � 2 ),  ̂, is obtained by:  ̂, =  ̅ , +   2 (, )−  2   2 (, ) � , −  ̅ , � where,  ̅ , and σ2A (i, j) are local spatial mean and local variance of A values from running square windows on Bayer format, respectively and σ2n is variance of noise regarded as known value in this study.Or else, it is easily estimated by calculating the smooth region's local variance.Red and blue plane interpolation: Though red and blue planes are sparsely sampled than green planes, they are quickly interpolated by using a fully interpolated green plane and K R and K B domains.Similar to green plane interpolation the missing R value at B location is estimated adaptively by R B :

Fig. 10 :
Fig. 10: PSNR for image 1 n y n calculate fitness values of k individuals inn POPn u sin g objective function; find out the individual with best fitness value IND nb in POP n ; if IND nb is better than IND cb then IND nw← IND nb (where IND nw is the individual with worst fitness value in POP c ) end As ensemble statistics are replaced by local spatial statistics estimated from degraded image, the adaptive noise smoothing filter's performance depends on the method to calculate local statistics.An efficient and effective way to estimate local statistics is to take weighted sample mean and variance from a running square window as: � , � =

Table 1 :
PSNR for image 1 and 2