Journal of Electrical and Computer Engineering

Volume 2016, Article ID 2374926, 12 pages

http://dx.doi.org/10.1155/2016/2374926

## Restoration of Partial Blurred Image Based on Blur Detection and Classification

School of Automation Science and Electrical Engineering, Beihang University, Haidian District, Beijing 100191, China

Received 15 September 2015; Accepted 6 December 2015

Academic Editor: William Sandham

Copyright © 2016 Dong Yang and Shiyin Qin. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

A new restoration algorithm for partial blurred image which is based on blur detection and classification is proposed in this paper. Firstly, a new blur detection algorithm is proposed to detect the blurred regions in the partial blurred image. Then, a new blur classification algorithm is proposed to classify the blurred regions. Once the blur class of the blurred regions is confirmed, the structure of the blur kernels of the blurred regions is confirmed. Then, the blur kernel estimation methods are adopted to estimate the blur kernels. In the end, the blurred regions are restored using nonblind image deblurring algorithm and replace the blurred regions in the partial blurred image with the restored regions. The simulated experiment shows that the proposed algorithm performs well.

#### 1. Introduction

Image deblurring is one of the most classical and challenging problems in image processing. There are several reasons which can cause blur. The first reason is the relative motion. If the object in the view field of the camera moves during the exposure, the images which the camera captured are motion blurred images. The object region in the image is motion blurred. The second reason is out of focus. If the object in the view field of the camera is not in the focus of the camera during exposure, the images which the camera captured are defocus blurred images. The object region in the image is defocus blurred. The third reason is the blending of the above two reasons. If the object in the view field of the camera moves during the exposure and the object is not in the focus of the camera, the images which the camera get are blend blurred images. The object region in the image is blend blurred. Based on the above analysis, we can find the blur is corresponding to the object; this results in the partial blurred image. The object regions in the image which satisfy one of the above three reasons are blurred. The other regions of the image are not blurred. It is a very challenging problem to restore the partial blurred image, because the blurred regions and the clear regions coexist in one image. One solution is to restore the whole partial blurred image using the same blur kernel; this will cause unpleasant artifacts in the clear regions. Another possible solution to solve this problem is to detect the blurred regions in the partial blurred regions and then restore the blurred region using the image deblurring algorithm; this solution can avoid causing artifacts in the clear regions. The detection of the blurred regions in the partial blurred image is called blur detection. It is a very complex problem, and it is very important for partial blurred image restoration. Once the blurred region is extracted from the partial blurred image, the following problem is to estimate the blur kernels. For the defocus, motion, and blend blurred regions, their blur kernels can be expressed in mathematic model. They will be introduced in the following paragraph. If the blur class can be confirmed and the structure of the mathematical model is known, we just need to estimate the parameters of the model. But in many situations, the blur class which the blurred region belong to is not known. For example, we do not know whether the blurred region is a defocus blurred region, a motion blurred region, or a blend blurred region. The blur classification algorithm can solve this problem; it can classify the blurred region into a blur class. The proposed algorithm restores the partial blurred image using blur classification algorithm and blur detection algorithm. The blurring process can be shown as follows:where denotes blurred image, is the latent clear image, denotes convolution operator, is blur kernel, and denotes noise. The blur kernels of the different kinds of blur are not the same. For instance, the mathematic model of motion blur is a line; it can be shown as follows:where is blur kernel; the sum of all the elements of is 1. denotes the horizontal coordinate, means the vertical coordinate, is blur scale, and is blur angle. The mathematic model of defocus blur is a disk; it can be shown as follows:where is blur scale. The mathematic model of blend blur kernel is the convolution of the above two blur kernels. It can be shown as follows:

Based on the above image blurring model, the image deblurring theories and algorithms developed very fast. In the beginning, the filter based image deblurring algorithms such as Wiener filter [1] are successfully used in image deblurring. The method can be shown as the following equation:where denotes the Fourier transformation of the restored image; we can use inverse Fourier transformation to get the restored image; denotes the conjugation of the Fourier transformation of the blur kernel, is the power spectrum of the noise, and is the power spectrum of the blurred image. denotes the Fourier transformation of the blurred image. Then, the regularization based image deblurring algorithms developed very fast; this kind of methods performs very well in image deblurring; it is still the mainstream of image deblurring algorithms. The basic idea of the regularization based algorithm is to construct a regularization term which can ensure the restored image satisfy a special condition. The construction of the regularization term is the key point of regularization based methods; the most famous regularization term is called TV (Total Variation) [2] which will be introduced in detail in the following paragraph. The regularization based image deblurring can be modeled as the following equation: where denotes the restored image. The first term is data fidelity term; the second term is regularization term; it is a function of the latent clear image . Given the mathematic model, we can get the restored image by solving (6). Some of the regularization terms are very complex; the analytic solutions of these methods are very hard to get, so the optimization technique is used to get an optimal solution. The construction of the regularization term and the methods to solve (6) are two most important key points. Most of the regularization based image deblurring algorithms are focused on solving these two problems. As the image deblurring technique developed, more complex image deblurring problems are proposed. The restoration of partial blurred image is one of them. This paper proposes a solution of this problem based on blur detection and classification.

#### 2. Related Works

Some regions of the partial blurred image may be blurred while the other regions remain clear. The restoration of this kind of complex blurred image is a very challenging problem. The solution for this problem contains two key points. The first is how to extract the blurred region from the partial blurred image which is called blur detection. The second is the classification of the extracted blurred region which is called blur classification.

Blur detection and classification are two meaningful problems. If we can detect blur regions from a partial blurred image, some useful information can be extracted from the detection result; for example, the moving object often causes motion blur; it can be extracted from the detected blurred regions. The blur classification also brings out meaningful results. The kernel structure is corresponding to their blur class. Some algorithms can get the depth information from the defocus blurred image [3].

Liu et al. [4] propose a blur detection algorithm which performs well in blur detection. In their method the local power spectrum slope is adopted to describe the frequency domain feature. The gradient histogram span is used to describe the time domain feature. The maximum saturation is also adopted. Shi et al. [5] brought out a new blur detection algorithm which is based on the effective features. Shi’s method performs well. The output of their detection algorithm is an image; the pixel value of each point is corresponding to a score; this score is a measure which can describe the probability that this point belongs to blur class or clear class. But there are some wrong classified points whose scores are not corresponding with their blur class in their detection results. The blurred regions in the partial blurred images often correspond to a specific object, for example, a ball. If there are wrong classified points in the ball area, we cannot extract the entire ball area from the partial blurred images. The colors of the points in the same blurred area are often the same, so image segmentation algorithm can be adopted to improve the result. The details will be introduced in the following paragraphs. We propose a new blur detection algorithm based on image segmentation to improve the detection result.

The image gradient distribution is a very important feature to classify different kinds of image. A new generalized Gaussian distribution which is proposed in [6] is adopted to describe the gradient distribution. It is successfully used in image processing. For the defocus blur, the blur kernel affects the gradient distribution of the blurred image in all the directions in the same manner, while the motion blur kernel affects the gradient distribution of the blurred image in all the directions in different manners. For the direction of the blur kernel, the gradient distribution is affected more seriously than the other directions. So we use it to describe the different kinds of blur. In order to classify the different kinds of blurred images more precisely, the image frequency domain feature needs to be added to the final classification framework. So the Radon transformation is adopted. The Radon transformation of an image is its projection along a direction. For different blurred images, their Fourier transformation images are different. This is because the convolution in the time domain is equal to multiplication in frequency domain. The convolution of clear image and blur kernel is converted into the multiplication of the Fourier transformation of the clear image and the Fourier transformation of the blur kernel. The different blur kernels will affect the blurred images in different way. In order to describe the difference, the Radon transformation of the Fourier transformation is also used to classify the different kinds of blur.

After the blur class of the extracted blurred region is confirmed, the following procedure is the blur kernel parameter estimation. The cepstrum is adopted to estimate the parameters. In the end, the nonblind image deblurring algorithm is adopted to restore the blurred region.

#### 3. Restoration Strategy Based on Blur Detection and Classification

##### 3.1. The Necessity of Detection and Classification of Blurred Regions

The difficulty of restoring the partial blurred image is obvious. It contains clear regions and blurred regions. If the whole image is considered to be a blurred image, the blur kernel estimated from this image is obviously not suitable. If the whole image is considered to be clear image, it is not suitable too. So the clear regions and the blurred regions should be processed in different way. The strategy is to detect the blurred regions and restore them while keeping the other clear regions unchanged.

##### 3.2. The Restoration Scheme Based on Blurred Regions

Given a partial blurred image, the blur detection algorithm is adopted to detect the blurred regions; then the blur classification algorithm is adopted to classify the different blurs. The blur detection procedure is finished in a coarse to fine mode. Firstly we get the coarse detection result; then we use image segmentation to refine the detection result. The blur classification procedure includes two steps. The first step is feature extraction; the second step is the classification based on SVM (Support Vector Machine) [7, 8]. Then, the blur kernels are estimated from the blurred region. In the end, the final restored image is the recombination of the restored version of the blurred region and the clear regions. Figure 1 is the flow chart of the proposed algorithm.