Blurring and deblurring digital images using the dihedral group

A new method of blurring and deblurring digital images is presented. The approach is based on using new filters generating from average filter and H-filters using the action of the dihedral group. These filters are called HB-filters; used to cause a motion blur and then deblurring affected images. Also, enhancing images using HB-filters is presented as compared to other methods like Average, Gaussian, and Motion. Results and analysis show that the HB-filters are better in peak signal to noise ratio (PSNR) and RMSE. Keywords—Dihedral group; Kronecker Product; motion blur and deblur; digital image


INTRODUCTION
This template, There are three main categories of image processing, image enhancement, image compression and restoration and measurement extraction [3,6]. A digital image is divided into pixels. Each pixel has a magnitude that represents intensity. The camera uses the recorded image as a faithful representation of the scene that the user saw, but every image is more or less burry. Blurring may arise in the recording of image, because it is unavoidable the scene information "spills over" to neighboring pixels. When there is motion between the camera and image objects during photographing, the motion blur the image. In order to recover motion-blurred images, mathematical model of blurring process are used [1]. Many authors studied motion blur. Often, it is not easy or convenient to eliminate the blur technically. Mathematically, motion blur is modeled as a convolution of point spread function (filters) denoted by (PSF) with the image represented by its intensities. The original image must be recovered by using mathematical model of the blurring process which is called image deblurring [7]. Many researchers introduced algorithms to remove blur such as Average filter AF (or Mean filter), Gaussian filter (GF). The Gaussian filter is equivalent to filtering with a mask of radius R, whose weights are given by Gaussian function: ( ) ( ) ; where σ is stander deviation of the Gaussian: large σ for more intensive smoothing) [2]. Motion Blur effect filter is a filter that makes the image appear to be moving by adding a blur in a specific direction [10]. The largest subgroup H of dihedral group is found in [4].
In this work, Markov basis HB is used to introduce a new filters from Average filter for adding and removing motion blur of image, denoted by HB-filters.

II. PRELIMINARY CONCEPTS
This section reviews the preliminaries about H-filters, Dihedral group, Convolution and Deconvolution processes.

A. H-Filters
H-filters are 18 elements as per the following set [5].  Let be a positive integer greater than or equal to . The group of all symmetries of the regular polygon with sides, including both rotations and reflections, is called dihedral group and denoted by [13]. The 2n elements in can be written as: { , , … , , , , , }, where is the identity element in . In general, we can write as: = :   , 0 j 1 which has the following properties: , ( ) The composition of two elements of the is given by , s , .

C. 2D Convolution
Assume two discrete 2-dimensional images ƒ(x, y) and h(x, y). Their convolved (or folded) sum is the image g(x, y), the convolution of these two functions is defined as [12]: where N M  is a size of ( ) .
Given the transform F(u, v), we can obtain f(x, y) by using the inverse discrete Fourier transform (IDFT): ( ) It can be shown by direct substitution into Eq. 2 and Eq. 3 that the Fourier transform pair satisfies the following translation properties: ( ) Now, interested in finding the Fourier transform of Eq. 1: This result of the convolution theorem is written as: The transform of the original image simply by dividing the transform of the degraded image ( ), by the degradation function ( ) is that's called inverse filter [9].

A. Fourier Spectrum
Because the 2-D DFT is complex in general [8], it can be expressed in polar form: where the magnitude, The power spectrum is defined as, ). As before, R and J are the real and imaginary parts of F(u, v) and all computations are carried out for the discrete variables u = 0, 1, 2, ... , M -1 and v = 0,1,2, ... , N-1. Therefore, ), and P(u, v) are arrays of size .

B. Image Restoration based on Wiener Deconvolution
The method considers images and noise as random variables, and the objective is to find an estimate ̂ of the uncorrupted image f such that the mean square error (MSE) between them is minimized. This error measure is given by: Based on these conditions, the minimum of the error function in Eq. 8 is given in the frequency domain by the expression: The terms in Eq. 9 are as follows: power spectrum of the original image& G(u, v)= the transform of the degraded image. Note that if the noise is zero, then the noise power spectrum vanishes and the Wiener filter reduces to the inverse filter.

IV. THE PROPOSED APPROACH
H-filters are used to generate HB-filters by adding each element in H-filters to the average filter, so we got some HBfilters with dimensions 3-by-3 and each of which has type of blur different from the other.
Then the HB-filters can be extended using tenser product (by operation ) to larger sizes, in order to get a higher degrees of blur in digital images. Take any one of HB-filters h(x,y) of dimension 3-by-3 and extend it by identity matrix , n-by-n where n is an odd number greater than or equals 3, by Tensor Product T: Similarly, one obtains All of these filters belong to HB-filters.
Most HB-filters can be obtained using other H-filters. For example the extended HB-filters generated from HB-filter ( ) [ ] with is given by

A. Blurring
This sub-section describes the standard filters algorithm for addition blur of an image by using the convolution theorem.

Blur algorithm
Consider an image matrix f(x, y) of dimension m-by-n, which can be written as follows: Step1: In the beginning add f(x,y) by p-1 rows with zeros from up and down, and p-1 columns with zeros from left and right, such that the result is {m+2(p-1)}-by-{n+2(q-1)} dimensions, as follows: where i= m+2(p-1) and j= m+2(q-1).
Step2: Reverse ( ) (that used in blurring) for two directions, Step4: Calculate the convolution equation for all pixels of blurred matrix g(x,y): ). After that shift the filter h(x,y) as much as one column as follows: Now repeat step 4 to obtain digital image convolution g(x,y) at all times that the two arrays overlap. We continue until we find g(r, c), where r & c=m+ (p-1), then the final form of the blurred matrix g(x,y) is: Step5: Delete from g(x,y) as much as rows from up and down, and columns from left and right, such that the blurred matrix g(x,y) becomes m-by-n in dimension:

Example 2.
Suppose the image matrix f(x,y) is: Step1: Add two rows from up and down, and two columns from left and right of zeros for the matrix f(x, y), such that becomes 7-by-7 dimension, as follows: Step2: Reverse the filter h(x,y) for two directions: Step3: Make the two arrays, as the following form:

B. Deblurring
Here we express the proposed deblurring method.

Deblur Algorithm
Weiner deconvolution for the matrix g(x,y) and h(x,y) is given by: Suppose there is no noise (i.e. Step 2: Find Fourier transform of HB-filter h(x,y).
If the dimension of h(x,y) is less than dimension of g(x,y), we will add zeros for h(x,y) to create as same as the dimension of the image matrix g(x,y) before doing the transform, such that the result is m-by-n in dimension.
Step 3: Calculate the transform of estimated image ̂( ).
Step 4: Find estimated image ̂( ) by taking inverse Fourier transform of ̂( ), by follows: Step 5: Remove zeros from ̂( )as much as ( ) of last rows and columns, where resulted dimensions equal to dimensions original image matrix f(x,y). Example 2. We will take blurred matrix g(x,y) from ex. Step 2: Because of the dimension of h(x,y) is less than dimension of g(x,y), then add zeros for h(x,y) to create as same as the dimensions of the image matrix g(x,y), so we have: Step 5: Remove the last two rows and columns of zeros from ̂( ): where the original matrix Now, we give the (original, blurred, estimated) block image to explain the image enhancement in ex.2 and ex.3 as shown in Fig.1.  www.ijarai.thesai.org  Table I. The application of proposed method and some other methods on the color images (in jpg. format) of different blur is shown in Fig.2.

V. CONLCLUSION
Nlur has been added and removed from digital images using HB-filters. The HB-filters perform well for grayscale, binary and color (jpg, png) images with different blur degrees. Results show that the HB method has higher PSNR and less RMSE than Average, Gaussian and Motion methods.