Out of focus blur estimation using genetic algorithm

Blur identification is the most important step of image restoration. Since now, many researchers have presented methods to estimate out of focus blur, but most of these methods suffer the additive noise. In this paper, a method is presented to estimate out of focus blur in noisy images precisely. Proposed method uses two rough estimate of blur function parameter, and then the real parameter is calculated using a genetic algorithm. The structure of out of focus blurring function was analyzed in frequency domain to develop a precise method. Experimental results showed proposed method was very precise.


INTRODUCTION 1
Blurring procedure is modeled as following equation in literature [3]: In this equation g, f, n and h are observed image, original image, additive noise (usually Gaussian), and PSF of blurring system, respectively. To restore original image using the observed image, the blurring function (h) should be estimated. The employed procedure to estimate this function is called blur identification [2]. There are two categorize of image restoration methods; in the first group, the restoration method restores images without exact estimation of blur and noise (these methods usually are called Blind Restoration). These methods are not dependent on the blur type. The EM (Expectation -Maximization) method belongs to this group. Second group of restoration methods use estimated blur. The restoration process in this group of algorithms is more precise than the first ones. Out of focus blurring is the most famous blurring function that occurs frequently in images. Several methods have been presented to estimate out of focus blur since now. Most of these methods do not work precisely in high level of noise. The method presented in [3], determines the exact location of blurred edges using LSF (Line Spread Function) analysis in spatial domain; however, the out of focus blur parameter is estimated by using this information. Another method that uses image LSF to estimate out of focus blur is presented at [7]. In this method, the power spectrum equalization (PSE) restoration filter in image form is used to restore original image. This method can be applied only onto small areas of frequency. The method presented in [5] uses block based edge classification to find amount of out of focus blur. This method works mainly on low and median frequency; therefore, sharp details are not improved in restoration process. There are some other methods that work in frequency domain; e.g edge information is employed to find out of focus blur in [4]; however, extended DCT approach was used for edge detection of Bayer pattern in this paper. In [8], a method is presented to compute image depth. To do this, an out of focus blur is employed and at the first step, its blurring parameter is estimated. The OTF (Optical Transfer Function) is used to estimate blur parameters in this paper. We have presented a method [2] that estimates out of focus blur when additive noise is greater than 55 dB. This method is based on modeling the zero crossing in log of Fourier spectrum. Also, another method is presented in [1] by us. This method is more precise than the first one but its accuracy is dependent on step size of its iterative algorithm. In this paper, we have presented a method to estimate out of focus blur. The method has no constraints and it can work in each noise level. The proposed method uses the properties of wiener filter restoration and Bessel function to estimate out of focus blur. To identify real parameter, two rough estimate of blur parameter are employed. To restore blurred image wiener filter is used. With Regards to the properties of out of focus blur function in frequency domain and structure of wiener filter a genetic algorithm estimates out of focus blur parameter. We have supposed that the noise model is Gaussian with zero mean. Also, we presented exhaustive experimental results in statistical form which can be used in method evaluation. The rest of paper is organized as follows: In section 2 blur model and its parameter are presented. In section 3 the blur estimation method is proposed. Experimental results are introduced in section 4 and finally we have concluded our conclusion in section 5.

OUT FOCUS BLUR MODEL
In most cases, the out of focus blur caused by a system with circular aperture can be modeled as follow [3]:  Otherwise (2) In this equation R is the radius of COC (Circle of Confusion). It has been shown in [9] that an accurate and complex physical model does not result in significantly restoration than this geometric model. By considering equation (2): to find blurring function it is significant to find R. The frequency response of (2) which is called OTF (Optical Transfer Function) is defined in (3) that is based on a Bessel function of the first kind [10]: Where J is the Bessel function of first kind and R is radius of COC. " Fig.1" shows the frequency response of equation (2) with specified radius.

BLUR ESTIMATION METHOD
With Regards to (2) to estimate blurring function, it is enough to estimate the R parameter that is radius of COC. To do it, we need some mathematical observations. Suppose that the radius of COC in equation (2) is R. If we consider another blurring function that its parameter is R 1 , then with regards to (3) H(u,v) shows the frequency response of degradation function and K is a constant that models signal to noise ratio. As it is shown in (7) and (8) H(u,v) and K should be estimated. The restoration process can be completed using these estimated parameters. Therefore, frequency response of degradation function (H(u, v)) and K should be estimated. Estimating signal to noise ratio which can be used in wiener filter to restore original image is addressed in [6]. The method presented in [6] employed a genetic algorithm with MSE (Mean Square Error) and IAWE (Image Activity Weighted Error) as its measure to estimate K. A genetic algorithm in a similar way will be presented here to estimate out of focus parameter. To present this genetic algorithm: At first, a arbitrary COC radius (R a ) is used to create a degraded function (H a ). If H a is used to restore original image, then It is obvious that DC part of degradation function (H a (0, 0)) should be 1, therefore, if additive noise average is assumed as zero, with regards to (6); the following equation can be concluded: H(0,0) = 1, therefore, F(0,0) = G(0,0) can be concluded. However, in the equation (13) the F a (0, 0) ,K and R are unknown parameters and Ra and F(0,0) are known ones. If the equation (13) is solved to find R then:

It is obvious that
is the estimated R using R a . If a proper K for wiener filter is estimated, F a (0,0) can be calculated. Therefore, finding the R is possible by using F a (0,0). The proposed genetic algorithm can estimate K and R simultaneously. To create a proper fitness function, another arbitrary parameter R b , its degradation function(h b ), and its corresponding restored image are needed. With Regards to (13) we can conclude that The proposed genetic algorithm is presented as below: 1-Randomly generates some zero and ones values. The created string is called gentype. 2-Normalize the value of gentype. 3-Use the value of normalized gentype as estimation of K and apply wiener filter on corrupted image using H a and H b to find F a and F b . 4-Calculate ′ and by using (14) and (16). 5-select and keep the best K that minimizes abs( -) 6-Cross over and or mutate the gentype to obtain new generation.(The cross over rate was selected as 0.3) 7-Repeat above steps till finding the best result of K. After running this algorithm, we have found the K value regarding to optimized R. Estimated values of or shows estimated value of R.

EXPERIMENTAL RESULS
To validate proposed method; a test bed that consist of more than 100 images was created. This test bed consists of standard images like Lena, Baboon, Barbara, etc that were degraded randomly by out of focus and additive Gaussian noise. The interval of random degradation parameter (R) was [2::16] and the random noise variance was [0:01::0:6]. The resolution of all images in the test bed was 256*256. After creating this test bed, proposed algorithm ran on these images. Table 1 shows some real parameters and their estimated values using proposed algorithm and Table 2 shows the average error and its standard deviation in presented method. This algorithm was able to estimate degradation parameter in images with high level of noise. " Fig.2" shows a blurred image and its corresponding estimated parameter using presented method. " Fig.3" shows a degraded image and its restored result using wiener filter.

CONCLUSION
In this paper, a precise and robust method is presented to estimate the out of focus blur function. In spite of other presented method since now, our method has no constraints and it can work on all defocused noisy images. This method estimates precisely blur parameters by using a genetic algorithm which was designed base on analysis of the image frequency response. The genetic algorithm estimates signal to noise ration and degradation parameter. To test this method some degraded images that additive noise were added to them were used. The type of image degradation was known and the presented method was used to estimate its parameter. The experimental results were satisfactory. In future work we are going to develop a method that can estimate the parameter more precisely.