Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

Quantum Image Filtering in the


Frequency Domain
Simona CARAIMAN, Vasile I. MANTA
Department of Computer Engineering, Technical University of Iasi,
D. Mangeron 27, 700050 Iasi, Romania
sarustei@cs.tuiasi.ro

1
Abstract—In this paper we address the emerging field of The research in quantum image processing is still
Quantum Image Processing. We investigate the use of quantum confronting with fundamental aspects such as representing
computing systems to represent and manipulate images. In and storing an image on a quantum computer and the basic
particular, we consider the basic task of image filtering. We
processing operations. Representation of color information
prove that a quantum version for this operation can be
achieved, even though the quantum convolution of two on one qubit was proposed for the Qubit Lattice approach
sequences is physically impossible. In our approach we use the [8] and was also employed in the FRQI framework [9].
principle of the quantum oracle to implement the filter Several basic processing operations were defined in the
function. We provide the quantum circuit that implements the FRQI framework: geometrical transformations [10], one-
filtering task and present the results of several simulation qubit quantum gates applied on the color wire [11], a
experiments on grayscale images. There are important
similarity measure between two images based on pixel
differences between the classical and the quantum
implementations for image filtering. We analyze these differences [12], two strategies for quantum image
differences and show that the major advantage of the quantum watermarking [13, 14].
approach lies in the exploitation of the efficient implementation Beach et al. [15] show that Grover's quantum search
of the quantum Fourier transform. algorithm [16] is applicable to image processing tasks such
as pose recognition in a model-based machine vision
Index Terms—quantum image processing, quantum Fourier system.
transform, quantum oracle, image filtering.
Other important contributions to the quantum image-
processing field rely on the exploitation of maybe the most
I. INTRODUCTION
valuable resource of many–qubit quantum systems,
The spectacular perspectives offered by the realization of entanglement. It was shown that it could lead to the
a quantum computer have determined an increasing interest development of efficient methods for representing and
for research in quantum information and quantum retrieving information about the objects in a quantum image
computation. It seems that, in certain cases, the massive [17] and also to a quantum image compression scheme [18].
parallelism inherent in quantum computational systems can In this paper we focus on how to achieve a quantum
lead to exponential speedups over the best classical version of a rather basic classical task, that of image
approaches [1-3]. Nevertheless, exploiting the remarkable filtering. A common approach is to convolve the image with
properties of quantum systems for developing efficient a filter function, which in the frequency domain translates
quantum algorithms is a challenging task. This is due to the into a multiplication operation. However, there are
fundamental differences between the operating modes of fundamental differences between classical and quantum
quantum and classical computers. operations, the latter being necessarily invertible due to the
The key role in most of the known quantum algorithms is reversible nature of quantum computation. Therefore there
played by the quantum Fourier transform. It is the main are classical processing operations that cannot be directly
ingredient for the efficient quantum order-finding algorithm applied to quantum images. Such examples are convolution
introduced by Peter Shor [4]. Other problems such as and correlation [19]. In our paper we describe a method to
performing discrete logarithms and factoring, which for achieve the filtering of a quantum image by exploiting the
large numbers are considered intractable on a classical quantum Fourier transform and the principle of the quantum
computer, benefit from similar speedups as they can be oracle.
reduced to order finding. Before describing the proposed quantum image-filtering
The remarkable properties of quantum systems have led algorithm, background is given to make the paper self-
to the emergence of innovative ideas in all major fields of contained. We give a short introduction to the basic
computing, including graphics processing. Nevertheless, concepts in quantum computing and briefly overview the
speeding up certain signal processing tasks is a rather under quantum version of the discrete Fourier transform. In
researched area. There is an important potential use of Section III we describe our approach for representing a
quantum computation in this field generated by the more quantum image and then discuss the proposed technique for
efficient quantum versions of the Fourier transform, wavelet quantum image filtering. In Section IV we provide the
transform [5] and of the discrete cosine transform [6-7]. results of applying various filters on quantum images by
1
performing simulation experiments. In Section V we
This work was supported by the project PERFORM-ERA Postdoctoral analyze the features of the proposed quantum algorithm for
Performance for Integration in the European Research Area (ID-57649),
financed by the European Social Fund and the Romanian Government). image filtering with respect to its classical counterpart and
Digital Object Identifier 10.4316/AECE.2013.03013

77
1582-7445 © 2013 AECE
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

to the use of other quantum image representation The action of the controlled-Not gate is x, y  x, x  y ,
approaches. In Section VI we summarize our conclusions
and discuss the prospects for further development of the where  is addition modulo two, and has the following
quantum image-processing field in the light of the new matrix representation:
contributions presented in this paper. 1 0 0 0
 
0 1 0 0
CNOT   . (5)
II. BASIC CONCEPTS IN QUANTUM COMPUTING 0 0 0 1
The quantum analogous of the classical bit is called a  
0 0 1 0
qubit. The states of the qubit can be completely described by
The only irreversible operation allowed is the
the superposition of two orthonormal basis states, which in
measurement of quantum states, which has the effect of
Dirac notation are labelled 0 and 1 (in a Hilbert space collapsing the superposition into one of the computational
  C 2 ). This orthonormal system 0 , 1, with basis states.
A direct consequence of the principles of quantum
0  1 0  and 1   0 1 , is called computational
T T
physics is the immense computing power of a quantum
machine compared to that of a classical one. This is due to
basis. Any state  can be described by a linear
three remarkable quantum resources that have no classical
combination of these two states: counterparts: quantum parallelism, quantum interference
   0   1 with     1 .
2 2
(1) and entanglement of quantum states.
These remarkable properties of quantum systems allowed
Complex values  and  represent the probability
the formulation of optimal algorithms for two fundamental
amplitudes of the basis states. This means that measuring problems: integer factorization (Shor's algorithm [4]) and
the quantum system  yields 0 with probability 
2
the search in an unstructured database (Grover's algorithm
[16]). Thus, two main classes of quantum algorithms have
and 1 with probability  .
2
better time complexity than their classical counterparts. The
The state of an n -qubit quantum computer is described algorithms in the first class are based on the quantum
by an unit vector in Hilbert space H  C 2 :
n
Fourier transform and provide remarkable solutions for
2n 1
solving the factorization and discrete logarithm problems,
   i i (2) with an exponential speedup over the best known classical
i 0 algorithms. The algorithms in the second class are based on
2n 1 the mechanism of quantum amplitude amplification [21]
  1 and  i
2 2
where i represents the probability of found in Grover's quantum search algorithm. This class of
i 0
algorithms provides a quadratic speedup with respect to the
obtaining state i when measuring the register. best classical algorithms.
A quantum register s is represented by a sequence of
qubits. If s is an n -qubit quantum register and U is an III. QUANTUM IMAGE FILTERING
operator in the states space H , then the operator U (s) A. Representation of Quantum Images
applied to a register is called a quantum gate. Any quantum In order to represent the quantum image we will use a
operator is a unitary operator and thus any computational quantum register prepared in a state that encodes both color
process can be implemented by a sequence of quantum and position of a pixel [22]:
gates. Elementary quantum gates include single qubit gates
1 2 1 2 1
2n m

(Not, Hadamard, phase-shift, rotations), controlled gates Q  C m  P 2 n  n    ij j i . (6)


(CNOT, CPHASE) and the Toffoli gate [20]. The unitarity 2 i 0 j 0
of quantum operators ensures the reversibility of the Pixel positions are encoded in register P using 2n qubits,
computational process. We remark that the number of
which are enough to store an image with N  2n  2n pixels.
outputs of a quantum gate is equal to the number of inputs.
For example, the Not gate ( X ) and the Hadamard gate ( H ) Register P is in the form y x where y and x encode
act on a single qubit and can be described by the row and column coordinates of a pixel respectively.
0 1
 
Color information for each pixel is represented using
X   , X  0   1   0  1 , (3) m  log 2 L qubits encoding the L colors (gray levels)
1 0

2m 1 2
 present in the image. Coefficients  ij , with  ij  1
0 1
1
 H 0  j 0
1  1 1   2
H  , . (4) for all i with 0  i  22 n , are used to express the color of a
2  1 1  

H 1 
1
0 1 pixel with position i by means of a superposition of all
2 possible colors. For a given pixel i coefficients  ij take
The controlled-Not gate ( CNOT ) acts on two qubits, a value 1 if the color of the pixel is j , and 0 otherwise. This
target qubit and a control qubit. The former is flipped if and
is illustrated in Fig. 1 with a simple example of a 2  2
only if the latter is in state 1 :
image with four colors.
00  00 ; 01  01 ; 10  11 ; 11  10 .

78
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

algorithm that computes the discrete Fourier transform on


2 n elements requires exponentially more operations, using
 
O n2 n gates. Even though the quantum Fourier transform
is an efficient quantum algorithm for performing a Fourier
transform of quantum amplitudes, it does not speed up any
task that requires computing the Fourier transform on
classical data. This is because the complete set of Fourier
coefficients are in fact encoded in the amplitudes of the
quantum state given by the right side of (8). As noted in
Section II, the amplitudes in a quantum computer cannot be
directly accessed by measurement. Nevertheless, a more
subtle use of the quantum Fourier transform allows for
exponential speedups to be obtained when solving several
interesting problems. These include the order-finding
problem, the factoring problem, and, in combination with
the quantum search algorithm, the problem of counting the
solutions to a search problem.
C. Quantum Circuit for Image Filtering
In classical image processing image filtering can be
achieved by convolving the input image with a filter. This
Figure 1. Example of a simple 2  2 quantum image with four possible can be achieved either in the spatial domain or in the
colors (two qubits are used to represent the color information and two frequency domain but, in general, the latter approach is
qubits encode the position of each pixel).
computationally faster, especially as the filter size increases.
B. The Quantum Fourier Transform and Its Inverse This is due to the convolution theorem, which leads to the
following steps for performing the filtering process:
The quantum Fourier transform (QFT) on an orthonormal
1. Compute F (u, v) , the Fourier transform of the
basis 0 , 1 , , N  1 is a linear operator whose action on
input image f ( x, y ) ;
a computational basis state is defined by
2. Multiply the Fourier transformed image with a
1 N 1 2 ixk N
QFTN x  e
N k 0
k . (7) filter function H (u, v) ;
3. The filtered image is obtained by computing the
It can be easily verified that the transform in (7) is unitary
inverse Fourier transform of the result obtained in
( QFTN x is normalized to unity and QFTN x is step 2.
orthogonal to QFTN x  unless x  x ). Applied to a In order to achieve the filtering of a quantum image we
need to derive the corresponding quantum steps of the above
superposition of states x with complex amplitudes  x it procedure. Nevertheless, as proved by Lomont [19], the
produces another superposition of states k with quantum convolution of two sequences, encoded in the
coefficients of two quantum states, cannot be achieved
amplitudes related to  x by an appropriate discrete Fourier
directly. It also holds true for the correlation operation. This
transform: is because, due to linearity constraints, there is no physical
 N 1  N 1
QFTN    x x     k k , (8) process capable of realizing the multiplication step. That is,
 x0  k 0 for arbitrary quantum states  i ai i and  j b j j there is
where no quantum operator to compute the state
1 N 1 2 ikx N
 e x .
N 1 N 1 N 1
k 
N x 0
(9)
 ai b j ij 
i , j 0
P
   a j bk  j k
k 0 j 0
(11)
From the unitarity of the quantum Fourier transform it
 ab
2
follows that its inverse is the Hermitian adjoint of the where   1 i j is the normalization factor and
quantum Fourier operator, QFT 1  QFT † . It maps the state
N  2n for some integer n  0 . In order to avoid the
given by the right side of (7) to x and its action on a consequences of this result we propose to apply the filtering
computational basis state is described by step using a quantum oracle provided as a black box. As
1 N 1 2 ixk N shown in Figure 2, at the output of the proposed quantum
QFTN1 x  e
N k 0
k . (10) filtering circuit we actually find the input image. Thus,
Lomont’s proof is not contradicted but only avoided.
The quantum Fourier transform and its inverse can be Moreover, exploiting the quantum interference
efficiently implemented using one-qubit Hadamard gates phenomenon, we can use an additional qubit initially in state
and 2-qubit controlled-phase gates. That is, a quantum
0 to reinterpret the quantum image as a superposition of
circuit that performs the n-qubit Fourier transform needs
 
O n 2 such quantum gates. In contrast, the best classical two images. If for example a high pass or a low pass filter is

79
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

Figure 2. The quantum circuit for image filtering in the frequency domain.

used, the output image is the sum of the image containing state representing the frequencies removed by the filter:
the high frequencies and the image containing the 22 n  t t
corresponding low frequencies. The additional qubit can be I1  2n
I1bad  2 n I1good , (15)
2 2
used to make the distinction between the two images.
In the following we analyse this process and describe the where I1good is the state containing the ‘good’ frequencies
state of the quantum image filtering circuit at each step of
that the filter allows to pass, I1bad is the state containing
the computation as marked in Fig. 2. The input state I 0 is
the ‘bad’ frequencies that are suppressed by the filter and t
represented by the input image and an additional qubit in
is the number of ‘good’ frequencies. Applying the oracle
state 0 :
operator U H to this superposition one can use the additional
2n 1 2n 1 2m 1
1
I0  Q  0 
2n
  
y 0 x 0 j 0
ij j y x 0 , (12) qubit to make the distinction between the two states, where
the action of U H is
where Q holds the quantum image using the kp z 
UH
kp z  H (k , p) . (16)
representation described in Section III.A. Applying the I 2  I m  U H I1
quantum Fourier transform on the image produces state 2 i ( yk  xp )
2n 1 2n 1 2m 1 2n 1 , (17)
j UH  k p 0 
1
I1 : 
22 n
   yxj e 2n

 
y 0 x 0 j 0 k , p 0
I1  I m  QFT22 n Q  I 0
U H only acts on the position qubits and leaves the color
2n 1 2n 1 2m 1

1
2n
   yxj j QFT22 n y x 0 qubits unaffected. In our case z is initially 0 and the
y 0 x 0 j 0
filter H (k , p ) is
2n 1 2n 1 2m 1

2
1
 n    yxj 
j QFT2n y  QFT 2n
x 0 (13) 1, k , p  S good
H (k , p )   . (18)
0, k , p  Sbad
y 0 x 0 j 0

2n 1 2n 1 2m 1 2n 1 2 iyk 2n 1 2 ixp
1

22 n
  
y 0 x 0 j 0
yxj j e
k 0
2n
k e
p 0
2n
p 0 S good and Sbad represent the sets of coordinates for the
‘good’ and ‘bad’ frequencies classified accordingly by the
2n 1 2n 1 2m 1 2n 1 2 iyk 2 ixp
1
 
corresponding filter function. The resulting state, I 2 can
 2n
n n
2 2
yxj e e j k p 0
2 y 0 x 0 j 0 k , p 0 thus be re-written:
2 iyk 2 ixp
1 2 1 2 1 2 1
n n m
where I and I m denote the identity operator on one and m
I 2  2 n      yxj e 2 e 2 j k p 0 
n n

qubits, respectively. We also used the fact that the quantum 2 y  0 x  0 j  0 k , pSbad
Fourier transform on k qubits is the k -fold tensor product 2 iyk 2 ixp
(19)
2n 1 2n 1 2m 1
1
of k one-qubit quantum Fourier transforms (written  2n
2
 
y  0 x  0 j  0 k , pS good
 yxj e 2n
e 2n
j k p 1
QFT  k ):
TABLE 1. THE Sgood AND Sbad FREQUENCY SETS FOR SOME
QFT2k i k
 QFT  k ik 1  i1i0 COMMON IDEAL FILTERS.
. (14)
 QFT ik 1    QFT i0 Filter Frequency Sets
Low-pass 
The next step performed by the quantum circuit is the  S good  k , p D(k , p )  D0 

equivalent of the classical filtering step. Nevertheless, there  Sbad  k , p D(k , p )  D0 

is a fundamental distinction compared to the classical High-pass 
operation that allows us to avoid the result proved by  S good  k , p D(k , p )  D0 

Lomont. The state of the register holding the image does not  Sbad  k , p D(k , p )  D0 

actually change to a state representing the filtered image but Band-pass 
rather it undergoes an interference process with the S  k , p DL  D(k , p )  DH 
 good
additional qubit initially in state 0 . This is achieved using  Sbad  k , p D(k , p )  DL and D(k , p)  DL 

a quantum oracle built using the filter function H (k , p ) . Band-stop 
 S good  k , p D(k , p )  DL and D (k , p )  D

The quantum state I1 is actually a superposition of two  Sbad  k , p DL  D(k , p )  DH 

states, a state representing only the filtered frequencies and a

80
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

Various choices for the filter function H (k , p ) lead to both images in the final superposition using the quantum
different values in the ‘good’ and ‘bad’ frequency sets. storage and retrieval protocol described by Venegas-
Table 1 shows the different sets associated with some ideal Andraca and Bose [8]. The disadvantage of this protocol is
filters. that it involves preparing several copies of the input image,
The last computational step in the quantum circuit in Fig. applying the same computational process on each copy and
2 represents the inverse quantum Fourier transform that then sampling using the measurement operator. This is in
reverts from the frequency to the spatial representation of fact a statistical procedure that serves for minimizing the
the image. The final state of the circuit contains the uncertainty in the retrieval process of a quantum parameter.
superposition of two quantum images: the image containing This uncertainty comes from the probabilistic nature of
the frequencies passed by the filter and the image containing quantum measurement.
the frequencies suppressed by the filter. For example, if a An alternative for extracting useful information from a
low-pass filter is used, the final image is actually a quantum-transformed image is to apply further processing
superposition of the low-frequencies image and the high- steps. In fact, this is also the common procedure in classical
frequencies image. Moreover, the distinction between these image processing. The filtering step is part of a pre-
two images can still be made using the additional qubit: processing stage where the image is enhanced such that
further operations, e.g. segmentation, could be better
I3 
applied. Then, other classes of measurements could be
1  2 1 2 1 2 1
n n m
applied on the processed image that could reveal its
      yxj j QFT21 k QFT21 p 0 
22 n  y0 x0 j 0 k , pS
n n
properties without the need to actually ‘see’ the processed
bad

image. For example, the segmentation of the high frequency


2 1 2 1 2 1
n n m

      yxj  j QFT21 k QFT21 p 1  , (20) n n image, i.e. the image containing edge information, can
y 0 x 0 j 0 k , pS good  produce a quantum state representing only the pixels
1  2 1 2 1 2 1 2n 1 2 ikr 2n 1 2  ipt
n n m
belonging to the edges of an object. Variations of quantum
       yxj  j e e t 0 
2n 2n
r searching, quantum counting and/or quantum integral
23 n  y 0 x0 j 0 k , pS bad r 0 t 0
estimation can then be applied to compute useful statistics
2n 1 2n 1 2m 1 2n 1 2 ikr 2n 1 2 ipt

     yxj
j e 2n
r e 2n
t 1 associated to the shape of the object, e.g. perimeter, area,
y 0 x 0 j 0 k , pS good r 0 t 0  etc. Such information could then be determined by
2 iyk 2 ixp measuring the final quantum state. The result of the
 is  yxj e
where  yxj 2n
e 2n
. By re-arranging the sums we measurement can then be used for comparing two images in
can interpret state I3 as the superposition of the two a content-based image retrieval system. It follows that
implementing such a system quantumly can bring a
images: significant speedup compared to the classical variant. This is
I3  due both to the exponential speedup of the quantum version
2n 1 2n 1 2m 1 2n 1 2n 1 2 i ( kr  pt ) of the Fourier transform, but also due to the speedup brought
1
 3n
2
     
r  0 t  0 j  0 k , pSbad y  0 x  0
'
yxj e 2n
j r t 0  by the quantum search algorithm.

2n 1 2n 1 2m 1 2n 1 2n 1 2 i ( kr  pt )
1 IV. SIMULATION OF QUANTUM IMAGE FILTERING

23 n
     
r  0 t  0 j  0 k , pS good y  0 x  0
'
yxj e 2n
j r t 1
In this section we present the results of applying the
,(21) filtering operation on the gray scale images in Fig. 3. The
2n 1 2n 1 2m 1
1

23 n
   b
rtj j r t 0  simulations were performed in MATLAB by representing
r 0 t 0 j 0
the quantum images in the form of an  ij -matrix according
2n 1 2n 1 2m 1
1

23 n
  
r 0 t 0 j 0
g
rtj j r t 1 to (6) and by applying (21) to compute the intensity values
for the pixels in the resulting quantum states that represent
 Qbad 0  Qgood 1 the filtered images, Qbad and Qgood . Three 32 by 32
where the color of a pixel with position rt is pixels images were used: a synthetic image containing only
two gray levels (Fig. 3 left) and two sub-images of a
2m 1
1
22 n

j 0
b
rtj j in the image containing the suppressed microscopy image (Fig. 3 right). For each image, the color
information for each pixel is represented using m  8 qubits
1 2m 1 to encode 256 possible gray levels and the pixel positions
frequencies, Qbad , and
22 n

j 0
g
rtj j in the image with are encoded using 2n  10 qubits.
The synthetic image was filtered using a high pass filter
the frequencies passed through by the filter, Qgood . with D0  6.4 and the resulting high- and low-frequency
In classical image processing the final stage usually images are shown in Fig. 4, corresponding to the Qgood
assumes extracting information from the result by looking at
the image. This, however, cannot be achieved in the and Qbad states, respectively. Scaled versions of the 32 by
quantum domain because the resulting image(s) are stored in 32 images are presented. As expected, the high-pass filter
quantum states. A measurement on the final state I 3 only emphasizes a horizontal edge in the middle of the image and
samples from the transformed image, revealing only the the low-pass filter has a blurring effect. The horizontal
color at a single pixel position. However, one can retrieve bands in the filtered images are due to the ringing effect of

81
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

the ideal filter. Fourier transform. For comparison and displaying purposes,
the classical representation of the quantum high- and low-
frequency images is extracted from the corresponding
quantum superpositions by multiplying the amplitudes, i.e.
the  coefficients, with the integer encoding of the state
vectors. Just like in the classical case, negative floating point
values are also obtained for the gray levels in the filtered
images. The minimum value in the image is displayed as
black, the maximum value is displayed as white and the
values in between are displayed as intermediate shades of
Figure 3. Test images. Left – synthetic image, 32  32 pixels, with two gray, using 256 gray levels. The gray level for pixel (3,3) in
gray levels. Right – Microscopy image of a tissue section displaying cell the high-frequency image is represented as 105 and in the
nuclei as bright round objects; A,B are 32  32 pixels sub-images used for
low-frequency image as 246.
testing purposes.
The results of filtering sub-images A and B of the
microscopy image are presented in Fig. 5 and Fig. 6. As
only four gray levels are present in the original sub-image
A, the quantum representation of each pixel in the filtered
images is expressed as a superposition of four basis vectors.
The gray levels and the corresponding amplitudes in the
quantum representation of pixel (3,3) of sub-image A are
detailed in Table III. The original sub-image B contains 189
different gray levels. The quantum amplitudes of the
superposition representing the intensity value of the same
Figure 4. Result of filtering the synthetic image in Fig. 3 with a high-pass pixel in sub-image B are presented in Fig. 7.
filter, D0  0.2  32  6.4 . Left – image containing the corresponding high
frequencies. Right – image containing the corresponding low frequencies.

TABLE II. QUANTUM REPRESENTATION OF THE PIXEL WITH COORDINATES


(3,3) IN THE SYNTHETIC IMAGE IN FIG. 3, FILTERED WITH A HIGH-PASS
FILTER WITH D0  0.2  32  6.4

input high-freq. low-freq.


image image ( Qgood ) image ( Qbad ) Figure 5. Result of filtering sub-image A of the cell image in Fig. 3 with a
high-pass filter, D0  0.2  32  6.4 . Left – original sub-image A. Center -
gray level 170 -3.91 173.91 image containing the corresponding high frequencies. Right - image
containing the corresponding low frequencies.
C 1 170 0.0559 100 -0.0559 100
8 TABLE III. QUANTUM REPRESENTATION OF THE PIXEL WITH COORDINATES
-0.0559 170 1.0559 170 (3,3) IN SUB-IMAGE A OF THE CELL IMAGE IN FIG. 3, FILTERED WITH A HIGH-
PASS FILTER WITH D0  0.2  32  6.4
In the filtered images, the intensity value of each pixel is
represented by a quantum superposition of the two basis input high-freq. low-freq.
vectors corresponding to the gray levels in the original image image image
image. For example, for pixel with coordinates (3,3), the gray level 0 1.3942 -1.3942
gray levels and the corresponding quantum representation in
each image – original, high- and low-frequency images – are C 10 -0.0262 0 1.0262 0
8
detailed in Table II. The resulting quantum state,
corresponding to the representation in (21), is a normalized -0.0008 1 0.0008 1
state: 0.0079 51 0.0079 51
j
g
rtj  b 2
rtj 1, (22) 0.0191 52 0.0191 52

and is equivalent to the quantum representation of the gray


level in the original image. This is consistent with the
classical case where the summation of the corresponding
high- and low-frequency images gives the original image.
In general, the inverse Fourier transform is complex.
However, when both the input image and the filter are real-
valued, the imaginary part of the inverse transform should
be zero. In practice, the imaginary components appear to be Figure 6. Result of filtering sub-image B of the cell image in Fig. 3 with a
non-zero usually due to computational approximations and high-pass filter, D0  0.2  32  6.4 . Left – original sub-image B. Center -
need to bee ignored. Thus, in the filtered image, the  image containing the corresponding high frequencies. Right - image
coefficients are taken to be the real part of the inverse containing the corresponding low frequencies.

82
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

filtered image. In contrast, the quantum filtering process is


reversible because only unitary operators are used to act
upon the system. Another contrast regards the retrieval of
the filtered image(s). In the classical case the process is
straightforward, while the quantum representation of the
filtered image(s) encodes this information in the amplitudes
of the quantum states. A statistical procedure would then be
necessary to extract these amplitudes by measurement. Such
a procedure involves preparing several copies of the input
Figure 7. Quantum representation of the pixel with coordinates (3,3) in sub- image and applying the same computational process on each
image B of the cell image in Fig. 3 filtered with a high-pass filter with copy. However, in most image processing applications,
D0  0.2  32  6.4 . The gray level of the pixel is 0.2788 and is represented filtering is a pre-processing step and its result is usually an
by a superposition of quantum states that correspond to all the gray levels in input for several other operations. Thus, the retrieval of the
the original sub-image. filtered image is not necessary. It can be further processed
and useful information can be extracted at the end of the
V. DISCUSSION quantum computational process as discussed in Section
The convolution operation in the spatial domain III.C. Further processing can be applied on either of the two
corresponds to multiplication in the frequency domain. images in the quantum superposition represented by the
Thus, for spatial invariant linear filters, convolution can be final state of the quantum filtering circuit. This can be
implemented efficiently using the discrete Fourier achieved making use of the oracle qubit and controlled
transform. Despite the obvious speedup that could be operators. This qubit distinguishes between the two quantum
introduced by the quantum version of the Fourier transform, states. It is flipped if the value of the filter function
a quantum implementation for the filtering operation in the implemented by the oracle is one and remains unchanged
frequency domain is not straightforward. This is due to the otherwise. Thus it can be used as a control qubit to
fact that the quantum convolution of two sequences, manipulate one image or the other.
encoded in the coefficients of two quantum states, is In the quantum protocol for image filtering proposed in
physically impossible. Thus, in order to develop a quantum this paper the color of a pixel in the quantum image is
version of the image filtering operation we devise a quantized and represented with an appropriate number of
workaround to this problem. Our solution is based on the qubits, much like in the classical case ( m  log 2 L qubits are
use of a quantum oracle. An oracle is a quantum circuit that needed to represent the L colors of a gray level image). The
‘recognizes’ solutions to a given problem. It is supplied as a same m qubits are used to store the colors of all the pixels
black box that provides a yes-no answer to a specific in the image, which is possible by efficiently exploiting the
question. In our case the oracle operator is used to properties of quantum superpositions. This, in fact, allows
implement the filter function. Thus, we are able to avoid the for an overall exponentially lower memory space to be used
impossibility of the quantum convolution by working with than in the classical case ( m  2n qubits are needed to store
the image containing both ‘good’ and ‘bad’ frequencies as
classified by the filter. The trick is to reinterpret this image a 2n  2n image with L gray levels compared to m22 n
as the sum of two filtered images: the image containing only classical bits).
the ‘good’ frequencies and the image containing only the Another approach for encoding the color information
‘bad’ frequencies. This way we don’t need to actually would be to use a single qubit as suggested by Venegas-
convolve the image with the filter function but only use the Andraca and Bose [8] and Le et al. [9]. It relies on the
filter to distinguish between the two component images. The definition of a machine capable of detecting electromagnetic
output state of the quantum circuit implementing the waves and producing an initialized qubit that encodes the
filtering process is a superposition of the two quantum frequency of the electromagnetic wave in the phase
images. parameter. Le et al. use single qubit unitary operators to
The main advantage of our quantum implementation for achieve basic color processing operations such as color
the image filtering operation is related to the efficiency of inversion [11]. However this representation restricts the
the quantum Fourier transform. It requires exponentially less possible processing operations that can be defined in the
operations than the classical fast Fourier transform. quantum domain. For example, using our representation, the
However, this speedup is usually difficult to be exploited mechanism of quantum amplitude amplification can be
because the complete set of Fourier coefficients are encoded employed to define quantum procedures for histogram
as amplitudes of quantum states and cannot be directly computation and threshold-based segmentation [22]. The
accessed. In our method we are able to preserve the speedup one-qubit color representation is not suited for such a
of the quantum Fourier transform as the Fourier coefficients purpose because the quantum states representing pixels with
need not be extracted. a given color are not computational basis states. Even
In classical information processing the result of image though in our representation the necessary state space is
filtering is represented by an image containing only the larger than in the representation suggested in [8], we
frequencies passed through by the filter. The result of our consider that the broader possibilities for processing
quantum image filtering method is different from the operations are much more valuable. Still, we find that the
classical counterpart under several aspects. In the classical mechanism for image filtering described in this paper is
case, the original image cannot be reconstructed out of the straightforward to be employed on the one-qubit

83
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]

Advances in Electrical and Computer Engineering Volume 13, Number 3, 2013

representation. Moreover, we envision that a more advanced applications for quantum information processing. It would
quantum image processing field will exploit various image also represent an overall justification for the immense
representation models. This is much like in the classical case efforts needed for building working quantum computers.
where one uses different image formats and color models
depending on the purpose of the image manipulation process REFERENCES
(we use compressed formats for image transmission, the [1] D. R. Simon, “On the Power of Quantum Computation”, SIAM J.
RGB color model for image display, the L*a*b* color Comput. 26, 5, pp. 1474-1483, 1997, dx.doi.org/
10.1137/S0097539796298637.
model for color analysis, etc.). [2] D. Deutsch and R. Jozsa, “Rapid Solution of Problems by Quantum
Computation”, Proc. R. Soc. Lond. A, 439, pp. 553-558, 1992,
VI. CONCLUSIONS dx.doi.org/10.1098/rspa.1992.0167.
[3] E. Bernstein and U. Vazirani, “Quantum Complexity Theory”, SIAM
In this paper we addressed the field of Quantum J. Comput. 26, 5 pp. 1411-1473, 1997,
Information Processing by analyzing the prospects of dx.doi.org/10.1137/S0097539796300921.
applying quantum computation concepts to image [4] P. Shor, “Algorithms For Quantum Computation: Discrete
Logarithms and Factoring”, in: SFCS '94: Proc. of the 35th Annual
processing tasks. Specifically, we developed a quantum Symposium on Foundations of Computer Science, IEEE Computer
version for the image filtering operation. This is an Society, 1994, pp. 124-134, dx.doi.org/ 10.1109/SFCS.1994.365700.
important technique that comes up in many image [5] A. Fijany, C. Williams, “Quantum Wavelet Transform: Fast
Algorithm and Complete Circuits”, arXiv:quant-ph/9809004, 1998.
processing applications. It is usually applied in the early [6] A. Klappenecker, M. Roetteler, “Discrete Cosine Transforms on
stages of vision processing for image enhancement. For Quantum Computers”, arXiv:quant-ph/0111038, 2001.
example, it can be used to eliminate undesirable [7] C. C. Tseng, T. M. Hwang, “Quantum Circuit Design of 8x8 Discrete
Cosine Transform Using Its Fast Computation Flow Graph”, in:
characteristics introduced in the acquisition process (e.g. Circuits and Systems, 2005. ISCAS 2005. IEEE International
noise) or to emphasize various structures in the image prior Symposium on, pp. 828-831 Vol. 1,
to a segmentation process (e.g. edges). In classical dx.doi.org/10.1109/ISCAS.2005.1464716.
[8] S. Venegas-Andraca and S. Bose, “Storing, Processing and Retrieving
computing, image filtering can be achieved by convolving an Image Using Quantum Mechanics,” in Proc. of the SPIE Conf.
the image with a mask representing the filter. However, Quantum Information and Computation, 2003, pp. 137–147,
convolution with large filters is a very expensive process in dx.doi.org/ 10.1117/12.485960.
[9] P. Le, F. Dong, and K. Hirota, “A Flexible Representation of
the spatial domain. The alternative is to apply filtering in the Quantum Images for Polynomial Preparation, Image Compression,
frequency domain as it corresponds to a multiplication and Processing Operations,” Quantum Inf. Process., vol. 10, pp. 63–
operation. Either way, to the best of our knowledge, no 84, 2011, dx.doi.org/ 10.1007/s11128-010-0177-y.
quantum algorithm has yet been devised to implement this [10] P. Q. Le, A. M. Iliyasu, F. Dong, K. Hirota, “Strategies for Designing
Geometric Transformations on Quantum Images”, Theor. Comput.
operation. Sci. 412 (2011), 1406-1418, dx.doi.org/ 10.1016/j.tcs.2010.11.029.
Our quantum version for the image filtering operation [11] P. Q. Le, A. M. Iliyasu, F. Dong, K. Hirota, “Efficient Color
avoids convolving the image with a filter, which has been Transformations on Quantum Images”, JACIII 15 (2011) 698-706.
[12] F. Yan, P. Q. Le, A. M. Iliyasu, B. Sun, J. A. Garcia, F. Dong and K.
proved to be physically impossible to realize directly [19], Hirota, “Assessing the Similarity of Quantum Images Based on
and uses a quantum oracle to act as a filter. This quantum Probability Measurements,” 2012 IEEE World Congress on
image filtering mechanism has several advantages over the Computational Intelligence, Brisbane, 10-15 June 2012, pp. 1-6,
dx.doi.org/ 10.1109/CEC.2012.6256418.
classical case: [13] A. M. Iliyasu, P. Q. Le, F. Dong, and K. Hirota, “Watermarking and
- It exploits the speedup introduced by the quantum authentication of quantum images based on restricted geometric
version of the Fourier transform and thus it is transformations”. Inf. Sci. 186, 1, pp. 126-149, 2012,
dx.doi.org/10.1016/j.ins.2011.09.028.
exponentially faster; [14] W. Zhang, F. Gao, B. Liu, Q. Wen, and H. Chen, “A watermark
- It exploits the properties of quantum superpositions and strategy for quantum images based on quantum Fourier transform”
thus requires less memory space to represent and process Quantum Inf. Process. 12, 2, pp. 793-803, 2013,
dx.doi.org/10.1007/s11128-012-0423-6.
the image ( m  2n qubits are needed to store a 2n  2n [15] G. Beach, C. Lomont, C. Cohen, “Quantum Image Processing
image with L  2m gray levels compared to m 22 n (QuIP)”, in: Proc. of 32nd Workshop on Applied Imagery Pattern
Recognition, 2003, pp. 39-44, dx.doi.org/
classical bits); 10.1109/AIPR.2003.1284246.
- The output quantum state incorporates information about [16] L. K. Grover, “A Fast Quantum Mechanical Algorithm for Database
both components of the original image – the image Search”, in: Proc. of the 28th annual ACM Symposium on Theory of
Computing, STOC '96, ACM, New York, NY, USA, 1996, pp. 212-
containing the frequencies passed by the filter and the 219, dx.doi.org/ 10.1145/237814.237866.
image containing the frequencies stopped by the filter. [17] S. Venegas-Andraca, J. Ball, “Processing Images in Entangled
The two components can be efficiently distinguished and Quantum Systems”, Quantum Inf. Process. 9 (2010) 1-11, dx.doi.org/
10.1007/s11128-009-0123-z.
exploited using the oracle qubit. [18] J. Latorre, “Image Compression and Entanglement”,
The result obtained in this paper offers a promising arXiv:quantph/0510031, 2005.
perspective on the investigation of more such applications of [19] C. Lomont, “Quantum Convolution and Quantum Correlation
quantum computing to image processing tasks. The Algorithms Are Physically Impossible,” arXiv:quant-ph/0309070,
2003.
developments in the field of Quantum Image Processing are [20] M. Nielsen and I. Chuang, “Quantum Computation and Quantum
still in an early stage. We believe that the contributions to Information”, Cambridge Series on Information and the Natural
this field are not a mere digression in a hot topic as many Sciences. Cambridge, UK: Cambridge University Press, 2000
[21] G. Brassard, P. Hoyer, M. Mosca, A. Tapp, “Quantum Amplitude
may think, but they could significantly impact the overall Amplification and Estimation”, arXiv:quant-ph/0005055, 2000.
advent of the main framework of Quantum Information [22] S. Caraiman and V. Manta, “Image Processing Using Quantum
Processing. Interesting ideas could arise for the design of Computing”, 16th International Conference on System Theory,
Control and Computing (ICSTCC), Sinaia, 12-14 October 2012 , pp.
new quantum algorithms and the development of novel 1-6.

84

You might also like