A design method and system for quantum image edge detection

By optimizing the NEQR expression for quantum image edge detection and reusing auxiliary qubits, a quantum circuit was designed for image filtering and edge detection, solving the problem of the difficulty in simulating quantum image edge detection technology on a classical computer and realizing the effective processing of large-size images.

CN116452623BActive Publication Date: 2026-01-27SICHUAN KAIXIANGYUAN SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310377764.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-10
Publication Date
2026-01-27
Estimated Expiration
2043-04-10

AI Technical Summary

Technical Problem

Existing quantum image edge detection technology is still imperfect and difficult to simulate on classical computers, making it unable to effectively process large-size images.

Method used

Image preparation is optimized using NEQR expression, auxiliary qubits are reused, quantum circuits are designed and auxiliary images are added to reduce the number of qubits and redundancy, and quantum adders, absolute value subtractors and comparators are used for filtering and edge detection.

Benefits of technology

The performance of quantum image representation algorithms has been improved, making them easy to simulate on classical computers and enabling them to process larger quantum images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116452623B_ABST
    Figure CN116452623B_ABST
Patent Text Reader

Abstract

The application relates to a design method and system for quantum image edge detection and belongs to the field of quantum computation. The method comprises the following steps: S1: preparing NEQR expressions of an image to be processed and twelve neighborhood images thereof; S2: designing a quantum circuit of a quantum image filtering and edge detection algorithm, and performing edge detection operation on the quantum image prepared in S1 and the twelve neighborhood images thereof; S3: designing a quantum circuit of a quantum image zero-crossing method, and performing calculation on the quantum image filtered and edge detected in S2; and S4: measuring the quantum image expression processed in S3, obtaining information in the image expression, and converting the information into classical image information. Through multiplexing of auxiliary bits and optimization of preparation of the quantum image, the quantum image edge detection algorithm can be realized, the performance of quantum image processing is greatly improved, and a foundation is laid for subsequent processing of the quantum image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of quantum computing and relates to a design method and system for quantum image edge detection. Background Technology

[0002] Quantum image processing is an interdisciplinary field combining quantum computing and visual information processing. It lays the algorithmic groundwork for the widespread adoption of quantum computers, primarily processing visual data and representing a core topic in numerous application areas. Unlike classical image processing, quantum image processing is an interdisciplinary field integrating quantum mechanics, computer science, and information science. The parallelism, superposition, and measurement uncertainty of quantum image processing are fundamental advantages over classical image processing.

[0003] Edge detection is a crucial preprocessing step in image processing. During transmission and use, digital images are often inevitably subjected to noise interference due to imperfections in imaging systems, transmission media, and recording equipment, leading to image quality degradation and affecting subsequent processing. Therefore, image processing techniques are frequently used to improve image quality before further processing. While edge detection research in classical image processing is relatively mature, quantum edge detection has only been proposed in recent years and is still in its early stages, lacking refinement. Therefore, designing more efficient quantum image edge detection schemes by leveraging the unique parallelism of quantum mechanics is a topic worthy of further exploration. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a design method for quantum image edge detection. This method optimizes the preparation process of the image to be processed and its domain based on the NEQR expression, reuses auxiliary qubits in the quantum circuit, and adds auxiliary images to reduce the number of qubits in the quantum circuit and reduce redundant quantum elements, which greatly improves the performance of the quantum image representation algorithm, makes it easier to simulate under classical computers, and makes it possible to process larger quantum images, thereby improving the capability of the quantum image algorithm.

[0005] To achieve the above objectives, the present invention provides the following technical solution:

[0006] A design method for quantum image edge detection, comprising the following steps:

[0007] S1: NEQR expression for preparing the quantum image to be processed and its twelve-neighborhood image;

[0008] S2: Design a quantum circuit for quantum image filtering and edge detection algorithms, and perform edge detection operations on the prepared quantum image and its twelve neighboring images;

[0009] S3: Design the quantum circuit for the zero-crossing method of quantum image and perform calculations on the quantum image after filtering and edge detection in S2;

[0010] S4: Measure the processed quantum image expression, obtain the information of each component in the quantum image expression, and convert it into classical image information.

[0011] Optionally, S1 specifically includes:

[0012] S11: Obtain information about the twelve neighborhoods of the original image, including the grayscale information and the size information of the image; the method for obtaining the twelve neighborhood information is as follows: the grayscale information of the twelve neighborhood images is related to the image to be edge detected. By performing a cyclic shift on the original image, one neighborhood image can be obtained each time the cyclic shift is performed, and twelve neighborhood images can be obtained by performing twelve cyclic shifts.

[0013] S12: Set the corresponding qubits according to the information of the image to be processed; the method for setting the qubits is as follows: the grayscale value of the image to be processed is set to the range [0, 2]. q-1 ], size is 2 n ×2 n Then, the grayscale information corresponding to each image is q qubits.

[0014] S13: By sharing the same position information with the twelve neighboring images, the grayscale information of each image is controlled, resulting in a quantum sequence that uniquely maps pixel position information to grayscale information.

[0015] Optionally, S2 specifically includes:

[0016] S21: Use numerical multiplication operations on quantum circuits to transform the grayscale values ​​of a twelve-neighbor image according to the weights of each pixel in the filtering and edge detection matrix. Design a quantum adder to perform the addition operation after the grayscale values ​​have been transformed;

[0017] S22: Use pixel grayscale value multiplication to enlarge the pixel values ​​of the original image;

[0018] S23: Design a quantum absolute value subtractor to perform absolute value subtraction on the values ​​obtained from S21 and S22 to obtain the filtered and edge-detected image.

[0019] Optionally, S3 specifically includes:

[0020] S31: Design a quantum comparator for threshold determination of image pixel grayscale values;

[0021] S32: The quantum image after filtering and edge detection is calculated using a quantum adder and a quantum absolute value subtractor through a zero-crossing method. A quantum comparator is used to judge the gray values ​​of the image pixels from four directions to obtain the quantum image after edge detection.

[0022] Optionally, S4 specifically includes:

[0023] Using the open-source quantum computing toolkit QISKIT, the IBMQ simulation cloud platform, and the package and environment management functions provided by Anaconda, a quantum image edge detection algorithm was simulated and implemented in Python.

[0024] A computer system includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the method.

[0025] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method.

[0026] The beneficial effects of this invention are as follows: This invention optimizes the preparation process of the image to be processed and its twelve neighboring images based on the NEQR expression, while realizing the quantum preparation of nine images, reusing the auxiliary bits in the quantum circuit, and adding auxiliary images to reduce the number of qubits in the quantum circuit and reduce redundant quantum elements, which greatly improves the performance of the quantum image representation algorithm.

[0027] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0028] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0029] Figure 1 This is a technical roadmap of the method of the present invention;

[0030] Figure 2 This is a Gaussian-Laplace filter template;

[0031] Figure 3 This is a schematic diagram of the original image and its twelve-neighbor image after cyclic shifting;

[0032] Figure 4This invention provides a quantum circuit diagram for preparing the image to be processed and its twelve neighboring images at the same location based on the NEQR expression.

[0033] Figure 5 This is a circuit diagram of the quantum adder used in this invention;

[0034] Figure 6 This is a circuit diagram of the quantum full subtractor used in this invention;

[0035] Figure 7 This is a circuit diagram of the quantum absolute value subtractor used in this invention;

[0036] Figure 8 This is a schematic diagram of the specific circuit for edge detection of quantum images using a Gaussian-Laplace filter template in this invention.

[0037] Figure 9 This is a circuit diagram of the quantum comparator used in this invention;

[0038] Figure 10 This is a schematic diagram of the neighboring pixels of pixel (Y,X) in the zero-crossing method;

[0039] Figure 11 This is a schematic diagram illustrating the process of using the zero-crossing method to determine the gradient of a quantum image in this invention.

[0040] Figure 12 The probability histogram after measurement for a quantum image edge detection algorithm. Detailed Implementation

[0041] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0042] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0043] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0044] Figure 1 This is a technical roadmap of the method of the present invention. In this embodiment, S1 specifically refers to:

[0045] First step, according to Figure 2 The Gaussian-Laplace filter template shown is used to filter and perform edge detection on the original image. To obtain basic information about the image to be processed, the image is first cyclically shifted in twelve directions, such as... Figure 3 As shown, the central 3(1) is the pixel matrix of the original image. The coordinates of the original image pixel matrix are cyclically shifted upward, downward, left, right, upper left, upper right, lower left, and lower right, respectively, to obtain... Figure 3 The eight neighboring cyclically shifted images shown are 3(3), 3(8), 3(5), 3(6), 3(2), 3(4), 3(7), and 3(9). The pixel matrix that is cyclically shifted upwards is then cyclically shifted upwards again, resulting in pixel matrix 3(11) that is cyclically shifted upwards twice. This process is repeated to obtain pixel matrices 3(13), 3(10), and 3(12) that are cyclically shifted downwards, leftwards, and rightwards twice. This yields twelve neighboring images after the original image has been cyclically shifted, thus realizing... Figure 2 The Gaussian-Laplace filter template performs numerical processing on the pixel grayscale values ​​of the original image.

[0046] The second step involves preparing the positional and grayscale information of the image to be processed and its twelve neighboring images. Pixel information from thirteen classical images is traversed, and quantum circuits are constructed based on the optimized image to achieve a unique mapping between pixel positional and grayscale information. Pixel information (including grayscale and positional information) in the image is scanned sequentially, and the obtained pixel information is converted into the required quantum sequence, thus achieving the unique mapping between grayscale and positional information.

[0047] When the Qiskit quantum simulation system runs a quantum circuit, the output quantum sequence corresponds one-to-one from left to right to the top to bottom of the quantum circuit. Based on the information represented by the qubits from bottom to top in the quantum circuit, it can be seen that the first twenty-six bits of each variable group represent the pixel grayscale values ​​of thirteen images, the next four bits represent position information, and the last three bits are auxiliary bits. Subsequent quantum sequences are presented in this order. Figure 4 Taking the first data point from top to bottom, 00000000000000000000011000000001, as an example, the prepared image is explained. Figure 4 From top to bottom, |m0>-|m441> represent the qubits storing the grayscale values ​​of thirteen images. Figure 3 In the thirteen images, the data for the first coordinate, i.e., the grayscale values ​​of the thirteen pixels at coordinates X = "00", Y = "00", only has a grayscale value of 3 at the location of the neighboring image that has undergone two cyclic shifts to the right, i.e., the value of qubits |m330> and |m331> is 1. The remaining qubits representing grayscale values ​​are all 0. Therefore, the qubit data representing grayscale values ​​is 00000000000000000000001100. The next four qubits representing position information are 0000, indicating the coordinate positions X = "00", Y = "00". The last three qubits representing auxiliary bits are 001, which need to be reset to zero after use to achieve the reuse of auxiliary bits.

[0048] Specifically, in this embodiment, the process of uniquely mapping pixel position information to grayscale information is as follows:

[0049] Step 1, as follows Figure 3 As shown, given that the initial state of the position qubits |p0>-|p3> is |0>, an H-gate transformation is performed on them to prepare the position information of the image;

[0050] Step 2: Transfer position information to auxiliary qubits to prepare for a unique mapping between position information and grayscale information. Auxiliary qubits will be used in this process because the superposition state representing position information cannot change throughout the image preparation process. Therefore, in this embodiment, the required position information is transferred to the auxiliary qubits, which then control the change in grayscale values, thereby achieving a unique mapping relationship between position information and grayscale information.

[0051] Step 3: Obtain the grayscale value corresponding to the position information; this completes the preparation of one pixel. Afterwards, the auxiliary qubit is reset to zero using a zero-gate, allowing it to be reused when preparing the next pixel. Simultaneously, any operation performed on the position information requires restoration.

[0052] This embodiment provides the quantum circuitry for two pixels in the twelve-neighborhood image of the image to be processed, such as... Figure 4 The diagram shows the quantum circuit diagrams for preparing the qubit information corresponding to the gray values ​​at positions X = "00", Y = "00" and X = "00", Y = "01", which are 0000000000000000000001100 and 00000011000011001100001000.

[0053] In this embodiment, regardless of the number of qubits representing position information, the position information can always be transmitted through these three auxiliary qubits. The information is transmitted to one of the auxiliary qubits using the multiplexing method described above. Therefore, the number of auxiliary qubits in this embodiment does not increase with the increase of image size, and the complexity of the quantum circuit is greatly reduced.

[0054] S2 specifically involves designing the quantum circuitry for a quantum image edge detection algorithm, and performing filtering and edge detection processing on the quantum image expression prepared in step S1.

[0055] In this invention, quantum adders and quantum absolute value subtractors are used to perform filtering and edge detection of quantum images.

[0056] (1) Quantum adder

[0057] The circuit diagram of a quantum adder is as follows: Figure 5 As shown, it can obtain the sum of two binary numbers |a> and |b>. The specific steps of addition are: first, add from the least significant bit, then consider whether a carry is needed to the most significant bit, then add the second bit until the last bit. The result is stored in qubits |x> and |s>, where |x> is the carry, i.e., the most significant bit of the addition result. Figure 5 The augend and addend used in the addition operation use two qubits, which can be increased or decreased depending on the size of the data to be added.

[0058] (2) Quantum full subtractor

[0059] The circuit diagram of the quantum full subtractor is as follows: Figure 6 As shown, |a>=|a2a1a0> is the minuend, and |b>=|b2b1b0> is the subtrahend. |ass1ass0> is an auxiliary bit used to store borrow information, and a reset operation is used to multiplex |ass1ass0>. The result of the subtraction operation is stored in |s2s1s0> at the output. The number of qubits used for the minuend and subtrahend can be increased or decreased according to the actual size of the data involved in the operation.

[0060] (3) Quantum absolute value subtractor

[0061] In this design, the gray values ​​of the seed point and other pixels are different, so a quantum subtractor with absolute value is needed to obtain the difference between the two gray values. Figure 7This is a circuit diagram of a quantum absolute value subtractor, composed of a quantum full subtractor and a quantum adder. |a2a1a0> is the minuend, |b2b1b0> is the subtrahend, and |ass0ass1> are auxiliary bits. It's important to note that if the result of the quantum full subtractor is negative, the subtraction result is in two's complement. |a2a1a0> is the value in the two's complement, and the final borrow |ass1> is the sign bit in the two's complement. However, this design requires the original code value for subsequent comparison operations, so the two's complement needs to be converted to the original code. Finally, the absolute value of the difference between the minuend and subtrahend is obtained and stored in |s2s1s0>. The number of qubits used for the minuend and subtrahend can be increased or decreased depending on the size of the data involved in the operation.

[0062] (4) Quantum multiplication operation

[0063] Based on the special characteristics of binary operations, suppose an n-bit binary number M = m n m n-1 ...m1m0, then 2M=m n m n-1 ...m1m00, that is, adding a zero to the end of a binary number doubles the size of the binary number; adding two zeros quadruples it, and so on. This is a relatively simple way to obtain the 2^n timestamp of a binary number. n Multiples of, used to achieve Figure 2 The image grayscale value changes by two times and sixteen times in the filtering and edge detection template.

[0064] The implementation methods for quantum image filtering and edge detection are as follows:

[0065] according to Figure 2 The filtering and edge detection template shown is based on Figure 2 The weight of each pixel in the template is multiplied by the grayscale value of the corresponding neighboring image using a quantum multiplication operation, and then the values ​​of all neighboring images after multiplying by grayscale value are added together using a quantum adder. Figure 2 In this algorithm, all neighboring images except the original image have negative weights. Therefore, the sum of the gray values ​​of the original image (multiplied by a factor of sixteen) and the sum of the gray values ​​of all neighboring images is subtracted using a quantum absolute value subtractor. The result is saved as a new image matrix, resulting in a quantum image that has undergone smoothing filtering and edge detection. The specific quantum circuitry is as follows: Figure 8 As shown. Due to the parallelism of quantum circuits, the algorithm can process pixels at all locations simultaneously. For edge pixels in the original image, the image boundary is expanded by copying edge pixels to meet the filtering requirements of the twelve-neighborhood template.

[0066] Specifically, S3 is as follows: Design a quantum circuit for the quantum image zero-crossing method, and calculate the quantum image obtained by filtering and edge detection in S2;

[0067] The implementation principle of the quantum comparator used is as follows:

[0068] Given a composite system |a>|b> composed of two n-bit quantum states, use a quantum comparator (Quantum BitString Comparator, QBSC) to implement the operation of the quantum bit strings |a> = |a n-1 a n-2 ...a0> and the bit string |b> = |b n- 1b n-2 ...b0>. The QBSC is the unitary evolution shown below:

[0069] U CMP |a>|b>|0>|0> = |a>|b>|0>|c> (1)

[0070] where is the total number of quantum bits in the composite system. The implementation of the comparator also requires another 2 auxiliary quantum bits initialized to 0; does not carry any useful information, and the last quantum bit state carries the result information obtained by comparison. and are the two quantum bit strings for comparison respectively. For example, when a < b, then c = 1; when a ≥ b, then c = 0. The increase in the number of bits of the quantum bit strings participating in the comparison in the implementation of the comparator will not cause an increase in the number of bits of the auxiliary quantum bits, as Figure 9 shown.

[0071] The implementation principle of the zero-crossing method is as follows:

[0072] According to mathematical knowledge, the local maximum of the first derivative means the zero point of the second derivative. Edge pixels have the maximum value of the first derivative and the zero crossing of the second derivative. However, in practical applications, there are some points with larger gradients than other points, which are actually not edge points. Therefore, the zero-crossing method is used to judge the true edge points on different gradients.

[0073] G1 = f(Y + 1, X) + f(Y - 1, X) - 2 × f(Y, X)

[0074] G2 = f(Y + 1, X - 1) + f(Y - 1, X + 1) - 2 × f(Y, X)

[0075] G3 = f(Y, X + 1) + f(Y, X - 1) - 2 × f(Y, X)

[0076] G4 = f(Y + 1, X + 1) + f(Y - 1, X - 1) - 2 × f(Y, X) (2)

[0077] Equation (2) shows the gradient in four directions, and the corresponding coordinate positions are as follows: Figure 10 As shown, (Y,X) is the original pixel, and the remaining pixels are the eight neighboring pixels of the original pixel. The gradient in the corresponding direction is calculated according to equation (2). The image boundary is expanded by copying edge pixels to meet the requirement of nine neighboring pixels in the zero-crossing method. An edge threshold T is set, and the calculated G1, G2, G3, and G4 are compared with T using a quantum comparator. If any gradient is greater than the threshold T, then the point is an edge point; if it is less than T, then it is not an edge point. The specific quantum circuit diagram is shown below. Figure 11 As shown, the result obtained after using the zero-crossing method is a binary image. In the binary image, pixels with a value of 1 are edge points, and those with a value of 0 are not. This completes the zero-crossing operation on the quantum image after filtering and edge detection.

[0078] S4 specifically involves measuring the quantum image expression processed by S3 to obtain the probability information of each state in the quantum image, and converting the quantum image into a classical image for display through measurement operations.

[0079]

[0080]

[0081]

[0082]

[0083] Equation (3) is the original image matrix to be processed, Equation (4) is the image matrix after filtering and edge detection matrix processing, and Equation (5) is the matrix of the maximum gradient value after zero-crossing operation. The edge information in Equation (5) is more obvious and conforms to the change trend of the original image matrix. With the threshold T set to 21, only the gray value of the third column pixel 23 in Equation (5) is greater than the threshold and is extracted as an edge point. The final edge detection result is shown in Equation (6), realizing the edge detection of quantum image.

[0084] The probability amplitude information of each state in the quantum image is obtained through measurement operations. After the previous steps, the probability amplitude information of each state can only be obtained after performing measurement operations on the quantum image system. Figure 12 The probability histogram obtained after quantum measurement is shown in the figure. There are 5 qubits. The first qubit indicates whether it is an edge point and the last four qubits are the position information of the pixel. As shown in equation (5), the first qubit is 1 only when the last two qubits are "10", that is, the position information X = "10", and is determined to be an edge point.

[0085] From the above experimental process and its corresponding experimental data, it can be seen that the quantum image edge detection algorithm has been implemented in quantum images with an image size of 4*4.

[0086] It should be recognized that embodiments of the present invention can be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium. The method can be implemented using standard programming techniques—including a non-transitory computer-readable storage medium configured with a computer program, wherein such a storage medium causes the computer to operate in a specific and predefined manner—according to the methods and drawings described in the specific embodiments. Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system. However, if desired, the program can be implemented in assembly or machine language. In any case, the language can be a compiled or interpreted language. Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit (ASIC).

[0087] Furthermore, the procedures described herein may be performed in any suitable order unless otherwise indicated herein or otherwise clearly contradicted by the context. The procedures described herein (or variations and / or combinations thereof) may be executed under the control of one or more computer systems configured with executable instructions, and may be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. The computer program comprises a plurality of instructions executable by one or more processors.

[0088] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices. Aspects of the invention can be implemented as machine-readable code stored on a non-transitory storage medium or device, whether removable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it is readable by a programmable computer, which, when read by the computer, can be used to configure and operate the computer to perform the processes described herein. Furthermore, the machine-readable code, or portions thereof, can be transmitted via wired or wireless networks. The invention described herein includes these and other different types of non-transitory computer-readable storage media when such media comprises instructions or programs that implement the steps described above in conjunction with a microprocessor or other data processor. When programmed according to a design method and technique for quantum image edge detection according to the invention, the invention also includes the computer itself.

[0089] A computer program can be applied to input data to perform the functions described herein, thereby transforming the input data to generate output data stored in non-volatile memory. The output information can also be applied to one or more output devices, such as a display. In a preferred embodiment of the invention, the transformed data represents physical and tangible objects, including specific visual depictions of physical and tangible objects generated on the display.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A design method for quantum image edge detection, characterized in that: The method includes the following steps: S1: NEQR expression for preparing the quantum image to be processed and its twelve-neighborhood image; S2: Design a quantum circuit for quantum image filtering and edge detection algorithms to perform edge detection operations on the prepared quantum image and its twelve neighboring images; S3: Design the quantum circuit for the quantum image zero-crossing method and perform calculations on the quantum image after filtering and edge detection in S2; S4: Measure the processed quantum image expression, obtain the information of each component in the quantum image expression, and convert it into classical image information; Specifically, S1 is: S11: Obtain information about the twelve neighborhoods of the original image, including the grayscale information and the size information of the image; the method for obtaining the twelve neighborhood information is as follows: the grayscale information of the twelve neighborhood images is related to the image to be edge detected. By performing a cyclic shift on the original image, one neighborhood image can be obtained each time the cyclic shift is performed, and twelve neighborhood images can be obtained by performing twelve cyclic shifts. S12: Set the corresponding qubits according to the information of the image to be processed; the method for setting the qubits is as follows: the grayscale value of the image to be processed is set to the range [0, 2]. q-1 ], size is 2 n ×2 n Then the grayscale information corresponding to each image is q qubits; S13: By sharing the same position information with the twelve neighboring images, the grayscale information of each image is controlled, resulting in a quantum sequence that uniquely maps pixel position information to grayscale information; Specifically, S2 is: S21: Use the numerical multiplication operation on the quantum circuit to realize the numerical change of the gray value of the twelve-neighbor image according to the weight of each pixel in the filtering and edge detection matrix; design a quantum adder to realize the addition operation after the gray value is numerically changed; S22: Use pixel grayscale value multiplication to enlarge the pixel values ​​of the original image; S23: Design a quantum absolute value subtractor to perform absolute value subtraction on the values ​​obtained from S21 and S22 to obtain the filtered and edge-detected image.

2. The design method for quantum image edge detection according to claim 1, characterized in that: Specifically, S3 is: S31: Design a quantum comparator for threshold determination of image pixel grayscale values; S32: The quantum image after filtering and edge detection is calculated using a quantum adder and a quantum absolute value subtractor through a zero-crossing method. A quantum comparator is used to judge the gray values ​​of the image pixels from four directions to obtain the quantum image after edge detection.

3. The design method for quantum image edge detection according to claim 1, characterized in that: Specifically, S4 is: Using the open-source quantum computing toolkit QISKIT, the IBMQ simulation cloud platform, and the package and environment management functions provided by Anaconda, a quantum image edge detection algorithm was simulated and implemented in Python.

4. A computer system comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that: When the processor executes the computer program, it implements the method as described in any one of claims 1-3.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Quantum LoG edge detection method

    CN107169982A

  • Physical transformations for multi-dimensional data quantum representations

    US20230013217A1