Video edge detection system based on vector matrix operation acceleration kernel
By introducing a vector matrix operation acceleration core into the video edge detection system and converting convolution operations into matrix operations, the problem of slow edge detection algorithms in high-resolution video stream processing is solved, and real-time performance and efficiency are improved.
Patent Information
- Application Number
- CN202410849237.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-01
AI Technical Summary
When the existing technology processes high-resolution and high-refresh rate video streams, the edge detection algorithm lacks real-time performance due to the slow convolution operation, making it difficult to meet the needs of real-time image processing.
A video edge detection system based on the vector matrix operation acceleration core is designed. By converting the image data into a grayscale image, and using the vector matrix operation acceleration unit for parallel processing, the convolution operation is converted into a matrix operation, and the image pixel data is increased. Parallelism improves processing speed.
It achieves real-time edge detection of high-resolution video streams, improves the speed and efficiency of image processing, and ensures the real-time nature of processing results.
Smart Images

Figure CN118735955A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image data processing, for example, to a video edge detection system based on a vector matrix operation acceleration core. Background Art
[0002] Nowadays, real-time image processing has become a huge challenge due to the use of high-resolution camera sensors that produce high-definition video streams with high resolution and high frame rate. Therefore, processing such huge amounts of data on the processor becomes a huge challenge.
[0003] Edge detection is one of the most important preprocessing methods, which is often used in image perception and analysis to find the boundaries of the region of interest, which plays an important role in many applications such as feature extraction, motion detection, object tracking, etc. Especially with the rise of artificial intelligence, edge detection plays an important role in it. The edge attribute is calculated using the function behavior of the image in the neighborhood of the pixel. The edge detection operator is represented by two masks, each mask corresponding to a certain direction.
[0004] Currently, the Sobel and Prewitt detection algorithms are among the most commonly used algorithms. However, when faced with high-resolution and high-refresh-rate video streams, the convolution operations are relatively slow, and the image data is processed serially in a line buffered manner, which may cause the processed image data to lack real-time performance.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0006] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0007] The video edge detection system based on the vector matrix operation acceleration core provided by the embodiment of the present disclosure includes:
[0008] The image data extraction module is used to receive the image data collected by the camera, perform data extraction and filtering operations, and retain only key information;
[0009] An RGB format conversion module, used for receiving filtered image data and converting it into a standard RGB format;
[0010] AXI_interconnect bus, as the hub for multi-master and multi-slave data transmission;
[0011] The DMA write module directly interacts with the DDR memory at high speed through the AXI_interconnect bus and writes the image data in RGB format directly into the DDR memory;
[0012] DDR controller, used to control the read and write operations of DDR memory. When the DDR controller is the host of the AXI_interconnect bus, it reads data from the DDR memory. When the DDR controller is the slave of the AXI_interconnect bus, it writes image data into the DDR memory.
[0013] A vector matrix operation core, used for performing complex processing on input image data, wherein the complex processing includes converting an RGB image into a grayscale image to reduce the amount of data processing, and performing efficient image edge detection using a vector matrix operation acceleration unit;
[0014] DMA read module, used to read the image data processed by edge detection from DDR memory and prepare it for output;
[0015] The DDR controller monitors the DDR memory, and when enough frames of image data are stored, triggers the vector matrix operation core to perform image processing;
[0016] The calculation results are stored back to the DDR memory and read out through the DMA read module.
[0017] In some embodiments, the system may further include a camera configuration module for configuring camera parameters so that the camera can work stably in a specific mode.
[0018] In some embodiments, the vector matrix operation kernel performs image processing, which may include:
[0019] After receiving the image data, the vector matrix operation core first performs an RGB to grayscale image process on the data. After converting the grayscale image into a grayscale image, the grayscale image data is sent to the vector matrix operation acceleration module for vector matrix acceleration operation, and the operation result is sent to the DDR controller through the AXI_interconnect bus. The DDR controller then stores the calculated data back into the DDR.
[0020] In some embodiments, the vector-matrix operation acceleration module performs vector-matrix acceleration operations, including:
[0021] The input grayscale image data is stored in the cache according to the rows of pixels of each frame of the image, and a 3*3 matrix is selected by the matrix selection module;
[0022] Each generated 3*3 matrix is converted into a row of the A matrix by the matrix conversion storage module for storage, so that all rows in a frame of image can be operated at the same time; at the same time, the two convolution operator kernels also form a 9*2 matrix;
[0023] After that, it enters the calculation array for calculation. Each calculation array is composed of 6 operator blocks. There are K calculation arrays in total. The number of calculation arrays is equal to the number of rows of matrix A.
[0024] In some embodiments, a 3*3 matrix is selected by a matrix selection module, including:
[0025] For the calculation in the column direction, the first matrix is formed by selecting the first three rows of pixels, and selecting 3 pixels in each row in sequence. The second matrix is formed by selecting the first three pixel data of each row of pixels in the second, third, and fourth rows, and so on.
[0026] For the calculation in the row direction, after the first calculation in the column direction is completed, the three pixels selected in the row direction are moved back by one, and then the column direction matrix is selected in turn, and so on to complete the edge detection of the entire image, so that all rows of each frame image can perform convolution operations at the same time.
[0027] In some embodiments, entering a computing array to perform operations includes:
[0028] In each calculation array, X1, X2, and X3 are used to perform horizontal gradient operator calculations, and Y1, Y2, and Y3 are used to perform vertical gradient operator calculations.
[0029] In some embodiments, the method further comprises:
[0030] A00, A01, and A02 of matrix A are sent to operator block X1 and operator block Y1 at the same time, and multiplication and addition operations are performed on the first three elements. Similarly, A03, A04, and A05 are sent to operator block X2 and operator block Y2 at the same time, and multiplication and addition operations are performed on the middle three elements. A06, A07, and A08 are sent to operator block X3 and operator block Y3 at the same time, and multiplication and addition operations are performed on the last three elements. At the same time, the calculation results of these three operator blocks are accumulated at the end to obtain the gradient value in the horizontal direction; the gradient value in the Y direction is obtained in the same way; after the gradient values in the horizontal and vertical directions are obtained, a specific pixel is output according to a preset threshold.
[0031] In some embodiments, the above-mentioned operator block includes 3 multiplication units and 1 addition unit.
[0032] The video edge detection method and system based on the vector matrix operation acceleration core provided by the embodiments of the present disclosure can achieve the following technical effects:
[0033] By designing a vector matrix operation kernel, the convolution operation of edge detection is converted into a matrix operation in a specific format, and the pixel matrix data is input into the designed matrix operation array, which increases the parallelism of image pixel data operations and speeds up image processing.
[0034] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] One or more embodiments are exemplarily described by corresponding drawings, which do not limit the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements, and the drawings do not constitute a scale limitation, and wherein:
[0036] Figure 1 It is a video edge detection system architecture diagram based on a vector matrix operation acceleration core provided by an embodiment of the present disclosure;
[0037] Figure 2 It is a flow chart of a vector matrix operation acceleration unit architecture provided by an embodiment of the present disclosure;
[0038] Figure 3 is a calculation array diagram provided by an embodiment of the present disclosure;
[0039] Figure 4 is an operator block diagram provided by an embodiment of the present disclosure;
[0040] Figure 5 It is a schematic diagram of the structure of another video edge detection system based on a vector matrix operation acceleration core provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0041] In order to be able to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure is described in detail below in conjunction with the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, a full understanding of the disclosed embodiments is provided through multiple details. However, one or more embodiments can still be implemented without these details. In other cases, to simplify the drawings, well-known structures and devices can be simplified for display.
[0042] The terms "first", "second", etc. in the embodiments of the present disclosure are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so as to describe the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0043] Unless otherwise stated, the term "plurality" means two or more.
[0044] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0045] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0046] The term "correspondence" may refer to an association relationship or a binding relationship. The correspondence between A and B means that there is an association relationship or a binding relationship between A and B.
[0047] The following describes a video edge detection method and system based on a vector matrix operation acceleration core provided by an embodiment of the present disclosure in conjunction with the accompanying drawings.
[0048] Figure 1 This is a video edge detection system architecture diagram based on a vector matrix operation acceleration core provided by an embodiment of the present disclosure; Figure 1 , a video edge detection system based on a vector matrix operation acceleration core may include:
[0049] The image data extraction module is used to receive the image data collected by the camera, perform data extraction and filtering operations, and retain only key information;
[0050] An RGB format conversion module, used for receiving filtered image data and converting it into a standard RGB format;
[0051] AXI_interconnect bus, as the hub for multi-master and multi-slave data transmission;
[0052] The DMA write module directly interacts with the DDR memory at high speed through the AXI_interconnect bus and writes the image data in RGB format directly into the DDR memory;
[0053] DDR controller, used to control the read and write operations of DDR memory. When the DDR controller is the host of the AXI_interconnect bus, it reads data from the DDR memory. When the DDR controller is the slave of the AXI_interconnect bus, it writes image data into the DDR memory.
[0054] A vector matrix operation core, used for performing complex processing on input image data, wherein the complex processing includes converting an RGB image into a grayscale image to reduce the amount of data processing, and performing efficient image edge detection using a vector matrix operation acceleration unit;
[0055] DMA read module, used to read the image data processed by edge detection from DDR memory and prepare it for output;
[0056] The DDR controller monitors the DDR memory, and when enough frames of image data are stored, triggers the vector matrix operation core to perform image processing;
[0057] The calculation results are stored back to the DDR memory and read out through the DMA read module.
[0058] The present invention designs a vector matrix operation kernel, converts the convolution operation of edge detection into a matrix operation in a specific format, and inputs the pixel matrix data into the designed matrix operation array, thereby increasing the parallelism of image pixel data operations and accelerating the speed of image processing.
[0059] Figure 2 is a flow chart of a vector matrix operation acceleration unit architecture provided by an embodiment of the present disclosure. Figure 3 is a calculation array diagram provided by an embodiment of the present disclosure, Figure 4 It is an operator block diagram provided by an embodiment of the present disclosure.
[0060] Combination Figure 2-Figure 4 ,right Figure 1 The description of the system in is continued.
[0061] In some embodiments, Figure 1 The system may also include a camera configuration module for configuring camera parameters so that the camera can work stably in a specific mode.
[0062] In some embodiments, the above-mentioned vector matrix operation kernel performs image processing, which may include:
[0063] After receiving the image data, the vector matrix operation core first performs an RGB to grayscale image process on the data. After converting the grayscale image into a grayscale image, the grayscale image data is sent to the vector matrix operation acceleration module for vector matrix acceleration operation, and the operation result is sent to the DDR controller through the AXI_interconnect bus. The DDR controller then stores the calculated data back into the DDR.
[0064] In some embodiments, the vector matrix operation acceleration module may perform vector matrix acceleration operations, which may include:
[0065] The input grayscale image data is stored in the cache according to the rows of pixels of each frame of the image, and a 3*3 matrix is selected by the matrix selection module;
[0066] Each generated 3*3 matrix is converted into a row of the A matrix by the matrix conversion storage module for storage, so that all rows in a frame of image can be operated at the same time; at the same time, the two convolution operator kernels also form a 9*2 matrix;
[0067] After that, it enters the calculation array for calculation. Each calculation array is composed of 6 operator blocks. There are K calculation arrays in total. The number of calculation arrays is equal to the number of rows of matrix A.
[0068] In some embodiments, selecting a 3*3 matrix through a matrix selection module includes:
[0069] For the calculation in the column direction, the first matrix is formed by selecting the first three rows of pixels, and selecting 3 pixels in each row in sequence. The second matrix is formed by selecting the first three pixel data of each row of pixels in the second, third, and fourth rows, and so on.
[0070] For the calculation in the row direction, after the first calculation in the column direction is completed, the three pixels selected in the row direction are moved back by one, and then the column direction matrix is selected in turn, and so on to complete the edge detection of the entire image, so that all rows of each frame image can perform convolution operations at the same time.
[0071] In some embodiments, the process of entering the computing array to perform calculations may include:
[0072] In each calculation array, X1, X2, and X3 are used to perform horizontal gradient operator calculations, and Y1, Y2, and Y3 are used to perform vertical gradient operator calculations.
[0073] In some embodiments, the above system can also be used to send A00, A01, and A02 of matrix A to operator block X1 and operator block Y1 at the same time, and perform multiplication and addition operations on the first three elements. Similarly, A03, A04, and A05 are sent to operator block X2 and operator block Y2 at the same time to perform multiplication and addition operations on the middle three elements. A06, A07, and A08 are sent to operator block X3 and operator block Y3 at the same time to perform multiplication and addition operations on the last three elements. At the same time, the calculation results of these three operator blocks are accumulated at the end to obtain the gradient value in the horizontal direction; the gradient value in the Y direction is obtained in the same way; after obtaining the gradient values in the horizontal and vertical directions, specific pixels are output according to a preset threshold.
[0074] In some embodiments, the above operator block may include 3 multiplication units and 1 addition unit.
[0075] like Figure 2As shown in the figure, the operation process of the vector matrix operation acceleration unit is introduced in detail. First, the input grayscale image data is stored in the cache according to the rows of pixels of each frame image, and a 3*3 matrix is selected through the matrix selection module. The column direction calculation is explained as follows: For example, the first matrix is formed by selecting the first three rows (first row, second row, third row) of pixels, and each row is formed by selecting 3 pixels in sequence. The second matrix is formed by selecting the first three pixel data of each row of pixels in the second row, third row, and fourth row, and so on.
[0076] The row direction calculation is explained as follows: after the first column direction calculation is completed, the three pixels that need to be selected in the row direction are moved back one, and then the column direction matrix is selected in turn, and so on to complete the edge detection of the entire image, so that all rows of each frame image can be convolved at the same time.
[0077] Then each generated 3*3 matrix will be converted into a row of matrix A through the matrix conversion storage module for storage, so that all rows in a frame of image can be calculated at the same time, which greatly increases the parallelism compared to the serial sequential calculation method. At the same time, the two convolution operator kernels also form a 9*2 matrix.
[0078] After that, it enters the calculation array for calculation. Each calculation array is composed of 6 operator blocks. There are K calculation arrays in total. The number of calculation arrays is equal to the number of rows of matrix A.
[0079] like Figure 3 As shown, in each calculation array, X1, X2, and X3 are used for horizontal gradient operator operations, and Y1, Y2, and Y3 are used for vertical gradient operator operations. For example, A00, A01, and A02 of matrix A are sent to operator blocks X1 and Y1 at the same time, and the multiplication and addition operations of the first three elements are performed. Similarly, A03, A04, and A05 are sent to operator blocks X2 and Y2 at the same time, and the multiplication and addition operations of the middle three elements are performed. A06, A07, and A08 are sent to operator blocks X3 and Y3 at the same time, and the multiplication and addition operations of the last three elements are performed. At the same time, the calculation results of these three operator blocks are accumulated at the end to obtain the gradient value in the horizontal direction. Similarly, the gradient value in the Y direction can be obtained in the same way. After obtaining the gradient value, a specific pixel can be output according to the threshold.
[0080] Figure 4 is the architecture diagram of the operator block, such as Figure 4 As shown in FIG. 1 , it includes three multiplication units and one addition unit. During operation, the multiplication unit can also be replaced with other operation logic according to the characteristics of the operator core.
[0081] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0082] Combination Figure 5 As shown, the embodiment of the present disclosure provides another video edge detection system 500 based on a vector matrix operation acceleration core, including a processor 504 and a memory 501. Optionally, the system may also include a communication interface 502 and a bus 503. The processor 504, the communication interface 502, and the memory 501 may communicate with each other through the bus 503. The communication interface 502 may be used for information transmission. The processor 504 may call the logic instructions in the memory 501 to execute the video edge detection method based on the vector matrix operation acceleration core of the above embodiment.
[0083] In addition, the logic instructions in the memory 501 described above can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0084] The memory 501 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 504 executes the function application and data processing by running the program instructions / modules stored in the memory 501, that is, the video edge detection method based on the vector matrix operation acceleration core in the above embodiment is implemented.
[0085] The memory 501 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 501 may include a high-speed random access memory and may also include a non-volatile memory.
[0086] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute a video edge detection method based on a vector matrix operation acceleration core.
[0087] The computer-readable storage medium mentioned above may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.
[0088] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, including: a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and other media that can store program codes, or a transient storage medium.
[0089] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. As used in the description of the embodiments, unless the context clearly indicates otherwise, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of one or more associated listings. In addition, when used in this application, the term "comprise" and its variants "comprises" and / or including (comprising) refer to the existence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the existence or addition of one or more other features, wholes, steps, operations, elements, components and / or these groups. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same or similar parts between the embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0090] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the systems, devices and units described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0091] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0092] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A video edge detection system based on a vector matrix operation acceleration core, characterized in that: The system comprises: The image data extraction module is used to receive the image data collected by the camera, perform data extraction and filtering operations, and retain only key information; An RGB format conversion module, used for receiving filtered image data and converting it into a standard RGB format; AXI_interconnect bus, as the hub for multi-master and multi-slave data transmission; The DMA write module directly interacts with the DDR memory at high speed through the AXI_interconnect bus and writes the image data in RGB format directly into the DDR memory; DDR controller, used to control the read and write operations of DDR memory. When the DDR controller is the host of the AXI_interconnect bus, it reads data from the DDR memory. When the DDR controller is the slave of the AXI_interconnect bus, it writes image data into the DDR memory. A vector matrix operation core, used for performing complex processing on input image data, wherein the complex processing includes converting an RGB image into a grayscale image to reduce the amount of data processing, and performing efficient image edge detection using a vector matrix operation acceleration unit; DMA read module, used to read the image data processed by edge detection from DDR memory and prepare it for output; The DDR controller monitors the DDR memory, and when enough frames of image data are stored, it triggers the vector matrix operation core to perform image processing; the operation results are stored back to the DDR memory, and are read and output through the DMA read module.
2. The system according to claim 1, characterized in that The system also includes a camera configuration module, which is used to configure camera parameters so that the camera can work stably in a specific mode.
3. The system according to claim 1, characterized in that The vector matrix operation core performs image processing, including: After receiving the image data, the vector matrix operation core first performs an RGB to grayscale image process on the data. After converting the grayscale image into a grayscale image, the grayscale image data is sent to the vector matrix operation acceleration module for vector matrix acceleration operation, and the operation result is sent to the DDR controller through the AXI_interconnect bus. The DDR controller then stores the calculated data back into the DDR.
4. The system according to claim 3, characterized in that The vector matrix operation acceleration module performs vector matrix acceleration operations, including: The input grayscale image data is stored in the cache according to the rows of pixels of each frame of the image, and a 3*3 matrix is selected by the matrix selection module; Each generated 3*3 matrix is converted into a row of the A matrix by the matrix conversion storage module for storage, so that all rows in a frame of image can be operated at the same time; at the same time, the two convolution operator kernels also form a 9*2 matrix; After that, it enters the calculation array for calculation. Each calculation array is composed of 6 operator blocks. There are K calculation arrays in total. The number of calculation arrays is equal to the number of rows of matrix A.
5. The system according to claim 4, characterized in that The step of selecting a 3*3 matrix through a matrix selection module includes: For the calculation in the column direction, the first matrix is formed by selecting the first three rows of pixels, and selecting 3 pixels in each row in sequence. The second matrix is formed by selecting the first three pixel data of each row of pixels in the second, third, and fourth rows, and so on. For the calculation in the row direction, after the first calculation in the column direction is completed, the three pixels selected in the row direction are moved back by one, and then the column direction matrix is selected in turn, and so on to complete the edge detection of the entire image, so that all rows of each frame image can perform convolution operations at the same time.
6. The system according to claim 4, characterized in that The entering the computing array to perform operations includes: In each calculation array, X1, X2, and X3 are used to perform horizontal gradient operator calculations, and Y1, Y2, and Y3 are used to perform vertical gradient operator calculations.
7. The system according to claim 6, characterized in that The system is also used to send A00, A01, and A02 of the matrix A to the operator block X1 and the operator block Y1 at the same time, and perform multiplication and addition operations on the first three elements. Similarly, A03, A04, and A05 are sent to the operator block X2 and the operator block Y2 at the same time to perform multiplication and addition operations on the middle three elements. A06, A07, and A08 are sent to the operator block X3 and the operator block Y3 at the same time to perform multiplication and addition operations on the last three elements. At the same time, the calculation results of these three operator blocks are accumulated at the end to obtain the gradient value in the horizontal direction; the gradient value in the Y direction is obtained in the same way; after the gradient values in the horizontal and vertical directions are obtained, specific pixels are output according to a preset threshold.
8. The system according to claim 4, characterized in that The operator block includes 3 multiplication units and 1 addition unit.
Citation Information
Patent Citations
Single-pixel margin detection method based on FPGA
CN102044071A
Image interpolation based on CUDA (compute unified device architecture) and edge detection
CN102622723A
Target detection model optimization method and device, medium and device
CN116468969A
Self-adaptive threshold nut edge detection method based on image enhancement
CN116862936A
Track damage detection method and device based on edge detection
CN117670793A
