High-efficiency SOBEL operator edge detection circuit
By implementing parallel operation and data transposition of horizontal and vertical convolution factors in the SOBEL operator edge detection circuit, a multi-stage pipeline structure is constructed, which solves the problems of low efficiency and low data multiplexing in the existing circuit, and improves the operation Efficiency and data multiplexing.
Patent Information
- Application Number
- CN202411023117.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-12
AI Technical Summary
The existing SOBEL operator edge detection circuit has low efficiency and power consumption overhead problems caused by data reuse in horizontal and vertical convolution factor operations, resulting in low computing efficiency and data multiplexing rate.
A high-efficiency SOBEL operator edge detection circuit is designed to realize parallel operation of horizontal and vertical convolution factors through the data scheduling module, and data transpose and rearrange data using the control module to build a multi-stage pipeline structure to support data pulsation input. and parallel processing to reduce repeated data scheduling.
It improves data processing efficiency and data multiplexing rate, reduces power consumption overhead, realizes efficient parallel computing of horizontal and vertical convolution factors, and solves the problem of inefficiency in traditional circuits.
Smart Images

Figure CN118941589A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of collaborative guidance, and in particular to a reinforcement learning collaborative guidance law for tracking a maneuvering target. Background Art
[0002] The demand for digital image processing in daily life is increasing, and it is widely used in transportation, geography, biomedicine, aerospace and other fields. Among the many image processing technologies, edge detection technology is a very important step in the image preprocessing process. It can detect and extract relatively rich image information at the edge of the image. It plays an important role in the aerospace field. It can extract the edges of targets and features such as buildings, boundaries, and border lines in satellite images, which helps subsequent analysis and processing, and is of great significance in satellite image processing.
[0003] As researchers continue to deepen their understanding of image edge detection technology, my country has also developed rapidly in related fields, and a variety of edge detection technologies have emerged one after another. From the perspective of research trends, conducting research on edge detection algorithms and implementing hardware platform deployment is a research trend in recent years. According to existing research results, image edge detection methods can be mainly divided into two categories: one is the traditional edge detection method, and the other is the edge detection method based on neural networks. In traditional edge detection methods, the gradient edge detection operators based on first-order differential operations mainly include Roberts operators, Prewitt operators, and Sobel operators. The principle is to use the detection operator to scan the image, obtain the first-order differential function of each pixel, and determine the location of the edge point by calculating its maximum and minimum values; the edge detection operators based on second-order differential operators mainly include Laplace operators, Canny operators, etc. The principle is to perform edge detection by searching for the second-order differential zero crossing points in the image. Among the edge detection methods based on neural networks, there are edge detection algorithms based on U2-net, etc. The principle is to identify edge features in the image through training and learning, and use convolution operations and other features to process and judge new images pixel by pixel. When using the Roberts operator for detection, the detection results are not very accurate, so they are very different from expectations; secondly, for the Prewitt operator, when the grayscale of the image changes greatly, the processing effect is very good, but the detection accuracy is not very high; the Canny operator and the algorithm based on the neural network are relatively complex, not very friendly to hardware implementation, and difficult to implement. Compared with other operators, the Sobel operator has certain advantages in noise resistance and detection effect, and the algorithm has high feasibility in hardware platform implementation, which is conducive to practical industrial applications. Therefore, in recent years, researchers have gradually valued the research on the Sobel operator and hardware circuit design.
[0004] In the existing research on edge detection circuit design based on the SOBEL operator, most of them use traditional multiplication and addition circuits to implement operator operations. However, since the Sobel operator has two convolution factors in the horizontal and vertical directions, and the convolution factors have a lot of data reuse in the process of sliding detection on the image, the existing circuit design has the problem of additional power consumption overhead caused by repeated scheduling of a large amount of data and low efficiency caused by time-sharing operation of horizontal and vertical convolution factors. Summary of the invention
[0005] The technical problem solved by the present invention is: to overcome the shortcomings of the prior art and propose a high-efficiency SOBEL operator edge detection circuit, which can realize parallel operation processing of horizontal and vertical convolution factors, maximize data reuse, avoid multiple access scheduling of reused data, and greatly improve the operation efficiency and reduce the power consumption overhead caused by data reuse without losing the operation accuracy.
[0006] The technical solution of the present invention is:
[0007] A high-efficiency SOBEL operator edge detection circuit, comprising: a data scheduling module, a control module, a data processing module and a post-processing module;
[0008] The data scheduling module caches the input serial image data in groups of three lines, and performs convolution window sliding and parallel pulse output on the three lines of image pixel data required for the Sobel operator operation; the data output by the data scheduling module is the horizontal operation data, which is sent to the data processing module and the multiplexer to be controlled by the control module at the same time;
[0009] The control module controls the multiplexer, and through the control logic, the horizontal operation data is transposed and rearranged to obtain the vertical operation data, and then sent to the data processing module, so that the data required for the Sobel operator operation in the horizontal and vertical directions are input into the data processing module in parallel;
[0010] The data processing module includes two processing units, namely a horizontal operator processing unit and a vertical operator processing unit, which process horizontal operator operations and vertical operator operations in parallel; wherein the horizontal operator processing unit processes the horizontal operation data directly output by the data scheduling module, and the vertical operator processing unit processes the vertical operation data output by the multiplexer controlled by the control module;
[0011] The post-processing module is used to fuse the operation results of the horizontal direction operator processing unit and the vertical direction operator processing unit, and compare the fusion result with the threshold of edge detection, so as to complete edge detection.
[0012] Furthermore, the data scheduling module performs convolution window sliding and parallel pulsation output, specifically:
[0013] In the T clock cycle, the first row outputs A00, in the T+1 clock cycle, the first row outputs A01, the second row outputs A10, in the T+2 clock cycle, the first row outputs A02, the second row outputs A11, the third row outputs A20, and so on. The output of each row of data is one clock cycle slower than the previous row.
[0014] Furthermore, the Sobel operator includes a horizontal operator and a vertical operator. For the horizontal operator operation, the image pixel data flows into the data processing module in a horizontal pulsating manner. For the vertical operator operation, the image pixel data flows into the data processing module in a vertical pulsating manner.
[0015] Furthermore, the control module adopts a state machine circuit design method. The state machine includes 6 states: IDLE, S1, S2, S3, S4, and S5. Each state corresponds to a different output control signal. The input data multiplexer is controlled through the state jump of the state machine, thereby realizing the transposition and rearrangement of the input data.
[0016] Furthermore, the three output control signals of the control module are out1, out2, and out3, respectively, corresponding to three multiplexers MUX1, MUX2, and MUX3, and connected to the data processing module through the multiplexers.
[0017] Furthermore, the state machine includes 6 states: IDLE, S1, S2, S3, S4, and S5, specifically:
[0018] IDLE is the initial state. In the IDLE state, the three control signals out1, out2, and out3 are all 0, and MUX1, MUX2, and MUX3 are controlled to select row data 1;
[0019] In the s1 state, it remains unchanged;
[0020] In the s2 state, out1 is 1, controlling MUX1 to select row data 2, out2 and out3 are 0, controlling MUX1 to select row data 1;
[0021] In the s3 state, out1 is 2, which controls MUX1 to select row data 3, out2 is 1, which controls MUX2 to select row data 2, and out3 is 0, which controls MUX3 to select row data 1;
[0022] In the s4 state, out1 is 0, controlling MUX1 to select row data 1, out2 is 2, controlling MUX2 to select row data 3, and out3 is 1, controlling MUX3 to select row data 2;
[0023] In the s5 state, out1 is 1, controlling MUX1 to select row data 2, out2 is 0, controlling MUX2 to select row data 1, and out3 is 2, controlling MUX3 to select row data 3.
[0024] Furthermore, the processing unit 1 in the horizontal operator processing unit and the processing units 2, 3 and 4 in the vertical operator processing unit in the data processing module all adopt a multi-stage pipeline architecture design, and the vertical operator processing unit adopts a polling control design.
[0025] Furthermore,
[0026] The operation logic of processing unit 1, processing unit 2, processing unit 3, and processing unit 4 in the horizontal and vertical operator processing units of the data processing module specifically includes: inputting data into the register for storage; using a shifter to replace the multiplication by 2 operation, and shifting the corresponding data one bit to the left; negative number operations are represented by the -1 symbol and implemented by a logic circuit of inverting and adding 1; and addition operations are implemented by calling an adder.
[0027] Furthermore,
[0028] The processing units 1, 2, 3 and 4 in the horizontal and vertical operator processing units of the data processing module adopt a multi-stage pipeline design. The data flows in the horizontal direction according to the clock cycle and is pipelined in the vertical direction. The data AOO starts to flow into the processing unit from time T, passes through the two-level register cache, and the operation result Q1 is stored in register 10 after -1 operation at time T+2.
[0029] After the data A10 is input, it passes through the secondary register and the corresponding operation, and then is accumulated with Q1, and the operation result Q2 is stored in register 11 at time T+3;
[0030] After the data A20 is input, it also passes through the secondary register and the corresponding operation, and then is accumulated with Q2, and the operation result Q3 is stored in register 12 at time T+4, thus completing the multiplication and accumulation operation of the data A00, A10, A20 and the operator -1, -2, -1 through the 5-stage pipeline;
[0031] At the same time, data A02 flows into the processing unit at time T+2 and is directly stored in register 7 as the operation result K1. Data A12 flows into the processing unit at time T+3, and is shifted and accumulated with K1, and the operation result K2 is stored in register 8. Data A22 flows into the processing unit at time T+4 and is accumulated with K2, and its operation result K3 is stored in register 9. Thus, after passing through the 5-stage pipeline, the multiplication and accumulation operations of data A02, A12, A22 and 1, 2, 1 in the operator are completed.
[0032] Afterwards, the operation results Q3 and K3 are added to complete the entire processing flow of the input data and the Sobel operator.
[0033] Furthermore, the horizontal operator processing unit directly outputs the operation result, and the vertical operator processing unit needs to send the operation results of operation unit 2, operation unit 3, and operation unit 4 to the multi-way data selector MUX4, and select the final operation result in the vertical direction at the current moment through polling control and output. Specifically: operation units 2, 3, and 4 synchronously output the first operation result as the operation result of operation unit 2 at moment T, and the polling control selects MUX4; at moment T+1, the polling control selects the operation result of operation unit 3 of MUX4; at moment T+2, the polling control selects the operation result of operation unit 4 of MUX4, and so on.
[0034] Furthermore, the post-processing module sends the calculation result of the data processing module to the comparator for comparison with the value of 0. If it is greater than 0, the original value is maintained; if it is less than 0, the complement code is taken, thereby realizing the logical operation of taking the absolute value of the input data, and then adding them to complete the fusion of the calculation results; finally, the fusion result is compared with the preset threshold. If it is less than the preset threshold, the pixel value 0 is output, and if it is greater than the preset threshold, the pixel value 255 is output, thereby completing an edge detection.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] (1) The data processing module in the circuit design proposed in the present invention constructs a bilateral multi-stage pipeline structure, which supports efficient parallel operation of the horizontal convolution factor and the vertical convolution factor in the SOBEL operator, solves the problem of low efficiency of time-sharing operation of the horizontal convolution factor and the vertical convolution factor in the existing traditional SOBEL operator detection circuit, and has extremely high data processing efficiency.
[0037] (2) In the circuit design proposed by the present invention, the control module implements the data rearrangement scheduling strategy through state machine design, supports convolution matrix transposition scheduling, solves the problem of time-sharing repeated scheduling of data in the traditional SOBEL operator detection circuit, and has extremely high data reuse rate and data scheduling efficiency.
[0038] (3) The scheduling module in the circuit design proposed in the present invention realizes the parallel pulsating input of the sliding convolution window, which solves the problem of repeatedly reading the reused data from the storage in the traditional design, improves the data reuse rate, and reduces the data reading overhead.
[0039] (4) The present invention proposes a high-efficiency SOBEL operator edge detection circuit design scheme in the overall circuit design, which supports data pulsation input and multi-stage pipeline processing, solves the problems of low data reuse rate and low computing efficiency in traditional designs, and has extremely high data reuse rate and computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is the overall architecture diagram of the high-efficiency SOBEL operator edge detection circuit of the present invention;
[0041] Figure 2 This is a schematic diagram of the principle of the data scheduling module;
[0042] Figure 3 It is the schematic diagram of the control module principle;
[0043] Figure 4 Schematic diagram of the data processing module principle;
[0044] Figure 5 Schematic diagram of the post-processing module. DETAILED DESCRIPTION
[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0046] In the existing research on edge detection circuit design based on SOBEL operator, most of them use traditional multiplication and addition circuits to implement operator operations. However, since the Sobel operator has two convolution factors in the horizontal and vertical directions, and there is a lot of data reuse in the process of sliding detection on the image, the existing circuit design has the problem of additional power consumption caused by repeated scheduling of a large amount of data and low efficiency caused by time-sharing operation of horizontal and vertical convolution factors. In view of the shortcomings of the above-mentioned existing technologies, it is necessary to design a SOBEL operator edge detection algorithm circuit with higher operation efficiency and data reuse rate, which can realize parallel operation processing of horizontal and vertical convolution factors, maximize data reuse, avoid multiple access scheduling of reused data, and greatly improve operation efficiency and reduce power consumption caused by data reuse without losing operation accuracy.
[0047] The present invention designs a high-efficiency SOBEL operator edge detection circuit, supports parallel operation of horizontal convolution factors and vertical convolution factors in the SOBEL operator, builds a multi-stage pipeline structure, efficiently realizes data operation processing, supports pulse input of operation data, and realizes data rearrangement through a control unit, does not require data repeated scheduling, and has a very high data reuse rate. The circuit design proposed by the present invention is as follows Figure 1 shown.
[0048] like Figure 1As shown, the high-efficiency SOBEL operator edge detection circuit proposed in the present invention includes a data scheduling module, a control module, a data processing module and a post-processing module.
[0049] The data scheduling module caches the input serial image data in groups of three lines, and performs convolution window sliding and parallel pulse output on the three lines of image pixel data required for the Sobel operator operation; the data output by the data scheduling module is the horizontal operation data, which is sent to the data processing module and the multiplexer to be controlled by the control module at the same time;
[0050] The control module controls the multiplexer, and through the control logic, the horizontal operation data is transposed and rearranged to obtain the vertical operation data, and then sent to the data processing module, so that the data required for the Sobel operator operation in the horizontal and vertical directions are input into the data processing module in parallel;
[0051] The data processing module includes two processing units, namely a horizontal operator processing unit and a vertical operator processing unit, which process horizontal operator operations and vertical operator operations in parallel; wherein the horizontal operator processing unit processes the horizontal operation data directly output by the data scheduling module, and the vertical operator processing unit processes the vertical operation data output by the multiplexer controlled by the control module;
[0052] The post-processing module is used to fuse the operation results of the horizontal direction operator processing unit and the vertical direction operator processing unit, and compare the fusion result with the threshold of edge detection, so as to complete edge detection.
[0053] Each module will be introduced in detail below.
[0054] The principle of data scheduling module is as follows Figure 2 As shown in Figure 1, the Sobel operator uses a 3×3 convolution kernel to convolve with the image pixels and slides with a step size of 1. Therefore, the data input adopts a pulsating input scheduling method, and the three rows of image pixel data covered by the convolution kernel sliding are input in parallel. Figure 2 In the input example shown, the data scheduling module performs convolution window sliding and parallel pulsating output, specifically:
[0055] In the T clock cycle, the first row outputs A00, the T+1 clock cycle, the first row outputs A01, the second row outputs A10, the T+2 clock cycle, the first row outputs A02, the second row outputs A11, the third row outputs A20, and so on. The output of each row of data is one clock cycle slower than the previous row, which is conducive to subsequent data scheduling and efficient computing processing. At the same time, when the sobel operator convolution kernel slides on the image with a step size of 1, there will be a lot of reused image pixel data, such as Figure 2Among A01, A02, A11, A12, A21, and A22, the above-mentioned data scheduling method is adopted, and only the data pulse output is needed, which avoids the repeated reading of reused data from the storage, improves the data reuse rate, and reduces the data reading overhead.
[0056] The principle and design of the control module are as follows: Figure 3 As shown, since the Sobel operator includes a horizontal operator and a vertical operator, for the horizontal operator operation, the image pixel data needs to flow into the data processing module in a horizontal pulsating manner, while for the vertical operator operation, the image pixel data needs to flow into the data processing module in a vertical pulsating manner. In order to improve the data reuse rate and processing efficiency, the present invention proposes that the image pixel data mapped by the Sobel operator needs to be synchronously and parallelly input in the horizontal and vertical directions. Therefore, the present invention designs a control module, which transposes and rearranges the horizontal input data through control logic to realize vertical data input, and adopts a circuit design method of a state machine, such as Figure 3 As shown, the state machine includes 6 states: IDLE, S1, S2, S3, S4, and S5. Each state corresponds to a different output control signal. The input data multiplexer is controlled by the state jump of the state machine, thereby realizing the transposition and rearrangement of the input data. The three output control signals of the control module are out1, out2, and out3, corresponding to the three multiplexers MUX1, MUX2, and MUX3, and the data processing module is connected through the multiplexer.
[0057] IDLE is the initial state. In the IDLE state, the three control signals out1, out2, and out3 are all 0, and MUX1, MUX2, and MUX3 are controlled to select row data 1;
[0058] In the s1 state, it remains unchanged;
[0059] In the s2 state, out1 is 1, controlling MUX1 to select row data 2, out2 and out3 are 0, controlling MUX1 to select row data 1;
[0060] In the s3 state, out1 is 2, which controls MUX1 to select row data 3, out2 is 1, which controls MUX2 to select row data 2, and out3 is 0, which controls MUX3 to select row data 1;
[0061] In the s4 state, out1 is 0, controlling MUX1 to select row data 1, out2 is 2, controlling MUX2 to select row data 3, and out3 is 1, controlling MUX3 to select row data 2;
[0062] In the s5 state, out1 is 1, controlling MUX1 to select row data 2, out2 is 0, controlling MUX2 to select row data 1, and out3 is 2, controlling MUX3 to select row data 3.
[0063] Through the control module, the parallel input of data required for Sobel operator calculations in the horizontal and vertical directions is achieved, reducing the various overheads caused by repeated data reading or time-sharing data reading, improving data reuse rate while also improving data scheduling efficiency.
[0064] In the data processing module, the horizontal operator processing unit includes a processing unit 1, and the vertical operator processing unit includes processing unit 2, processing unit 3, processing unit 4 and a multiplexer data selector MUX4; processing unit 1, processing unit 2, processing unit 3, processing unit 4 have the same structure, all adopt a multi-stage pipeline architecture, and the vertical operator processing unit adopts polling control.
[0065] The principle and design of the data processing module are as follows Figure 4 As shown, the data processing module is divided into a horizontal operator processing unit and a vertical operator processing unit, including processing unit 1, processing unit 2, processing unit 3, and processing unit 4, which process horizontal operator operations and vertical operator operations in parallel. Since the four processing unit structures adopt the same multi-stage pipeline design, the detailed structure and operation principle of processing unit 1 in the horizontal operator processing unit are shown here, and the structural design and operation principle of processing units 2, 3, and 4 in the vertical operator processing unit are consistent with them, and will not be repeated.
[0066] First, the operation logic of the data processing module is explained. Since the Sobel operator uses Figure 4 The fixed value shown in the figure is used to optimize each operation in order to reduce the operation cost. The result of multiplication by 1 is the value itself, so this operation can be omitted. In circuit design, the data can be directly input into the register for storage. The multiplication by 2 operation can be replaced by a shifter in circuit design to shift the corresponding data to the left by one bit. The negative number operation can be replaced by a shifter in circuit design. Figure 4 In the circuit design, it is represented by the -1 symbol, and in the circuit design, it is implemented by the logic circuit of taking the inversion and adding 1; the addition operation is implemented by calling the adder. Through the above-mentioned optimization design of the operation circuit, the operation power consumption can be greatly reduced. Secondly, the processing flow of the data processing module is explained. The data processing module adopts a multi-stage pipeline design, such as Figure 4 As shown, data flows horizontally according to the clock cycle and pipeline operations are performed vertically.
[0067] exist Figure 4In the example shown, data AOO starts to flow into the processing unit from time T, passes through the two-level register cache, and stores the operation result Q1 in register 10 (reg10) after the -1 operation at time T+2; after the data A10 is input, it passes through the second-level register and the corresponding operation, and is accumulated with Q1, and the operation result Q2 is stored in register 11 (reg11) at time T+3; after the data A20 is input, it also passes through the second-level register and the corresponding operation, and is accumulated with Q2, and the operation result Q3 is stored in register 12 (reg12) at time T+4, thereby completing the multiplication and accumulation operations of data A00, A10, A20 and -1, -2, -1 in the operator after passing through the 5-level pipeline. At the same time, data A02 flows into the processing unit at time T+2 and is directly stored in register 7 (reg7) as the operation result K1. Data A12 flows into the processing unit at time T+3 and is shifted and accumulated with K1, and the operation result K2 is stored in register 8 (reg8). Data A22 flows into the processing unit at time T+4 and is accumulated with K2, and its operation result K3 is stored in register 9 (reg9). Thus, after a 5-stage pipeline, the multiplication and accumulation operations of data A02, A12, A22 and 1, 2, 1 in the operator are completed. After that, the operation result Q3 is added to K3, thus completing the entire processing flow of the input data and the sobel operator. Finally, the capabilities and advantages of the data processing module are explained. The data processing module is designed with a 5-stage pipeline. With the pulsating input of data, the operation operations of the horizontal operator and the vertical operator in the sobel operator can be executed in parallel, and it has a very high operation efficiency.
[0068] Post-processing module design Figure 5 As shown in the figure, the post-processing module is mainly responsible for the fusion of the operation results of the horizontal operator processing unit and the vertical operator processing unit in the Sobel operator, and compares the fusion result with the threshold of edge detection to complete edge detection. The operation result of the processing unit is sent to the comparator to compare with the value of 0. If it is greater than 0, the original value is maintained. If it is less than 0, the complement code is taken, thereby realizing the logical operation of taking the absolute value of the input data, and then adding them to complete the fusion of the operation results. Finally, the fusion result is compared with the threshold. If it is less than the threshold, the pixel value 0 is output, and if it is greater than the threshold, the pixel value 255 is output, thereby completing an edge detection.
[0069] The contents not described in detail in the specification of the present invention belong to the common knowledge of the professionals in this field.
Claims
1. A high-efficiency SOBEL operator edge detection circuit, characterized in that: include: Data scheduling module, control module, data processing module and post-processing module; The data scheduling module caches the input serial image data in groups of three lines, and performs convolution window sliding and parallel pulse output on the three lines of image pixel data required for the Sobel operator operation; the data output by the data scheduling module is the horizontal operation data, which is sent to the data processing module and the multiplexer to be controlled by the control module at the same time; The control module controls the multiplexer, and through the control logic, the horizontal operation data is transposed and rearranged to obtain the vertical operation data, and then sent to the data processing module, so that the data required for the Sobel operator operation in the horizontal and vertical directions are input into the data processing module in parallel; The data processing module includes two processing units, namely a horizontal operator processing unit and a vertical operator processing unit, which process horizontal operator operations and vertical operator operations in parallel; wherein the horizontal operator processing unit processes the horizontal operation data directly output by the data scheduling module, and the vertical operator processing unit processes the vertical operation data output by the multiplexer controlled by the control module; The post-processing module is used to fuse the operation results of the horizontal direction operator processing unit and the vertical direction operator processing unit, and compare the fusion result with the threshold of edge detection, so as to complete edge detection.
2. The high-efficiency SOBEL operator edge detection circuit according to claim 1, characterized in that: The data scheduling module performs convolution window sliding and parallel pulsation output, specifically: In the T clock cycle, the first row outputs A00, in the T+1 clock cycle, the first row outputs A01, the second row outputs A10, in the T+2 clock cycle, the first row outputs A02, the second row outputs A11, the third row outputs A20, and so on. The output of each row of data is one clock cycle slower than the previous row.
3. The high-efficiency SOBEL operator edge detection circuit according to claim 1, characterized in that: The sobel operator includes a horizontal operator and a vertical operator. For the horizontal operator operation, the image pixel data flows into the data processing module in a horizontal pulsating manner. For the vertical operator operation, the image pixel data flows into the data processing module in a vertical pulsating manner.
4. The high-efficiency SOBEL operator edge detection circuit according to claim 1, characterized in that: The control module adopts a state machine circuit design method. The state machine includes 6 states: IDLE, S1, S2, S3, S4, and S5. Each state corresponds to a different output control signal. The input data multiplexer is controlled by the state jump of the state machine, thereby realizing the transposition and reordering of the input data.
5. The high-efficiency SOBEL operator edge detection circuit according to claim 4, characterized in that: The three output control signals of the control module are out1, out2, and out3, respectively, corresponding to three multiplexers MUX1, MUX2, and MUX3, and connected to the data processing module through the multiplexers.
6. The high-efficiency SOBEL operator edge detection circuit according to claim 5, characterized in that: The state machine includes 6 states: IDLE, S1, S2, S3, S4, and S5. Specifically: IDLE is the initial state. In the IDLE state, the three control signals out1, out2, and out3 are all 0, and MUX1, MUX2, and MUX3 are controlled to select row data 1; In the s1 state, it remains unchanged; In the s2 state, out1 is 1, controlling MUX1 to select row data 2, out2 and out3 are 0, controlling MUX1 to select row data 1; In the s3 state, out1 is 2, which controls MUX1 to select row data 3, out2 is 1, which controls MUX2 to select row data 2, and out3 is 0, which controls MUX3 to select row data 1; In the s4 state, out1 is 0, controlling MUX1 to select row data 1, out2 is 2, controlling MUX2 to select row data 3, and out3 is 1, controlling MUX3 to select row data 2; In the s5 state, out1 is 1, controlling MUX1 to select row data 2, out2 is 0, controlling MUX2 to select row data 1, and out3 is 2, controlling MUX3 to select row data 3.
7. The high-efficiency SOBEL operator edge detection circuit according to claim 1, characterized in that: The horizontal operator processing unit includes a processing unit 1, and the vertical operator processing unit includes processing unit 2, processing unit 3, processing unit 4 and a multiplexer data selector MUX4; processing unit 1, processing unit 2, processing unit 3, processing unit 4 have the same structure, all adopt a multi-stage pipeline architecture, and the vertical operator processing unit adopts polling control.
8. The high-efficiency SOBEL operator edge detection circuit according to claim 7, characterized in that: The operation logic of processing unit 1, processing unit 2, processing unit 3, and processing unit 4 specifically includes: inputting data into a register for storage; using a shifter to replace the multiplication operation by 2, and shifting the corresponding data one position to the left; negative number operations are represented by the -1 symbol and implemented by a logic circuit that inverts and adds 1; and addition operations are implemented by calling an adder.
9. The high-efficiency SOBEL operator edge detection circuit according to claim 8, characterized in that: The processing units 1, 2, 3 and 4 adopt a multi-stage pipeline architecture, that is, data flows in the horizontal direction according to the clock cycle and pipeline operations are performed in the vertical direction; data AOO pulses into the processing unit from time T, passes through two-level register caches, and after -1 operation at time T+2, the operation result Q1 is stored in register 10; After the data A10 is input, it passes through the secondary register and the corresponding operation, and is accumulated with Q1, and the operation result Q2 is stored in register 11 at time T+3; After the data A20 is input, it also passes through the secondary register and the corresponding operation, and then is accumulated with Q2, and the operation result Q3 is stored in register 12 at time T+4, thus completing the multiplication and accumulation operation of the data A00, A10, A20 and the operator -1, -2, -1 through the 5-stage pipeline; At the same time, data A02 flows into the processing unit at time T+2 and is directly stored in register 7 as the operation result K1. Data A12 flows into the processing unit at time T+3, and is shifted and accumulated with K1, and the operation result K2 is stored in register 8. Data A22 flows into the processing unit at time T+4 and is accumulated with K2, and its operation result K3 is stored in register 9. Thus, after passing through the 5-stage pipeline, the multiplication and accumulation operations of data A02, A12, A22 and 1, 2, 1 in the operator are completed. Afterwards, the operation results Q3 and K3 are added to complete the entire processing flow of the input data and the Sobel operator.
10. The high-efficiency SOBEL operator edge detection circuit according to claim 9, characterized in that: The horizontal operator processing unit directly outputs the operation result, and the vertical operator processing unit sends the operation results of operation unit 2, operation unit 3, and operation unit 4 to the multiplexer MUX4, and selects and outputs the final operation result in the vertical direction at the current moment through polling control. Specifically, operation units 2, 3, and 4 synchronously output the first operation result as the operation result of operation unit 2 of MUX4 at moment T, and the polling control selects the operation result of operation unit 2 of MUX4 at moment T+1; the polling control selects the operation result of operation unit 3 of MUX4; at moment T+2, the polling control selects the operation result of operation unit 4 of MUX4, and so on.
11. The high-efficiency SOBEL operator edge detection circuit according to claim 1, characterized in that: The post-processing module sends the calculation result of the data processing module to the comparator for comparison with the value 0. If it is greater than 0, the original value is maintained; if it is less than 0, the complement code is taken, thereby realizing the logical operation of taking the absolute value of the input data, and then adding them to complete the fusion of the calculation results; finally, the fusion result is compared with the preset threshold. If it is less than the preset threshold, the pixel value 0 is output, and if it is greater than the preset threshold, the pixel value 255 is output, thereby completing an edge detection.
