CN115423688A - Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation - Google Patents

Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation Download PDF

Info

Publication number
CN115423688A
CN115423688A CN202211201390.XA CN202211201390A CN115423688A CN 115423688 A CN115423688 A CN 115423688A CN 202211201390 A CN202211201390 A CN 202211201390A CN 115423688 A CN115423688 A CN 115423688A
Authority
CN
China
Prior art keywords
quantum
image
module
pixel
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211201390.XA
Other languages
Chinese (zh)
Inventor
周日贵
李鑫
高超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Maritime University
Original Assignee
Shanghai Maritime University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Maritime University filed Critical Shanghai Maritime University
Priority to CN202211201390.XA priority Critical patent/CN115423688A/en
Publication of CN115423688A publication Critical patent/CN115423688A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4007Interpolation-based scaling, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N10/00Quantum computing, i.e. information processing based on quantum-mechanical phenomena
    • G06N10/20Models of quantum computing, e.g. quantum circuits or universal quantum computers

Abstract

The invention discloses a quantum circuit diagram and a quantum color image zooming method based on bilinear interpolation, which comprises a multi-control non-gate module, a 1 adding module, a pixel value operation module, an adder module, a subtracter module, a T-counting multiplier module and a 2 dividing module which are respectively constructed based on a basic quantum bit gate, including a single quantum bit gate and a quantum controlled gate. Then quantum realization lines for quantum color image enlargement and reduction are respectively designed based on the modular lines. Finally, the complexity of the quantum wires of both schemes was analyzed. The invention is suitable for many practical image processing applications, for example, quantum image watermarking can be more efficient by means of quantum image scaling.

Description

Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation
Technical Field
The invention belongs to the field of quantum image processing, and particularly relates to a quantum circuit diagram and a quantum color image scaling method based on bilinear interpolation.
Background
Quantum computing is a novel area relative to classical computing. Quantum computers have different structural models, such as quantum turing models, quantum wire models, cell automata models, etc. Quantum wire models, by their easy understanding, are commonly used to define quantum computers: constructed of quantum wires containing wires and basic quantum gates arranged to process quantum information. The basic unit of information storage and processing in quantum computers is a Qubit. Quantum mechanics has the advantages of unique superposition, entanglement, decoherence and the like. Therefore, the quantum computer can perform superposition storage and parallel processing on data, and can solve the problems of large-capacity and ultra-high-speed task requirements, such as large-quality factor decomposition, accelerated database search and the like, which are difficult to solve by the conventional classical computer.
At present, quantum information is planned as one of the key development targets of advanced science and technology in all countries in the world.
Quantum image processing is an important branch of quantum computing, an emerging interdisciplinary discipline in which quantum computing and digital image processing techniques are combined and extended. Currently, there are two main research directions for quantum image processing: a quantum image representation method and a quantum image processing algorithm.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the quantum circuit diagram and the quantum color image scaling method based on the bilinear interpolation are provided, and the problem of low processing speed of quantum images in the prior art is solved.
The invention adopts the following technical scheme for solving the technical problems:
a quantum circuit diagram comprises a multi-control non-gate module, an adding 1 module, an operation module, an adder module, a subtracter module, a T-counting multiplier module and a dividing 2 module; the multi-control non-gate module is used for copying the known quantum bit; the 1 adding module is used for executing 1 adding operation when a certain condition is met; the operation module is used for operating corresponding data after receiving the instruction; the adder module performs an adding operation on a plurality of stored same quantum bits X and Y by using quantum Fourier transform; the subtractor module is used for performing subtraction operation on a plurality of stored quantum bits X and Y with the same quantity; the T-counting multiplier module is used for executing multiplication operation on a plurality of stored quantum bits X and Y with the same quantity; the divide-by-2 module is used for halving a non-negative integer; and according to a bilinear interpolation reasoning formula, selectively combining the modules, and performing matched connection on the data ports by means of auxiliary quantum bits to construct a quantum circuit diagram required by a scheme.
The quantum circuit diagram is used for quantum image scaling, wherein the operation module is a pixel value operation module and is used for calculating pixel values of all pixel points in the quantum image.
The quantum image processing circuit comprises an image amplifying circuit and an image reducing circuit; the image amplification circuit comprises a multi-control non-gate module, a 1 adding module, a pixel value operation module, 3 adder modules, 4T-counting multiplier modules and a plurality of 2 dividing modules; the multi-control non-gate module and the plus 1 module are used for acquiring position information of four pixel points of an original image and calculating the weight of each pixel by combining the subtracter module; the pixel value operation module is used for calculating the pixel values of the four pixel points; the 3 adder modules, the 4T-counting multiplier modules and the plurality of division-2 modules are combined to calculate all pixel values of the enlarged image;
the image reducing circuit comprises 4 multi-control non-gate modules and 1 pixel value operation module; the multi-control non-door module is used for acquiring coordinate position information mapped to an original image; the pixel value operation module is used for calculating the pixel value of the position.
The line complexity of the quantum color image magnification algorithm is
Figure BDA0003872505030000021
The line complexity of the downscaling of the quantum color image algorithm is O (q (n) 1 +n 2 ) Wherein n) is 1 Is the number of longitudinal quantum bits, n, of the carrier image 2 Is the number of horizontal quantum bits, m, of the carrier image 1 Is the carrier image longitudinal scaling, m 2 Is the carrier image lateral scaling, q is the number of quantum bits per channel of the three channels RGB, α = max {3q, m 1 ,m 2 Denotes the maximum quantum-bit number of color and position information.
The quantum color image zooming method based on the bilinear interpolation comprises the steps of amplifying and reducing a color image, wherein the specific process of amplifying is as follows:
firstly, constructing an amplified blank image according to the specification and the amplification scale of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the positions of the pixel point corresponding to four adjacent pixel points of the original image, and respectively calculating the pixel values of the four pixel points;
then, respectively obtaining the weights of the four pixel values according to the bilinear interpolation characteristic; calculating the pixel values of the selected blank image pixel points by combining the pixel values of the four pixel points of the original image, and assigning the pixel values to the selected pixel points;
finally, after the pixel values of all pixel points on the blank image are calculated and assigned, obtaining an amplified quantum color image;
the specific process of the reduction is as follows:
firstly, constructing a reduced blank image according to the specification and the reduction proportion of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the position of the original image pixel point corresponding to the pixel point, and calculating the pixel value of the original image pixel point;
then, assigning the pixel value of the pixel point of the original image to the selected blank pixel point;
and finally, after assigning the pixel values of all the pixel points on the blank image, acquiring a reduced quantum color image.
When the image is amplified, the pixel value | C of the selected blank image pixel point is calculated Y′,X′ >The following formula is adopted:
Figure BDA0003872505030000031
wherein, | C Y,X >,|C Y,X+1 >,|C Y+1,X >,|C Y+1,X+1 >Corresponding to pixel values at four positions (Y, X), (Y, X + 1), (Y +1,X), (Y +1, X + 1), respectively, on the original image.
When the image is reduced, the pixel value | C of the selected blank image pixel point is calculated Y′,X′ >The following formula is adopted:
|C Y′,X′ >=|C Y,X >。
the color information of the original color image is represented by three channels of red, green and blue, and the pixel value range of each channel is [0,2 ] q -1]Pixel value | C of pixel point of original image Y,X >The following formula is adopted for calculation:
Figure BDA0003872505030000032
wherein Red, green and Blue respectively represent RGB three color channels in turn, R i 、G i 、B i Q-1 corresponding to pixel information of RGB channels, i =0,1.
Is of the size of
Figure BDA0003872505030000033
For the color original image
Figure BDA0003872505030000034
One arbitrary quantum superposition state | I of the Vi Hilbert space>Expressed, the concrete formula is as follows:
Figure BDA0003872505030000035
wherein the content of the first and second substances,
Figure BDA0003872505030000036
is the position information in the vertical direction,
Figure BDA0003872505030000037
is position information in the horizontal direction.
Compared with the prior art, the invention has the following beneficial effects:
1. the guiding idea of the invention is to give full play to the unique advantages of quantum computing such as quantum superposition and quantum parallelism, reduce the complexity of quantum circuits as much as possible, and design corresponding quantum circuits to realize a quantum color image scaling scheme based on bilinear interpolation.
The technical scheme of the invention is that quantum computation is combined with a bilinear interpolation algorithm of a classical digital image processing type to perform interpolation operation on an original color carrier image, thereby realizing a scaling scheme of a quantum color image.
2. The invention creatively provides a quantum color image scaling scheme based on bilinear interpolation. Compared with a quantum color image scaling method based on nearest neighbor interpolation, the scheme has the advantages that the image scaling effect is better, and the quality of the interpolated image is higher.
3. The invention is suitable for many practical image processing applications, for example, quantum image watermarking can be more efficient by means of quantum image scaling.
Drawings
The invention and its features, aspects and advantages will become more apparent from the following detailed description of non-limiting embodiments, which is to be read in connection with the accompanying drawings. Like reference symbols in the various drawings indicate like elements. The drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention.
FIG. 1 is a conventional single quantum bit gate;
FIG. 2 is a dual qubit controlled U gate, and a dual qubit controlled X gate;
FIG. 3 is a multi-qubit controlled U-gate;
FIG. 4 is a bilinear interpolation method in the X direction;
FIG. 5 is a pixel mapping relationship between an original image and an interpolated image;
FIG. 6 is a quantum wire implementing a multi-control non-gate module;
FIG. 7 is a quantum wire implementing an plus 1 module;
FIG. 8 is a simplified block diagram of an implementation of the arithmetic block;
FIG. 9 is a simplified block diagram of an implementation of an adder block;
FIG. 10 is a simplified block diagram of an implementation of a subtractor module;
FIG. 11 is a simplified block diagram of an implementation of a T-count multiplier block;
FIG. 12 is a quantum wire implementing a divide-by-2 module;
FIG. 13 is a specific quantum wire implementing a quantum color image magnification scheme;
fig. 14 is a specific quantum wire implementing a quantum color image reduction scheme.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The guiding idea of the invention is to give full play to the unique advantages of quantum superposition and quantum parallelism equivalent to quantum computation, reduce the complexity of quantum circuits as much as possible, and design corresponding quantum circuits to realize the quantum color image scaling scheme based on bilinear interpolation.
The technical scheme of the invention is that quantum computation is combined with a bilinear interpolation algorithm in a classical digital image processing mode, and interpolation operation is carried out on an original color carrier image, so that a scaling scheme of a quantum color image is realized.
In the classical calculation, an information unit is represented by a Bit (Bit) mode, and the Bit representation modes are only two types: the 0 state or the 1 state. In quantum computing, information elements are represented in the form of qubits. The qubit has two fundamental quantum states |0>And |1>Simply referred to as the ground State (Basis State). The classical bit can only be in the 0 or 1 state, while the qubit can be a linear combination of the two above-mentioned ground states, called the Superposition state, which is denoted as
Figure BDA0003872505030000051
Wherein a and b are two complex numbers, each corresponding to a ground state |0>And |1>The quantum amplitude of (a) satisfies | a 2 +|b| 2 And =1. Quantum state when measured on a qubit
Figure BDA0003872505030000052
Will collapse (Collapsing) to the ground state |0>And |1>Respectively has a probability of | a 2 And | b |) 2 . The method is a unique superposition characteristic in quantum mechanics, is a characteristic which is quite different from a classical calculation, and is one of important reasons that a quantum computer can process large data.
Tensor Product is a method of combining small vector spaces together to form a vector space with larger dimensions, using symbols
Figure BDA0003872505030000053
It has the following meanings:
suppose W and V are two complex matrices
Figure BDA0003872505030000054
Then the tensor product of W and V can be expressed as
Figure BDA0003872505030000055
For two quantum ground states | w>And | v>Product of tensor
Figure BDA0003872505030000056
The abbreviated forms of (a) are generally of the following three types: i wv >, | w > | v>And | w, v>. For the ground state |1 of a single qubit>And |0>, their tensor product can be expressed as:
Figure BDA0003872505030000057
when quantum state | w > is subjected to tensor product n times, its expression form
Figure BDA0003872505030000058
Can be abbreviated as
Figure BDA0003872505030000059
A two-quantum bit can be synthesized from two single-quantum bit tensor operations, which have four basis states |00 >, |01>、|10>And |11>. Thus, the state of a double qubit
Figure BDA00038725050300000510
Can be described as
Figure BDA0003872505030000061
Correspondingly, to
Figure BDA0003872505030000062
When the measurement is performed, the measurement result is |00>、|01>、|10>Or |11>Respectively has a probability of | a 00 | 2 、 |a 01 | 2 、|a 10 | 2 And | a 11 | 2 And it must be satisfied that the sum of the probability magnitudes of all the outcomes is 1, i.e. | a 00 | 2 +|a 01 | 2 +|a 10 | 2 +|a 11 | 2 =1。
If a quantum system consists of n qubits, the quantum system has 2 n A mutually orthogonal ground state | i n- 1 i n-2 ...i 0 >, i n-1 ,i n-2 ,...i 0 E.g. {0,1}. The state of the quantum system can be expressed as
Figure BDA0003872505030000063
Wherein i = i n-1 i n-2 ...i 0 And satisfies the normalization condition
Figure BDA0003872505030000064
A set of quantum gates is common if a quantum circuit using the set of quantum logic gates can approximate any unitary operation with any precision. An important class of general-purpose gates are single-qubit gates and controlled-not gates, i.e. a general quantum-logic gate may consist of one or more single-qubit gates and controlled-not gates.
The representation of the qubit gate can be generally described in terms of a matrix. For a single qubit gate, it can be represented by a 2 × 2 unitary matrix U. Figure 1 gives a symbolic representation of four commonly used single-quantum-bit gates and the corresponding matrix descriptions.
For a biqubit gate, the composition of the biqubit gate is the most important controlled U gate, U being an arbitrary 2 × 2 unitary matrix. Generally, a dual qubit gate has two qubit inputs and two qubit outputs, a target qubit and a control qubit, respectively, where the control qubit functions to control whether to perform an operation.
If the control qubit is in the control qubit state, the U-operation will act on the target qubit, so that the target qubit is operated, otherwise the target qubit is unchanged. The control qubit can be either the |0> state or the |1> state, and the symbols and their corresponding matrix representations are shown in FIG. 2, where the black and white origins in the quantum wires represent the states of the control qubit as the calculated ground states |0> and |1>, respectively.
In particular, when the U matrix in the double-qubit controlled U Gate is an X Gate, this particular controlled U Gate is called a controlled not Gate (CNOT Gate).
When the quantum bit number n of the quantum bit controlled gate is more than or equal to 2, the quantum bit controlled gate is called C n (U), where U is an arbitrary 2 × 2 unitary matrix, the number of control quantum bits is n-1, and the number of target quantum bits is 1. Assume a binary number i n- 1 i n-2 ...i 0 Is a number on the quantum control bit, then C n The symbol of (U) is shown in FIG. 3. C in FIG. 3 n (U) Gate application to Quantum State | x of n Single Quantum bits n-1 x n-2 ...x 0 Above, can get
Figure BDA0003872505030000071
Wherein if x n-1 x n-2 ...x 1 =i n-1 i n-2 ...i 1
The function f (x) n-1 x n-2 ...x 1 ,i n-1 i n-2 ...i 1 ) Is 1, otherwise is 0, and let U 0 =I,U 1 =U。
When the U matrix is an X gate, it is commonly referred to as an n qubit controlled not gate, abbreviated C n (X). C is to be n (X) gating quantum state | X to n single-quantum bits n-1 x n-2 ...x 0 >Can be obtained
Figure BDA0003872505030000072
Let n =4, where 3 control qubits | i 3 >=|i 2 >=|i 1 >=|1>1 target qubit | i 0 >= |1>, and 4 (X) to the four quantum states |1111>To obtain
C 4 (X)|1111>=|1110>
It should be noted that, in the quantum wires, each wire represents a connection of the quantum wires, and the execution sequence of the quantum wires is from left to right.
A quantum circuit diagram comprises a multi-control non-gate module, an adding 1 module, an operation module, an adder module, a subtracter module, a T-counting multiplier module and a dividing 2 module; the multi-control non-gate module is used for copying known quantum bits; the 1 adding module is used for executing 1 adding operation when a certain condition is met; the operation module is used for receiving the instruction and then performing operation on corresponding data; the adder module performs an adding operation on a plurality of stored same quantum bits X and Y by using quantum Fourier transform; the subtractor module is used for executing subtraction operation on a plurality of stored quantum bits X and Y with the same quantity; the T-counting multiplier module is used for executing multiplication operation on a plurality of stored quantum bits X and Y with the same quantity; the divide-by-2 module is used for halving a non-negative integer; and according to a bilinear interpolation reasoning formula, the modules are selected and combined, and the data ports are connected in a matching manner by means of auxiliary quantum bits to construct a quantum circuit diagram required by a scheme.
In one embodiment, as shown in fig. 6 to 14,
the present embodiment aims to provide a quantum color image scaling design and implementation method based on bilinear interpolation, and design a corresponding quantum line according to two scaling modes.
The quantum circuit design of the scheme is based on a basic quantum bit gate, and 7 quantum modules (shown in figures 6-13) are constructed, including a multi-control non-gate module (Multiple CNOT module) and a plus 1 module (U) 1 module), pixel value operation module (omega) Y,X module), adder module (Adder module), subtractor module (RS module), T-count multiplier module (TM module), divide-by-2 module. Based on the quantum module, quantum circuits for amplifying and reducing the complete quantum color image are designed.
The specific design schemes of this embodiment include two schemes, one is a quantum color image magnification scheme based on bilinear interpolation, and the other is a quantum color image reduction scheme based on bilinear interpolation, which will be described in detail below.
1. The method comprises the following steps of (1) line design and specific steps of quantum color image amplification based on bilinear interpolation:
suppose that a frame is interpolated by bilinear interpolation
Figure BDA0003872505030000081
The color image is enlarged to
Figure BDA0003872505030000082
Wherein n is 1 Is the number of quantum bits in the longitudinal (i.e. Y) direction of the carrier image, n 2 Is the carrier image transverse directionNumber of quantum bits (i.e. X direction), m 1 Is the carrier image longitudinal scaling, m 2 Is the carrier image lateral scaling, n 1 ,n 2 ,m 1 And m 2 Are all non-negative integers. Then, for the scaling factor r in the Y and X directions y And r x Respectively corresponding values are
Figure BDA0003872505030000083
And
Figure BDA0003872505030000084
interpolating the image I 'according to the bilinear interpolation principle'>Pixel value | C of upper (Y ', X') point Y',X' >Can be calculated from its four neighboring pixels mapped on the original image. I C Y',X' >The specific calculation formula is as follows:
Figure BDA0003872505030000085
wherein, | C Y,X >,|C Y,X+1 >,|C Y+1,X >,|C Y+1,X+1 The > values correspond to pixel values at four positions (Y, X), (Y, X + 1), (Y +1,X), (Y +1, X + 1) on the original image, respectively.
Fig. 13 shows a quantum wire diagram of a specific quantum color image magnification scheme, in which the gray shaded area is the core part of the calculation of pixel color weights.
The specific implementation steps of the amplification scheme are as follows:
step 1: first, use Multiple CNOT and U 1 The module acquires four positions (Y, X), (Y, X + 1), (Y +1,X) and (Y +1, X + 1) of the original image.
Step 2: based on the four pixel points obtained in the step 1, passing through omega Y,X The module respectively calculates the pixel value | C of each pixel point Y,X >,|C Y,X+1 >,|C Y+1,X >,|C Y+1,X+1 >。
And step 3: according to the bilinear interpolation characteristic, the weight of each pixel value is obtained by using a Multiple CNOT and RS module.
And 4, step 4: finally, by using 4 TM modules, 3 Adder modules and (m) 1 +m 2 ) A digital by 2module for calculating pixel value | C Y',X' >。
2. The method comprises the following steps of (1) line design and specific steps of quantum color image reduction based on bilinear interpolation:
in this scenario, assume one frame
Figure BDA0003872505030000091
The size of the color image is reduced to
Figure BDA0003872505030000092
Wherein n is 1 ,n 2 ,m 1 And m 2 Are all non-negative integers. At this time, the scaling ratios in the vertical direction and the horizontal direction are respectively
Figure BDA0003872505030000093
And
Figure BDA0003872505030000094
due to the nature of the digital image, n is specified 1 >m 1 ,n 2 >m 2
Similar to the image enlargement scheme, the image | I 'is interpolated according to a bilinear interpolation method'>Pixel value | C of middle position (Y', X Y',X' >Can be taken from the original image | I>The corresponding pixel values of the four coordinates are obtained. In this reduction scheme, | C Y',X' >The detailed calculation process is as follows:
Figure BDA0003872505030000095
wherein the content of the first and second substances,
Figure BDA0003872505030000096
and
Figure BDA0003872505030000097
can continue to useSimplifying:
Figure BDA0003872505030000098
Figure BDA0003872505030000099
thus, the final | C Y',X' >The expression (c) may be equivalent to:
|C Y',X' >=|C Y,X >
as can be seen from the above formula, the pixel value | C of the interpolation image (Y ', X') point in the reduction scheme Y',X' >Finally only by the pixel value | C of the original image (Y, X) point Y,X >And (4) determining. Therefore, the interpolation algorithm used in this case is not exactly the same as the conventional bilinear interpolation algorithm. The demagnification scheme is relatively simple compared to the amplification scheme employed herein, which corresponds to the quantum wires shown in fig. 14.
The complexity of the present invention in defining a quantum wire depends on the number of single qubit gates in the wire. The complexity of the basic gate including the not gate, the controlled not gate and the 2 × 2 unitary operation is defined as 1. Furthermore, to accomplish quantum computation, an auxiliary qubit |0> or |1> is typically introduced into the quantum circuit design. Thus, the complexity of each quantum block can be calculated as follows:
Figure BDA0003872505030000101
according to fig. 13, the quantum wire of the quantum color image amplification scheme designed in the present invention is routed through 16 Multiple CNOT modules, 2U 1 Module, 4 Ω Y,X Module, 2 RS modules, 3 Adder modules, (m) 1 +m 2 ) A number of partitioned by 2 modules and 8 TM modules. Thus, the quantum wire complexity of this amplification scheme is:
Figure BDA0003872505030000102
where q is the number of quantum bits per channel of the three RGB channels, α = max {3q 1 ,m 2 Denotes the maximum qubit number of color and position information.
According to fig. 14, the quantum wire route of the quantum color image reduction scheme designed in the present invention is 4 Multiple CNOT modules and 1 Ω Y,X And (5) forming modules. Thus, the quantum wire complexity of the scaling scheme is:
Figure BDA0003872505030000103
the quantum color image zooming method based on bilinear interpolation comprises the steps of color image zooming and color image zooming, wherein the specific process of zooming is as follows:
firstly, constructing an amplified blank image according to the specification and the amplification ratio of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the positions of the pixel point corresponding to four adjacent pixel points of the original image, and respectively calculating the pixel values of the four pixel points;
then, respectively obtaining the weights of the four pixel values according to the characteristic of bilinear interpolation; calculating the pixel values of the selected blank image pixel points by combining the pixel values of the four pixel points of the original image, and assigning the pixel values to the selected pixel points;
finally, after the pixel values of all pixel points on the blank image are calculated and assigned, obtaining an amplified quantum color image;
the specific process of the reduction is as follows:
firstly, constructing a reduced blank image according to the specification and the reduction proportion of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the position of the original image pixel point corresponding to the pixel point, and calculating the pixel value of the original image pixel point;
then, assigning the pixel value of the pixel point of the original image to the selected blank pixel point;
and finally, after assigning the pixel values of all the pixel points on the blank image, acquiring a reduced quantum color image.
In the second embodiment, as shown in fig. 1 to 5,
1. image representation method
For a size of
Figure BDA0003872505030000111
Can be used as the color digital image
Figure BDA0003872505030000112
One arbitrary quantum superposition state | I of the Vi Hilbert space>To represent
Figure BDA0003872505030000113
Wherein | Y>=|y n-1 y n-2 …y 0 >And | X>=|x n-1 x n-2 …x 0 >Respectively represents position information in the vertical direction and the horizontal direction, | C Y,X >Representing the corresponding pixel value at the pixel point (Y, X). The color information of a color image is represented by three channels of Red (Red), green (Green), and Blue (Blue), and the pixel value range of each channel is [0,2 ] q -1]Thus | C Y,X >The representation is as follows:
Figure BDA0003872505030000114
the expression of a 4 x 2 color image can be expressed by the following formula,
Figure BDA0003872505030000121
the image needs to use 24-bit quantum bits to represent color information, 2-bit quantum bits to represent vertical direction information, and 1-bit quantum bits to represent horizontal direction information. Therefore, the number of quantum bits required for this 4 × 2 color image is 27.
2. Bilinear interpolation algorithm
The purpose of the interpolation algorithm is to modify a digital image by either generating new pixels or removing redundant pixels. Bilinear interpolation is usually applied at two latitudes of an image, and its corresponding function is expressed as follows:
I'=S(I,r x ,r y )=S y (S x (I,r x ),r y )=S x (S y (I,r y ),r x )
where I and I' correspond to the original image and the interpolated image, respectively, S represents a scaling function, r y And r x Corresponding to the scaling in the vertical and horizontal directions, respectively. The image scaling is a combination of two one-dimensional scaling, i.e. the final scaled image is exactly the same regardless of which dimension was scaled first.
The bilinear interpolation method in the X direction is shown in fig. 4, where the pixel value c of the target pixel (X, c) is defined by the pixel (X) 0 ,c 0 ) And (x) 1 ,c 1 ) And (6) calculating. The specific linear relationship is as follows:
Figure BDA0003872505030000122
suppose a frame
Figure BDA0003872505030000123
The original image of size is scaled to a size of
Figure BDA0003872505030000124
The interpolated image of (2). Then the pixel value f (Y ', X') of the pixel point (Y ', X') in the interpolated image can be calculated by applying the bilinear interpolation algorithm to the four adjacent pixel points (Y, X), (Y +1,X), (Y, X + 1) and (Y +1, X + 1) on the original image. The mapping relationship for these pixel point correspondences is given in fig. 5, where
Figure BDA0003872505030000125
Figure BDA0003872505030000126
Based on the above mapping relationship, the pixel value f (Y ', X') of the pixel position (Y ', X') in the interpolated image can be calculated by the following formula:
Figure BDA0003872505030000131
by way of example only, it is possible to illustrate,
to better embody the advantages of the present invention, a quantum color image scaling scheme based on nearest neighbor interpolation is selected below to compare with the present scheme. Since physical quantum computers have not become widespread, in this example, a simulation experiment was conducted using a classical computer equipped with an Intel (R) Core (TM) i5-10210U CPU@1.60GHz,SK Hynix 16GB Ram, loaded with the software MATLAB R2016 a. Two color images Lena and Mandril are compared based on simulation results of different interpolation schemes.
Example one (amplification scheme):
in this example, two 64 × 32 original color images will be enlarged to 128 × 128 with scaling factors of 2 and 4 in the Y and X directions, respectively.
Example two (reduction scheme):
in this example, two 128 × 128 original color images will be scaled down to 32 × 64 with scaling factors of 1/4 and 1/2 in the Y and X directions, respectively.
Obviously, from the visual point of view, no matter the Lena image or the Mandril image, the image quality of the interpolation image amplified by the method is far higher than that of the method based on the nearest neighbor interpolation algorithm. Interpolated images based on nearest neighbor interpolation algorithms show significant jagged markings and mosaicing, but the magnified images of the proposed scheme are relatively smooth. However, it is to be noted that the image quality of the reduced images is similar. This is because the bilinear interpolation employed in the downscaling scheme proposed by the present invention uses only one neighboring pixel, which is similar to the nearest neighbor interpolation scheme.
It should be noted that the terms "comprises" and "comprising," and any variations thereof, in the description and claims of this application and the above-described drawings, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood by those skilled in the art that, in combination with the prior art and the above embodiments, variations may be implemented by those skilled in the art, and such variations do not affect the essence of the present disclosure, and are not described herein.
It is to be understood that the present solution is not limited to the particular embodiments described above, wherein devices and structures that have not been described in detail are understood to be implemented in a manner common in the art; those skilled in the art can make many possible variations and modifications to the disclosed solution, or modify it to equivalent embodiments, without departing from the scope of the solution, using the methods and techniques disclosed above, without affecting the substance of the solution. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present solution are still within the protection scope of the technical solution of the present solution, unless the contents of the technical solution of the present solution are departed.

Claims (9)

1. A quantum circuit diagram, characterized by: the system comprises a multi-control non-gate module, a 1 adding module, an operation module, an adder module, a subtracter module, a T-counting multiplier module and a 2 dividing module; the multi-control non-gate module is used for copying known quantum bits; the 1 adding module is used for executing 1 adding operation when a certain condition is met; the operation module is used for receiving the instruction and then performing operation on corresponding data; the adder module performs addition operation on a plurality of stored same quantum bits X and Y by using quantum Fourier transform; the subtractor module is used for executing subtraction operation on a plurality of stored quantum bits X and Y with the same quantity; the T-counting multiplier module is used for executing multiplication operation on a plurality of stored quantum bits X and Y with the same quantity; the divide-by-2 module is used for halving a non-negative integer; and according to a bilinear interpolation reasoning formula, selectively combining the modules, and performing matched connection on the data ports by means of auxiliary quantum bits to construct a quantum circuit diagram required by a scheme.
2. A quantum wire graph as claimed in claim 1, wherein: the quantum circuit diagram is used for scaling the quantum image, wherein the operation module is a pixel value operation module and is used for calculating pixel values of all pixel points in the quantum image.
3. A quantum wire graph as claimed in claim 2, wherein: the quantum image processing circuit comprises an image amplifying circuit and an image reducing circuit; the image amplification circuit comprises a multi-control non-gate module, a 1 adding module, a pixel value operation module, 3 adder modules, 4T-counting multiplier modules and a plurality of 2 dividing modules; the multi-control non-gate module and the plus 1 module are used for acquiring position information of four pixel points of an original image and calculating the weight of each pixel by combining the subtracter module; the pixel value operation module is used for calculating the pixel values of the four pixel points; the 3 adder modules, the 4T-counting multiplier modules and the plurality of division-2 modules are combined to calculate all pixel values of the enlarged image;
the image reducing circuit comprises 4 multi-control non-gate modules and 1 pixel value operation module; the multi-control non-door module is used for acquiring coordinate position information mapped to an original image; the pixel value operation module is used for calculating the pixel value of the position.
4. The quantum wire diagram of claim 3, wherein: line of quantum color image magnification algorithmThe road complexity is
Figure FDA0003872505020000011
The line complexity of the downscaling of the quantum color image algorithm is O (q (n) 1 +n 2 ) Wherein n) is 1 Is the number of longitudinal quantum bits of the carrier image, n 2 Is the number of horizontal quantum bits, m, of the carrier image 1 Is the carrier image longitudinal scaling, m 2 Is the carrier image lateral scaling, q is the number of quantum bits per channel of the three channels RGB, α = max {3q, m 1 ,m 2 Denotes the maximum quantum bit number of color and position information.
5. The quantum color image scaling method based on the bilinear interpolation is characterized in that: the method comprises the steps of amplifying and reducing the color image, wherein the specific process of amplifying is as follows:
firstly, constructing an amplified blank image according to the specification and the amplification scale of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the positions of the pixel point corresponding to four adjacent pixel points of the original image, and respectively calculating the pixel values of the four pixel points;
then, respectively obtaining the weights of the four pixel values according to the characteristic of bilinear interpolation; calculating the pixel values of the selected blank image pixel points by combining the pixel values of the four pixel points of the original image, and assigning the pixel values to the selected pixel points;
finally, after pixel values of all pixel points on the blank image are calculated and assigned, an amplified quantum color image is obtained;
the specific process of shrinking is as follows:
firstly, constructing a reduced blank image according to the specification and the reduction ratio of an original carrier image;
secondly, selecting any pixel point on the blank image, acquiring the position of the original image pixel point corresponding to the pixel point, and calculating the pixel value of the original image pixel point;
then, assigning the pixel value of the pixel point of the original image to the selected blank pixel point;
and finally, after assigning the pixel values of all the pixel points on the blank image, acquiring a reduced quantum color image.
6. The bilinear interpolated quantum color image scaling method of claim 5, wherein: when the image is amplified, the pixel value | C of the selected blank image pixel point is calculated Y′,X′ >The following formula is adopted:
Figure FDA0003872505020000021
wherein, | C Y,X >,|C Y,X+1 >,|C Y+1,X >,|C Y+1,X+1 >Corresponding to pixel values at four locations (Y, X), (Y, X + 1), (Y +1,X), (Y +1, X + 1) on the original image, respectively.
7. The bilinear interpolated quantum color image scaling method of claim 5, wherein: when the image is reduced, calculating the pixel value | C of the selected blank image pixel point Y′,X′ >The following formula is adopted:
|C Y′,X′ >=|C Y,X >。
8. the bilinear interpolated quantum color image scaling method of claim 6 or 7, wherein: the color information of the original color image is represented by three channels of red, green and blue, each having a pixel value in the range of [0,2 ] q -1]Pixel value | C of pixel point of original image Y,X >Calculated using the following formula:
Figure FDA0003872505020000022
wherein Red, green and Blue respectively represent Red, green and Blue color channels, R i 、G i 、B i Respectively red, green and bluePixel information for each color channel, i =0,1.. Q-1.
9. The bilinear interpolated quantum color image scaling method of claim 8, wherein: a size of
Figure FDA0003872505020000031
For the color original image
Figure FDA0003872505020000032
One arbitrary quantum superposition state | I of the Vi Hilbert space>The concrete formula is as follows:
Figure FDA0003872505020000033
wherein, the first and the second end of the pipe are connected with each other,
Figure FDA0003872505020000034
is the position information in the vertical direction,
Figure FDA0003872505020000035
is position information in the horizontal direction.
CN202211201390.XA 2022-09-29 2022-09-29 Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation Pending CN115423688A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211201390.XA CN115423688A (en) 2022-09-29 2022-09-29 Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211201390.XA CN115423688A (en) 2022-09-29 2022-09-29 Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation

Publications (1)

Publication Number Publication Date
CN115423688A true CN115423688A (en) 2022-12-02

Family

ID=84205815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211201390.XA Pending CN115423688A (en) 2022-09-29 2022-09-29 Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation

Country Status (1)

Country Link
CN (1) CN115423688A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115859405A (en) * 2023-03-02 2023-03-28 青岛昊宇重工有限公司 Design data enhancement method for self-supporting steel chimney
CN116227507A (en) * 2023-05-10 2023-06-06 摩尔线程智能科技(北京)有限责任公司 Arithmetic device for performing bilinear interpolation processing

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115859405A (en) * 2023-03-02 2023-03-28 青岛昊宇重工有限公司 Design data enhancement method for self-supporting steel chimney
CN116227507A (en) * 2023-05-10 2023-06-06 摩尔线程智能科技(北京)有限责任公司 Arithmetic device for performing bilinear interpolation processing
CN116227507B (en) * 2023-05-10 2023-07-14 摩尔线程智能科技(北京)有限责任公司 Arithmetic device for performing bilinear interpolation processing

Similar Documents

Publication Publication Date Title
Gao et al. Pixel transposed convolutional networks
CN115423688A (en) Quantum circuit diagram and quantum color image scaling method based on bilinear interpolation
US5740285A (en) Image reduction/enlargement technique
US6295072B1 (en) Method and apparatus for rendering cubic curves
CN107204008B (en) Quantum image matching method
CN108198196B (en) Design and implementation method of quantum image edge detection based on Sobel operator
US7471295B2 (en) Multi-variate data and related presentation and analysis
JPH09153029A (en) Memory distributed parallel computer for execution of fast fourier transform and its method
CN112419152B (en) Image super-resolution method, device, terminal equipment and storage medium
CN109447897B (en) Real scene image synthesis method and system
Chervyakov et al. Residue number system-based solution for reducing the hardware cost of a convolutional neural network
CN106683041B (en) Quantum image miscut method based on NEQR expression
CN111200716B (en) Precision compensation method, system and storage medium for feature mapping scaling
Liu et al. Quantum image edge detection based on eight-direction Sobel operator for NEQR
Zhou et al. Quantum image scaling based on bilinear interpolation with decimals scaling ratio
CN110474769B (en) Quantum color image encryption method based on direction modification
Hu et al. Quantum watermarking based on neighbor mean interpolation and LSB steganography algorithms
Gao et al. Quantum color image scaling based on bilinear interpolation
CN107256534B (en) GQIR quantum image reduction and amplification method based on bilinear interpolation
CN111832734B (en) Design method of quantum image multiplication operation and simulation implementation method thereof
JPH05233795A (en) Image expansion/reduction device
JP3066596B2 (en) Address translation device
CN112949841A (en) Attention-based CNN neural network training method
Chen et al. Design and implementation of mqir image scaling
CN106454382A (en) Quantum image preparation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination