A hybrid grayscale and color quantum image representation method
By mixing grayscale and color quantum image representation methods, ground state coding is used to restore grayscale information and amplitude coding is used to store color proportions, which solves the shortcomings of grayscale and color information recovery in the existing technology and achieves lossless recovery of grayscale information. and probabilistic recovery of color information, suitable for image processing operations.
Patent Information
- Application Number
- CN202411009382.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-26
AI Technical Summary
While the existing quantum image processing methods accurately represent grayscale information, it is difficult to restore color values probabilistically, and more qubits are spent to restore grayscale information and consume too much when storing color values. There is a lack of a method that can neutralize the problem. Two types of image representation methods.
A hybrid grayscale and color quantum image representation method is proposed, which restores grayscale information through ground state encoding, and uses two additional qubits to store color proportions with amplitude encoding, achieving lossless recovery of grayscale information and probabilistic color information. recover.
This method allows accurate representation of grayscale images and probabilistic recovery of color images, reduces image processing consumption, and is suitable for operations such as image classification and edge extraction.
Smart Images

Figure CN118552658B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of quantum images, and in particular relates to a mixed grayscale and color quantum image representation method. Background Art
[0002] In recent years, the accelerated progress in various fields such as optical imaging, Internet technology, and high-performance computing has led to an explosive growth in the amount of data. Therefore, there is an urgent need to explore new methods for information storage and processing. After Feynman proposed the concept of quantum computers in 1982, the benefits of quantum computing have gradually emerged in various research fields, including quantum acceleration of classical algorithms, quantum communication, quantum simulation, and quantum image processing. Quantum Image Processing (QIP) has become an emerging interdisciplinary research field at the intersection of quantum computing and image processing.
[0003] Unlike classical image processing, quantum computers store images in quantum bits. Using quantum superposition and entanglement, quantum computers have good parallel processing capabilities in quantum image processing. Quantum image representation requires clarifying how classical images are represented on quantum computers. For quantum bits and their superposition states in quantum computers, the data of classical images can be encoded into the orthogonal ground state or amplitude of the quantum bits. Consider an N-bit binary string x = , the basis state encoding encodes x onto the computational basis, i.e. , , For example, x=6 can be represented by a 3-bit binary string 110, and the encoded quantum state is For magnitude encoding, consider an N-element set ,make ,in is the calculated ground state of the ith basis. For example, x= ,but .
[0004] According to these two types of encoding methods, the representation of quantum images can be divided into two categories: ground state encoding and amplitude encoding. For example, FRQI encodes the grayscale information of the grayscale image into the amplitude of the quantum state by controlling the rotation angle of the controlled Ry gate, and through the properties of the quantum superposition state, the number of bits (quantum bits) used is greatly reduced compared to classical computers. Then, based on the idea of FRQI, MCRQI stores the color information of three channels through two additional quantum bits, expanding the research object of FRQI to color images. Since FRQI and MCRQI only use one and three quantum bits to represent the grayscale and color information of the image, complex image transformations cannot be well implemented, and the data encoded on the amplitude cannot be read very accurately. In order to solve the problems of FQRI and MCRQI, NEQR was proposed. Unlike FRQI, NEQR spends more additional quantum bits to represent the grayscale information of the grayscale image and encodes it to the ground state. Through the principle of orthogonal state separability, NEQR achieves more accurate quantum grayscale image restoration than FRQI, and can simply implement more image operations. Subsequently, NCQI, based on NEQR, expanded the quantum grayscale image to the quantum color image, and achieved four times acceleration compared to the quantum image preparation of MCRQI. Next, OCQI optimized NCQI, reducing the quantum image preparation consumption by nearly 1 / 3 and providing more convenient quantum image operations. In general, quantum image representation can be simply divided into amplitude coding types such as FRQI, MCQI, NASS, NAQSS, FRQCI and OQIM and ground state coding types such as NEQR, QUALPI, INEQR, GQIR, QMCR, NCQI, OCQR, QRMW and QRCI. The first type of quantum representation requires fewer quantum bits, but can only restore the image probabilistically, while the second type spends more quantum bits for accurate image restoration. Figure 1 The 2x2 classical grayscale image shown in the figure shows two types of quantum image representation: amplitude encoding and ground state encoding using FRQI and NEQR. and Both use two superpositioned quantum bits , , and Indicates the position of the pixel Use the amplitude of a quantum bit to store the grayscale information of each pixel
[0005] Use eight qubits to store the binary value of the grayscale value of each pixel:
[0006]
[0007] Figure 2 Use NCQI and MCRQI to represent a 2x2 R, G, B three-channel color image. Both qubits use two superposition qubits. , , and represents the position of the pixel, Use three quantum bits to store the grayscale information of each pixel
[0008] Use 24 qubits to store the binary value of the grayscale value of each pixel:
[0009] These two different quantum image representation methods have their own advantages and disadvantages. The actual selection should be based on the application requirements of the image. However, a color image can be divided into three grayscale images of the three channels of R, G, and B. In most cases, it is hoped that the grayscale image can accurately display the information of the image, while the color image more often serves to visually improve the details.
[0010] For current research in the field of quantum image processing, there is a lack of a quantum image representation method that can accurately represent grayscale information and probabilistically restore color values. That is, more quantum bits are used to accurately restore grayscale information, while fewer quantum bits are used to store color values in amplitude and probabilistically restore color value information. How to neutralize the two types of image representation methods and learn from each other's strengths has not yet been achieved. Summary of the invention
[0011] In order to solve the above technical problems, the present invention proposes a hybrid grayscale and color quantum image representation method, in which the ground state encoding method of the grayscale image can losslessly restore the grayscale information of the color image, and the additional two amplitude-encoded quantum bits store the color ratio of the color image, which can probabilistically restore the color image.
[0012] To achieve the above object, the present invention provides a mixed grayscale and color quantum image representation method, comprising:
[0013] Based on the initialized quantum system, the preset quantum gate is used to superimpose the quantum bits storing the image color information and position information to obtain a preset blank quantum image.
[0014] Filling the preset blank quantum image with grayscale to obtain a grayscale image;
[0015] The grayscale image is filled with color values of pixels to obtain a preset classical color image, thereby completing a new hybrid quantum image representation.
[0016] Optionally, the image to be stored is a 2n^2^n color image, wherein n is the image size;
[0017] Initialize the quantum system to: 2n+q+2 states of a quantum system; where q is the number of binary bits required to represent the color value of the image.
[0018] Optionally, the preset quantum gates include: a quantum I gate and a quantum H gate;
[0019] The quantum I gate and quantum H gate are respectively:
[0020]
[0021] Among them, I is the quantum I gate and H is the quantum H gate.
[0022] The method of superposition is:
[0023]
[0024] in, It is a quantum state superposition operation.
[0025] Optionally, gray-filling the preset blank quantum image includes:
[0026] Using a controlled NOT gate, based on a preset filling operation, grayscale filling is performed on the preset blank quantum image; wherein yx=i represents the horizontal and vertical coordinates, that is, the i-th pixel position;
[0027]
[0028] in, is the preset fill operation, q is the grayscale range of the color value, l is the index value, Binary fill operation for each color, Binary fill operation for the second color, It is the binary filling operation of the qth color, yx=i represents the horizontal and vertical coordinates, that is, the i-th pixel position;
[0029] For each pixel position i, the grayscale value of the pixel position i is represented by the average value of the three color channels, that is, ;in, is the average grayscale of the i-th pixel, is the average R channel value of the i-th pixel, is the G channel value of the i-th pixel, is the B channel value of the i-th pixel.
[0030] After grayscale filling of the preset blank quantum image, the method further includes:
[0031] For each pixel, if the index value of the pixel value position at the lth bit is 1, a 2n-controlled NOT gate operation is performed, otherwise a unit matrix operation is performed.
[0032] Optionally, the method of filling the grayscale image with color values of pixels is:
[0033]
[0034] in, Represents the transformation process from a blank image to a color image. is the quantum unitary transformation of the quantum system filling the color value of pixel i;
[0035]
[0036] Among them, j and i are pixel position indexes, For color value filling operation, Fill operation for grayscale values.
[0037] The preset blank quantum image is:
[0038]
[0039] in, is a blank quantum image.
[0040] Compared with the prior art, the present invention has the following advantages and technical effects:
[0041] The present invention is based on an initialized quantum system, and uses a preset quantum gate to superimpose the quantum bits storing the color information and position information of the image to obtain a preset blank quantum image; grayscale fills the preset blank quantum image to obtain a grayscale image; fills the grayscale image with the color values of the pixels to obtain a preset classical color image, and completes the new hybrid quantum image representation; the ground state encoding method of the grayscale image can losslessly restore the grayscale information of the color image, and the additional two quantum bits encoded with amplitude store the color ratio of the color image, which can probabilistically restore the color image. Therefore, through NHQR, the grayscale information of the color image can be accurately represented except for the different ratios of the color values. This allows NHQR to conveniently perform various image processing operations on grayscale images, such as image classification, edge extraction, etc., without the need for accurate color information recovery, greatly reducing the consumption of image processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0043] Figure 1 Schematic diagram of grayscale representation of FRQI and NEQR in an embodiment of the present invention;
[0044] Figure 2 Schematic diagram of the color graph model of NCQI and MCRQI according to an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the quantum circuit structure of NHQR according to an embodiment of the present invention;
[0046] Figure 4 Schematic diagram of the construction process of NHQR according to an embodiment of the present invention;
[0047] Figure 5 is a schematic diagram of an NHQR example of a 2x2 color image according to an embodiment of the present invention;
[0048] Figure 6 This is a schematic diagram of an 8x8 color image in which the colors of an embodiment of the present invention are divided into blue and red;
[0049] Figure 7 A schematic diagram of a Boolean compression process according to an embodiment of the present invention;
[0050] Figure 8 A schematic diagram of the construction and compression of a red quantum circuit according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0052] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0053] Combining the advantages of two quantum image representations and the characteristics of color image display, the proposed NHQR is mainly divided into two parts: quantum grayscale image and color information storage. For a 2^n X 2^n color image with a color range of {0,2^q-1}, a quantum register of 2n+q qubits represents the grayscale image and another register of two qubits represents the storage of color information. Considering the ratio of the three channel values of each pixel is:
[0054]
[0055] make is the grayscale information of the i-th pixel value, let , Then the quantum state of NHQR can be expressed as: ,in , like Figure 3 shown. and For two additional qubits storing color value information, amplitude coding is used to store the color value information of each pixel in the rotation angle of the 2n qubit-controlled Ry gate, that is, the controlled Boolean value of the controlled Ry is position i, and the rotation angle is and The rotation angle of the controlled rotating door Ry at each pixel position can be obtained as and . In order to avoid the situation where the denominator is 0, the color value is readjusted from {0, 255} to {1, 256}. In this way, the storage of grayscale information only requires q=8 quantum bits, and 2n controlled NOT gates are used to store the ground state encoding of the grayscale image. Through this design, the ground state encoding method of the grayscale image can losslessly restore the grayscale information of the color image, and the additional two quantum bits encoded with amplitude store the color ratio of the color image, which can probabilistically restore the color image.
[0056] A mixed grayscale and color quantum image representation method proposed in this embodiment includes: based on an initialized quantum system, using a preset quantum gate, entanglement superposition of a preset number of quantum bits storing position information in an image to be stored, to obtain a preset blank quantum image; wherein, after superposition, the quantum bits initially in the 0 state become a superposition state of (0+1); and then grayscale and color filling are realized by performing an entanglement operation on the superposition state;
[0057] Fill the preset blank quantum image with grayscale to obtain a grayscale image;
[0058] Fill the grayscale image with pixel color values to obtain a preset classical color image and complete the new hybrid quantum image representation.
[0059] Furthermore, the image to be stored is a 2n^2^n color image, where n is the image size;
[0060] Initialize the quantum system as follows: Initialize the quantum system to 2n+q+2 quantum bits. The initial state; where q is the number of binary bits required to represent the image color value.
[0061] Specifically, by Figure 4As shown, this embodiment consists of two steps. In order to store a 2n^2^n color image, NHQR requires the quantum system to be initialized to 2n+q+2 quantum bits. The initial state is The first step is to store the 2n storage locations. The quantum bits are entangled and superimposed. This step uses quantum I and H gates, namely: The quantum unitary operation in Step 1 is express, Then after After that, the quantum state of the system becomes .
[0062] At this point, the system has constructed a 2n^2^n blank quantum image. In Step 2, continue to fill each pixel with a color value.
[0063] Since the design concept of NHQR is to restore the grayscale information of the color image losslessly and the color information losslessly, the grayscale information filling process uses a controlled NOT gate, while the color information filling process uses a controlled Ry gate. Let the grayscale filling operation be , where yx=i represents the horizontal and vertical coordinates, that is, the i-th pixel position. For each pixel position i, the gray value of the point is represented by the average value of the three color channels, that is, . It represents the gray value of the i-th pixel The binary value of the pixel bit (for {0, 255} color values, q=8). If the position is 1, a 2n controlled NOT gate operation is performed, otherwise a unit matrix operation is performed. ( is the position index of the q-bit pixel value; if q=00000001, l=0 means the first bit of the binary value of q, which is 1). In this way, by filling each pixel, a blank 2n^2^n image is filled into a grayscale image. Indicates the color information filling of the i-th pixel position, , contains the color value ratio of the three channels at the i-th pixel position, where .and Similarly, two 2n-Ry gates are needed to fill in the color information of a certain pixel value. The quantum unitary transformation of the entire system for filling in the color value of pixel i can be expressed as To express, that is: Then to complete the color value filling for all pixel positions, ,at this time represents the transformation process from a blank image to a color image. The transformation process of the system quantum is expressed as: .pass and , a classic 2n^2^n color picture is stored in the quantum computer in the form of NHQR.
[0064] In addition, the quantum gates of 2n control bits are further simplified according to Boolean compression. The first idea is how to compress the number of quantum gates used in the preparation process. If there are a large number of repeated cases of the same color in the input color image, then in the construction of the quantum circuit, the rotation angles of the two color value storage quantum bits are the same, while the conditional quantum bits are different. Therefore, all controlled Ry gates can be grouped, and each group is the same color, that is, corresponding to the same rotation angle. The difference between each different grouping lies only in the condition of the control quantum bit. The conditional quantum bit of the controlled Ry is related to the binary string of the pixel position. Based on this, the control quantum bits within each group can be Boolean compressed, such as Figure 6 In the NHQR representation, the binary string at each position is considered as a Boolean variable. is a Boolean variable representing the pixel position in the string, with a value of 1 indicating , otherwise it is expressed as For example, the binary strings 0000 and 0010 are converted to and In this way, all Boolean minimum terms generated from the Boolean variables of each pixel can be obtained. Then, all binary strings in the group can be integrated and the sum of all corresponding Boolean minimum terms can be calculated. and , then the control effect at this position will be invalid. After this method, the minimized expression can be obtained .
[0065] Moreover, in the proposed model, Boolean compression can also be applied to the gray value setting and grouping of q qubits, further reducing the quantum gates for NHQR state preparation.
[0066] Another compression method is based on the fact that the human eye cannot detect the color difference between two pixels within 20. Therefore, it is possible to further classify the groups into fewer groups, each containing more pixels, and this applies both to the grayscale value setting and the color setting.
[0067] like Figure 5 As shown, this embodiment uses the NHQR model to encode a three-channel 2x2 color image. , it can be clearly seen that the grayscale information is losslessly encoded onto the 8-bit quantum bits, such as the first pixel , represents the first pixel position. The color information is lossily encoded into the amplitude of two quantum bits, i.e. When a quantum system is measured, grayscale information, such as the grayscale value of the first pixel, It can be restored losslessly, and the color information is obtained through the ratio of the three-channel colors and , and recover.
[0068] like Figure 6-Figure 8 As shown in the figure, the specific process of NHQR quantum circuit construction and quantum gate compression is as follows: Figure 6 A color image is shown divided into two groups (blue and red). Figure 7 The principle of Boolean compression is demonstrated by using the 8 elements of the red group. The 8 conditional qubits are reduced to 3, and finally we get The smallest Boolean term of , that is, the controlled bits are reduced from 6 to 3, e is the smallest Boolean term, and e=111. Through Boolean compression, the difficulty of preparing NHQR is greatly reduced. Figure 8 When constructing the red filling, the quantum gates of the quantum circuit are compressed from 16 6-control-bit Ry gates to 2 3-control-bit Ry gates, achieving very significant compression performance.
[0069] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A mixed grayscale and color quantum image representation method, characterized in that: include: Initialize the pure state quantum system, and use the preset quantum gate to superimpose the initial state of the initialized pure state quantum system to obtain a preset blank quantum image; Among them, the pure state quantum system after initialization is: 2n+q+2 A quantum system; where q is the grayscale range of the color value, and n is the image size; The preset quantum gates include: quantum I gate and quantum H gate; The quantum I gate and quantum H gate are respectively: in, I is a quantum I gate, H is a quantum H-gate; The method of superposition is: in, It is a quantum state superposition operation; Filling the preset blank quantum image with grayscale to obtain a grayscale image; Filling the preset blank quantum image with grayscale includes: Using a controlled NOT gate, based on a preset filling operation, grayscale filling is performed on the preset blank quantum image; wherein yx=i represents the horizontal and vertical coordinates, that is, the i-th pixel position; in, To preset fill operation, l is the index value, Binary fill operation for each color, Binary fill operation for the second color, is the binary filling operation for the qth color, yx=i Represents the horizontal and vertical coordinates, that is, i pixel positions; For each pixel position i , the position of the pixel i The gray value is expressed as the average value of the three color channels, that is, ;in, is the average grayscale of the i-th pixel, is the average R channel value of the i-th pixel, is the G channel value of the i-th pixel, is the B channel value of the i-th pixel; Filling the grayscale image with color values of pixels to obtain a preset classical color image and complete a new hybrid quantum image representation; The method for filling the grayscale image with color values of pixels is: in, Represents the transformation process from a blank image to a color image. is the quantum unitary transformation of the quantum system filling the color value of pixel i; in, j and i is the pixel position index, For color value filling operation, Fill operation for grayscale values.
2. The mixed grayscale and color quantum image representation method according to claim 1, characterized in that: The quantum image to be stored is a 2n^2^n color image.
3. The mixed grayscale and color quantum image representation method according to claim 1, characterized in that: After grayscale filling of the preset blank quantum image, the method further includes: For each pixel, if the index value of the pixel value position at the lth bit is 1, a 2n-controlled NOT gate operation is performed, otherwise a unit matrix operation is performed.
4. The mixed grayscale and color quantum image representation method according to claim 1, characterized in that: The preset blank quantum image is: in, is a blank quantum image.
Citation Information
Patent Citations
Storage, design and implementation method for multi-dimensional quantum gray image and multi-dimensional quantum colorful image
CN103971328A
Median filtering method and system for quantum color image
CN114494056A
