Quantum color image filtering method and system
By calculating the aggregation distance of each pixel in the quantum color image and exchanging the vector median target pixel and the center pixel, the problem that the weighted mean filter of the quantum image cannot process the quantum color image is solved, and the filtering of the quantum color image is realized, and the effect is better than the traditional method. .
Patent Information
- Application Number
- CN202410887048.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-29
AI Technical Summary
The existing quantum image weighted mean filtering method can only be applied to quantum grayscale images and cannot be extended to quantum color images, which has limitations in the scope of use.
By obtaining the color information of the central pixel and neighboring pixels in the quantum color image, calculating the aggregation distance of each pixel, and exchanging the neighborhood pixels corresponding to the minimum aggregation distance as the vector median target pixel with the central pixel, the quantum color image is realized. filter.
It breaks through the limitations of quantum image weighted mean filtering and enables quantum color image filtering. The filtering effect is better than quantum image weighted mean filtering, which can effectively reduce noise and maintain image quality.
Smart Images

Figure CN118864262A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a quantum color image filtering method and system. Background Art
[0002] Quantum computing is a new computing model based on quantum mechanics. It uses quantum superposition, quantum entanglement and other characteristics to process computing tasks in parallel, thereby significantly reducing time complexity. Representative quantum algorithms include Shor's large integer prime factorization algorithm and Grover's quantum search acceleration algorithm. The excellent acceleration performance of quantum algorithms has attracted the attention of many researchers, and it has gradually been cross-integrated with more and more disciplines. Among them, quantum image processing is an emerging cross-research direction that combines quantum computing and image processing. The research content includes quantum image representation models and quantum image processing algorithms.
[0003] At present, in the field of quantum image spatial domain filtering, quantum image weighted mean filtering is mainly used, which includes: firstly, converting the quantum grayscale image into a quantum image representation, and designing a weighted mean filtering algorithm for the quantum grayscale image, which reduces noise or smoothes the image by weighted averaging the grayscale values of each pixel in the image and its neighboring pixels. The designed weighted mean filtering algorithm is implemented on a quantum computer, the filtered quantum image state is extracted from the quantum computer, and it is converted back to a classical image representation to obtain the filtered image data.
[0004] The defects of the above-mentioned prior art are: the application scope of quantum image weighted mean filtering is limited, and it can only act on quantum grayscale images and cannot be extended to quantum color images. Summary of the invention
[0005] Based on this, it is necessary to provide a quantum color image filtering method and system to address the above technical problems.
[0006] An embodiment of the present invention provides a quantum color image filtering method, comprising:
[0007] Acquire a quantum color image to be processed, wherein the quantum color image includes a central pixel and a plurality of neighboring pixels surrounding the central pixel;
[0008] Based on the quantum superposition state of the central pixel, the color information of the neighboring pixels is replicated to obtain multiple quantum bits (qubits) representing the color information of the neighboring pixels;
[0009] Obtain the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel, integrate all the vector distances in each neighborhood pixel respectively, and obtain the aggregated distance between multiple neighborhood pixels and the central pixel;
[0010] Arrange the aggregation distances between each neighborhood pixel and the central pixel in ascending order, and take the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel;
[0011] The vector median target pixel is exchanged with the center pixel to obtain the filtered quantum color image.
[0012] In addition, the step of obtaining the quantum color image to be processed specifically includes:
[0013] First, the initial 2n qubits are prepared into a superposition state using 2n H gates and 3q identity gates I;
[0014] Exploit 2 2n NCQI color setting submoduleΩ YX All pixel grayscale information on the classical image is prepared into a superposition state to obtain a quantum color image to be processed.
[0015] In addition, the color information of neighboring pixels is replicated based on the quantum superposition state of the central pixel, which specifically includes:
[0016] Prepare 27q qubits initialized to the |0> state and use the cyclic shift module to obtain the position of the neighboring pixels;
[0017] The color information of the position is prepared into the quantum state of the central pixel by using the NCQI color information preparation module, and a pair of position bits are shared with the central pixel;
[0018] After 8 cyclic shifts and NCQI color setting operations and 2 cyclic shifts, the shared position bits are returned to the initial position state.
[0019] In addition, the obtaining of the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel specifically includes:
[0020] Input the qubit sequence |d> used to store the vector distance and the pixel vector;
[0021] The pixel vectors are grouped into three channels and input into three non-negative integer difference calculation modules respectively. The calculated results are saved in |C Y′X′ >Three channels;
[0022] Call the quantum addition module three times in sequence to |C Y′X′ >, the differences saved in the three channels are summed, and the results are saved in the quantum bit sequence |d′> to obtain the vector distance between the quantum bit qubit and the central pixel.
[0023] In addition, the non-negative integer difference calculation module specifically includes:
[0024] The module input is a=a n-1 a n-2 …a 0 and b=b n-1 b n-2 …b 0 ;
[0025] Add two qubits s representing sign bits to a and b respectively a and b , initialized to |0>;
[0026] For a a n-1 a n-2 …a 0 With s b b n-1 b n-2 …b 0 Perform quantum subtraction on two non-negative integers. If a ≥ b, s b The quantum state is |0>, acting on s b b n-1 b n-2 …b 0 The n C-NOT gates and controlled cyclic shift modules will not change b n-1 b n-2 …b 0 The quantum state of c n-1 c n-2 …c 0 Get the non-negative integer difference at
[0027] If a<b, s b The quantum state is set to |1>, b n-1 b n-2 …b 0 is the two's complement of the difference of non-negative integers, applied to s b b n-1 b n-2 …b 0 The n C-NOT gates make b n-1 b n-2 …b 0 The quantum state is flipped, and the controlled cyclic shift module will flip the flipped b n- 1 b n-2 …b 0 Perform an addition operation, in c n-1 c n-2 …c 0 Get the non-negative integer difference at .
[0028] In addition, the method of taking the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel specifically includes:
[0029] |c 0 >|c 1 >…|c 8 > represents the grayscale information of the pixels in the window, |d 0 >|d 1 >…|d 8 > represents the aggregation distance of pixels within the window;
[0030] Use the comparison module to judge |d 0 > and |d 1 >, if the output qubit |out> = |1>, for |C 0 >、|C 1 > and the corresponding |d 0 >、|d 1 > and perform the same operation on the other 8 pixels and their corresponding aggregation distances. Finally, 8 >Get the minimum aggregation distance |d min >, in |C 8 ) to obtain the vector median target pixel |C vmf >.
[0031] In addition, the vector median target pixel |C vmf >With the center pixel |C (Y,X) >To exchange, the formula is:
[0032]
[0033] Among them, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image.
[0034] In addition, a quantum color image filtering system includes:
[0035] A color image preparation module, used for acquiring a quantum color image to be processed, wherein the quantum color image includes a central pixel and a plurality of neighboring pixels surrounding the central pixel;
[0036] A neighborhood pixel preparation module is used to replicate the color information of the neighborhood pixels based on the quantum superposition state of the central pixel, and obtain multiple quantum bits (qubits) representing the color information of the neighborhood pixels;
[0037] The aggregate distance calculation module is used to obtain the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel, and integrate all the vector distances in each neighborhood pixel to obtain the aggregate distance between multiple neighborhood pixels and the central pixel;
[0038] The vector median selection module is used to arrange the aggregation distances between each neighborhood pixel and the central pixel in ascending order, and use the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel;
[0039] The median pixel replacement module is used to exchange the vector median target pixel with the center pixel to obtain a filtered quantum color image.
[0040] Compared with the prior art, the quantum color image filtering method and system provided by the embodiment of the present invention have the following beneficial effects:
[0041] In the prior art, the application scope of quantum image weighted mean filtering is limited. It can only be applied to quantum grayscale images and cannot be directly extended to quantum color images.
[0042] The present invention obtains multiple quantum bits (qubits) representing the color information of neighboring pixels by replicating the color information of neighboring pixels based on the quantum superposition state of the central pixel, thereby avoiding the processing of the grayscale values of each pixel in the image and its neighboring pixels in the prior art and breaking through the limitations of quantum image weighted mean filtering.
[0043] In addition, the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel is obtained, and all vector distances in each neighborhood pixel are integrated respectively to obtain the aggregated distance between multiple neighborhood pixels and the central pixel, and the neighborhood pixel corresponding to the minimum aggregated distance is used as the vector median target pixel; the central pixel and the vector median target pixel are exchanged to obtain a filtered quantum color image, so that the filtering of the quantum color image can be realized, and the filtering effect is better than the weighted mean filtering of the quantum image. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A quantum filter circuit design flow chart of a quantum color image filtering method provided in one embodiment;
[0045] Figure 2 A quantum circuit diagram for color image preparation of a quantum color image filtering method provided in one embodiment;
[0046] Figure 3 A quantum circuit diagram prepared for a neighborhood pixel of a quantum color image filtering method provided in one embodiment;
[0047] Figure 4 A quantum circuit diagram of a non-negative integer difference calculation module (MDC) of a quantum color image filtering method provided in one embodiment;
[0048] Figure 5A quantum circuit diagram of a vector distance calculation module of a quantum color image filtering method provided in one embodiment;
[0049] Figure 6 A quantum circuit diagram of a neighborhood pixel aggregation distance calculation module of a quantum color image filtering method provided in one embodiment;
[0050] Figure 7 A vector median selection quantum circuit diagram of a quantum color image filtering method provided in one embodiment;
[0051] Figure 8 A quantum circuit diagram of median pixel replacement of a quantum color image filtering method provided in one embodiment;
[0052] Fig. 9 A quantum circuit diagram of a quantum image vector median filter of a quantum color image filtering method provided in one embodiment;
[0053] Fig.10 A diagram of data before processing of a quantum color image filtering method provided in one embodiment;
[0054] Fig.11 This is a graph of processed data of a quantum color image filtering method provided in an embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] In one embodiment, a quantum color image filtering method is provided, such as Figure 1 As shown, the method includes:
[0057] 1. Color image preparation
[0058] A quantum color image to be processed is acquired, wherein the quantum color image includes a central pixel and a plurality of neighborhood pixels surrounding the central pixel.
[0059] 2. Neighborhood pixel preparation
[0060] The color information of the neighboring pixels is replicated based on the quantum superposition state of the central pixel, and multiple quantum bits (qubits) representing the color information of the neighboring pixels are obtained.
[0061] 3. Aggregation distance calculation
[0062] The vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel is obtained, and all vector distances in each neighborhood pixel are integrated to obtain the aggregated distance between multiple neighborhood pixels and the central pixel.
[0063] 4. Vector median selection
[0064] The aggregation distances between each neighborhood pixel and the central pixel are arranged in ascending order, and the neighborhood pixel corresponding to the minimum aggregation distance is taken as the vector median target pixel.
[0065] 5. Median pixel replacement
[0066] The vector median target pixel is exchanged with the center pixel to obtain the filtered quantum color image.
[0067] The detailed implementation process is as follows:
[0068] 1. Color image preparation
[0069] The preparation process of the NCQI quantum color image model mainly includes two steps: 1) First, 2n H gates and 3q identity gates I are used to prepare the initial 2n quantum bits into a superposition state for storing 2 n Pixel color information; 2) using 2 2n NCQI color setting submoduleΩ YX Prepare all pixel grayscale information on the classical image into the prepared superposition state, Ω YX It is composed of 3q-1 2n-CNOT gates. The matrix description of H gate and identity gate I can be expressed as:
[0070]
[0071] Among them, H is the H gate, a gate in quantum computing, whose full name is Hadamard gate; n is the number of pixels on the edge of the image.
[0072] Color image preparation quantum circuit such as Figure 2 As shown, after the preparation is completed, the quantum representation of the color image can be obtained, which is called the quantum color image.
[0073]
[0074] Among them, I is the unit gate, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image.
[0075] 2. Neighborhood pixel preparation
[0076] In order to make full use of quantum parallelism, the color information of the neighboring pixels can be prepared into the quantum superposition state of the central pixel to obtain multiple quantum bits (qubits). In quantum computing, quantum bits (qubits) can carry more information than classical bits. That is,
[0077]
[0078] Among them, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image.
[0079] First, prepare 27q quantum bits initialized to the |0> state, then use the cyclic shift module to obtain the position of the neighboring pixel, and use the NCQI color information preparation module to prepare the color information of the position into the quantum state of the central pixel, sharing a pair of position bits with it. After 8 cyclic shifts and NCQI color setting operations, 2 cyclic shifts are required to return the shared position bits to the initial position state.
[0080] The quantum circuit of the neighborhood pixel preparation module is as follows Figure 3 As shown, the NCQI module here is used to prepare neighborhood color information, so it does not include the H gate. |X> and |Y> are fixed inputs of the NCQI color preparation module. The bold position in front of each NCQI module indicates that the quantum bit sequence is the color preparation position of this module.
[0081] 3. Aggregation distance calculation
[0082] To calculate the aggregate distance of pixels, we need to first complete the vector distance calculation between pixels. To this end, we first designed a quantum circuit for calculating the difference of non-negative integers, then applied it to the quantum circuit of the vector distance calculation module, and finally designed the quantum circuit of the aggregate distance calculation module by integrating the vector distance calculation module.
[0083] 3.1 Non-negative integer difference calculation module
[0084] The difference of non-negative integers defined in this study refers to the absolute value of the difference between two positive numbers. Since the difference between two numbers can be negative, the concept of complement is introduced into quantum computing. By adding a sign bit to the input parameter and using the C-NOT gate to negate the result and add one, the absolute value of the difference is calculated. The advantage of this is that it avoids using a quantum comparator for comparison before subtraction, reducing additional quantum overhead.
[0085] The detailed circuit design of this module is as follows Figure 4 As shown, according to the reversibility of quantum computing, quantum subtraction can be realized by the inverse circuit of the quantum addition module. When the position of the black line in the Adder symbol is on the left, it is the quantum subtraction module.
[0086] The input of this module is a=a n-1 a n-2 …a 0 and b=b n-1 b n-2 …b 0 Add two qubits s representing the sign bit respectively a and b , and initialized to |0>. a a n-1 a n-2 …a 0 With s b b n-1 b n-2 …b 0 When performing quantum subtraction on two non-negative integers, if a ≥ b, s b The quantum state is still |0>, acting on s b b n-1 b n-2 …b 0 The n C-NOT gates and controlled cyclic shift modules on the n-1 b n-2 …b 0 The quantum state of c n-1 c n-2 …c 0 The difference is a non-negative integer; if a<b, according to the properties of quantum subtraction, s b The quantum state will be set to |1>, and b n-1 b n-2 …b 0 It is the complement of the difference of non-negative integers, and it acts on s b b n-1 b n-2 …b 0 The n C-NOT gates on b will make n-1 b n-2 …b 0 The quantum state is flipped, and the controlled cyclic shift module will flip the flipped b n-1 b n-2 …b 0 Perform an addition operation, and finally in c n-1 c n-2 …c 0 Get the non-negative integer difference at .
[0087] 3.2 Vector distance calculation module
[0088] This study selects Manhattan distance as the vector distance. The vector distance calculation module can be constructed by the non-negative integer difference calculation module and the quantum addition module. The vector distance calculation is obtained by adding the non-negative integer differences of the three channel components. The detailed circuit design is as follows: Figure 5 shown.
[0089] The key input of this module is the pixel vector |C YX >=|C (Y,X)R >|C (Y,X)G >|C (Y,X)B >、|C Y′X′ >=|C (Y′,X′)R >|C (Y′,X′)G >|C (Y′,X′)B > and the quantum bit sequence |d> used to store the vector distance. First, the pixel vectors are grouped into three channels and input into three non-negative integer difference calculation modules respectively, and the calculated results are saved in |C Y′X′ > on the three channels, and then call the quantum addition module three times in sequence to |C Y′X′ >, and save the result in the quantum bit sequence of the vector distance. After the calculation, the quantum bit sequence |d′> is stored to obtain the vector distance between the quantum bit qubit and the center pixel.
[0090] It is worth noting that the use of the non-negative integer difference calculation module and the addition module will change |C Y′X′ > value, so in order to ensure |C Y′X′ > remains unchanged. Before calculating the vector distance, you need to use C-NOT to keep |C Y′X′ > to the auxiliary qubit, and after the vector distance calculation is completed, the Swap gate is used to store |C Y′X′ >Information restoration.
[0091] 3.3 Aggregation distance calculation
[0092] For a 3×3 filter window, the aggregate distance of each pixel is obtained by adding up 8 vector distances, so this process requires a total of 72 vector distance calculation modules in the quantum circuit. In order to reduce the number of auxiliary qubits, this study uses the result of each vector distance calculation as the input of the next vector distance calculation module, so as to complete the vector distance summation operation of one pixel through a qubit sequence. In addition, this module also requires 9q initialized qubits to save the aggregate distance of 9 pixels. The specific quantum circuit is as follows: Figure 6 shown.
[0093] Figure 6 Each dotted line in the figure corresponds to the calculation process of the aggregation distance of each pixel. For example, the first dotted line can complete |C 0 > Aggregate distance calculation of other pixels in the same neighborhood. This part contains 8 vector distance calculation modules. 0 > and |d 0 > is the fixed input of these vector distance calculation modules, |C1 > is another input of the first vector distance calculation module, through which |C 0 > and |C 1 > and save the result to |d 0 >. Similarly, |C 2 >|C 3 >…|C 8 >As additional inputs to the other 7 vector distance calculation modules, they can complete |C 0 >Same|C 2 >|C 3 >…|C 8 > and add the result to |d 0 > on. Therefore, |d 0 > is the accumulation of 8 vector distances, i.e. pixel|C 0 > aggregation distance. After being processed by this module, the quantum state |K) can be expressed as:
[0094]
[0095] Among them, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image.
[0096] 4. Vector median selection
[0097] The vector median selection is to find the pixel corresponding to the minimum aggregation distance. The output of this module determines the final effect of image filtering. This study uses a one-comparison and two-swap method to search for the minimum aggregation distance and its corresponding pixel, that is, using two swap modules (composed of a set of Swap gates) and a comparison module to simultaneously manipulate the pixel color information of (Y, X). (Y,X) > and its corresponding aggregation distance |d>.
[0098] Assumptions |c 0 >|c 1 >…|c 8 > and |d 0 >|d 1 >…|d 8 >represents the grayscale information of the pixels in the window and their aggregation distance respectively. The target pixel extraction process is as follows: First, the comparison module is used to determine |d 0 > and |d 1 >, if the output qubit |out>=|1>, then |C 0 >、|C 1 > and the corresponding |d 0 >、|d 1> is exchanged, and then the same operation is performed on the other 8 pixels and their corresponding aggregation distances in turn, and finally |d 8 >Get the minimum aggregation distance |d min >, in |C 8 >Get the target pixel in the vector median|C vmf >, the quantum circuit of this module is as follows Figure 7 shown.
[0099] 5. Median pixel replacement
[0100] The pixel color information of (Y, X) | C (Y,X) > is regarded as the central pixel when (Y, X) is the center point, and a set of Swap gates are used to convert the central pixel |C (Y,X) > and the target pixel in the vector |C vmf >Exchange to complete the vector median filtering task. The quantum state after processing can be expressed as
[0101]
[0102] Among them, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image. The quantum circuit of this process is as follows: Figure 8 shown.
[0103] 6. Complete quantum circuit
[0104] The complete quantum circuit of quantum image vector median filtering is shown in Fig. 9 As shown. It should be pointed out that the final output of the filter circuit here is still the quantum color image represented by NCQI, which is usually used as the input of other quantum image processing algorithms. It is not necessary to restore it to a classical image at this time. At present, the complexity of quantum image restoration is relatively high. How to reduce the number of measurements in the image restoration process is an important topic in the research branch of quantum image retrieval, and related research is still ongoing.
[0105] In one embodiment, a quantum color image filtering system is provided, the system comprising:
[0106] A color image preparation module, used for acquiring a quantum color image to be processed, wherein the quantum color image includes a central pixel and a plurality of neighboring pixels surrounding the central pixel;
[0107] A neighborhood pixel preparation module is used to replicate the color information of the neighborhood pixels based on the quantum superposition state of the central pixel, and obtain multiple quantum bits (qubits) representing the color information of the neighborhood pixels;
[0108] The aggregate distance calculation module is used to obtain the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel, and integrate all the vector distances in each neighborhood pixel to obtain the aggregate distance between multiple neighborhood pixels and the central pixel;
[0109] The vector median selection module is used to arrange the aggregation distances between each neighborhood pixel and the central pixel in ascending order, and use the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel;
[0110] The median pixel replacement module is used to exchange the vector median target pixel with the center pixel to obtain a filtered quantum color image.
[0111] Example 1
[0112] The hardware environment of the simulation experiment is Intel(R) Core(TM) i5-6700 CPU@2.30GHz4.00 GB RAM, and the software environment is Win10 operating system and Matlab(2021a). In order to simulate the Hilbert space, the quantum state is represented by a vector and the unitary transformation is represented by a unitary matrix. The Hilbert space of the entire algorithm exceeds the size that can be simulated by a classical computer. Therefore, this study only performs matrix operations on the filtering module of the quantum algorithm, and the other steps are simulated by classical methods. It should be noted that the simulation on the classical computer mainly demonstrates the effectiveness of the quantum circuit, and the parallel advantage of the quantum algorithm is mainly demonstrated by algorithm complexity analysis.
[0113] The experiment selected Fig.10 The five images shown are common color images, namely Strawberries, Flowers, Lenna, Peppers, and Baboon, and the grayscale range of their RGB channels is [0, 2 7 ], with a size of 512 × 512. Salt and pepper noise with a density of 0.1 was added to each color image, and the 5 color images were denoised using quantum Boolean mean filtering, classical vector median filtering, and quantum vector median filtering. Fig.10 These are 5 original images (images without artificially added noise). Fig.11 The comparison diagrams of unfiltered (Noised, the image with artificially added noise, the purpose is to verify the denoising effect of the algorithm) and filtered (the noisy image is filtered using quantum Boolean mean filtering QBMF, vector median filtering VMF, and quantum vector median filtering QVMF methods). It can be clearly seen that this scheme can effectively filter out salt and pepper noise on color images, and the denoising effect is better than that of quantum Boolean mean filtering.
[0114] In order to further analyze the denoising effect of the algorithm, this study analyzes the effectiveness of quantum image vector median filtering from the perspective of image quality by calculating the peak signal-to-noise ratio RPSN. RPSN is a commonly used indicator to measure image quality. This parameter is based on the statistical analysis of the effects of image processing before and after grayscale values of image pixels, and can be expressed as
[0115]
[0116] Where I O ,I P Represent the original image and the processed image respectively.
[0117] Table 1 gives Fig.10 The RPSN of the five color images shown in the figure are processed by different filtering schemes. The left column of each filtering scheme is the RPSN after denoising, and the right column is the improvement value compared with the RPSN of the noisy image. The last row gives the mean of each column of data. As shown in Table 1, the RPSN improvement mean of the scheme proposed in this study is 7.4723dB higher than the quantum Boolean mean filter and 0.4367dB higher than the classical scheme. In addition, compared with the noisy image, the RPSN of this research scheme is improved by an average of 14.0252dB, the RPSN of the quantum Boolean mean filter is improved by an average of 6.5529dB, and the RPSN of the classical scheme is improved by an average of 13.5885dB. The above results show that the image quality of the quantum image vector median filter proposed in this study is significantly improved after processing the color image polluted by salt and pepper noise, and the effect is significantly better than the quantum Boolean mean filter and slightly better than the classical vector median filter.
[0118] Table 1 RPSN of five color images before and after denoising
[0119]
[0120]
[0121] The reason for the above results is that the proposed filtering scheme is a nonlinear filtering scheme, which adopts the principle of neighborhood pixel vector median replacement, which can make the pixel vector of the processed pixel point biased towards the neighborhood vector median, thus effectively filtering out the pixel extreme value generated by salt and pepper noise; while quantum Boolean mean filtering is a variant of mean filtering, and the filtering principle of its underlying slice is mean filtering, which belongs to linear filtering. It will blur the image during the filtering process, so the filtering effect is lower than the scheme proposed in this study. In addition, the quantum Boolean mean filtering process decomposes the color image into 24 planes for separate filtering, which will generate new pixels and cause the image to be color-biased, while the median of the pixel vector in the neighborhood finally selected by the scheme proposed in this study will not cause the image to be color-biased.
[0122] In addition, the relevant indicators of the proposed quantum filter and the classical vector median filter are basically the same, which shows that the quantum filter scheme reduces the time complexity of the vector median filter task while ensuring the effectiveness of noise reduction. The reason why it is slightly better than the classical vector median filter is that the cyclic shift module used can use the image itself to fill the edge pixels, and then filter the edge pixels.
[0123] In general, compared with the quantum Boolean mean filter, the proposed scheme has a significantly better filtering effect on color images and does not cause image color cast. Compared with the classical vector median filter, the quantum version of the vector median filter has basically the same effect, but the quantum image vector median filter has the advantage of quantum computing and has a lower time complexity.
[0124] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A quantum color image filtering method, characterized in that: include: Acquire a quantum color image to be processed, wherein the quantum color image includes a central pixel and a plurality of neighboring pixels surrounding the central pixel; Based on the quantum superposition state of the central pixel, the color information of the neighboring pixels is replicated to obtain multiple quantum bits (qubits) representing the color information of the neighboring pixels; Obtain the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel, integrate all the vector distances in each neighborhood pixel respectively, and obtain the aggregated distance between multiple neighborhood pixels and the central pixel; Arrange the aggregation distances between each neighborhood pixel and the central pixel in ascending order, and take the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel; The vector median target pixel is exchanged with the center pixel to obtain the filtered quantum color image.
2. A quantum color image filtering method as claimed in claim 1, characterized in that: The step of obtaining a quantum color image to be processed specifically includes: First, the initial 2n qubits are prepared into a superposition state using 2n H gates and 3q identity gates I; Exploit 2 2n NCQI color setting submoduleΩ YX All pixel grayscale information on the classical image is prepared into a superposition state to obtain a quantum color image to be processed.
3. A quantum color image filtering method as claimed in claim 1, characterized in that: The method of replicating the color information of the neighboring pixels based on the quantum superposition state of the central pixel specifically includes: Prepare 27q qubits initialized to the |0> state and use the cyclic shift module to obtain the position of the neighboring pixels; The color information of the position is prepared into the quantum state of the central pixel by using the NCQI color information preparation module, and a pair of position bits are shared with the central pixel; After 8 cyclic shifts and NCQI color setting operations and 2 cyclic shifts, the shared position bits are returned to the initial position state.
4. A quantum color image filtering method as claimed in claim 1, characterized in that: The step of obtaining the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel specifically includes: Input the qubit sequence |d> used to store the vector distance and the pixel vector; The pixel vectors are grouped into three channels and input into three non-negative integer difference calculation modules respectively. The calculated results are saved in |C Y'X' >Three channels; Call the quantum addition module three times in sequence to |C Y'X' >, the differences saved in the three channels are summed, and the results are saved in the quantum bit sequence |d'> to obtain the vector distance between the quantum bit qubit and the central pixel.
5. A quantum color image filtering method as claimed in claim 4, characterized in that: The non-negative integer difference calculation module specifically includes: The module input is a=a n-1 a n-2 …a0 and b = b n-1 b n-2 …b0; Add two qubits s representing sign bits to a and b respectively a and b , initialized to |0>; For a a n-1 a n-2 ...a0 and s b b n-1 b n-2 ...b0 performs quantum subtraction on two non-negative integers, if a ≥ b, s b The quantum state is |0>, acting on s b b n-1 b n-2 ...b0's n C-NOT gates and controlled cyclic shift modules do not change b n-1 b n-2 ...the quantum state of b0, at c n-1 c n-2 ...get the non-negative integer difference at c0; If a<b, s b The quantum state is set to |1>, b n-1 b n-2 ...b0 is the two's complement of the difference of non-negative integers, applied to s b b n- 1b n-2 ...b0's n C-NOT gates make b n-1 b n-2 ...b0 quantum state flips, and the controlled cyclic shift module flips the b n- 1b n-2 ...b0 is incremented by one, and c n-1 c n-2 ...get the non-negative integer difference at c0.
6. A quantum color image filtering method as claimed in claim 1, characterized in that: The step of taking the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel specifically includes: |c0>|c1>...|c8> represents the grayscale information of the pixels in the window, and |d0>|d1>...|d8> represents the aggregation distance of the pixels in the window; The comparison module is used to determine the size of |d0> and |d1>. If the output qubit |out>=|1>, |C0>, |C1> and the corresponding |d0>, |d1> are swapped, and the same operation is performed on the other 8 pixels and their corresponding aggregation distances in turn. Finally, the minimum aggregation distance |d can be obtained at |d8>. min >, get the vector median target pixel |C at |C8> vmf >.
7. A quantum color image filtering method as claimed in claim 6, characterized in that: The vector median target pixel |C vmf >With the center pixel |C (Y,X) >To exchange, the formula is: Among them, Y and X represent the pixel position information in the vertical and horizontal directions respectively, and n is the number of pixels on the edge of the image.
8. A quantum color image filtering system, characterized in that: include: A color image preparation module, used for acquiring a quantum color image to be processed, wherein the quantum color image includes a central pixel and a plurality of neighboring pixels surrounding the central pixel; A neighborhood pixel preparation module is used to replicate the color information of the neighborhood pixels based on the quantum superposition state of the central pixel, and obtain multiple quantum bits (qubits) representing the color information of the neighborhood pixels; The aggregate distance calculation module is used to obtain the vector distance between the quantum bit qubit contained in each neighborhood pixel and the central pixel, and integrate all the vector distances in each neighborhood pixel to obtain the aggregate distance between multiple neighborhood pixels and the central pixel; The vector median selection module is used to arrange the aggregation distances between each neighborhood pixel and the central pixel in ascending order, and use the neighborhood pixel corresponding to the minimum aggregation distance as the vector median target pixel; The median pixel replacement module is used to exchange the vector median target pixel with the center pixel to obtain a filtered quantum color image.
