DETECTING AND CORRECTING MOTION BLUR FROM IMAGES SHOT WITH CHANNEL-DEPENDENT EXPOSURE TIME

This article describes a pipeline developed to auto ma ically detect and correct motion blur due to the airplane motion in aerial images provided by a digital camera system with cha nnel-dependent exposure times. Blurred images show a nisotropy in their Fourier Transform coefficients that can be detected and est imated to recover the characteristics of the motion blur. To disambiguate the anisotropy produced by a motion blur from the possi ble spectral anisotropy produced by some periodic p atterns present in a sharp image, we consider the phase difference of the Four ier Transform of two channel shot with different ex posure times (i.e. with different blur extensions). This is possible becaus e of the deep correlation between the three visible channels ensures phase coherence of the Fourier Transform coefficients in harp images. In this context, considering the phas e difference constitutes both a good detector and estimator of the motion blur para meters. In order to improve on this estimation, the p ase difference is performed on local windows in the image where the channels ar e more correlated. The main lobe of the phase diffe rence, where the phase difference between two channels is close to zero ac tually imitates an ellipse which axis ratio discrim inates blur and which orientation and minor axis give respectively the orientation an d the blur kernel extension of the long exposure-ti me channels. However, this approach is not robust to the presence in the phase difference of minor lobes due to phase sign invers ions in the Fourier transform of the motion blur. They are removed by considering th e polar representation of the phase difference. Base d on the blur detection step, blur correction is eventually performed using two d ifferent approaches depending on the blur extension ize: using either a simple frequency-based fusion for small blur or a semi bli nd terative method for larger blur. The higher com puting costs of the latter method make it only suitable for large motion blur, when the former method is not applicable. * Corresponding author.


INTRODUCTION
Since the late 1990's, the development of airborne digital acquisition brought many improvements, especially in the radiometric quality of images where each pixel could be given a physical value after a radiometric calibration of the camera, which was not the case with silver film.The missions often take place in summer when the brightness is optimal.Nevertheless, the tree foliage could hide some ground level objects as roads or rivers.The only way to have leafless trees is to fly the mission between autumn and spring when the luminosity is weak.Thus, the exposure time should be increased, at the risk of causing motion blur.
Fortunately, the images in which the blur is significant (more than 2 pixels) often represent a very small proportion of the mission.Our article proposes an automated pipeline that detects blurred images and removes the motion blur according to the blur extension.First, we will describe the channel-dependent exposure time camera for which our method is designed.Then we will review the previous work done on the topic of blur correction.Our pipeline will then be presented in two parts: first, a blur detector taking advantage of the specificity of our camera, then a step of correction that will depend on the blur extension.Some results on real images eventually illustrate the reliability and the relevance of the method.

Data acquisition
The images used in our study are provided by a multi-channel camera system designed by the French National Mapping Agency (inset Figure 1).This multi-sensor system has been preferred to a classical Bayer sensor for many reasons.Among them, the lack of colored artifacts, a better dynamic range in the shadowed areas and the possibility of using a fourth channel in the near infra-red wavelengths for remote sensing applications.We will only work on natural color images where only the visible wavelengths (between 380 and 780 nm) are considered.
The relative response of the three channels (R, G, B) are influenced by the KAF-16801LE sensor performances (Eastman Kodak Company, 2002) and by the colour filter transmission (CAMNU, 2005) as illustrated on Figure 1.In particular, the response in the blue channel is very low relative to other channels.The blue signal is enhanced by augmenting the exposure time which ensures a good signal to noise ratio (SNR) along with a better dynamic range in the blue channel.
Conversely, for highly luminous scenes, the response in the red channel is very high, such that it may cause sensor saturation, even for small exposure times (Figure 1).To avoid this, another correction, has been brought to the red camera by reducing its The motion blur produced by the movement of the airplane (which is, in first order approximation, rectilinear and uniform) is corrected by Time Delayed Integration: the charge on each pixel are physically shifted in the sensor matrix in order to compensate the airplane's uniform movement knowing its elevation and speed.The device reaches a precision of half a pixel (CAMNU, 2005) and allows long exposure time acquisitions.However, it has some limits: the compensation is only made for a motion blur induced by the principal movement of the airplane and doesn't take into account perturbations such as drifts or rotations.They may cause a motion blur ranging from one to ten pixels in some images.
Figure 1.Cameras response for constant exposure and aperture (inset: 4 channels digital camera used in our study)

Motion blur model
We assume that the blur kernel is a rectangular function centered on zero along a single direction.The exposure time is supposed to be short enough not to integrate non-uniform movements from the airplane.The best way to represent a linear blur is to consider the blurred image i as a convolution of the sharp image f by a blur kernel h: The additive noise n will be neglected in the step of blur detection (the good SNR of the imaging system allows us to make this assumption).This quantity will yet be significant in the step of deconvolution.Applying a Fourier Transform (FT) to a convolution leads to a product: Using a channel dependant exposure time to shoot the images has the effect of returning three images with three different motion blur kernels.Those kernels have the same orientation but different extension: according to the Table 1 and assuming that the blur extension is proportional to the exposure time, in the same shot the blur extension h red in the red channel is about 3 times smaller than h blue in the blue channel and about 2 times smaller than h green in the green channel.After neglecting the noise, the model (2) becomes:

RELATED WORK
Image restoration has gained in importance with the arrival of digital photography and the development in computer sciences; it is now a fundamental topic in image processing.With the evolution computer resources, methods of increasing complexity have become feasible.With very little information, blind or semi-blind deconvolution algorithms can restore photographs.In a different way, pansharpening algorithm could also be a solution.

Pansharpening approach
In the case of blurred images, there is a loss of information in the high frequencies of the Fourier domain.Some imaging systems produce two versions of the same image: a high resolution grayscale version and a low resolution color version.One solution is to replace, in the Fourier domain, the altered high frequencies of the low resolution image by the frequencies of the full resolution panchromatic image.An equivalent method (Strait et al., 2008) is to do the same operation in a wavelet domain where the detail levels of the low resolution image are replaced by the ones of the panchromatic image.Another solution (Strait et al., 2008) is to work in the IHS space (Intensity-Hue-Saturation) and replace the intensity of the low resolution image by the one of the full resolution panchromatic image.
Yet in the case of a color image where the three channels are taken with different exposure times, the completion of the frequencies in the Fourier domain would be preferable to the IHS method.Even if the channels are well correlated together, replacing the intensity by a specific channel (where the image is sharp) wouldn't give suitable results.

Bayesian approach
In the case of blind deconvolution, the problem is twofold.First, the blur should be characterized (determination of the PSF) then it should be removed from the image (deconvolution).A general approach would be to look for a function that maximizes the probability of obtaining the desired result according to the data we already have.Let's define h as the image of the PSF we are looking for, f the desired sharp image (latent image) and (i,h) the knowledge we have at our disposal: After applying Bayes' law to (4) and also writing it as an energy minimization problem: Where p(i,h|f) is the maximum likelihood and p(i,h) the a priori.This Maximum a Posteriori (MAP) problem is an ill-posed problem.The a priori knowledge is a constraint that helps to find the best solution among all the possible ones.

Single image method
Historically, the two most classical approaches are the ones proposed respectively by Wiener (Wiener, 1964) and Richardson (Richardson, 1972).Wiener filter is the solution of a MAP problem based on an energy minimization implying a regularization term.The regularization term is a function (often depending on SNR) that will have an influence on some aspect of the restored images (noise, smoothness, etc.).Richardson-Lucy deconvolution is an iterative procedure which converges on the maximum likelihood solution.Both methods return restored images with some unaesthetic artifacts (ringing for example).
A more recent study (Fergus et al., 2006) proposes a multi-scale method to estimate the blur kernel using a MAP approach based on the gradient distribution of the image.The restoration step is done using Richard-Lucy algorithm.This method returns good results, yet, to obtain satisfying results an operator should choose a relevant area (typically an area without saturated pixel) on the image to run the blur kernel estimator.

Multi-image method
Another way to obtain good a priori information on the latent image is to use several images with different blur extensions.
Lim (Lim et al., 2008) uses a short exposure time image (with noise) and a long exposure time images (with motion blur) of a same subject to obtain a deblurred and denoised image.The blur kernel is estimated by comparing the images of autocorrelation and inter-correlation between the two images.However, the results obtained with our images weren't satisfying.This method isn't suitable for images shot with different channels.An iterative approach is proposed by (Tico et al., 2007) where the PSF estimation and the image deconvolution are performed at the same time.The initial PSF is a rough estimation which is refine by repeating the operation on the roughly deblurred image.The model used in this method is close to (Lim et al., 2008) and gives better results, yet it remains slow.These methods imply the existence of a short exposure image which is not always our case.In addition, the images taken by the three channels of our imaging system are not exactly the same.

PROPOSED APPROACH
The presented method could be divided into two parts: first a blur detector using two channels of the imaging system and returning an estimation of blur extension and estimation, then a step of restoration taking into account the blur parameters obtained in the first time.

Blur detection and first estimation
In a previous work (Lelégard et al., 2010) we showed that considering the phase difference constitutes a robust way to detect images with motion blur.This consideration was based on the fact that the structure of an image is mostly held by the phase of its Fourier transform (Oppenheim and Lim, 1981).Let's define ∆φ as the phase difference between the red channel image (where the exposure time is the shortest) and the blue channel (with the longest exposure time).As the three channels are quite correlated with each other, the phase difference in the case of sharp images is close to zero: Yet instead of performing the phase difference on the whole image, it will be defined as a mean of ∆φ calculated on small patches (128x128 pixels) and weighted by a relative coefficient { 1 -"mean of the saturation channel on the patch" } in order to give more importance to patches where the three channel are correlated.
In order to emphasize the frequency regions where the phase difference is close to zero and have a better visualization of the phenomenon, (Lelégard et al., 2010) provides an ad-hoc definition of ψ equivalent to: This quantity (Figure 2) often imitates a circle (sharp images) or an ellipse (blurred images).The blur parameters can be easily derived by fitting an ellipse on the gradient of a thresholded version of ψ.The orientation of the main axis of the ellipse is perpendicular to the motion blur kernel orientation and the minor axis is inversely proportional to the blur extension.
In very few cases, some ψ show minor lobes (Figure 2, right example) which bring bad estimation of the ellipse parameters.
Those specific ψ are easy to detect by setting a threshold on the residual variance with the fitted ellipse.In order to remove the minor lobes, ψ is represented in polar projection (Figure 4).For each column, a region-growing is performed from the bottom to the top with a double threshold on ψ intensity (it stops under a certain value, where the coefficient are no more correlated) and on ψ gradient (it stops when the value of the gradient changes, before the appearance of a minor lobe).The possible mistakes in the region growing process will be smoothened by mathematical morphology filtering.

Image restoration
The score ρ is defined as the ration of the small axis on the large axis.A distinction will be made between the case ρ ≥ 35% and the case ρ < 35%.The value of 35% ratio is chosen according to the ratio between the exposures times of the red and the blue cameras (which is about 33%).

For small motion blur
For ρ ≥ 35%, the red channel could be assumes as a sharp channel (the blur kernel is less than a pixel in this case).By considering the red channel as a reference channel, one could consider a pansharpening method to restore the image.
For small motion blur we replace the altered coefficient in the green and blur channel by the one of the red channel that is considered as unaltered.The selection of the coefficient in the green and the blue channel are done according to the blur parameter returned in the previous step.The blur is overestimated (the spectral mask is narrowed) in order to give priority to the sharpest channel.The process is illustrated in Figure 3.
Figure 3. Pansharpening approach used in the case of small motion blur (when the red channel remains sharp)

For large motion blur
However, for ρ < 35%, all the channels are blurred.In this case, the way we choose to restore these images blurred with a large kernel is to use a semi blind approach.

Figure 4. Minor lobes removal
In order to deal with our problem, we choose a fully automatic approach close to (Fergus et al., 2006) and developed by Shan in (Shan et al., 2008).It is an iterative single image approach especially relevant in the case of large blur extension.This semi-blind deconvolution is illustrated by the Figure 6.It is a MAP problem where the latent image and the blur kernel are the a priori.Let's suppose that the kernel h is independent from the latent image f: The quantity p(i|f,h) is the maximum of likelihood and is here to minimize the noise produced by the deconvolution.Shan works on a derivative-dependent model of noise to limit noise multiplication in the flat area of the image.The blur a priori p(h) supposes that the kernel is mostly composed of zero.Its distribution follows an exponential law.Eventually, the latent image a priori p(f) could be decomposed as a product of two terms p l (f) and p g (f) relative to the local and global behaviors of the desired image.The global term p g (f) is based on observations made by (Roth and Black, 2005) and (Weiss and Feeman, 2005) that show that the gradient distribution of an image follow a distribution Φ focusing on two distinct behavior of the gradient distribution (where x refers to the gradients values): The local term p l (f) limits the ringing effect in the restored image.It constrains the flat area of the image to remain close to the original blurred image.
( ) The energy E is here defined by the relation (11).Each line of the equation ( 11) corresponds respectively to p(i|f,h) , p g (f) , p l (f) and p(h).M is a binary mask with value 1 for smooth area and 0 either (Figure 5).It is obtained by calculating a standard deviation on a sliding windows followed by a thresholding.The minimization of the energy is performed after separating the determination of the latent image (the three first lines of ( 11)) from the one of the blur kernel (the last line of ( 11)).
( ) ) The parameter γ constrains φ to be close to ∂f.The choice of its value has an influence on the speed convergence of the algorithm.As Φ is convex each term could be minimized separately.Now let assume that φ is fixed and f is the variable: This equation can be solved in the Fourier domain.In fact, on could apply Plancherel's theorem, which states that the sum of the square of a function equals the sum of the square of its Fourier transform.The equation ( 12) is equivalent to: The blind determination of h is performed in order to estimate a more accurate kernel than the one returned by our blur detection step.In this step, f is fixed and the energy E is limited to the first and the last line of ( 11 I order the find the blur kernel h, (14) is solved under its matrix form: ( ) As the kernel h is assumed to be small (less than 20 pixels), its matrix form H has a moderate size (less than 400x400).To keep a reasonable size, A and B are matrix forms of a crop of their relative images.The resolution is based on a method developed by (Kim et al., 2007).

RESULTS
In most of the cases, the blur extension in the blue channel (the one with the maximum exposure time) is less than three pixels.This kind of blur could be corrected with a pansharpening approach (Figure 8) present a part 4.2.1.Even if the corrected image looks sharp, the radiometry is slightly altered.Yet this inconvenience will be unnoticed for the user of the final product.
In the case of larger motion blur, the more sophisticated approached proposed by (Shan et al. 2008) brings interesting results.Even if the ringing artifacts are still there (Figure 7) the idea of looking for a more accurate model of kernel is justified by the fact that the ellipse detection (Figure 3) often overestimates the blur extension.In addition, the rectangular uniform model of the motion blur is an approximation that isn't strictly relevant for large blur extension.Yet the computing time of Shan's iterative deblurring method is the main drawback of the process especially on large aerial images.

CONCLUSION
The process presented in this article is an improvement of a previous work based on a blur detector (Lelégard et al., 2010).A step of blur estimation and two kind of correction depending on the blur extension have been added to complete the process.The results are quite promising and an application in an operational context is conceivable at least in the case of images with small blur extension requiring only a pansharpening correction using the high frequencies of the non-blurred channel, in our case the red one.
Yet the correction of larger blur extension still returns unaesthetic ringing artifacts.A possible improvement would be to correct the three channels by using spectral information in the three channels together as it is done in the pansharpening approach and not independently for each channel as it is done in this current work.Another perspective would be the exploitation of the in-flight inertial measurements to derive the blur kernel estimate.

Figure 2 .
Figure 2. Examples of phase difference ψ for a sharp image (left) and for blurred images (right)

Figure 5 .
Figure 5.A binary mask obtained with a 21x21 pixels window

Figure 7 .
Figure 7. Result of the blur correction step using the iterative approached developed by (Shan et al., 2008) Left: the original image.Right: the restored image.

Figure 8 .
Figure 8. Result of the blur correction step using the pansharpening approach.Top: the original image.Bottom: the restored image.

Table 1 .
aperture.The following table summarises the specificities of the airborne camera system that provided the data exploited in this study: Aperture and exposure time for each channel