Development of High Performance Quantum Image Algorithm on Constrained Least Squares Filtering Computation

Recent development of computer technology may lead to the quantum image algorithms becoming a hotspot. Quantum information and computation give some advantages to our quantum image algorithms, which deal with the limited problems that cannot be solved by the original classical image algorithm. Image processing cry out for applications of quantum image. Most works on quantum images are theoretical or sometimes even unpolished, although real-world experiments in quantum computer have begun and are multiplying. However, just as the development of computer technology helped to drive the Technology Revolution, a new quantum image algorithm on constrained least squares filtering computation was proposed from quantum mechanics, quantum information, and extremely powerful computer. A quantum image representation model is introduced to construct an image model, which is then used for image processing. Prior knowledge is employed in order to reconstruct or estimate the point spread function, and a non-degenerate estimate is obtained based on the opposite processing. The fuzzy function against noises is solved using the optimal measure of smoothness. On the constraint condition, determine the minimum criterion function and estimate the original image function. For some motion blurs and some kinds of noise pollutions, such as Gaussian noises, the proposed algorithm is able to yield better recovery results. Additionally, it should be noted that, when there is a noise attack with very low noise intensity, the model based on the constrained least squares filtering can still deliver good recovery results, with strong robustness. Subsequently, discuss the simulation analysis of the complexity of implementing quantum circuits and image filtering, and demonstrate that the algorithm has a good effect on fuzzy recovery, when the noise density is small.


Introduction
Just as Feynman first discussed quantum computing in 1982 [1] and Bennett and Brassard, who performed key distribution on the quantum channel, proposed BB84 protocol [2] with modern technology. This is a new burgeoning branch of quantum physics is updating 19th-century image processing algorithm for quantum information systems at present. Some quantum information algorithms have been extensively studied in the past few decades. The quantum prime factorization algorithm that was proposed by Shor [3] and the quantum search algorithm proposed by Grover [4] have proved the computing power of quantum computers. In these case, increasing amounts of researchers have began to explore the various applications of quantum computers [5][6][7][8][9]. In addition, interrelated disciplines are also emerging. Quantum image algorithm is an interdisciplinary field in its infancy.
Physicists nowadays who work at the intersection of two fields-quantum information theory and image processing-live it. The existing computing technology is inefficient for the demand of image processing. The development of classic image processing is limited by image resolution. Because of the properties of quantum superposition and entanglement, the efficiency of algorithm can be greatly improved. It is possible to use quantum computer to solve the problem of time and space consumption in this kind of complex image processing algorithm. At first, S. E. Venegas Andraca proposed the concept of a quantum matrix shown here, exists as a thought experiment [10]. Since then, other algorithms [11,12] have been constantly improved. In previous studies, researchers have proposed many quantum image models, which play a good role in representing image information in practice. These include qubit lattice [13], entangled image [14], real ket [15], flexible representation of quantum images(FRQI) [16], and the novel enhanced quantum representation of digital images (NEQR) cite12. The image processing function [18][19][20][21] in the classical field is very powerful, and the development of quantum image is also following the direction of classical image processing. However, due to the late start, most of the existing models can only be used for simple image processing. Yuan et al. [22] proposed two kinds of improved quantum dilation and erosion operations in order to reduce the time complexity of quantum morphology operations in 2016. In this algorithm, all operations are done via quantum circuits. They constructed a system for using qubits to code and process image information. In 2020, Ma et al. [23] improved the algorithm on the basis of Yuan et al. and proposed a more consistent algorithm for quantum dilation and erosion as well as its implementation in the IBM quantum simulator. This is a powerful step forward in quantum image processing. In many digital image processing algorithms, noise cancellation is one of the basic procedures that must be considered. However, not a lot of studies have considered the noise problem in the quantum image processing mode. In 2017, Liu et al. studied restoration to remove noise in quantum images [24]. Although the filtering model of quantum image works well, the problem of blurring should also be considered. In digital image processing, we should not only consider noise, but also the deblurring problem caused by external factors. It can be said that the quality of digital images plays a crucial role in the process of communication and visual perception. High quality images will bring richer content and information, and even give the viewer a beautiful enjoyment, while poor quality images will not only lose a lot of image information, but also sometimes bring uncomfortable feelings to the viewer.
The photos taken by the camera may appear blurred due to some environmental influence factors of distance and light intensity. Shaking during filming can cause this problem. Therefore, we need to analyze this point spread function to solve the impact that is caused by the blur and restore the image. Because of the increase of image resolution, the development of traditional digital image processing have been restricted. The merge of quantum computation and traditional digital image processing methods is considered to be a promising candidate to solve the problem. Because quantum image processing will use the superposition and entanglement properties of quantum mechanics to calculate all pixels of the image at the same time, it can achieve exponential acceleration compared to classical algorithms. Accordingly, this paper proposes a quantum image restoration model that is based on constrained least squares filtering. This model can not only solve the problem that the degradation function is sensitive to noise, but also eliminate the influence of some noise.
The remaining paper are organized, as follows: Section 2 describes the NEQR model and constrained least square filtering computation. The detailed quantum image process, including NEQR construction process and basic quantum circuits, is described in Section 3. Sections 4 and 5 describe complexity analysis and simulation experiments. Finally, in Section 6, the conclusions and prospects of future work are introduced.

NEQR Model
In the NEQR representation model, the position information and color information of grayscale images can be represented by two entangled quantum sequences. Quantum entanglement is a quantum mechanical phenomenon, in which entangled quantum sequences have a correlation. The model uses q quantum bits to represent color information. q is the image color depth and it can represent all colors in the grayscale range [0, 2 q − 1]. An image compiled through the NEQR description model can be expressed, as follows: (1) |c i and |i respectively represents the color image color Information and the position information of the image: NEQR images can be measured in order to obtain images exactly the same as the original image color information. Therefore, NEQR images are more flexible in color processing.

Constrained Least Square Filtering Computation
The input-output relationship of image acquisition, in Figure 1: As a significant part of digital image processing, image restoration is helpful to eliminate the distortion and deterioration in the process of image information transmission so as to obtain high-quality image information. Image restoration is an inverse process of image degradation, where H points to the diffusion function. The constrained least square filtering model [25] only requires knowledge of the variance and mean of the noise signal, and the noise parameters can be inferred from the known degraded image.
The key of constrained least square filtering is to overcome the relative sensitivity of noise to H. H is the entire degradation process. Image degradation can be obtained after the original image is convolved with the system. Therefore, the image restoration can achieve de-convolution operation on the output result in order to obtain the original image estimation. To obtain the degenerate image g(x, y), one needs to superimpose the original image f (x, y) and noise n(x, y) under the degenerate operator h(x, y). Accordingly, a constrained minimum criterion function C can be set up, as follows In the constrained minimum criterion function C, M and N, respectively, represent the value range of pixels, Here, in the frequency domain, G is the degraded image, F is the estimate of degraded image, N is additive noise, and Laplace operator ∇ 2 is smoothness. To find the minimum value of the function, one needs to use the Lagrange multiplier method and convert the constraint term into the Lagrange multiplier term.
The matrix form of the Laplace operator can be expressed as: The Laplace transform of a continuous function f (x, y) at x and y is defined as: For digital images, it can be obtained by difference calculation Therefore, combining the second order difference of the horizontal and vertical directions of the image, the Laplace calculation method is as follows: Additionally likewise, use the Laplace convolution model and convert the constraint term to the Lagrange multiplier term, so the Lagrangian function L(F, λ) is: where H represents the fuzzy matrix and P is the Fourier transform of the Laplace operator. Different point spread function are used to restore the image. When one take the derivative of the function L(F, λ) with respect toF, one obtains when ∂L(F,λ) ∂F = 0 , one get the minimumF: where γ = 1 λ , H * is the complex conjugate of H.

Initialization
For a 2 n × 2 n classic image, NEQR requires a total of 2n + q qubits to save information. According to the initialization state, the quantum image can be constructed in two steps: (1) The initial quantum state is converted to an equal weight superposition of all pixels in the image. U 1 = I ⊗q ⊗ H ⊗2n . Hence, when U 1 applied to an initial quantum state |ψ , the quantum state is converted to an intermediate quantum state. This quantum evolution process can be expressed as: (2) Each pixel on the intermediate state is assigned a color bit. Since in the new quantum image, the pixels of the image are still processed in the superposition state, the operation in this step still needs to be divided into 2 n × 2 n sub-operations in order to assign color bits to each pixel of the image. Suppose that the sub operation of each pixel is Ω YX , so the sub operation of each pixel of the image can be expressed as: Subsequently, when the operation U YX is applied to the intermediate state |ψ 1 , the quantum evolution process of the whole system is: In the classical digital image, the quantum image NEQR model is quantified and the translated data set is obtained through cyclic shift operation.

Quantum Circuit Implementation
We can obtain the gradient value of all pixels by quantum image cyclic shift operation. The original image I xy , and |I = 1 2 n ∑ 2 n −1 Y=0 ∑ 2 n −1 X=0 |C YX |Y |X , then C y− , Shift I xy one-unit downwards, The output I xy−1 , then C x+ , shift I xy one-unit rightwards, The output I x+1y , then C y+ , shift I xy one-unit upwards, The output I xy+1 , then C x− , shift I xy one-unit leftwards , At last, the output I x−1y . One obtains the pixel value of the neighborhood by cycle shift operation, and then calculate the gradient according to Laplace's template, where a quantum black box U L is designed to compute the gradient of the Laplace operator, in Figure 2.

Cycle Shift, Addition Subtraction and Double Operation
Cyclic shift transform can move the whole image at the same time, and each image will get the pixel information of its field, as in Figure 3. For the image I A and I B , the sum of the images is I C The following is the addition operation of the quantum image, and the expression of the addition operation is: The realization process of the quantum circuit of adder is shown in the Figure 4. Add the pixel value to the corresponding complement in order to obtain the difference of pixel subtraction between two quantum images |C YX = |A YX − |B YX .
The subtraction operation of the quantum image is deduced, as follows: The realization process of the quantum circuit of the subtracter is shown in the Figure 5. If one wants to shift the binary sequence to the right by this, one obtains |2 · C = c q−1 c q−2 · · · c 1 c 0 0 . In order to form a sequence of qubits,add an auxiliary qubit |0 , then obtain |0 ⊗ |C = 0c q−1 c q−2 · · · c 1 c 0 . The realization process of the quantum circuit of double operation is shown in the Figure 6.

Restoration for Deblurring of Quantum Image
If the premise of prior knowledge of noise signal n is lacking, then the process of image restoration is an estimationf of trying to find undegraded image f . This needs to make Hf and g mean square error as small as possible. In other words, in the sense of the least mean square error, Hf is closest to g. In order to solve this problem, Laplace operator is introduced, according to the previous discussion. The sensitivity to noise is reduced by means of smoothing measures.
If space domain recovery method is needed, then we need to solve the problem of estimating the least square of the original image f .
The quantum images can be obtained through the coordinate transformation. Through the cyclic shift operation of the original image I xy , we can obtain a set of quantum images: I xy−1 , I x−1y , I xy |I x+1 y , I xy+1 . Next, we calculate the gradient based on the convolution template. |µ 1 = qADD(|I xy−1 + |I x−1y ) |µ 2 = qADD(|I x+1y + |I xy+1 ) |µ 3 = qADD(|µ 1 + |µ 2 ) |ξ 1 = qADD(|I xy + |I xy ) The processed image is stored in | |If = 1 2 n Because solving the minimum value of the function consumes too many resources, so, according to Equations (11) and (12), we estimate the minimum of the functionF when the function

∂L(F,λ) ∂F
is equal to 0 . According to the frequency domain filtering [26] , an estimated expression for an image: |IF is the Fourier transform of the estimation of degraded image. |I G is the Fourier transform of fuzzy image. Where γ is a parameter that can be adjusted. H * is the complex conjugate of H and it represents the Fourier transform of fuzzy matrix. It is worth noting that, if γ = 0, the constrained least square filtering can be reduced to inverse filtering.

Complexity Analysis
We discuss the simulation analysis of the complexity of implementing quantum circuits and image filtering in this section. In quantum image processing, it is known that the complexity depends on the number of elementary gates in quantum image processing. Consider a digital image with a size of 2 n × 2 n as an example. The complexity of the basic quantum gate includes NOT gates and controlled NOT gates, which is considered to refer to a n-controlled NOT (n-CNOT) gate that equal to 2(n-1) Toffoli gates and one CNOT gate, and one Toffoli gate can be simulated by six CNOT gates.
From the introduction of Reference [17], we know that the computation complexity of this stage does not exceed O(qn2 2n ), because some operations will be performed for each pixel individually. The quantum circuit will construct the NEQR quantum image |I .
When an image is filtered by Laplace operator, the circuit design mainly involves two parts: shift transformation and gradient calculation of pixel points. In total, we use the 4 shift operations to get the pixel values in other locations. In addition, each shift conversion will cost O(n 2 ) the time complexity by the article [12]. In the light of the Laplace operator template, the complexity of quantum circuit mainly includes 5 addition operations and 1 subtraction operation, which are 8q − 4 and 3q 2 . The cost of quantum black boxes U L module is 2 q+3 − 2.
Therefore, the quantum cost of image filtering for a 2 n × 2 n digital image is: Hence, if the quantum image has been constructed, our proposed scheme can restore the quantum image that is based on NEQR, and its computational complexity of around O(n 2 + 2 q+3 ).

Simulation Experiment
In our simulation, the experiments were conducted on the classic computer with an Intel(R) Core(TM) i5-7500 CPU processor. The environment for the Windows 7 operating system and Matlab(2016a).
The peak signal-to-noise ratio (PSNR) is an objective criterion for evaluating images. It works by using the mean square error (MSE) between the undegraded original image I and the processed image G. In the Formula (30), MAXI is the maximum value in the pixel range.
The original input image is shown in the Figure 7. In motion blur functions, offset Angle is 11 and the offset length is 21 (see Figure 8). Gaussian noise can be added to the fuzzy image, as well as the noise density is 0.0001 (see Figure 9). We can calculate PSNR from the Formula (30). The PSNR of the motion blur image and noise-added image are 23.1184 dB and 23.1112dB, respectively. After the model processing ( Figure 10), the PSNR of the restored image is 31.6785dB. Different restoration effects can be seen according to different parameters. When the noise density is small, the algorithm has a good effect on fuzzy restoration, as shown in the Table 1.

Conclusions and Prospects
In this paper, quantum image-deblurring algorithm for quantum image with size 2 n × 2 n that is based on constrained least squares filtering is proposed and studied. The quantum circuit we designed based on Laplace operator solves the problem of image blur very well. In terms of the computational complexity, for the NEQR quantum image of size 2 n × 2 n , the quantum circuit that we constructed can recover the image whose computational complexity does not exceed O(n 2 + 2 q+3 ).
In fact, under the influence of the surrounding environment, image blurring is a problem that needs to be studied. When compared with classical computers, quantum computers have great advantages. This method can not only effectively remove the fuzzy problem, but also filter out a variety of noise. Image deblurring is always an important research direction in image processing. In the future, we will also study various deblurring problems .

Conflicts of Interest:
The authors declare no conflict of interest.