Image Reconstruction Methods for MATLAB Users – A Moore-Penrose Inverse Approach

In the last decades the Moore-Penrose pseudoinverse has found a wide range of applications in many areas of Science and became a useful tool for different scientists dealing with optimization problems, data analysis, solutions of linear integral equations, etc. At first we will present a review of some of the basic results on the so-called Moore-Penrose pseudoinverse of matrices, a concept that generalizes the usual notion of inverse of a square matrix, but that is also applicable to singular square matrices or even to non-square matrices.

The Moore-Penrose pseudoinverse is a useful concept in dealing with optimization problems, as the determination of aŞleast squaresŤ solution of linear systems. A typical application of the Moore-Penrose inverse is its use in Image and signal Processing and Image restoration.
The field of image restoration has seen a tremendous growth in interest over the last two decades, see [1]; [5]; [6]; [14]; [28]; [29]. The recovery of an original image from degraded observations is of crucial importance and finds application in several scientific areas including medical imaging and diagnosis, military surveillance, satellite and astronomical imaging, and remote sensing. A number of various algorithms have been proposed and intensively studied for achieving a fast recovered and high resolution reconstructed images, see [10]; [15]; [22].
The presented method in this article is based on the use of the Moore-Penrose generalized inverse of a matrix and provides us a fast computational algorithm for a fast and accurate digital image restoration. This article is an extension of the work presented in [7]; [8].

The Moore-Penrose inverse
We shall denote by R r×m the algebra of all r × m real matrices. For T ∈ R r×m , R(T) will denote the range of T and N(T) the kernel of T. The generalized inverse T † is the unique matrix that satisfies the following four Penrose equations: where T * denotes the transpose matrix of T.
Let us consider the equation Tx = b, T ∈ R r×m , b ∈ R r , where T is singular. If T is an arbitrary matrix, then there may be none, one or an infinite number of solutions, depending on whether b ∈ R(T) or not, and on the rank of T. But if b / ∈ R(T), then the equation has no solution. Therefore, another point of view of this problem is the following: instead of trying to solve the equation Tx − b = 0, we are looking for a minimal norm vector u that minimizes the norm Tu − b . Note that this vector u is unique. So, in this case we consider the equation Tx = P R(T) b, where P R(T) is the orthogonal projection on R(T). Since we are interested in the distance between Tx and b, it is natural to make use of T 2 norm.
The following two propositions can be found in [12].
Proposition 0.1. Let T ∈ R r×m and b ∈ R r , b / ∈ R(T). Then, for u ∈ R m , the following are equivalent: This set of solutions is closed and convex; it therefore has a unique vector u 0 with minimal norm. In fact, B is an affine manifold; it is of the form u 0 + N (T). In the literature (c.f. [12]), B is known as the set of the least square solutions. Proposition 0.2. Let T ∈ R r×m and b ∈ R r , b / ∈ R(T), and the equation Tx = b. Then, if T † is the generalized inverse of T, we have that T † b = u, where u is the minimal norm solution defined above.
We shall make use of this property for the construction of an alternative method in image processing inverse problems.

Image restoration problems
The general pointwise definition of the transform τ(u, v) that is used in order to convert an r × r pixel image s(x, y) from the spatial domain to some other domain in which the image exhibits more readily reducible features is given in the following equation: where u and v are the coordinates in the transform domain and g(x, y, u, v) denote the general basis function used by the transform. Similarly, the inverse transform is given as: where h(x, y, u, v) represents the inverse of the basis function g(x, y, u, v).
The two dimensional version of the function g(x, y, u, v) in Equation (1) can typically be derived as a series of one dimensional functions. Such functions are referred to as being 'separable', we can derive the separable two dimensional functions as follows: The transform been performed across x Moreover we transform across y: and using Equation (3) we have We can use an identical approach in order to write Equation (1) and its inverse (Equation 2) in matrix form , using the standard orthonormal basis: in which T, S, G and H are the matrix equivalents of τ, s, g and h respectively. This is due to our use of orthogonal basis functions, meaning the basis function is its own inverse. Therefore, it is easy to see that the complete process to perform the transform, and then invert it is thus: In order for the transform to be reversible we need H to be the inverse of G and H T to be the inverse of G T , i.e. , HG = G T H T = I.
Given that G is orthogonal it is trivial to show that this is satisfied when H = G T . Given H is merely the transpose of G the inverse function for g (x, y, u, v)h (x, y, u, v) is also separable.
In the scientific area of image processing the analytical form of a linear degraded image is given by the following integral equation : represents the measured data from where the original image will be reconstructed and h(i, j; u, v) is a known Point Spread Function (PSF). The PSF depends on the measurement imaging system and is defined as the output of the system for an input point source.
A digital image described in a two dimensional discrete space is derived from an analogue image x in (u, v) in a two dimensional continuous space through a sampling process that is frequently referred to as digitization. The two dimensional continuous image is divided into r rows and m columns. The intersection of a row and a column is termed a pixel. The discrete model for the above linear degradation of an image can be formed by the following summation where i = 1, 2, . . . , r and j = 1, 2, . . . , m.
In this work we adopt the use of a shift invariant model for the blurring process as in [11]. Therefore, the analytically expression for the degraded system is given by a two dimensional (horizontal and vertical) convolution i.e., where * * indicates two dimensional convolution.
In the formulation of equation (8) the noise can also be simulated by rewriting the equation as where n(i, j) is an additive noise introduced by the system.
However, in this work the noise is image related which means that the noise has been added to the image.

The Fourier Transform, the Haar basis and the moments in image reconstruction problems
Moments are particularly popular due to their compact description, their capability to select differing levels of detail and their known performance attributes (see [3]; [9]; [17]; [18]; [19]; [20]; [26]; [27]; [28]. It is a well-recognised property of moments that they can be used to reconstruct the original function, i.e., none of the original image information is lost in the projection of the image on to the moment basis functions, assuming an infinite number of moments are calculated. Another property for the reconstruction of a band-limited image using its moments is that while derivatives give information on the high frequencies of a signal, moments provide information on its low frequencies. It is known that the higher order moments capture increasingly higher frequencies within a function and in the case of an image the higher frequencies represent the detail of the image. This is also consistent with work on other types of reconstruction, such as eigenanalysis where it has been found that increasing numbers of eigenvectors are required to capture image detail ( [23], ) and again exceed the number required for recognition. Describing images with moments instead of other more commonly used image features means that global properties of the image are used rather than local properties. Moments provide information on its low frequency of an image.
Applying the Fourier coefficients a low pass approximation of the original image is obtained. It is well known that any image can be reconstructed from its moments in the least-squares sense. Discrete orthogonal moments provide a more accurate description of image features by evaluating the moment components directly in the image coordinate space.
The reconstruction of an image from its moments is not necessarily unique. Thus, all possible methods must impose extra constraints in order to its moments uniquely solve the reconstruction problem.
The most common reconstruction method of an image from some of its moments is based on the least squares approximation of the image using orthogonal polynomials ( [19]; [21]). In this paper the constraint that introduced is related to the bandwidth of the image and provides a more general reconstruction method. We must keep in mind that this constraint is a global, for a local one a joint bilinear distribution such as Wigner or wavelet must be used.

The Fourier Basis
In view of the importance of the frequency domain, the Fourier Transform (FT) has become one of the most widely used signal analysis tool across many disciplines of science and engineering. The FT is generated by projecting the signal on to a set of basis functions, each of which is a sinusoid with a unique frequency. The FT of a time signal s(t) is given bỹ where ω = 2π f is the angular frequency. Since the set of exponentials forms an orthogonal basis the signal can be reconstructed from the projection values Following the property of the FT that the convolution in the spatial domain is translated into simple algebraic product in the spectral domain Equation (8) can be written in the form In a discrete Fourier domain the two-dimensional Fourier coefficients are defined as rearranging the above equation leads to thus, F(m, n) can be written in matrix form as: where K S (y, n) * denotes the conjugate transpose of the forward kernel K S (y, n).
Using the same principles but writing Equation (12) in a form where the increasing indexes correspond to higher frequency coefficients we obtain The Fourier coefficients can be seen as the projection coefficients of the image S XY onto a set of complex exponential basis functions that lead to the basis matrix: The approximation of an image S XY in the least square sense, can be expressed in terms of the projection matrix P kl : When considering image reconstruction from moments, the number of moments required for accurate reconstruction will be related to the frequencies present within the original image. For a given image size it would appear that there should be a finite limit to the frequencies that are present in the image and for a binary image that limiting frequency will be relatively low. As the higher order moments approach this frequency the reconstruction will become more accurate.

The Haar basis
The reconstruction of an image from its moments is not necessarily unique. Thus, all possible methods must impose extra constraints in order to its moments uniquely solve the reconstruction problem. In this method the constraint that introduced is related to the number of coefficients and the spatial resolution of the image. The Haar basis is unique among the functions we have examined as it actually defines what is referred to as a 'wavelet'. Wavelet functions are a class of functions in which a 'mother' function is translated and scaled to produce the full set of values required for the full basis set. Limiting the resolution of an image means eliminating those regions of smaller size than a given one. The Haar coefficients are obtained from the projection of the image onto the discrete Haar functions B k,l (m) for k a power of 2, and are defined as in the case l = 1, and for l > 1 stands for the function fix(x), which rounds the elements of x to the nearest integer towards zero.

Restoration of a blurry image in the spatial domain
This work introduces a new technique for the removal of blur in an image caused by the uniform linear motion. The method assumes that the linear motion corresponds to a discrete number of pixels and is aligned with the horizontal or vertical sampling. Given x out , then x in is the deterministic original image that has to be recovered. The relation between these two components in matrix structure is the following : where H represents a two dimensional (r × m) priori knowledge matrix or it can be estimated from the degraded X-ray image using its Fourier spectrum ( [24]) . The vector x out , is of r entries, while the vector x in is of m(= r + n − 1) entries, where m > r and n is the length of the blurring process in pixels. The problem consists of solving the underdetermined system of equations (Eq. 13).
However, since there is an infinite number of exact solutions for x in that satisfy the equation Hx in = x out , an additional criterion that finds a sharp restored vector is required. Our work provides a new criterion for restoration of a blurred image including a fast computational method in order to calculate the Moore-Penrose inverse of full rank r × m matrices. The method retains a restored signal whose norm is smaller than any other solution. The computational load for the method is compared with the already known methods.
The criterion for restoration of a blurred image that we are using is the minimum distance of the measured data, i.e., min( x * in − x out ), where x * in are the first r elements of the unknown image x in that has to be recovered subject to the constraint Hx in − x out = 0. In fact, zero is not always attained, but following Proposition 0.1(ii) the norm is minimized.
In general, the PSF varies independently with respect to both (horizontal and vertical) directions, because the degradation of a PSF may depend on its location in the image. An example of this kind of behavior is an optical system that suffers strong geometric aberrations. However, in most of the studies, the PSF is accurately written as a function of the horizontal and vertical displacements independently of the location within the field of view.

The generalized inverse approach
A blurred image that has been degraded by a uniform linear motion in the horizontal direction, usually results of camera panning or fast object motion can be expressed as follows, as desribed in Eq.
where the index n indicates the linear motion blur in pixels. The element k 1 , . . . , k n of the matrix are defined as: k l = 1/n (1 ≤ l ≤ n).
Equation (3) can also be written in the pointwise form for i = 1, . . . , r, that describes an underdetermined system of r simultaneous equations and m = r + n − 1 unknowns. The objective is to calculate the original column per column data of the image. As we have seen, the matrix H is a r × m matrix, and the rank of H is less or equal to m. Therefore, the linear system of equations is underdetermined. The proper generalized inverse for this case is a left inverse, which is also called a {1,2,4} inverse, in the sense that it needs to satisfy only the three of the four Penrose equations. A left inverse gives the minimum norm solution of this underdetermined linear system, for every x out ∈ R(H). The Moore-Penrose Inverse is clearly suitable for our case, since we can have a minimum norm solution for every x out ∈ R(H), and a minimal norm least squares solution for every x out / ∈ R(H).
The proposed algorithm has been tested on a simulated blurred image produced by applying the matrix H on the original image. This can be represented as where i = 1, . . . , r j = 1, . . . , m for m = r + n − 1, and n is the linear motion blur in pixels.
Following the above, and the analysis given in Section 3, there is an infinite number of exact solutions for x in that satisfy the equation Hx in = x out , but from proposition 2.2, only one of them minimizes the norm Hx in − x out .
We shall denote this unique vector byx in . So,x in can be easily found from the equation : The following section presents results that highlight the performance of the generalized inverse.

Experimental results
In this section we apply the proposed method on an boat picture and present the numerical results.
The numerical tasks have been performed using Matlab programming language. Specifically, the Matlab 7.4 (R2007b) environment was used on an Intel(R) Pentium(R) Dual CPU T2310 @ 1.46 GHz 1.47 GHz 32-bit system with 2 GB of RAM memory running on the Windows Vista Home Premium Operating System. Figure 1(a) provides the original boat picture. In Figure 1(b), we present the degraded boat picture where the length of the blurring process is equal to n = 60. Finally, in Figure 1(c) we present the reconstructed image using the Moore-Penrose inverse approach. As we can see, it is clearly seen that the details of the original image have been recovered.

Recovery from a degraded image
The Improvement in Signal to Noise Ratio (ISNR) has been chosen in order to present the reconstructed images obtained by the proposed algorithm. It provides a criterion that has been used extensively for the purpose of objectively testing the performance of image processing algorithms expressed as: where x in and x out represent the original deterministic image and degraded image respectively, andx in is the corresponding restored image. Figure 2(a) shows the corresponding ISNR values. for increasing the number of pixels in the blurring process n = 1, . . . , 60.
The second set of tests aimed at accenting the reconstruction error between the original image x in and the reconstructed imagex in for various values of linear motion blur, n. The calculated quantity is the normalized reconstruction error given by using the generalized inverse reconstructed method.

Recovery from a degraded and noisy image
Noise may be introduced into an image in a number of different ways. In Equation (10) the noise has been introduced in an additive way. Here, we simulate a noise model where a number of pixels are corrupted and randomly take on a value of white and black (salt and pepper noise) with noise density equal to 0.02. The image that we receive from a faulty transmission line can contain this form of corruption. In Figure 3(b), we present the original boat image while a motion blurred and a salt and pepper noise has been added to it.
Image processing and analysis are based on filtering the content of the images in a certain way. The filtering process is basically an algorithm that modifies a pixel value, given the original value of the pixel and the values that surrounding it. Accordingly, Figure 4(a) provides a graphical representation for the ISNR of the reconstructed and filtered image for different values of n. Moreover, Figure 4(b) shows the reconstruction error by increasing the number of pixels in the blurring process n = 1, . . . , 60.

Deblurring in the spatial and spectral domain: Application of the Haar and Fourier moments on image reconstruction.
As mentioned before, images can be viewed as non-stationary two-dimensional signals with edges, textures, and deterministic objects at different locations. Although non-stationary signals are, in general, characterized by their local features rather than their global ones, it is possible to recover images by introducing global constrains on either its spatial or spectral resolution. The objective is to calculate the inverse matrix of the blurring kernel H and then applied back (simple multiplication in the spectral domain) to the degraded blurred image xout. Figure 5 shows the spectral representation of the degraded image obtained using Equation (11).
In order to obtain back the original image, Equation (13) is solved in the Fourier spacẽ The reconstructed image is the inverse Fourier transform ofx in . By using our method not only we have the advantage of fast recovery but also provide us with an operatorH † that exists even for not full rank non square matrices. In this section the whole process of deblurring and restoring the original image is done in the spatial domain by using the Haar basis moments and in the spectral domain by applied the Fourier basis moments on the image. It provides us the ability of fast recovering and algorithmic simplicity. The former, obtained by using directly the original image and analysed that on its moments. The method is robust in the presence of noise, as can be seen on the results. In the latter, From the reconstruction point of view the basis matrix is applied to both original image and blurring kernel transforming these into spectral domain. After the inversion of the blurring kernel, its product with the degraded image is applied to inverted basis functions for the reconstruction of the original image. The method provides almost the same robustness for the case of degradation and noise presence as for the spatial moment analysis case.  From the reconstruction point of view the basis matrix is applied to both original image and blurring kernel transforming these into spectral domain. After the inversion of the blurring kernel, its product with the degraded image is applied to inverted basis functions for the reconstruction of the original image.   moment values k = l = 450 (blue line for the Fourier moment and red line for the Haar moment case). The image is corrupted with white and black (salt and pepper) noise with noise density equal to 0.02. After the moment analysis took place a low pass rotationally symmetric Gaussian filter of standard deviation equal to 45 were applied. Finally, on Figures 9(a) and 9(b) we present the ISNR and the Reconstruction Error respectively, for a number of moments, k = l = 1, . . . , 200 and keeping the number of blurring process at a high level equal to n = 60. Similarly, to the previous cases the value of the black and white noise density is equal to the 0.02 and a low-pass Gaussian filter was used for the filtering process.

Conclusions
In this study, we introduced a novel computational method based on the calculation of the Moore-Penrose inverse of full rank r × m matrix, with particular focus on problems arising in image processing. We are motivated by the problem of restoring blurry and noisy images via well developed mathematical methods and techniques based on the inverse procedures in order to obtain an approximation of the original image. By using the proposed algorithm, the resolution of the reconstructed image remains at a very high level, although the main advantage of the method was found on the computational load that has been decreased considerably compared to the other methods and techniques. The efficiency of the generalized inverse is evidenced by the presented simulation results. In this chapter the results presented were demonstrated in the spatial and spectral domain of the image. Orthogonal moments have demonstrated significant energy compaction properties that are desirable in the field of image processing, especially in feature and object recognition. The advantage of representing and recovered any image by choosing a few Haar coefficients (spatial domain) or Fourier coefficients (spectral domain), is the faster transmission of the image as well as the increased robustness when the image is subject to various attacks that can be introduced during the transmission of the data, including additive noise. The results of this work are well established by simulating data. Besides digital image restoration, our work on generalized inverse matrices may also find applications in other scientific fields where a fast computation of the inverse data is needed.
The proposed method can be used in any kind of matrix so the dimensions and the nature of the image do not play any role in this application %