Detection Circuit, Chip and Electronic Device
By designing a detection circuit, the signal amplitude difference is converted into conductance difference, and the image edge is indirectly detected, which solves the problems of large calculation amount and high power consumption in the prior art, and realizes efficient image edge detection.
Patent Information
- Application Number
- CN202410782330.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-08-24
- Filing Date
- 2020-11-27
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2040-11-27
AI Technical Summary
The prior art has a large amount of computing in image edge detection, resulting in low computing efficiency and high device power consumption.
A detection circuit is designed to convert the amplitude difference between the first signal and the second signal into the frequency or amplitude difference of the pulse sequence, and then convert it into the difference between the first conductance and the second conductance, and indirectly detect the signal difference, and apply it to the image edge detection scene.
Reduces calculation steps, improves computing efficiency, reduces device power consumption, and improves image edge detection performance.
Smart Images

Figure CN118887245B_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202011360776.6, the filing date of the original application is November 27, 2020, and the entire content of the original application is incorporated herein by reference. Technical Field
[0002] This application relates to the field of signal processing technologies, and in particular to detection circuits, chips, and electronic devices. Background Art
[0003] Image edge detection technology is widely used in fields such as image segmentation, motion detection, target tracking, and face recognition. Therefore, image edge detection technology is one of the research hotspots in image processing technology. Improving edge detection accuracy and exploring the application of edge detection technology in practical engineering are important research contents of edge detection technology. The purpose of edge detection is to identify points with obvious brightness changes in a digital image. Significant changes in image attributes usually reflect important events and changes in attributes, including depth discontinuities, surface direction discontinuities, material property changes, and scene illumination changes, etc.
[0004] The principle of image edge detection can be divided into two categories: finding the extrema of the first derivative of the image and finding the zeros of the second derivative of the image. Since an image can be divided into a set of discrete pixels, calculating the derivative of the image edge can be transformed into the difference operation of the gray values of the pixels. In practice, template convolution is commonly used for approximate calculation. Specifically, the origin of the template (i.e., the convolution kernel) is aligned with a pixel in the image to be detected, the values of the elements on the template are multiplied by the gray values of the corresponding pixels in the image to be detected, and the products are added together to obtain the convolution value of the pixel. As Figure 1 shown, it is a schematic diagram of a convolution operation. In Figure 1 , after the matrix 1 composed of the gray values of the highlighted elements in Figure a is multiplied by the matrix 2 shown in Figure b, the value 0 of the highlighted element in Figure c obtained is the convolution value of the central element "4" of the matrix 1 in Figure a.
[0005] The convolution operation of an image requires the convolution kernel to move within the image range to complete the feature extraction for each pixel and the surrounding pixel information in the image. For example, in combination with Figure 1 , each element in Figure a of Figure 1 needs to be aligned with the origin of the template in Figure b respectively, and the matrix multiplication operation is performed. For an image with an m×n resolution, m×n times of convolution kernel movement are required, that is, m×n times of matrix multiplication operations. The computational complexity is relatively large. Based on this, whether implementing the convolution operation using software or hardware, it will lead to low computational efficiency due to the large computational complexity, and the problem of high power consumption of the devices used in the calculation process. Summary of the Invention
[0006] An embodiment of the present application provides a detection circuit, a chip, and an electronic device, which helps to reduce calculation steps, improve calculation efficiency, and reduce device power consumption.
[0007] To achieve the above object, the embodiments of the present application adopt the following technical solutions:
[0008] In a first aspect, an embodiment of the present application provides a detection circuit, including: a first pulse sequence generator, configured to receive a first signal and generate a first pulse sequence based on the first signal; a second pulse sequence generator, configured to receive a second signal and generate a second pulse sequence based on the second signal; wherein, the amplitudes of the first signal and the second signal are different, and the frequencies or amplitudes of the first pulse sequence and the second pulse sequence are different; a first conductance device, configured to receive the first pulse sequence to generate a first conductance; a second conductance device, configured to receive the second pulse sequence to generate a second conductance; the first conductance device and the second conductance device are further configured to receive a third signal respectively; a difference detection circuit, configured to be connected to the first conductance device and the second conductance device; the difference detection circuit is further configured to output a difference voltage when both the first conductance device and the second conductance device receive the third signal; the difference voltage is used to characterize the difference between the first conductance and the second conductance.
[0009] This detection circuit converts the difference in the amplitudes of the first signal and the second signal into the difference in the frequency or amplitude of the pulse sequence, and further into the difference between the first conductance and the second conductance. In this way, by detecting the difference between the first conductance and the second conductance, the difference between the first signal and the second signal can be indirectly detected. This detection circuit can be applied to the image edge detection scenario, thereby reducing calculation steps, improving calculation efficiency, and reducing device power consumption. The specific analysis process can refer to the specific implementation part below and will not be elaborated here.
[0010] In a possible design, the conductances of the first conductance device and the second conductance device change with the frequency or amplitude of the respective received pulse sequence.
[0011] In a possible design, the conductances of the first conductance device and the second conductance device increase with the increase in the frequency of the respective received pulse sequence, such as linearly increasing.
[0012] In a possible design, the conductances of the first conductance device and the second conductance device increase with the increase in the amplitude of the respective received pulse sequence, such as linearly increasing.
[0013] In a possible design, the conductances of the first conductance device and the second conductance device increase with the increase in the number of pulses in the respective received pulse sequence, such as linearly increasing.
[0014] In a possible design, the first conductance device and the second conductance device are volatile devices. At a first moment, the first conductance device receives a first pulse sequence, and the second conductance device receives a second pulse sequence. At a second moment, the first conductance device and the second conductance device respectively receive a third signal. The time interval between the first moment and the second moment is less than or equal to an interval threshold. In this way, it helps the first conductance device and the second conductance device to generate the first conductance and the second conductance simultaneously, and helps to complete the detection of the difference between the first conductance and the second conductance before the initialization of the first conductance and the second conductance.
[0015] In a possible design, the first conductance device and the second conductance device are non-volatile devices. The first conductance device is further configured to initialize the conductance of the first conductance device after the difference detection circuit outputs a difference voltage. The second conductance device is further configured to initialize the conductance of the second conductance device after the difference detection circuit outputs a difference voltage. In this way, the detection circuit can be directly used to measure the difference between a new first signal and a new second signal subsequently.
[0016] In a possible design, both the first signal and the second signal are current signals or voltage signals.
[0017] In a possible design, the amplitudes of the first pulse sequence and the second pulse sequence are both greater than or equal to a first threshold. That is to say, the first pulse sequence and the second pulse sequence can respectively change the conductance of the first conductance device and the second conductance device.
[0018] In a possible design, the amplitude of the third signal is less than the first threshold. That is to say, the third signal cannot change the conductance of the first conductance device and the second conductance device, so as to more accurately measure the difference between the first conductance and the second conductance.
[0019] In a possible design, the first signal is an analog signal corresponding to the gray value of the first pixel in the image to be detected. The second signal is an analog signal corresponding to the gray value of the second pixel in the image to be detected; wherein, the first pixel and the second pixel are adjacent. That is to say, the detection circuit can be used to detect the difference between the gray values of adjacent pixels, so that the detection circuit can be applied to the image edge detection scenario.
[0020] In a possible design, the detection circuit further includes: a first differential amplifier. One input terminal of the first differential amplifier is used to receive the difference voltage. The other input terminal of the first differential amplifier is used to receive a reference voltage. The voltage output by the first differential amplifier is used to characterize the gradient between the gray values of the first pixel and the second pixel. That is to say, the detection circuit can be used to detect the gradient between the gray values of adjacent pixels, that is, the detection circuit can be applied to the image edge detection scenario.
[0021] In a possible design, one pixel pair in the image to be detected corresponds to one detection circuit. Wherein, the pixel pair includes two adjacent pixels in the same row of the image to be detected, or two adjacent pixels in the same column of the image to be detected. In this way, it helps to obtain the edge gradient image of the image to be detected.
[0022] In a possible design, the first pixel pair in the image to be detected corresponds to the first detection circuit; the second pixel pair in the image to be detected corresponds to the second detection circuit. Wherein, both the first pixel pair and the second pixel pair include the same pixel; the first detection circuit and the second detection circuit share the same branch. The branch includes a first pulse sequence generator and a first conductance device, or the branch includes a second pulse sequence generator and a second conductance device. If this circuit structure is adopted for each row and each column of the image to be detected, a total of four parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected. If the row-by-row and column-by-column processing method is adopted, the detection circuits with the scale of rows and columns can be reused, and a total of 2*(m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device. Wherein, the resolution of the image to be detected is m*n.
[0023] In a possible design, the first pixel pair in the image to be detected corresponds to the first detection circuit; the second pixel pair in the image to be detected corresponds to the second detection circuit. Wherein, both the first pixel pair and the second pixel pair include the same pixel; the first detection circuit and the second detection circuit share the pulse sequence generator corresponding to the same pixel. If this circuit structure is adopted for each row and each column of the image to be detected, a total of two parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected. If the row-by-row and column-by-column processing method is adopted, the detection circuits with the scale of rows and columns can be reused, and a total of (m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device. Wherein, the resolution of the image to be detected is m*n.
[0024] In a possible design, the third pixel pair in the image to be detected corresponds to the third detection circuit; the fourth pixel pair in the image to be detected corresponds to the fourth detection circuit. Wherein, both the third pixel pair and the fourth pixel pair include the same pixel (i.e., the same pixel included in the first pixel pair and the second pixel pair); the third detection circuit and the fourth detection circuit share the pulse sequence generator corresponding to the same pixel. In this way, all rows and all columns of the image to be detected can be operated in parallel groups, that is, the edge detection operation of all elements can be completed in one step, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device.
[0025] In a possible design, the difference detection circuit includes: a first resistor, a second resistor, and a second differential amplifier. The first pulse sequence generator, the first conductance device, and the first resistor are connected in series in sequence, and the connection point between the first resistor and the first conductance device is connected to one input terminal of the second differential amplifier. The second pulse sequence generator, the second conductance device, and the second resistor are connected in series in sequence, and the connection point between the second resistor and the second conductance device is connected to the other input terminal of the second differential amplifier. The output terminal of the second differential amplifier serves as the output terminal of the difference detection circuit. This possible design provides a circuit for detecting the difference between the first conductance and the second conductance. Of course, the specific implementation is not limited to this.
[0026] In a second aspect, an embodiment of the present application provides a detection circuit, including: a first pulse sequence generator, configured to receive a first signal and generate a first pulse sequence based on the first signal; a second pulse sequence generator, configured to receive a second signal and generate a second pulse sequence based on the second signal; the amplitudes of the first signal and the second signal are different, and the frequencies of the first pulse sequence and the second pulse sequence are different; a first conductance device, configured to receive the first pulse sequence and the second pulse sequence and generate a first conductance; a second conductance device, configured to receive the first pulse sequence and the second pulse sequence and generate a second conductance; a first resistor and a second resistor; wherein, the first conductance device, the first resistor, the second resistor, and the second conductance device are connected in series in sequence, and the connection point between the first resistor and the second resistor serves as the output terminal of the detection circuit. The output terminal of the detection circuit is configured to output a difference voltage; the difference voltage is used to characterize the difference between the first conductance and the second conductance.
[0027] The detection circuit converts the difference in the amplitudes of the first signal and the second signal into the difference in the frequencies of the pulse sequences, and further converts it into the difference between the first conductance and the second conductance. In this way, by detecting the difference between the first conductance and the second conductance, the difference between the first signal and the second signal can be indirectly detected. The detection circuit can be applied to the image edge detection scenario, thereby reducing the calculation steps, improving the calculation efficiency, and reducing the device power consumption. The specific analysis process can refer to the specific implementation part below and will not be elaborated here.
[0028] In a possible design, the conductances of the first conductance device and the second conductance device change with the frequencies of the respective received pulse sequences.
[0029] In a possible design, the conductances of the first conductance device and the second conductance device increase with the increase in the frequencies of the respective received positive pulse sequences and decrease with the increase in the frequencies of the respective received negative pulse sequences.
[0030] In a possible design, the conductances of the first conductance device and the second conductance device increase as the number of pulses in the respective received positive pulse sequence increases, and decrease as the number of pulses in the respective received negative pulse sequence increases.
[0031] In a possible design, the first conductance device and the second conductance device are volatile devices. At the same moment, the first conductance device receives a first pulse sequence, and the second conductance device receives a second pulse sequence.
[0032] In a possible design, the first conductance device and the second conductance device are non-volatile devices. The first conductance device is further configured to initialize the conductance of the first conductance device after the detection circuit outputs a differential voltage. The second conductance device is further configured to initialize the conductance of the second conductance device after the detection circuit outputs a differential voltage. In this way, the detection circuit can directly measure the difference between a new first signal and a new second signal subsequently.
[0033] In a possible design, both the first signal and the second signal are current signals or voltage signals.
[0034] In a possible design, the amplitudes of the first pulse sequence and the second pulse sequence are both greater than or equal to a first threshold value. That is to say, the first pulse sequence and the second pulse sequence can respectively change the conductances of the first conductance device and the second conductance device.
[0035] In a possible design, the first signal is an analog signal corresponding to the gray value of a first pixel in the image to be detected. The second signal is an analog signal corresponding to the gray value of a second pixel in the image to be detected; wherein, the first pixel and the second pixel are adjacent. That is to say, the detection circuit can be used to detect the difference between the gray values of adjacent pixels, so that the detection circuit can be applied to the image edge detection scenario.
[0036] In a possible design, the detection circuit further includes: a first differential amplifier. One input terminal of the first differential amplifier is used to receive the differential voltage. The other input terminal of the first differential amplifier is used to receive a reference voltage. The voltage output by the first differential amplifier is used to characterize the gradient between the gray values of the first pixel and the second pixel. That is to say, the detection circuit can be used to detect the gradient between the gray values of adjacent pixels, that is, the detection circuit can be applied to the image edge detection scenario.
[0037] In a possible design, one pixel pair in the image to be detected corresponds to one detection circuit. Wherein, the pixel pair includes two adjacent pixels in the same row in the image to be detected, or two adjacent pixels in the same column in the image to be detected. In this way, it helps to obtain the edge gradient image of the image to be detected.
[0038] In a possible design, a first pixel pair in the image to be detected corresponds to a first detection circuit; a second pixel pair in the image to be detected corresponds to a second detection circuit. Among them, both the first pixel pair and the second pixel pair contain the same pixel; the first detection circuit and the second detection circuit share the same branch. This branch includes a first pulse sequence generator and a first conductance device, or the branch includes a second pulse sequence generator and a second conductance device. If this circuit structure is adopted for each row and each column of the image to be detected, a total of four parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected. If the row-by-row and column-by-column processing method is adopted, the detection circuits of the row and column scales can be reused, and a total of 2*(m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device. Among them, the resolution of the image to be detected is m*n.
[0039] In a possible design, a first pixel pair in the image to be detected corresponds to a first detection circuit; a second pixel pair in the image to be detected corresponds to a second detection circuit. Among them, both the first pixel pair and the second pixel pair contain the same pixel; the first detection circuit and the second detection circuit share the pulse sequence generator corresponding to this same pixel. If this circuit structure is adopted for each row and each column of the image to be detected, a total of two parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected. If the row-by-row and column-by-column processing method is adopted, the detection circuits of the row and column scales can be reused, and a total of (m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device. Among them, the resolution of the image to be detected is m*n.
[0040] In a possible design, a third pixel pair in the image to be detected corresponds to a third detection circuit; a fourth pixel pair in the image to be detected corresponds to a fourth detection circuit. Among them, both the third pixel pair and the fourth pixel pair contain this same pixel (i.e., the same pixel contained in the first pixel pair and the second pixel pair); the third detection circuit and the fourth detection circuit share the pulse sequence generator corresponding to this same pixel. In this way, all rows and all columns of the image to be detected can be operated in parallel groups, that is, the edge detection operation of all elements can be completed in one step, thereby saving the number of calculations, improving the calculation efficiency, and reducing the power consumption of the device.
[0041] In a third aspect, an embodiment of the present application provides a chip, which includes any one of the detection circuits provided in the first aspect and its possible designs.
[0042] In a fourth aspect, an embodiment of the present application provides a chip, which includes any one of the detection circuits provided in the second aspect and its possible designs.
[0043] Fifth aspect, an embodiment of the present application provides an electronic device, which includes any one of the chips provided in the third aspect above.
[0044] Sixth aspect, an embodiment of the present application provides an electronic device, which includes any one of the chips provided in the fourth aspect above.
[0045] Seventh aspect, an embodiment of the present application provides an electronic device, which includes any one of the detection circuits provided in the first aspect and its possible designs above.
[0046] Eighth aspect, an embodiment of the present application provides an electronic device, which includes any one of the detection circuits provided in the second aspect and its possible designs above.
[0047] Ninth aspect, an embodiment of the present application provides an image processing method, the method includes:
[0048] Construct a difference detection circuit for the gray values of adjacent pixel points, and perform difference detection on the gray values of the complete image by grouping in the X and Y directions to obtain the X component and Y component of the edge gradient of two adjacent pixel points;
[0049] Combine the X component and Y component of the same pixel point to obtain the edge gradient output of the complete image, and complete the edge detection function.
[0050] In a possible design, there are two circuit implementation methods for detecting the difference in gray values of adjacent pixel points. The principle is to first convert the input different gray values into pulse sequences with different frequencies or amplitudes, and then use the response differences of resistor devices to different pulse sequences to complete the output. If the final output is zero level, it means there is no edge. If the final output is high level, it means there is an edge and the amplitude of the high level is proportional to the magnitude of the edge gradient. The difference between the two circuits lies in the operation steps. If the pulse sequences converted from the input act on the resistor devices respectively, two operations are required to complete the final output. If the pulse sequences converted from the input act on the resistor devices simultaneously, only one operation is required to complete the final output.
[0051] In a possible design, the combined use method of three difference detection circuits for adjacent pixel points' gray values: for an image with m×n resolution, three structures can be used to concurrently output the edge detection results. If each pixel point corresponds to one device, at least four parallel operations are required. If each pixel point corresponds to two devices, the fastest two parallel operations are required. If each pixel point corresponds to four devices, the fastest one parallel operation is required. After the parallel operation output is completed, the components with the same pixel point coordinates are combined to finally obtain the edge gradient information of the entire image.
[0052] In a possible design, the method further includes:
[0053] The devices in the basic edge detection unit can be resistance volatile devices or resistance non-volatile devices. For volatile devices, it is required that two input signals be applied simultaneously and the output result be read out in a timely manner.
[0054] It should be understood that for the beneficial effects obtained by the technical solutions of the third aspect to the ninth aspect and the corresponding possible implementation manners in the embodiments of the present application, reference can be made to the beneficial effects of the first aspect and its corresponding possible designs, or the second aspect and its corresponding possible designs described above, which will not be elaborated here. Brief Description of the Drawings
[0055] Figure 1 A schematic diagram of a convolution operation provided by the conventional technology;
[0056] Figure 2 A schematic structural diagram of a detection circuit provided by an embodiment of the present application;
[0057] Figure 3 Applicable to Figure 2 A schematic diagram of the electrical characteristics of a conductance device of the detection circuit shown;
[0058] Figure 4 Applicable to Figure 2 A schematic diagram of the electrical characteristics of another conductance device of the detection circuit shown;
[0059] Figure 5 A schematic diagram of the working principle of a circuit for converting a first signal and a second signal into a first conductance and a second conductance provided by an embodiment of the present application;
[0060] Figure 6a A schematic diagram of the working principle of a circuit for detecting the difference between a first conductance and a second conductance provided by an embodiment of the present application;
[0061] Figure 6b A schematic diagram of the working principle of another circuit for detecting the difference between a first conductance and a second conductance provided by an embodiment of the present application;
[0062] Figure 7 Based on Figure 2 Another schematic structural diagram of a detection circuit provided by an embodiment of the present application;
[0063] Figure 8 Based on Figure 7 Another schematic structural diagram of a detection circuit provided by an embodiment of the present application;
[0064] Figure 9 A schematic diagram of the grouping result of an image with an m×n resolution provided by an embodiment of the present application;
[0065] Figure 10This is a schematic diagram of a circuit for edge detection of the first row elements of an image to be detected according to an embodiment of the present application based on Figure 8 provided;
[0066] Figure 11 This is a schematic diagram of another circuit for edge detection of the first row elements of an image to be detected according to an embodiment of the present application based on Figure 8 provided;
[0067] Figure 12 This is a schematic diagram of a circuit for edge detection of some elements in an image to be detected according to an embodiment of the present application based on Figure 8 provided;
[0068] Figure 13 This is a schematic diagram of another detection circuit according to an embodiment of the present application;
[0069] Figure 14 This is a schematic diagram of the electrical characteristics of a conductance device applicable to the detection circuit shown in Figure 13 ;
[0070] Figure 15 This is a schematic diagram of a detection circuit according to an embodiment of the present application based on Figure 13 provided;
[0071] Figure 16 This is a schematic diagram of a circuit for edge detection of the first row elements of an image to be detected according to an embodiment of the present application based on Figure 15 provided;
[0072] Figure 17 This is a schematic diagram of another circuit for edge detection of the first row elements of an image to be detected according to an embodiment of the present application based on Figure 15 provided. Detailed implementation manners
[0073] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.
[0074] In the embodiments of the present application, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise specified, "a plurality of" means two or more.
[0075] In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "a plurality" refers to two or more. For example, a plurality of second messages refers to two or more second messages.
[0076] It should be understood that the terms used in the description of various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of various examples and the appended claims, the singular forms "a", "an", and "the" are also intended to include the plural forms unless the context clearly indicates otherwise.
[0077] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a relational term describing an association between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.
[0078] It should also be understood that in the various embodiments of this application, the magnitude of the serial numbers of the various processes does not mean the order of execution. The order of execution of each process should be determined by its function and internal logic and should not impose any limitation on the implementation process of the embodiments of this application.
[0079] It should be understood that determining B based on A does not mean determining B solely based on A. B can also be determined based on A and / or other information.
[0080] It should also be understood that the term "comprises" (also referred to as "includes", "including", "comprises", and / or "comprising") when used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups.
[0081] It should also be understood that the term "if" can be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if it is determined..." or "if [the stated condition or event] is detected" can be interpreted to mean "when it is determined..." or "in response to determining..." or "when [the stated condition or event] is detected" or "in response to detecting [the stated condition or event]".
[0082] It should be understood that the "one embodiment", "an embodiment", and "a possible implementation" mentioned throughout the specification mean that the specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in an embodiment", "a possible implementation" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner.
[0083] Hereinafter, with reference to the accompanying drawings, the technical solutions provided by the embodiments of the present application will be described:
[0084] As Figure 2 shown, it is a schematic structural diagram of a detection circuit 1 provided by an embodiment of the present application.
[0085] The detection circuit 1 includes: a first pulse sequence generator 10, a second pulse sequence generator 20, a first conductance device 30, a second conductance device 40, and a difference detection circuit 50.
[0086] The first pulse sequence generator 10 is configured to receive a first signal and generate a first pulse sequence based on the first signal.
[0087] The second pulse sequence generator 20 is configured to receive a second signal and generate a second pulse sequence based on the second signal. Wherein, the amplitudes of the first signal and the second signal are different, and the frequencies or amplitudes of the first pulse sequence and the second pulse sequence are different.
[0088] The first conductance device 30 is configured to receive the first pulse sequence and generate a first conductance.
[0089] The second conductance device 40 is configured to receive the second pulse sequence and generate a second conductance.
[0090] The first conductance device 30 and the second conductance device 40 are further configured to receive a third signal respectively.
[0091] The difference detection circuit 50 is configured to be connected to the first conductance device 30 and the second conductance device 40.
[0092] The difference detection circuit 50 is further configured to output a difference voltage when both the first conductance device 30 and the second conductance device 40 receive the third signal. The difference voltage is used to characterize the difference between the first conductance and the second conductance.
[0093] Optionally, both the first signal and the second signal are current signals or voltage signals.
[0094] The first signal and the second signal may be different based on the different application scenarios of the detection circuit 1. For example, if the detection circuit 1 is used to detect the difference between the gray values of two pixels, the first signal and the second signal may be current signals (or voltage signals) after conversion of the gray values of the two pixels respectively. Another example, if the detection circuit 1 is used to detect the difference between two characters, the first signal and the second signal may be current signals (or voltage signals) after conversion of the two characters respectively
[0095] Optionally, the hardware structures of the first pulse sequence generator 10 and the second pulse sequence generator 20 are the same, and the hardware parameters are the same
[0096] For example, the first pulse sequence generator 10 and the second pulse sequence generator 20 are pulse sequence generators of the same model. In this way, the difference in the frequency or amplitude between the first pulse sequence and the second pulse sequence caused by the hardware difference between the first pulse sequence generator 10 and the second pulse sequence generator 20 can be reduced, so that the difference between the first pulse sequence and the second pulse sequence can more accurately represent the difference between the first signal and the second signal, thus making the detection result of the detection circuit 1 more accurate
[0097] Optionally, the hardware structures of the first conductance device 30 and the second conductance device 40 are the same, and the initial hardware parameters are the same
[0098] The initial hardware parameters of the first conductance device 30 and the second conductance device 40 being the same may mean that the initial conductances of the first conductance device 30 and the second conductance device 40 are the same, or the difference between the initial conductances is within a preset range. For example, the first conductance device 30 and the second conductance device 40 are conductance devices of the same model. In this way, the difference in the first conductance and the second conductance caused by the hardware difference between the first conductance device 30 and the second conductance device 40 can be reduced, so that the difference between the first conductance and the second conductance can more accurately represent the difference between the first pulse sequence and the second pulse sequence, and further more accurately represent the difference between the first signal and the second signal, so as to make the detection result of the detection circuit 1 more accurate
[0099] Optionally, the directions of the first pulse sequence and the second pulse sequence are the same. For example, the first pulse sequence is a positive pulse sequence with respect to the first conductance device 30, and the second pulse sequence is a positive pulse sequence with respect to the second conductance device 40. Another example, the first pulse sequence is a negative pulse sequence with respect to the first conductance device 30, and the second pulse sequence is a negative pulse sequence with respect to the second conductance device 40
[0100] In this case, the positive electrodes of the first conductance device 30 and the second conductance device 40 are respectively connected to the first pulse sequence generator 10 and the second pulse sequence generator 20, and the negative electrodes are both connected to the difference detection circuit 50, such asFigure 2 As shown. Alternatively, the negative electrodes of the first conductance device 30 and the second conductance device 40 are respectively connected to the first pulse sequence generator 10 and the second pulse sequence generator 20, and the positive electrodes are both connected to the difference detection circuit 50.
[0101] Optionally, both the first pulse sequence and the second pulse sequence may include one or more pulses. Correspondingly, other pulse sequences in the following text, such as the third pulse sequence, the fourth pulse sequence, etc., may also include one or more pulses. When the pulse sequence contains one pulse, the pulse sequence is specifically a single pulse.
[0102] Optionally, the duration for which the first conductance device 30 receives the first pulse sequence is the same as the duration for which the second conductance device 40 receives the second pulse sequence. That is to say, the acting durations of the first pulse sequence and the second pulse sequence on the first conductance device 30 and the second conductance device 40 are the same.
[0103] In the detection circuit 1, the first conductance device 30 and the second conductance device 40 have the following electrical characteristics:
[0104] Optionally, the conductance of the first conductance device 30 and the second conductance device 40 changes with the number of pulses in the respective received pulse sequences.
[0105] For example, the conductance of the first conductance device 30 and the second conductance device 40 increases as the number of pulses in the respective received pulse sequences increases, such as increasing linearly.
[0106] Again, for example, the conductance of the first conductance device 30 and the second conductance device 40 decreases as the number of pulses in the respective received pulse sequences increases, such as decreasing linearly.
[0107] In some alternative implementation manners, the conductance of the first conductance device 30 and the second conductance device 40 changes with the frequency of the respective received pulse sequences. In this case, the detection circuit 1 can convert the difference between the first signal and the second signal into the difference in the frequencies of the first pulse sequence and the second pulse sequence.
[0108] For example, the conductance of the first conductance device 30 and the second conductance device 40 increases as the frequency of the respective received pulse sequences increases, such as increasing linearly.
[0109] Again, for example, the conductance of the first conductance device 30 and the second conductance device 40 decreases as the frequency of the respective received pulse sequences increases, such as decreasing linearly.
[0110] As Figure 3 shown, it is a schematic diagram of the electrical characteristics of a conductance device. Among them, Figure 3Figures a and b respectively illustrate pulse sequence a1 and pulse sequence a2. These two pulse sequences have the same pulse width and the same amplitude. However, the pulse intervals of these two pulse sequences are different, so that the frequencies of these two pulse sequences are different. Figure 3 Figure c illustrates the conductance changes of the conductance devices that respectively receive pulse sequence a1 and pulse sequence a2.
[0111] From Figure 3 it can be known that for a certain pulse sequence, the conductance of the conductance device linearly increases as the number of pulses received by the conductance device increases. For multiple pulse sequences, the conductance of the conductance device increases as the frequency of the pulse sequence received by the conductance device increases.
[0112] In some other alternative implementation manners, the conductances of the first conductance device 30 and the second conductance device 40 change with the amplitudes of the respective received pulse sequences. In this case, the detection circuit 1 can convert the difference between the first signal and the second signal into the difference between the amplitudes of the first pulse sequence and the second pulse sequence.
[0113] For example, the conductances of the first conductance device 30 and the second conductance device 40 increase as the amplitudes of the respective received pulse sequences increase, such as linearly increasing.
[0114] Another example is that the conductances of the first conductance device 30 and the second conductance device 40 decrease as the amplitudes of the respective received pulse sequences increase, such as linearly decreasing.
[0115] As Figure 4 shown, it is a schematic diagram of the electrical characteristics of a conductance device. Among them, Figure 4 Figures a and b respectively illustrate pulse sequence b1 and pulse sequence b2. These two pulse sequences have the same pulse width and the same frequency. However, the amplitudes of these two pulse sequences are different. Figure 4 Figure c illustrates the conductance changes of the conductance devices that respectively receive pulse sequence b1 and pulse sequence b2.
[0116] From Figure 4 it can be known that for a single pulse, the conductance of the conductance device increases as the amplitude of the pulse received by the conductance device increases. For a certain pulse sequence, the conductance of the conductance device linearly increases as the number of pulses received by the conductance device increases. For multiple pulse sequences, the conductance of the conductance device increases as the amplitude of the pulse sequence received by the conductance device increases.
[0117] The embodiments of the present application are directed to those having Figure 3 and / or Figure 4The specific form of the conductance device with the characteristics shown is not limited. For example, the conductance device may include: a diffusive memristor, a dynamic RRAM with weak initialization processing, or a conductive bridging RAM (CBRAM), etc. Among them, RRAM is the English abbreviation of resistive random access memory. RAM is the English abbreviation of random access memory. The conductance of these several conductance devices can all change with the frequency and amplitude of the pulse sequence received by the conductance device. However, when applied to the detection circuit 1, usually one of its characteristics is used, such as using the characteristic that its conductance changes with the frequency of the pulse sequence received by the conductance device, or using the characteristic that its conductance changes with the amplitude of the pulse sequence received by the conductance device.
[0118] Optionally, the amplitudes of the first pulse sequence and the second pulse sequence are both greater than or equal to the first threshold.
[0119] Optionally, the amplitude of the third signal is less than the first threshold.
[0120] The first threshold is the critical value of the amplitude of the signal input to the conductance device when the conductance of the conductance device can be changed. That is to say, the first pulse sequence can change the conductance of the first conductance device 30, and the second pulse sequence can change the conductance of the second conductance device 40. The third signal can neither change the conductance of the first conductance device 30 nor change the conductance of the second conductance device 40. The value of the first threshold is related to the properties of the first conductance device 30 and the second conductance device 40, etc.
[0121] Optionally, the third signal can be a voltage signal or a current signal. The embodiments of the present application do not limit the specific form of the third signal. For example, the third signal can be a wide pulse sequence (or a single pulse), that is, a pulse sequence (or a single pulse) with a pulse width greater than or equal to a certain threshold. The third signal can be predefined.
[0122] Exemplarily, the third signal can be generated by a power supply independent of the detection circuit 1 as shown in Figure 2 shown. Exemplarily, the third signal can also be generated by the first pulse sequence generator 10 and / or the second pulse sequence generator 20.
[0123] Hereinafter, the working principle of the detection circuit 1 will be described.
[0124] Step 1: Convert the difference between the first signal and the second signal into the difference in frequency / amplitude of the first pulse sequence and the second pulse sequence, and further into the difference in the first conductance and the second conductance.
[0125] To implement this process, the detection circuit 1 may further include a resistor 31 and a resistor 41, and their connection relationships with other devices in the detection circuit 1 may be as Figure 5 shown.
[0126] The implementation process of this step may also be as Figure 5 shown. Specifically: The first pulse sequence generator 10 and the second pulse sequence generator 20 respectively determine the frequency / amplitude of the generated pulse sequences (i.e., the first pulse sequence and the second pulse sequence) according to the magnitudes of the received signals (i.e., the first signal and the second signal). For example, the larger the magnitude of the received signal, the larger the frequency / amplitude of the generated pulse sequence. The first conductance device 30 and the second conductance device 40 are in the same initial state (i.e., the first initial conductance and the second initial conductance are the same). Under the action of pulse sequences with different frequencies / amplitudes, the conductances of the first conductance device 30 and the second conductance device 40 gradually change and finally stay at different conductance values (i.e., the first conductance and the second conductance).
[0127] Step 2: Detect the difference between the first conductance and the second conductance.
[0128] The implementation process of this step may be as Figure 6a shown. Specifically: Input a third signal to both the first conductance device 30 and the second conductance device 40, and combine with the difference detection circuit 50 to detect the difference between the first conductance and the second conductance.
[0129] Optionally, the third signal may be the signals respectively generated by the first pulse sequence generator 30 and the second pulse sequence generator 40. In this case, the implementation process of this step may be as Figure 6b shown.
[0130] The embodiments of the present application do not limit the specific implementation manner of the difference detection circuit 50. For example, as Figure 7 shown, the difference detection circuit 50 includes: a first resistor 501, a second resistor 502, and a second differential amplifier 503.
[0131] The first pulse sequence generator 10, the first conductance device 30, and the first resistor 501 are connected in series in sequence, and the connection point of the "first resistor 501 and the first conductance device 30" is connected to one input terminal of the second differential amplifier 503.
[0132] The second pulse sequence generator 20, the second conductance device 40, and the second resistor 502 are connected in series in sequence, and the connection point of the "second resistor 502 and the second conductance device 40" is connected to the other input terminal of the second differential amplifier 503.
[0133] The output terminal of the second differential amplifier 503 serves as the output terminal of the difference detection circuit 50.
[0134] It should be noted that when the difference detection circuit 50 is implemented through Figure 7 When combined with Figure 5 , the first resistor 501 and the resistor 31 can be reused, and the second resistor 502 and the resistor 41 can be reused. That is to say, the first resistor 501 and the second resistor 502 both play the role of voltage division and current limiting in the above first step and second step.
[0135] Optionally, the first resistor 501 and the second resistor 502 are the same. In this way, in the process of the above first step and second step, the first resistor 501 and the second resistor 502 have the same voltage division degree, which helps to make the difference between the first conductance and the second conductance more accurately represent the difference between the first pulse sequence and the second pulse sequence, and further can accurately represent the difference between the first signal and the second signal, so that the detection result of the detection circuit 1 is more accurate.
[0136] From Figure 7 It can be seen that since the first conductance and the second conductance are different, and the first resistor 501 and the second resistor 502 are the same, according to the voltage division relationship, V1 and V2 are different, and the difference voltage output by the second differential amplifier 503 represents the difference between V1 and V2.
[0137] It should be noted that when the generation conditions of the first conductance and the second conductance are the same, and the detection conditions are the same, such as the first pulse sequence generator 10 and the second pulse sequence generator 20 are pulse sequence generators of the same model, the first conductance device 30 and the second conductance device 40 are conductance devices of the same model, and the first resistor 501 and the second resistor 502 are the same: the greater the difference between the first conductance and the second conductance, the greater the difference between the first signal and the second signal.
[0138] Optionally, the first conductance device 30 and the second conductance device 40 are volatile devices. That is to say, the first conductance generated by the first conductance device 30 and the second conductance generated by the second conductance device 40 can both be maintained for a certain period of time, and when the time period arrives, they are respectively initialized to the first initial conductance and the second initial conductance. For example, volatile devices include: diffusive memristors or non-steady-state resistive switching devices with weak initialization processing, etc.
[0139] In this case, at the first moment, the first conductance device 30 receives a first pulse sequence, and the second conductance device 40 receives a second pulse sequence. At the second moment, the first conductance device 30 and the second conductance device respectively receive a third signal. The time interval between the first moment and the second moment is less than or equal to an interval threshold.
[0140] Among them, at a certain moment (such as the first moment and the second moment), it may not be an absolute moment. For example, if the time interval between two time points is less than or equal to a certain threshold, these two time points can be regarded as the same moment.
[0141] The interval threshold is determined based on the time periods during which the first conductance and the second conductance are maintained. For example, the interval threshold is less than "the minimum value of the time periods during which the first conductance and the second conductance are maintained". If the models of the first conductance device 30 and the second conductance device 40 are the same, the time periods during which the first conductance and the second conductance are maintained are the same.
[0142] It should be noted that the above "at the first moment, the first conductance device 30 receives a first pulse sequence, and the second conductance device 40 receives a second pulse sequence" can be replaced by: at the first moment, the first conductance device 30 generates a first conductance, and the second conductance device 40 generates a second conductance. Thus, a new embodiment is obtained.
[0143] Extendably, this alternative implementation can be understood as: when the first conductance device 30 and the second conductance device 40 are volatile devices, within a certain time period starting from the end moment of the process of "converting the difference between the first signal and the second signal into the difference between the first conductance and the second conductance" (or within a certain time period starting from a certain moment during this process), the process of "detecting the difference between the first conductance and the second conductance" is executed.
[0144] Optionally, the first conductance device 30 and the second conductance device 40 are non-volatile devices. That is to say, the first conductance generated by the first conductance device 30 and the second conductance generated by the second conductance device 40 do not disappear after being generated. For example, non-volatile devices include CBRAM, etc.
[0145] In this case, the first conductance device 30 is further configured to initialize the conductance of the first conductance device 30 after the difference detection circuit 50 outputs a difference voltage, that is, to initialize the first conductance to a first initial conductance. The second conductance device 40 is further configured to initialize the conductance of the second conductance device 30 after the difference detection circuit 50 outputs a difference voltage, that is, to initialize the second conductance to a second initial conductance. In this way, subsequently, the detection circuit 1 can directly be used to measure the difference between a new first signal and a new second signal.
[0146] The embodiments of the present application do not limit the specific implementation manners of initializing the conductance of the first conductance device 30 and the conductance of the second conductance device 40.
[0147] In a possible implementation manner, if the first conductance device 30 and the second conductance device 40 change with the change of the frequencies of the respective received pulse sequences, then the conductance of the first conductance device 30 and the conductance of the second conductance device 40 can be initialized in the following manner: The first conductance device 30 is further configured to receive a fourth pulse sequence, where the fourth pulse sequence has the same frequency as the first pulse sequence and the opposite direction. The second conductance device 40 is further configured to receive a fifth pulse sequence, where the fifth pulse sequence has the same frequency as the second pulse sequence and the opposite direction.
[0148] In another possible implementation manner, if the first conductance device 30 and the second conductance device 40 change with the change of the amplitudes of the respective received pulse sequences, then the conductance of the first conductance device 30 and the conductance of the second conductance device 40 can be initialized in the following manner: The first conductance device 30 is further configured to receive a sixth pulse sequence, where the sixth pulse sequence has the same amplitude as the first pulse sequence and the opposite direction. The second conductance device 40 is further configured to receive a seventh pulse sequence, where the seventh pulse sequence has the same amplitude as the second pulse sequence and the opposite direction.
[0149] The detection circuit 1 provided by the embodiments of the present application converts the difference in amplitudes between the first signal and the second signal into the difference in frequencies or amplitudes of the pulse sequences, and further converts it into the difference between the first conductance and the second conductance. In this way, by detecting the difference between the first conductance and the second conductance, the difference between the first signal and the second signal can be indirectly detected. The detection circuit 1 can be applied to the image edge detection scenario, thereby reducing the calculation steps, improving the calculation efficiency, and reducing the device power consumption.
[0150] On the one hand, since for each pixel in the image to be detected, there are at most 4 adjacent pixels, therefore, by using the detection circuit 1, at most 4 calculations are required to obtain the difference between the gray value of a pixel and the gray values of all its adjacent pixels. However, in the traditional technology, when using the convolution algorithm to calculate the difference between the gray values of adjacent pixels, the size of the convolution kernel is usually large, which will lead to more calculation steps. For example, for a 3*3 convolution kernel, for each pixel in the image to be detected, 10 operations (specifically including 9 multiplication operations and 1 summation operation) are required to obtain the difference between the gray value of the pixel and the gray values of all its adjacent pixels. Therefore, using the detection circuit 1 helps to reduce the calculation steps, thereby improving the calculation efficiency and reducing the device power consumption.
[0151] On the other hand, for the entire image to be detected, a detection circuit 1 can be designed for each pair of adjacent pixels, and some devices can be reused between different detection circuits 1, such as Figures 10 - 12 the example shown, or the devices may not be reused. These multiple detection circuits 1 can perform calculations in parallel, so as to calculate the differences between the gray values of multiple pairs of adjacent pixels simultaneously. Compared with the serial calculation method in the traditional technology, where the convolution kernel needs to be moved for each pixel, the calculation steps can be reduced, thereby improving the calculation efficiency and reducing the device power consumption.
[0152] Hereinafter, through a specific example, the application of the detection circuit 1 provided above will be described.
[0153] This example will be described by taking the detection circuit 1 provided above as an example applied to the image edge detection scenario. Since each pixel corresponds to a gray value, edge detection is to find the positions where the gray value changes drastically, that is, to distinguish the differences between the gray values of two adjacent pixels, so as to determine whether these two pixels are edge pixels.
[0154] Based on this, in this scenario, the first signal is an analog signal corresponding to the gray value of the first pixel in the image to be detected. The second signal is an analog signal corresponding to the gray value of the second pixel in the image to be detected. The first pixel and the second pixel are adjacent. For example, the first pixel and the second pixel can be two adjacent pixels in any row of the image to be detected. Another example is that they can be two adjacent pixels in any column of the image to be detected. The analog signals are all current signals or all voltage signals.
[0155] Specifically, before the detection circuit 1, a front-end sensor (not shown in the figure) can also be set, and the front-end sensor is used to convert the gray value information of two adjacent pixels in the image to be detected into a first analog signal and a second analog signal. Among them, the first analog signal and the second analog signal are both voltage signals or current signals.
[0156] In one implementation, the first analog signal and the second analog signal are directly used as the first signal and the second signal respectively, and the first signal and the second signal are input into the first pulse sequence generator 10 and the second pulse sequence generator 20 respectively.
[0157] In another implementation, an amplifier is provided between the front-end sensor and the detection circuit 1, which is used to appropriately amplify the first analog signal and the second analog signal, and then use the amplified first analog signal and the amplified second analog signal as the first signal and the second signal respectively, and input the first signal and the second signal into the first pulse sequence generator 10 and the second pulse sequence generator 20 respectively.
[0158] Such as Figure 8As shown, the above detection circuit 1 further includes a first differential amplifier 60. Figure 8 is based on Figure 7 for drawing.
[0159] One input terminal of the first differential amplifier 60 is used to receive a differential voltage.
[0160] Another input terminal of the first differential amplifier 60 is used to receive a reference voltage. Among them, the reference voltage can be the voltage critical value corresponding to the edge pixel, and specifically can be determined according to actual requirements or empirical values.
[0161] The voltage output by the first differential amplifier 60 is used to characterize the gradient between the gray values of the first pixel and the second pixel.
[0162] The gradient between the gray values of the first pixel and the second pixel refers to the derivative of the two-dimensional discrete function within the local range of the first pixel and the second pixel after regarding the gray values of each pixel in the image to be detected as the two-dimensional discrete function.
[0163] The gradient between the gray values of the first pixel and the second pixel can further characterize whether the first pixel and the second pixel are edge pixels.
[0164] When the differential voltage is greater than the reference voltage, the first differential amplifier 60 outputs a high level, and this high level is used to characterize that both the first pixel and the second pixel are edge pixels in the image to be detected. The magnitude of the voltage amplitude of this high level reflects the degree of difference between the gray values of the first pixel and the second pixel. Among them, the larger the voltage amplitude, the greater the difference between the gray values of these two pixels, that is, the greater the gradient between the gray values of these two pixels.
[0165] When the differential voltage is less than or equal to the reference voltage, the first differential amplifier 60 outputs a low level such as zero level, and this low level is used to characterize that both the first pixel and the second pixel are not edge pixels in the image to be detected.
[0166] Figure 8 The power supply voltage V of the first differential amplifier 60 is also shown DD .
[0167] Figure 8 The working principle of the shown detection circuit 1 may include:
[0168] The first step: It can refer to Figure 5 and the textual description about Figure 5 in the above text.
[0169] Step 2: Input a third signal into both the first conductance device 30 and the second conductance device 40, and input a reference voltage into the first differential amplifier 60. In combination with the differential detection circuit 50, detect the difference between the first conductance and the second conductance, and in combination with the first differential amplifier 60, detect the gradient between the gray values of the first pixel and the second pixel.
[0170] This example illustrates by taking the use of the first differential amplifier 60 to determine the gradient between the gray values of the first pixel and the second pixel. In actual implementation, it can also be determined by other devices or combinations of devices, and the embodiments of the present application do not limit this.
[0171] Figure 8 The detection circuit for detecting the gradient of adjacent pixels is schematically shown. The following describes the detection circuit for detecting the edge gradient of the image to be detected. Among them, the edge gradient of the image to be detected is generally characterized by an edge gradient image. An edge gradient image refers to a set composed of the gradients of each pair of adjacent pixels in the image to be detected.
[0172] Specifically, taking the image to be detected as an image with a resolution of m×n (that is, the image to be detected contains m rows and n columns of pixels) as an example, the principle of obtaining the edge gradient of the image to be detected is as follows:
[0173] Step 1: First, perform grouping processing on the pixels in the image with a resolution of m×n. As Figure 9 shown, it is a schematic diagram of the grouping result of an image with a resolution of m×n.
[0174] Step 2: Use the detection circuit 1 as Figure 8 shown to process the gray values of the pixels in each group, and obtain the X component and Y component of each pixel in the edge gradient image.
[0175] It should be noted that if it is required that the number of pixels in the edge gradient image is the same as the number of pixels in the image to be detected, then zeros need to be filled after the last row and the last column of the image to be detected (as Figure 9 shown by the dotted line). If there is no such requirement, directly perform edge detection processing on the image to be detected, and finally obtain an edge gradient image with a resolution of (m - 1)×(n - 1).
[0176] Taking the number of pixels in the generated edge gradient image being the same as the number of pixels in the image to be detected as an example, the pixels in the first row of the image to be detected can be divided into two groups, namely the circle - marked group and the square - marked group. Among them, the circle - marked group, after being processed by the detection circuit 1, obtains X (1,1) 、X (1,3) …X (1,n-1) , which respectively correspond to the pixels (1,1), (1,3)…(1,n - 1) in the edge gradient image. The square - marked group, after being processed by the detection circuit 1, obtains X (1,2) 、X(1,4) …X (1,n) correspond to the pixels (1, 2), (1, 4)…(1, n) in the edge gradient image respectively. Similarly, similar outputs can be obtained for other rows through grouped operations.
[0177] Furthermore, the first column of the image to be detected is divided into a triangular mark group and a diamond mark group. After being processed by the detection circuit 1, these two groups respectively obtain "Y (1,1) 、Y (3,1) …Y (m-1,1) " and "Y (2,1) 、Y (4,1) …Y (m,1) ", which correspond to the pixels "(1, 1), (3, 3)…(m - 1, 1)" and "(2, 1), (4, 1)…(m, 1)" in the edge gradient image respectively. Similarly, similar outputs can be obtained for other columns through grouping.
[0178] Step 3: After obtaining the outputs of all rows and all columns of the image to be detected processed by the detection circuit 1, and synthesizing the X and Y with the same coordinates, the gradient of adjacent pixels corresponding to the coordinates in the image to be detected can be obtained. The gradients of all adjacent pixels in the image to be detected constitute the edge gradient map of the image to be detected.
[0179] The above process can be summarized as: grouping and processing the pixels (a, b) and (a, b + 1) in the image to be detected to obtain X (a,b) , that is, the X component of the pixel (a, b) in the edge gradient image. Grouping and processing the pixels (a, b) and (a + 1, b) in the image to be detected to obtain Y (a,b) , that is, the Y component of the pixel (a, b) in the edge gradient image. Finally, synthesize the X component and the Y component of the same pixel (such as through the formula sqrt(X 2 +Y 2 ) for synthesis) to obtain the pixel (a, b) in the edge gradient image.
[0180] Using the technical solutions provided in the above first step to the third step to obtain the edge gradient map, obtaining the edge gradient components in the X and Y directions and then synthesizing them can effectively filter out small gray value differences and make the edge gradient of the image to be detected sharper.
[0181] In terms of circuit implementation, the circuit for obtaining the edge gradient of the image to be detected may include: a plurality of detection circuits, and one pixel pair in the image to be detected corresponds to one detection circuit. For example, the detection circuit may be the one shown in Figure 8 . The pixel pair includes two adjacent pixels in the same row of the image to be detected, or two adjacent pixels in the same column of the image to be detected.
[0182] The following describes several specific implementation manners of the circuit for obtaining the edge gradient of the image to be detected provided by the embodiments of the present application:
[0183] Method 1: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. Among them, both the first pixel pair and the second pixel pair contain the same pixel. The first detection circuit and the second detection circuit share the same branch. This branch includes the first pulse sequence generator 10 and the first conductance device 30, or this branch includes the second pulse sequence generator 20 and the second conductance device 40.
[0184] For example, both the first detection circuit and the second detection circuit are the detection circuit 1 as Figure 8 shown.
[0185] As Figure 10 shown, it is a schematic structural diagram of the circuit for performing edge detection on the first row elements of the image to be detected. Figure 10 Taking "detecting the gradients of adjacent pixels in pixels (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6) in the first row elements of the image to be detected" as an example for description. Figure 10 The circuit shown includes sequence generators S1 - S6, conductance devices D1 - D6, resistors R1 - R6, differential amplifiers A1 - A5, B1 - B5, and 4 multiplexers (MUX).
[0186] Referring to Figure 10 , in an example, pixel (1, 1) and pixel (1, 2) form the first pixel pair, and pixel (1, 2) and pixel (1, 3) form the second pixel pair. The first detection circuit includes: S1, S2, D1, D2, R1, R2, A1, and B1, for obtaining X (1,1) . The second detection circuit includes: S2, S3, D2, D3, R2, R3, A2, and B2, for obtaining X (1,2) . The first detection circuit and the second detection circuit share a branch through the device MUX. This branch includes: S2, D2, and R2. MUX makes one of the first detection circuit and the second detection circuit conduct at the same moment.
[0187] Other examples are similar to this, and will not be elaborated here one by one.
[0188] Based on Figure 10 , the process of performing edge detection can be divided into two steps: The first step is to generate X (1,1) , X (1,3) , and X (1,5) . The second step is to generate X (1,2) and X (1,4)Among them, each MUX connects different lines in two steps of operation.
[0189] If each row of the image to be detected adopts such a circuit structure, all rows of the image to be detected can be operated in parallel groups, that is, the edge detection operations in all row directions are completed in two steps, and the X components of the gradients of all adjacent pixels are generated. Similarly, in the column direction, such operations can be performed using MUX, and the Y components of the gradients of all adjacent pixels are generated in two steps. In this case, a total of four steps of parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected.
[0190] If the row-by-row and column-by-column processing method is adopted, the detection circuit with the row and column scale can be reused, and a total of 2*(m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected.
[0191] Method 2: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. Among them, both the first pixel pair and the second pixel pair contain the same pixel. The first detection circuit and the second detection circuit share the pulse sequence generator corresponding to the same pixel.
[0192] For example, both the first detection circuit and the second detection circuit are the detection circuit 1 as Figure 8 shown.
[0193] As Figure 11 shown, it is a schematic structural diagram of the circuit for edge detection of the first row elements of the image to be detected. Figure 11 Taking "detecting the gradients of adjacent pixels in pixels (1,1), (1,2), (1,3), (1,4), (1,5), (1,6) in the first row elements of the image to be detected" as an example for illustration. Figure 11 The circuit shown includes sequence generators S1 - S6, conductance devices D1 - D10, resistors R1 - R10, and differential amplifiers A1 - A5, B1 - B5.
[0194] Referring to Figure 11 , in one example, pixel (1,1) and pixel (1,2) form the first pixel pair, and pixel (1,2) and pixel (1,3) form the second pixel pair. Both of these 2 pixel pairs contain pixel (1,2). The first detection circuit includes: S1, S2, D1, D2, R1, R2, A1, and B1, which are used to obtain X (1,1) . The second detection circuit includes: S2, S3, D3, D4, R3, R4, A2, and B2, which are used to obtain X (1,2) . The first detection circuit and the second detection circuit share the pulse sequence generator corresponding to pixel (1,2), that is, pulse sequence generator S2. Other examples are similar, and will not be elaborated here one by one.
[0195] Based on Figure 11 , when performing edge detection, X can be generated in one step (1,1) , X (1,2) , X (1,3) , X (1,4) and X (1,5) .
[0196] If each row of the image to be detected adopts this circuit structure, all rows of the image to be detected can be operated in parallel groups, that is, the edge detection operation in all row directions can be completed in one step, generating the X component representing the gradient of all adjacent pixels. Similarly, such an operation can be performed in the column direction, generating the Y component representing the gradient of all adjacent pixels in one step. In this case, a total of two parallel operations can complete the calculation of the gradients of all adjacent pixels in the image to be detected.
[0197] If the row-by-row and column-by-column processing method is adopted, the detection circuit with the row and column scale can be reused, and a total of (m + n) operations are required to complete the calculation of the gradients of all adjacent pixels in the image to be detected.
[0198] Compared with the above method 1, this method 2 can further reduce the number of operations. Since when using the detection circuit shown in Figure 10 or Figure 11 to calculate the gradients of all adjacent pixels in the image to be detected, the time is mainly consumed in the switching process of different operations. Therefore, compared with the above method 1, this method 2 can save calculation time.
[0199] Method 3: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. The third pixel pair in the image to be detected corresponds to the third detection circuit. The fourth pixel pair in the image to be detected corresponds to the fourth detection circuit. Among them, the first pixel pair, the second pixel pair, the third pixel pair and the fourth pixel pair all contain the same pixel. The first detection circuit, the second detection circuit, the third detection circuit and the fourth detection circuit share the pulse sequence generator corresponding to the same pixel.
[0200] For example, the first detection circuit, the second detection circuit, the third detection circuit and the fourth detection circuit are all the detection circuit 1 as shown in Figure 8 .
[0201] As shown in Figure 12 , it is a schematic structural diagram of the circuit for edge detection of some elements in the image to be detected. For the simplicity of the drawings, Figure 12 the resistors and differential amplifiers in the detection circuit are not shown in the figure.
[0202] Based on Figure 12, for pixel (2, 2), in the row direction, it is adjacent to pixel (2, 1) and pixel (2, 3) respectively; in the column direction, it is adjacent to pixel (1, 2) and pixel (3, 2) respectively.
[0203] That is to say, pixel (2, 2) and pixel (2, 1) form the first pixel pair, pixel (2, 2) and pixel (2, 3) form the second pixel pair, pixel (2, 2) and pixel (1, 2) form the third pixel pair, and pixel (2, 2) and pixel (3, 2) form the fourth pixel pair. These 4 pixel pairs all contain pixel (2, 2).
[0204] The first detection circuit includes: S1, D1, S2, and D2, and is used to obtain X (2,1) .
[0205] The second detection circuit includes: S2, D3, S3, and D6, and is used to obtain X (2,2) .
[0206] The third detection circuit includes: S2, D4, S4, and D7, and is used to obtain Y (1,2) .
[0207] The fourth detection circuit includes: S2, D5, S5, and D8, and is used to obtain Y (2,2) .
[0208] These 4 detection circuits share the pulse sequence generator corresponding to pixel (2, 2), that is, pulse sequence generator S2.
[0209] Other examples are similar to this, and will not be elaborated one by one here.
[0210] Figure 12 The circuit shown can be summarized as: for each pixel, four resistor devices are used to form detection circuits with the four adjacent units above, below, left, and right respectively. In this way, all rows and all columns of the image to be detected can be operated in parallel groups, that is, the edge detection operations of all elements are completed in one step, generating the X component representing the gradients of all adjacent pixels and the Y component representing the gradients of all adjacent pixels.
[0211] Compared with the above method 1 and method 2, this method 3 can further reduce the number of operations, thereby saving calculation time.
[0212] Next, through another specific example, the application of the detection circuit 1 provided above will be described.
[0213] This example is described by taking the application of the detection circuit 1 in the string difference detection scenario as an example. Specifically, two characters to be detected for differences in two strings are used as a character pair. For each character pair, the two characters in the character pair are respectively converted into a first signal and a second signal, and the first signal and the second signal are respectively input intoFigure 2 or Figure 7 or Figure 8 In the detection circuit 1 shown, the differential voltage obtained by the detection circuit 1 represents the difference between the two characters in the character pair. It should be noted that since the parameters of different branches in the detection circuit are not completely consistent, the output of the detection circuit may be very small but non-zero. At this time, an isolation for small-signal interference judgment can be implemented based on Figure 8 the first differential amplifier 60 in
[0214] It can be understood that the image edge detection scenario can be considered as detecting the difference between two-dimensional information. The string difference detection scenario can be considered as detecting the difference between one-dimensional information. Therefore, the circuit for detecting the difference between two strings as a whole can refer to Figure 10 or Figure 11 the circuit shown.
[0215] Of course, the above Figure 2 or Figure 7 The detection circuit 1 shown can also be applied to other difference detection scenarios. Extensibly, for any two parameters that can be converted into analog signals (such as voltage signals and current signals), the difference detection can be performed based on the above Figure 2 or Figure 7 detection circuit 1 shown.
[0216] For example, Figure 13 shown is a schematic structural diagram of a detection circuit 2 provided by an embodiment of the present application.
[0217] The detection circuit 2 includes: a first pulse sequence generator 10, a second pulse sequence generator 20, a first conductance device 30, a second conductance device 40, and a difference detection circuit 50.
[0218] The first pulse sequence generator 10 is configured to receive a first signal and generate a first pulse sequence based on the first signal.
[0219] The second pulse sequence generator 20 is configured to receive a second signal and generate a second pulse sequence based on the second signal; wherein, the amplitudes of the first signal and the second signal are different, and the frequencies of the first pulse sequence and the second pulse sequence are different.
[0220] The first conductance device 30 is configured to receive the first pulse sequence and the second pulse sequence and generate a first conductance.
[0221] The second conductance device 40 is configured to receive the first pulse sequence and the second pulse sequence and generate a second conductance.
[0222] The first resistor 70 and the second resistor 80. The first conductance device 30, the first resistor 70, the second resistor 80, and the second conductance device 40 are connected in series in sequence, and the connection point between the first resistor 70 and the second resistor 80 serves as the output terminal of the detection circuit 2.
[0223] The output terminal of the detection circuit 2 is used to output a differential voltage. This differential voltage is used to characterize the difference between the first conductance and the second conductance.
[0224] Without conflict, the descriptions of the relevant content in the detection circuit 2 provided in the embodiments of this application can all refer to the descriptions of the detection circuit 1 above. For example, both the first signal and the second signal are current signals or voltage signals. For example, the hardware structures of the first conductance device 30 and the second conductance device 40 are the same, and the initial hardware parameters are the same. For example, the hardware structures of the first conductance device 30 and the second conductance device 40 are the same, and the initial hardware parameters are the same. For example, the amplitudes of the first pulse sequence and the second pulse sequence are both greater than or equal to the first threshold.
[0225] Next, some characteristics unique to the detection circuit 2 compared to the detection circuit 1 will be described.
[0226] Optionally, the directions of the first pulse sequence and the second pulse sequence are opposite.
[0227] For example, the first pulse sequence is a positive pulse sequence with respect to the first conductance device, and the second pulse sequence is a negative pulse sequence with respect to the first conductance device. At the same time, the first pulse sequence is a negative pulse sequence with respect to the second conductance device, and the second pulse sequence is a positive pulse sequence with respect to the second conductance device.
[0228] Another example is that the first pulse sequence is a negative pulse sequence with respect to the first conductance device, and the second pulse sequence is a positive pulse sequence with respect to the first conductance device. At the same time, the first pulse sequence is a positive pulse sequence with respect to the second conductance device, and the second pulse sequence is a negative pulse sequence with respect to the second conductance device.
[0229] Optionally, the amplitudes of the positive pulse sequence and the negative pulse sequence are equal.
[0230] In the detection circuit 2, the first conductance device 30 and the second conductance device 40 have the following electrical characteristics:
[0231] Optionally, the conductances of the first conductance device 30 and the second conductance device 40 change in opposite directions under the action of the positive pulse sequence and the negative pulse sequence.
[0232] For example, the conductances of the first conductance device 30 and the second conductance device 40 increase as the number of pulses in the positive pulse sequence they receive increases, and decrease as the number of pulses in the negative pulse sequence they receive increases.
[0233] Optionally, when the number of pulses in the positive and negative pulse sequences is the same, under the action of the positive and negative pulse sequences, the conductances of the first conductance device 30 and the second conductance device 40 are symmetric.
[0234] As Figure 14 shown, it is a schematic diagram of the electrical characteristics of a conductance device. Among them, Figure 14 Figure a shows a positive pulse sequence and a negative pulse sequence, and the pulse widths, amplitudes, and frequencies of these two pulse sequences are the same. Figure 14 Figure b shows that the conductance of the conductance device increases linearly with the increase in the number of positive pulse sequences received by the conductance device, and decreases linearly with the increase in the number of negative pulse sequences received by the conductance device.
[0235] Optionally, the conductances of the first conductance device 30 and the second conductance device 40 change with the frequencies of the pulse sequences received by them respectively.
[0236] Further optionally, the conductances of the first conductance device 30 and the second conductance device 40 increase with the increase in the frequencies of the positive pulse sequences received by them respectively, and decrease with the increase in the frequencies of the negative pulse sequences received by them respectively.
[0237] The embodiments of the present application do not limit the specific form of the conductance device having the Figure 14 characteristics shown. For example, the conductance device may include: a diffusive memristor, a non-steady-state resistive switching device with weak initialization processing, or a CBRAM, etc.
[0238] The first resistor 70 and the second resistor 80 are current-limiting resistors, and their function is to reduce the static power consumption and ensure the normal operation of the circuit.
[0239] Optionally, the first resistor 70 is the same as the second resistor 80. In this way, the voltage division degrees of the first resistor 70 and the second resistor 80 are the same, so that the difference between the first conductance and the second conductance can more accurately reflect the difference between the first signal and the second signal, and thus the detection result of the detection circuit 2 is more accurate.
[0240] The following describes Figure 13 the working principle of the detection circuit 2 shown:
[0241] When a first signal and a second signal are respectively input into the first pulse sequence generator 10 and the second pulse sequence generator 20, the first pulse sequence generator 10 and the second pulse sequence generator 20 respectively generate a group of pulse sequences with equal amplitude, equal pulse width but opposite directions. The first conductance device 30 and the second conductance device 40 are in the same initial state (same initial conductance). Since the first conductance device 30 and the second conductance device 40 are connected back-to-back (such as the negative electrodes being connected), if the first pulse sequence causes the conductance of the first conductance device 30 to gradually increase, then the first pulse sequence will cause the conductance of the second conductance device 40 to gradually decrease; at the same time, the second pulse sequence will cause the conductance of the first conductance device 30 to gradually decrease and the conductance of the second conductance device 40 to gradually increase. There is a competitive relationship between the first pulse sequence and the second pulse sequence.
[0242] If the frequency of the first pulse sequence is relatively high, then within a certain period of time, the increase in the conductance of the first conductance device 30 is greater than the decrease, and overall it shows an increase in conductance. Similarly, the second conductance device 40 overall shows a decrease in conductance.
[0243] When the conductances of the first conductance device 30 and the second conductance device 40 change, the differential voltage Vout output at the connection point between the first resistor 70 and the second resistor 80 changes. For the first signal, Vout = G1 / (G1 + G2) * V1, and for the second signal, Vout = G2 / (G1 + G2) * V2. Here, G1 is the sum of the first conductance and the conductance corresponding to the first resistor 70. G2 is the sum of the second conductance and the conductance corresponding to the second resistor 80.
[0244] It should be noted that by comparing the detection circuit 1 and the detection circuit 2: The detection circuit 1 completes the detection of the difference between the first signal and the second signal by inputting signals twice (that is, first inputting the first signal and the second signal, and then inputting the third signal). The detection circuit 2 can complete the detection of the difference between the first signal and the second signal by inputting signals once (that is, inputting the first signal and the second signal simultaneously).
[0245] Optionally, the first conductance device 30 and the second conductance device 40 are volatile devices. At the same moment, the first conductance device 30 receives the first pulse sequence, and the second conductance device 40 receives the second pulse sequence.
[0246] Optionally, the first conductance device 30 and the second conductance device 40 are non-volatile devices. The first conductance device 30 is also used to initialize the conductance of the first conductance device 30 after the detection circuit 2 outputs the differential voltage. The second conductance device 40 is also used to initialize the conductance of the second conductance device 40 after the detection circuit 2 outputs the differential voltage. The relevant description of the initialization process can be obtained by referring to the above text and will not be elaborated here.
[0247] The detection circuit 2 provided by the embodiment of the present application converts the difference in the amplitudes of the first signal and the second signal into the difference in the frequencies of the pulse sequences, and further converts it into the difference between the first conductance and the second conductance. In this way, by detecting the difference between the first conductance and the second conductance, the difference between the first signal and the second signal can be indirectly detected. This detection circuit can be applied to the image edge detection scenario, thereby reducing the calculation steps, improving the calculation efficiency, and reducing the device power consumption. The specific analysis process can refer to the analysis process of the beneficial effects of the detection circuit 1 above, which will not be elaborated here.
[0248] Next, through a specific example, the application of the detection circuit 2 provided above will be described.
[0249] This example will be described by taking the detection circuit 2 provided above as an example applied to the image edge detection scenario. Based on this, in this scenario, the first signal is an analog signal corresponding to the gray value of the first pixel in the image to be detected. The second signal is an analog signal corresponding to the gray value of the second pixel in the image to be detected. The first pixel and the second pixel are adjacent.
[0250] As Figure 15 shown, the detection circuit 2 may further include a first differential amplifier 60. The first differential amplifier 60 here has the same function as the first differential amplifier 60 in the above detection circuit 1, so the relevant description can refer to the above, such as referring to the description of the detection circuit 1 as Figure 8 shown above, which will not be elaborated here.
[0251] In terms of circuit implementation, the circuit for obtaining the edge gradient of the image to be detected may include: a plurality of detection circuits, and one pixel pair in the image to be detected corresponds to one detection circuit. For example, this detection circuit may be Figure 15 the detection circuit 2 provided.
[0252] Next, several specific ways of the circuit for obtaining the edge gradient of the image to be detected provided by the embodiment of the present application will be described:
[0253] Method 1: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. Among them, both the first pixel pair and the second pixel pair include the same pixel. The first detection circuit and the second detection circuit share the same branch. This branch includes a first pulse sequence generator 10 and a first conductance device 30, or this branch includes a second pulse sequence generator 20 and a second conductance device 40.
[0254] For example, both the first detection circuit and the second detection circuit are Figure 15 the detection circuit 2 as
[0255] AsFigure 16 As shown, it is a schematic structural diagram of a circuit for edge detection of the first row elements of the image to be detected. Figure 16 For the relevant content description and beneficial effects in the embodiments shown, reference can be made to the Figure 10 description and beneficial effects of the relevant content in the embodiments shown, which will not be elaborated here.
[0256] Method 2: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. Among them, both the first pixel pair and the second pixel pair contain the same pixel. The first detection circuit and the second detection circuit share the pulse sequence generator corresponding to the same pixel.
[0257] For example, both the first detection circuit and the second detection circuit are the Figure 15 detection circuit 2 as shown.
[0258] As Figure 17 shown, it is a schematic structural diagram of a circuit for edge detection of the first row elements of the image to be detected. Figure 17 For the relevant content description and beneficial effects in the embodiments shown, reference can be made to the Figure 11 description and beneficial effects of the relevant content in the embodiments shown, which will not be elaborated here.
[0259] Method 3: The first pixel pair in the image to be detected corresponds to the first detection circuit. The second pixel pair in the image to be detected corresponds to the second detection circuit. The third pixel pair in the image to be detected corresponds to the third detection circuit. The fourth pixel pair in the image to be detected corresponds to the fourth detection circuit. Among them, the first pixel pair, the second pixel pair, the third pixel pair, and the fourth pixel pair all contain the same pixel. The first detection circuit, the second detection circuit, the third detection circuit, and the fourth detection circuit share the pulse sequence generator corresponding to the same pixel.
[0260] The circuit for obtaining the edge gradient of the image to be detected in this method can be referred to Figure 12 to obtain, and its relevant content description and beneficial effects can all be referred to the Figure 12 description and beneficial effects of the relevant content in the embodiments shown, which will not be elaborated here.
[0261] It should be noted that the detection circuit 2 can also be applied to the scenario of string difference detection. The relevant description can be referred to the relevant description of the detection circuit 1 applied to the scenario of string difference detection above. Of course, the detection circuit 2 can also be applied to other difference detection scenarios. Extendable, for any two parameters that can be converted into analog signals (such as voltage signals and current signals), difference detection can be performed based on any of the above detection circuit 2.
[0262] Based on the detection circuit provided in the embodiments of the present application, the embodiments of the present application further provide a chip, which includes any one of the above-provided detection circuits.
[0263] Correspondingly, the embodiments of the present application further provide an electronic device, which includes any one of the above-provided chips. Correspondingly, the electronic device provided by the present application includes a printed circuit board (PCB), and the chip can be located on the PCB of the electronic device.
[0264] Correspondingly, in another implementation, the embodiments of the present application further provide an electronic device, which includes any one of the above-provided detection circuits. The electronic device provided by the present application includes a PCB, and the chip can be located on the PCB of the electronic device.
[0265] The embodiments of the present application do not limit the specific form of the electronic device. For example, it can be any electronic device such as a camera, an image recognition device, an industrial detection device, a mobile phone, a computer, etc.
[0266] Correspondingly, the embodiments of the present application provide an image processing method, and the method includes:
[0267] Construct a detection circuit for the gray value difference between adjacent pixel points, perform gray value difference detection on the complete image by grouping in the X and Y directions, and obtain the X component and Y component of the edge gradient of two adjacent pixel points;
[0268] Synthesize the X component and Y component of the same pixel point, and the edge gradient output of the complete image can be obtained to complete the edge detection function.
[0269] In a possible design, there are two circuit implementation methods for the gray value difference detection between adjacent pixel points. The principle is to first convert the input different gray values into pulse sequences with different frequencies or amplitudes, and then use the response differences of resistor devices to different pulse sequences to complete the output. If the final output is zero level, it means there is no edge. If the final output is high level, it means there is an edge and the amplitude of the high level is proportional to the magnitude of the edge gradient. The difference between the two circuits lies in the operation steps. If the pulse sequences converted from the input act on the resistor device respectively, two operations are required to complete the final output. If the pulse sequences converted from the input act on the resistor device simultaneously, only one operation is required to complete the final output.
[0270] In a possible design, a method for combining the use of a circuit for detecting the difference in gray values of three adjacent pixel points: For an image with an m×n resolution, three structures can be used to concurrently output the edge detection results. If each pixel point corresponds to one device, at least four parallel operations are required; if each pixel point corresponds to two devices, the fastest two parallel operations can be achieved; if each pixel point corresponds to four devices, the fastest one parallel operation can be achieved. After the parallel operation output is completed, the components with the same pixel point coordinates are synthesized to finally obtain the edge gradient information of the entire image.
[0271] In a possible design, the method further includes:
[0272] The device in the basic edge detection unit can be a resistance volatile device or a resistance non-volatile device. For a volatile device, it is required that two input signals be applied simultaneously and the output result be read out in a timely manner.
[0273] Correspondingly, the embodiments of the present application provide an image processing device and a corresponding electronic device. In one implementation, the image processing device includes corresponding units for implementing the above image processing method. In another implementation, the image processing device includes corresponding circuits for implementing the above image processing method. The corresponding electronic device includes the above image processing device.
[0274] Descriptions of the beneficial effects of the chip, the electronic device, and the method for applying the detection circuit can all refer to the descriptions of the beneficial effects of the corresponding detection circuit above, and will not be repeated here.
[0275] The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any change or replacement within the technical scope disclosed in the present application should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A detection circuit, characterized in that, Comprising: A first pulse sequence generator, configured to receive a first signal and generate a first pulse sequence based on the first signal; A second pulse sequence generator, configured to receive a second signal and generate a second pulse sequence based on the second signal; the amplitudes of the first signal and the second signal are different, and the frequencies of the first pulse sequence and the second pulse sequence are different; A first conductance device, configured to receive the first pulse sequence and the second pulse sequence and generate a first conductance; A second conductance device, configured to receive the first pulse sequence and the second pulse sequence and generate a second conductance; A first resistor and a second resistor; wherein, the first conductance device, the first resistor, the second resistor, and the second conductance device are connected in series in sequence, and the connection point between the first resistor and the second resistor serves as the output terminal of the detection circuit; The output terminal of the detection circuit is configured to output a differential voltage; the differential voltage is used to characterize the difference between the first conductance and the second conductance.
2. The detection circuit according to claim 1, wherein The conductances of the first conductance device and the second conductance device change with the change of the frequencies of the respective received pulse sequences.
3. The detection circuit according to claim 2, wherein The conductances of the first conductance device and the second conductance device increase with the increase of the frequencies of the respective received positive pulse sequences and decrease with the increase of the frequencies of the respective received negative pulse sequences.
4. The detection circuit according to any one of claims 1 to 3, characterized in that, The conductances of the first conductance device and the second conductance device increase with the increase of the number of pulses in the respective received positive pulse sequences and decrease with the increase of the number of pulses in the respective received negative pulse sequences.
5. A detection circuit, characterized in that, Comprising: A first pulse sequence generator, configured to receive a first signal and generate a first pulse sequence based on the first signal; A second pulse sequence generator, configured to receive a second signal and generate a second pulse sequence based on the second signal; wherein, the amplitudes of the first signal and the second signal are different, and the frequencies or amplitudes of the first pulse sequence and the second pulse sequence are different; A first conductance device, connected to the first pulse sequence generator, configured to receive the first pulse sequence and generate a first conductance according to the first pulse sequence; A second conductance device, connected to the second pulse sequence generator, configured to receive the second pulse sequence and generate a second conductance according to the second pulse sequence; A differential detection circuit, configured to be connected to the first conductance device and the second conductance device, and output a differential voltage when both the first conductance device and the second conductance device receive a third signal, the differential voltage being used to characterize the difference between the first conductance and the second conductance.
6. The detection circuit according to claim 5, wherein The conductances of the first conductance device and the second conductance device change with the change of the frequencies or amplitudes of the respective received pulse sequences.
7. The detection circuit according to claim 6, characterized in that, The conductances of the first conductance device and the second conductance device increase with the increase of the frequencies of the respective received pulse sequences.
8. The detection circuit according to claim 6, characterized in that, The conductances of the first conductance device and the second conductance device increase with the increase of the amplitudes of the respective received pulse sequences.
9. The detection circuit according to any one of claims 5 to 8, characterized in that, The conductances of the first conductance device and the second conductance device increase with the increase of the number of pulses in the respective received pulse sequences.
10. The detection circuit according to any one of claims 5 to 9, characterized in that, The first conductance device and the second conductance device are volatile devices; At a first moment, the first conductance device receives the first pulse sequence, and the second conductance device receives the second pulse sequence; At a second moment, the first conductance device and the second conductance device respectively receive the third signal; The time interval between the first moment and the second moment is less than or equal to an interval threshold.
11. The detection circuit according to any one of claims 5 to 9, characterized in that, The first conductance device and the second conductance device are non-volatile devices; The first conductance device is further configured to initialize the conductance of the first conductance device after the difference detection circuit outputs the difference voltage; The second conductance device is further configured to initialize the conductance of the second conductance device after the difference detection circuit outputs the difference voltage.
12. The detection circuit according to any one of claims 5 to 11, wherein Both the first signal and the second signal are current signals or voltage signals.
13. The detection circuit according to any one of claims 5 to 12, wherein The amplitudes of the first pulse sequence and the second pulse sequence are both greater than or equal to a first threshold; The amplitude of the third signal is less than the first threshold.
14. The detection circuit according to any one of claims 5 to 13, wherein The first signal is an analog signal corresponding to the gray value of a first pixel in the image to be detected; The second signal is an analog signal corresponding to the gray value of a second pixel in the image to be detected; wherein, the first pixel and the second pixel are adjacent.
15. The detection circuit according to claim 14, wherein The detection circuit further includes: A first differential amplifier; One input terminal of the first differential amplifier is configured to receive the difference voltage; The other input terminal of the first differential amplifier is configured to receive a reference voltage; The voltage output by the first differential amplifier is used to characterize the gradient between the gray values of the first pixel and the second pixel.
16. The detection circuit according to claim 14 or 15, wherein One pixel pair in the image to be detected corresponds to one such detection circuit; Wherein, the pixel pair includes two adjacent pixels in the same row of the image to be detected, or two adjacent pixels in the same column of the image to be detected.
17. The detection circuit according to claim 16, wherein The first pixel pair in the image to be detected corresponds to a first detection circuit; The second pixel pair in the image to be detected corresponds to a second detection circuit; Wherein, both the first pixel pair and the second pixel pair include the same pixel; the first detection circuit and the second detection circuit share the same branch, and the branch includes the first pulse sequence generator and the first conductance device, or the branch includes the second pulse sequence generator and the second conductance device.
18. The detection circuit according to claim 16, wherein The first pixel pair in the image to be detected corresponds to a first detection circuit; The second pixel pair in the image to be detected corresponds to a second detection circuit; Among them, the first pixel pair and the second pixel pair both include the same pixel; the first detection circuit and the second detection circuit share the pulse sequence generator corresponding to the same pixel.
19. The detection circuit according to claim 18, wherein the third pixel pair in the image to be detected corresponds to a third detection circuit; the fourth pixel pair in the image to be detected corresponds to a fourth detection circuit; Among them, the third pixel pair and the fourth pixel pair both include the same pixel; the third detection circuit and the fourth detection circuit share the pulse sequence generator corresponding to the same pixel.
20. The detection circuit according to any one of claims 5 to 19, characterized in that, The difference detection circuit includes: a first resistor, a second resistor, and a second differential amplifier; The first pulse sequence generator, the first conductance device, and the first resistor are connected in series in sequence, and the connection point of the first resistor and the first conductance device is connected to one input end of the second differential amplifier; The second pulse sequence generator, the second conductance device, and the second resistor are connected in series in sequence, and the connection point of the second resistor and the second conductance device is connected to the other input end of the second differential amplifier; The output end of the second differential amplifier serves as the output end of the difference detection circuit.
21. A chip, characterized in that, The chip includes the detection circuit according to any one of claims 1 to 4.
22. A chip, characterized in that, The chip includes the detection circuit according to any one of claims 5 to 20.
23. An electronic device, characterized in that, The electronic device includes the chip according to claim 21.
24. An electronic device, characterized in that, The electronic device includes the chip according to claim 22.
25. An electronic device, characterized in that, The electronic device includes the detection circuit according to any one of claims 1 to 4.
26. An electronic device, characterized in that, The electronic device includes the detection circuit according to any one of claims 5 to 20.