# Motion Blurring Direction Identification Based on Second-Order Difference Spectrum

Junxiong Zhang, Fen He, Wei Li

► To cite this version:

Junxiong Zhang, Fen He, Wei Li. Motion Blurring Direction Identification Based on Second-Order Difference Spectrum. 4th Conference on Computer and Computing Technologies in Agriculture (CCTA), Oct 2010, Nanchang, China. pp.102-109, 10.1007/978-3-642-18336-2_12. hal-01562770

HAL Id: hal-01562770

https://inria.hal.science/hal-01562770

Submitted on 17 Jul 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Motion Blurring Direction Identification Based on Second-order Difference Spectrum

Junxiong Zhang¹, , Fen He², Wei Li¹*,

¹ College of Engineering, China Agricultural University, Beijing, 100083, P.R.China
{Zhang_junxiong, cau2004}@163.com

² Chinese Academy of Agricultural Engineering, Beijing, 100125, P.R.China
hefen_2005@163.com

**Abstract.** An identification method for uniform linear motion blurring direction based on second-order difference spectrum was proposed. The power spectrum of the blurred image was calculated after the Laplace second-order difference, and then the power spectrum was processed by the homomorphic filtering and the circular low-pass filtering. The blurring direction was attained by linear fitting of the frequency points with highest amplitude selected from the spectrum image. The experiments were carried out by using the blurred images which were simulated by the Lenna standard images with the blur extent being 20 pixels, and the mean square error of detection were 1.32° without additional noise and 2.27° with Gauss noise that the variance was 0.01. When using the real blurred images, the accuracy of the detection was -0.54°. This proposed method is proved to be available for motion blur of random plane direction and adaptable for noise.

**Keywords:** Image processing, Direction identification, Second-order difference, Motion blur, Fourier spectrum

## 1 Introduction

Motion blur occurs when there is relative motion between the camera and the object in the process of images collection. And it always exists in dynamic, real time image inspecting systems. In order to restore the blurred images, we often need to know Point Spread Function (PSF), which becomes the key of identification of motion blurring direction and extent.

According to the Fourier transform features of uniform linear motion PSF, the zero value dark stripes with equal interval existed in the power spectrum of the blurred images and the direction of dark stripes is perpendicular to the direction of motion blurring. In 1976, Cannon used this characteristic to estimate the uniform linear motion PSF of blurred images, while this method was sensitive to noise, it was usable when images' signal-to-noise ratio is high [1]. Chang and Savakis proposed bi-spectrum and residual spectrum matching methods, which overcome Cannon

* Corresponding author; E-mail:cau2004@163.com
method's disadvantages [2], [3]. But the bi-spectrum method need large numbers of data observed which have three-order stability, and the residual spectrum matching method need original image spectrum, noise variance, PSF styles, and other transcendental knowledge. Yitzhaky got some achievements in PSF estimation of motion blurring and vibrational blurring images, adopted 2x2 differential operator to identify motion blurring direction, and calculated the blurred extent according to differential image autocorrelation function [4], [5], [6], [7]. But this method's effect was better when the motion blurring direction was in the range of 0° to 45°. Chen thought that any planar motion blurring PSF was generalized tri-diagonal matrix, and firstly carried out the motion blurring direction identification [8], [9], [10]. Some other researches identified blurred direction through Radon transform of image Fourier spectrum [11], [12].

In this paper, a novel motion blurring direction identification method was proposed based on blurred image second-order difference Fourier spectrum, and motion blurred images collected in experiments and standard images were validated and the accuracy was detected.

## 2 Motion blurred image frequency character

The process of image motion blurred degeneration is the convolution of original image $f(x, y)$ and PSF $h(x, y)$ adding noise $n(x, y)$ to get degeneration image $g(x, y)$, and it is shown by formula (1),

$$g(x, y) = h(x, y) * f(x, y) + n(x, y) \quad (1)$$

The both sides of formula (1) are Fourier transformed, and according to convolution theorem, the generation model's frequency expression is

$$G(u, v) = H(u, v)F(u, v) + N(u, v) \quad (2)$$

Where $G(u, v)$, $H(u, v)$, $F(u, v)$ and $N(u, v)$ were the Fourier transform of $g(x, y)$, $h(x, y)$, $f(x, y)$ and $n(x, y)$ respectively. In particular, for uniform linear motion in horizontal direction, and without noise influence, $L-1(L$ is blurred extent) dark stripes perpendicular to the motion blurring direction occurred in power spectrum of blurred images, and the motion blurring direction was obtained according to the dark stripes' direction.

Figure 1(a) is the static fruit image, and (b) is the Fourier power spectrum of (a). (c) is the image that (a) was simulated with blurred extent being 11 pixels along the horizontal direction, and (d) is the Fourier power spectrum of (c). (e) is a practical collected blurred image, and (f) is the Fourier power spectrum of (e).

<figure><img src="image_2.png" /><figcaption>(a)</figcaption></figure>

<figure><img src="image_3.png" /><figcaption>(b)</figcaption></figure>
<figure><img src="image_4.png" /><figcaption>Fig. 1. Fruit image and its Fourier power spectrum</figcaption></figure>

When neglecting the noise, the dark stripes perpendicular to motion blurring direction obviously existed in Fourier power spectrum of blurred image. But in practical image collecting, noise is inevitable, dark stripes in vertical direction can be observed constrainedly in Figure 1(d). The reason is that in original image Figure 1(a) the system noise after motion blurred was processed equably, and its effect was reduced. But for practical collected image, in Figure 1(e), the system noise was not neglected, in Figure 1(f), the dark stripes were not obvious, then, it was hard to estimate the motion blurring direction according to the dark stripes' direction.

## 3 Motion blurred direction identification

Observed from Figure 1(d) and (f), the linear motion blurring weakened the image high frequency signal, but in motion blurring direction and its vertical direction, the image high frequency detail part changing extent were different. Though the dark stripes in frequency spectrum image were hard to be observed, the middle vertical bright stripes were obvious oppositely, which showed that the high frequency information were strengthened along the motion blurring direction, according to this, then the motion blurring direction can be identified.

For the bright part in power spectrum image was circular or fusiform, which was hard to be identified directly, and the accuracy can not be assured. If through high pass filtering and restraining the low frequency part, the high frequency part in bright stripes can be strengthened, so that the bright stripes direction was easy to be identified.

When using high pass filtering to process the image, the 8 neighborhood Laplace operator was convolution of image in spatial domain.

$$g_L(x, y) = g(x, y * Lap8) \qquad (3)$$
Where Lap8 is a non-direction second-order difference operator, and the second-order difference image of the blurred image could be obtained after the convolution operate.

The second-order difference image was Fourier transformed to get $G_L(u, v)$, which range was large. And to compare easily, it was need to be homomorphic filtered.

$$G_{jL} = \log_{10} (G_L(x, y)) \qquad (4)$$

Lap8 difference operation was used for blurred image in Figure 1(c), and the result was shown in Figure 2(a). After Fourier transform and homomorphic filtering, the zero frequency was moved in image middle and the result was shown in Figure 2(b).

<figure><img src="image_5.png" /><figcaption>Fig. 2. Detection of blurred image simulated</figcaption></figure>

In Figure 2(a), the two edges of fruits superimposed in horizontal direction. Compared with Figure 1(d) and Figure 2(b), the whole high frequency part was strengthened, which was caused for the second-order difference being sensitivity to noise. But the middle vertical bright stripes in Figure 2(b) were more obvious than Figure 1(d), and the motion blur direction can be judged by detecting the bright stripe direction.

In order to detect the direction of middle bright stripes in Figure 2(b), the brightest points should be picked up, and then using the least squares method for linear fitting. The number of brightest points should be appropriate. When the number is too large, the influence is strong and the operation quantity is great. The few number influences the reliability. The brightest points can be chosen by threshold segmentation, but it is hard to determine the right threshold. In this paper, the bright points can be obtained by threshold segmentation, sorting, and filtering.

Firstly, estimate a threshold to segmentation (choosing double average grey value of power spectrum image as threshold), segment the Figure 2(b) using threshold 85, and the result was Figure 2(c). Then account the number of brightest points. Ensuring the number needed for linear detecting, and reducing the data quantity after sorting,
the brightest points number is 50 to 300, if not in this range, the threshold should be adjusted and then segment the image. Lastly, sort and filter the brightest points after being arranged from high to low according to the grey value, and choose the front brightest 51 points (according to the experiment, when choosing 40 to 100 points, the results was better) for linear fitting $y=ax+b$ using the least squares method. According to the symmetry of Fourier transform, the linear intercept $b$ was 0. The motion blur direction can be calculated by linear slope $a$,

$$ \alpha = \begin{cases} 90 - a \tan(a) & a \ge 0 \\ -90 - a \tan(a) & a < 0 \end{cases} \qquad (5) $$

Where the clockwise angle was positive, and anticlockwise was negative.

Figure 2(c) was the front 51 brightest points filtered. Figure 2(d) was the linear fitting result, and the motion blur direction was 0.63°.

The method before-mentioned was available for the blurred image with high signal-to-noise ratio, but for low signal-to-noise ratio, it was need to be improved. Figure 3(a) was the result that the real blurred image collected was processed by Lap8 difference calculation, Fourier transform and homomorphic filtering.

<figure><img src="image_6.png" /><figcaption>Fig. 3. Detection of real blurred image</figcaption></figure>

In blurred image, noise can be processed by space domain filtering, but at the same time, it also will weaken the edge information. For the influence of noise, the high frequency part of Figure 3(a) has large intensity. The brightest points obtained by threshold segmentation distributed in high frequency part, and if using the brightest points to linear fitting, the estimating result was wrong.

The high frequency part influenced by noise distributed in peripheral of spectrum image, so a circular low-pass filtering was used to weaken the influence of high frequency part. In spectrum image, make the center of a circle as the image center, remove the area outside the circle with diameter being $d$ which decided by the intensity of high frequency chosen, and threshold segment the area inside the circle. Figure 3(b) was the segmentation result that $d$ was 140 pixels and the threshold was 85. The brightest pixels were selected and fitted by least squares method, and lastly the direction was received. In Figure 3(c), the direction of motion blurring was -0.54°.

Concluding the above steps, identifying image motion blurring direction was shown in Figure 4.
<figure><img src="image_7.png" /><figcaption>Fig. 4. Flow chart of motion blurring direction detection</figcaption></figure>

## 4 Identification accuracy test

The standard image Lenna was chosen to test the algorithm correctness and validity. Firstly, Lenna was blurred with motion blur extent being 20 pixels, the blur direction being 90° to -80°. Then the algorithm in Figure 4 (Do not need circular low-pass filtering) was utilized to identify the motion blur direction. Figure 5 was the partial result when the motion blur direction was -30°, and the whole identification results were in Table 1, which showed the mean square error of detection was 1.32°.

In order to validate the application of the algorithm for low signal-to-noise ratio motion blurred image, the standard image Lenna was blurred with motion blur extent being 20 pixels, the blur direction being 90° to -80°, and adding Gauss noise with variance being 0.001. Then the algorithm in Figure 4 (need circular low-pass filtering) was utilized to identify the motion blurring direction, and the result was shown by Table 2.

Table 2 showed the mean square error of detection was 2.27°, which was lower than 1.32° without additional noise. When adding noise and using low-pass filtering,
the number of brightness can not reach 50 to 100, which will influence the fitting accuracy.

<figure><img src="image_8.png" /><figcaption>Fig.5. The detection of L=20pixel, α =30°</figcaption></figure>

<table><caption>Table 1. Motion blur direction identification</caption><tr><td>Theoretic direction(°)</td><td>90</td><td>80</td><td>70</td><td>60</td><td>50</td><td>40</td><td>30</td><td>20</td><td>10</td></tr><tr><td>Result(°)</td><td>90.36</td><td>81.29</td><td>70.82</td><td>58.20</td><td>51.24</td><td>41.28</td><td>31.61</td><td>21.69</td><td>11.78</td></tr><tr><td>Error(°)</td><td>0.36</td><td>1.29</td><td>0.82</td><td>-1.80</td><td>1.24</td><td>1.28</td><td>1.61</td><td>1.69</td><td>1.78</td></tr></table>

<table><caption>(Table 1 continued)</caption><tr><td>Theoretic direction(°)</td><td>0</td><td>-10</td><td>-20</td><td>-30</td><td>-40</td><td>-50</td><td>-60</td><td>-70</td><td>-80</td></tr><tr><td>Result(°)</td><td>-0.13</td><td>-10.88</td><td>-20.91</td><td>-30.59</td><td>-40.11</td><td>-50.86</td><td>-61.19</td><td>-71.93</td><td>-82.07</td></tr><tr><td>Error(°)</td><td>-0.13</td><td>-0.88</td><td>-0.91</td><td>-0.59</td><td>-0.11</td><td>-0.86</td><td>-1.19</td><td>-1.93</td><td>-2.07</td></tr></table>

<table><caption>Table 2. Motion blur direction identification with additional noise</caption><tr><td>Theoretic direction(°)</td><td>90</td><td>80</td><td>70</td><td>60</td><td>50</td><td>40</td><td>30</td><td>20</td><td>10</td></tr><tr><td>Result(°)</td><td>90.63</td><td>80.57</td><td>69.03</td><td>60.68</td><td>51.36</td><td>40.18</td><td>32.36</td><td>24.25</td><td>14.23</td></tr><tr><td>Error(°)</td><td>0.63</td><td>0.57</td><td>-0.97</td><td>0.68</td><td>1.36</td><td>0.18</td><td>2.36</td><td>4.25</td><td>4.23</td></tr></table>
<table><caption>(Table 2 continued)</caption><tr><td>Theoretic direction(°)</td><td>0</td><td>-10</td><td>-20</td><td>-30</td><td>-40</td><td>-50</td><td>-60</td><td>-70</td><td>-80</td></tr><tr><td>Result(°)</td><td>2.24</td><td>-12.03</td><td>-24.35</td><td>-30.98</td><td>-40.70</td><td>-52.52</td><td>-61.11</td><td>-71.00</td><td>-81.95</td></tr><tr><td>Error(°)</td><td>2.24</td><td>-2.03</td><td>-4.35</td><td>-0.98</td><td>-0.70</td><td>-2.52</td><td>-1.11</td><td>-1.00</td><td>-1.95</td></tr></table>

Seen from Table 1 and Table 2, when motion blurring direction was parallel to original image edge, the blurred image still had strong boundary information, and its identification accuracy was high. On the contrary, if the blurred direction was vertical to original image edge, the boundary information was weak, the accuracy was low.

## 5 Conclusions

Uniform linear motion blurring can strengthen the Fourier power spectrum of image perpendicular to the direction of motion. According to this, the blurred image can be removed a great deal of low and high frequency information after second-order difference high-pass filtering and the circular low-pass filtering. Then the motion blurring direction was attained by linear fitting of the frequency points with highest amplitude selected from the spectrum image. This proposed method is proved to be available for motion blur of random plane direction and adaptable for noise.

**Acknowledgments.** The project supported by the foundation (No.20050019005 and No.200800191014) of Specialized Research Fund for the Doctoral Program of Higher Education (P. R. China).

## References

1. M. Cannon. Blind deconvolution of spatially invariant image blurs with phase. IEEE Transactions on Acoustics, Speech and Signal Processing, 24(1), 58--63 (1976)

2. M. M. Chang, A. M. Tekalp, and A T Erdem. Blur identification using bispectrum. IEEE Transactions on Signal Processing, 39(10), 2323--2325 (1991)

3. A. E. Savakis, and H. J. Trussell. Blur identification by residual spectral matching. IEEE Transactions on Image Processing, 2, 141--151 (1993)

4. Y. Yitzhaky, and N. S. Kopeika. Evaluation of the blur parameters from motion blurred images. In: 19th IEEE Conference, pp. 216--219 (1996)

5. Y. Yitzhaky, and N. S. Kopeika. Identification of blur parameters from motion blurred images. Graphical Models and Image Processing, 59(5), 310--320 (1997)

6. Y. Yitzhaky, I. Mor, and A. Lantzman, et al.. Direct method for restoration of motion-blurred images. Journal of the Optical Society of America, 15(6), 1512--1519 (1998)

7. Y. Yitzhaky, R. Milberg, and S. Yohaev, et al.. Comparison of direct blind deconvolution methods for motion-blurred image. Applied Optics, 38(20), 4325--4332 (1999)

8. Q. R. Chen, Q. S. Lu, and L. Z. Cheng. Identification of the motion blurred direction of motion blurred images. Journal of national university of defense technology, 26(1), 41--45 (2004) (in Chinese)
9 Q. R. Chen, Q. S. Lu, and L. Z. Cheng. Identification of Motion-blur direction from motion blurred image via directional derivation using C spline interpolation and weighted average. Computer engineering and applications, 29, 1--5 (2004) (in Chinese)

10 Q. R. Chen, Q. S. Lu, and L. Z. Cheng. Motion blur direction identification in motion blur image by Laplacian. Computer applications, 24(9), 4--6 (2004) (in Chinese)

11 L. Zhao, W. Q. Jin, and Y. N. Chen et al. A New blind restoration of motion blurred images based on super-resolution method. Acta photonica sinica, 37(11), 2355--2359 (2008) (in Chinese)

12 M. Lin, C. H. Li, and J. H. Huang. Parameters estimation of motion blurred images based on Radon transform. Computer technology and development, 18(1), 33--36 (2008) (in Chinese)