Road guardrail detection method and device

By performing gridding processing and parallel curve fitting on radar point cloud data in FPGA, the problem of low detection efficiency of road guardrails in existing technologies is solved, and efficient and timely road guardrail detection is achieved.

CN121522641APending Publication Date: 2026-02-13JIANGSU HIRAIN AUTOMOTIVE ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511587095.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

In existing technologies, radar point cloud data processing for road guardrail identification involves high computational complexity and low computational efficiency, resulting in insufficient timeliness and accuracy of road guardrail detection and increasing the risk of vehicle collisions with road guardrails.

Method used

The radar point cloud data is processed into a grid using a hardware parallel structure based on FPGA, and the nearest neighbor sliding window search and curve fitting are performed in parallel to reduce the amount of data and improve the computation speed.

Benefits of technology

This improved the efficiency and accuracy of road guardrail inspection, ensured timeliness, and reduced the risk of vehicles colliding with guardrails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121522641A_ABST
    Figure CN121522641A_ABST
Patent Text Reader

Abstract

The invention discloses a road guardrail detection method and device. The method is applied to a field programmable gate array (FPGA), and comprises the following steps: acquiring point cloud data of a road guardrail detected by a radar; mapping the point cloud data to a preset grid chart to obtain gridding point cloud data, the grid chart comprising a plurality of grids, each grid comprising at least one point cloud, and the gridding point cloud data comprising the number of point clouds corresponding to each grid and the grid coordinates of each grid; and performing nearest neighbor sliding window search on the gridding point cloud data to obtain feature points, and performing curve fitting calculation on grid coordinate information corresponding to the feature points in parallel to obtain a road guardrail curve corresponding to the road guardrail. According to the scheme provided by the embodiment of the invention, the road guardrail detection efficiency can be effectively improved, and a foundation is laid for the timeliness of road guardrail detection.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of automatic driving, and particularly relates to a detection method and device for a road guardrail. BACKGROUND

[0002] An automatic driving vehicle can detect objects through a radar to realize accurate perception and monitoring of the surrounding environment and reduce the risk of vehicle collision. A road guardrail is a traffic sign for dividing roads and ensuring safe and compliant driving of vehicles in a traffic system. In order to improve the safety of driving of an automatic driving vehicle, the road guardrail needs to be detected to provide correction support for identification of a drivable area of the vehicle.

[0003] However, in the related art, the method for processing radar point cloud data to identify a road guardrail has high computational complexity and low computational efficiency, which reduces the timeliness and accuracy of detection of the road guardrail and increases the risk of vehicle collision with the road guardrail. SUMMARY

[0004] The embodiments of the present application provide a detection method and device for a road guardrail, which can effectively improve the efficiency of detection of the road guardrail and lay a foundation for the timeliness of detection of the road guardrail.

[0005] In a first aspect, the embodiments of the present application provide a detection method for a road guardrail, applied in a field programmable gate array (FPGA), which comprises: acquiring point cloud data of a road guardrail detected by a radar; mapping the point cloud data to a preset grid map to obtain gridized point cloud data, wherein the grid map comprises a plurality of grids, each grid comprises at least one point cloud, and the gridized point cloud data comprises a number of point clouds corresponding to each grid and a grid coordinate of each grid; performing nearest neighbor sliding window search on the gridized point cloud data to obtain a feature point, and simultaneously performing curve fitting calculation on grid coordinate information corresponding to the feature point in parallel to obtain a road guardrail curve corresponding to the road guardrail.

[0006] In a second aspect, the embodiments of the present application provide a detection device for a road guardrail, applied in an FPGA, which comprises: a data acquisition module configured to acquire point cloud data of a road guardrail detected by a radar; a grid division module configured to map the point cloud data to a preset grid map to obtain gridized point cloud data, wherein the grid map comprises a plurality of grids, each grid comprises at least one point cloud, and the gridized point cloud data comprises a number of point clouds corresponding to each grid and a grid coordinate of each grid; and a guardrail detection module configured to perform nearest neighbor sliding window search on the gridized point cloud data to obtain a feature point, and simultaneously perform curve fitting calculation on grid coordinate information corresponding to the feature point in parallel to obtain a road guardrail curve corresponding to the road guardrail.

[0007] Thirdly, embodiments of this application provide an electronic device, which includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements the road guardrail detection method as described in the first aspect.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer program instructions, which, when executed by a processor, implement the road guardrail detection method as described in the first aspect.

[0009] Fifthly, embodiments of this application provide a computer program product in which instructions, when executed by a processor of an electronic device, cause the electronic device to perform the road guardrail detection method as described in the first aspect.

[0010] As described above, in this embodiment, road guardrail detection is implemented in an FPGA. Compared to related technologies that use a CPU (Central Processing Unit) for road guardrail detection, the parallel hardware structure of the FPGA for data processing improves the real-time performance of data processing, thereby increasing the efficiency of road guardrail detection. Furthermore, in this embodiment, point cloud data is mapped to a mesh graph, and the meshed point cloud data is processed. A single mesh may contain multiple point clouds, and the number of meshes falling into a point cloud is less than the number of original point clouds, effectively reducing the amount of data required for road guardrail feature extraction and fitting, thus improving data processing efficiency. In addition, in this embodiment, the nearest neighbor sliding window search and curve fitting of the point cloud are performed in parallel, which improves computation speed compared to the serial processing method in related technologies, thereby increasing data processing efficiency.

[0011] Therefore, it can be seen that the solution provided in this application can effectively improve the efficiency of road guardrail detection and lay the foundation for the timeliness of road guardrail detection. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic flowchart of a road guardrail detection method provided in one embodiment of this application; Figure 2 This is a schematic diagram of the storage of gridded point cloud data provided in one embodiment of this application; Figure 3This is a schematic diagram of feature extraction of a double-sided guardrail provided in one embodiment of this application; Figure 4 This is a schematic diagram of a pipeline iterative curve fitting method provided in one embodiment of this application; Figure 5 This is a schematic diagram of the overall structure of an FPGA provided in one embodiment of this application; Figure 6 This is an overall flowchart of road guardrail detection provided in one embodiment of this application; Figure 7 This is a schematic diagram of the structure of a road guardrail detection device provided in another embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0014] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0015] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0016] To facilitate understanding, before explaining the solution provided in this application, the background of the solution provided in this application will be explained first.

[0017] ADAS (Advanced Driving Assistance System) is a crucial system for autonomous vehicles, aiming to reduce driver error, improve traffic efficiency, and promote urban development by assisting in avoiding collisions. Millimeter-wave radar is a vital sensor in the field of autonomous driving, detecting target objects by emitting and receiving electromagnetic waves in the millimeter-wave band, thereby achieving precise perception and real-time monitoring of the surrounding environment. Road guardrails are traffic signs in traffic systems that demarcate roads and ensure safe and compliant vehicle driving. Radar point cloud-based road guardrail detection is a technology that automatically detects road markings to ensure vehicles stay within designated lanes, reducing the risk of vehicles deviating from the road or colliding with guardrails, while also providing corrective support for identifying drivable areas.

[0018] In related technologies, detecting road guardrails using radar point cloud data typically involves two steps: feature extraction and data fitting. Specifically, features are first extracted from the radar point cloud data, and then a fitting algorithm is used to fit a straight line or curve to the road guardrail, thus obtaining the corresponding road guardrail curve. Commonly used feature extraction methods include binarization and sliding window methods, while curve fitting methods include Hough transform and least squares method.

[0019] However, binarizing radar point cloud data as a two-dimensional image to obtain the edge features of road guardrails only changes the numerical value; the number of static point clouds remains unchanged. Feature points outside the road guardrails can interfere with the extraction of target feature points on the road guardrails. The Hough transform is suitable for fitting straight road guardrails but cannot fit irregularly shaped curves. The least squares method can fit feature points of curved road guardrails, but this method requires serial traversal fitting operations after all feature points have been extracted, and the extracted feature points need to be stored before fitting, resulting in low computational efficiency. Furthermore, in related technologies, road guardrail detection is typically implemented using a CPU, and feature extraction and fitting directly manipulate the point cloud data, consuming significant computational resources and time.

[0020] To address the problems of existing technologies, this application provides a method and apparatus for detecting road guardrails. The method and apparatus provided in this application are both applied in an FPGA. An FPGA is a programmable, customizable, and easily expandable logic device with a hardware parallel structure, suitable for data processing systems with high real-time requirements. In this application embodiment, the FPGA is used to perform gridding processing on point cloud data, dividing the point cloud data into grids. Then, a pipelined approach to extract and fit road guardrail features from the gridded point cloud data is performed to effectively reduce the amount of data. Furthermore, for curve fitting, the least squares method is used. A parallel pipeline design for the least squares algorithm effectively improves the computational speed of road guardrail fitting. Simultaneously, the FPGA has internal hardware resources such as a DSP and BRAM (Block Random Access Memory), which enable efficient data computation and memory access, suitable for hardware acceleration of the road guardrail fitting algorithm.

[0021] The method for detecting road guardrails provided in the embodiments of this application will be introduced first below.

[0022] Figure 1 A schematic flowchart of a road guardrail detection method according to an embodiment of this application is shown. Figure 1 As shown, the method includes the following steps S101 to S103: Step S101: Obtain point cloud data of the road guardrail detected by radar.

[0023] In step S101, the radar may include, but is not limited to, millimeter-wave radar and lidar. In this embodiment, the radar communicates with the FPGA, so that the FPGA can acquire the point cloud data collected by the radar in real time.

[0024] In step S101, the point cloud data of the road guardrail includes, but is not limited to, information such as the coordinates (e.g., Cartesian coordinates), color, intensity, and timestamp of the point cloud.

[0025] Step S102: Map the point cloud data onto a preset grid map to obtain gridded point cloud data.

[0026] In step S102, the grid map is a two-dimensional map of multiple grids, each grid including at least one point cloud, and the gridded point cloud data includes the number of point clouds corresponding to each grid and the grid coordinates of each grid.

[0027] It should be noted that the point cloud data detected by radar is usually in three-dimensional coordinates. In this embodiment, the point cloud data detected by radar is mapped onto a grid map, thereby converting the three-dimensional coordinates of the point cloud into two-dimensional grid coordinates, which reduces the data dimensionality and thus reduces the complexity of data processing.

[0028] In step S102, the FPGA uses coordinate mapping to map the point cloud data. During this process, multiple point clouds may be mapped to the same grid in the grid diagram, so that the number of grids containing point clouds in the grid diagram is less than the number of point clouds detected by the radar. That is, the gridded point cloud data is much smaller than the original point cloud data detected by the radar, thereby reducing the data processing load of the FPGA, improving the data processing efficiency, and thus improving the detection efficiency of road guardrails.

[0029] Step S103: While performing nearest neighbor sliding window search on the gridded point cloud data to obtain feature points, curve fitting calculation is performed on the grid coordinate information corresponding to the feature points in parallel to obtain the road guardrail curve corresponding to the road guardrail.

[0030] It should be noted that for point cloud data, the feature extraction principle is to use the horizontal and vertical coordinates of the point cloud data as input data and employ image processing algorithms to extract target feature points from the point cloud. For feature extraction of gridded point cloud data, methods such as binarization or sliding windows can be used. The binarization method sets the grayscale value of pixels in a two-dimensional image to 0 or 255, and sets a grayscale threshold. Points with a grayscale value greater than the threshold are set to 255, and points with a grayscale value less than the threshold are set to 0. In radar point cloud data processing, binarization can be used to filter static point cloud data to obtain the desired point cloud information. The sliding window method extracts feature points of interest by setting a starting point, a threshold window, and a window sliding strategy. The starting point can be randomly generated or the minimum or maximum value of the point cloud coordinates can be used as the starting point. The threshold window can be determined based on information such as the vehicle speed in the radar point cloud. The window sliding strategy refers to the sliding direction and step size of the window after setting the starting point.

[0031] In step S103, the nearest neighbor sliding window search method is used to extract feature points from the gridded point cloud data. This can enable rapid localization of feature points of the road guardrail, effectively improve the search efficiency of feature points, and provide high-quality data input for subsequent data fitting, thereby improving the accuracy of road guardrail detection.

[0032] In addition, in step S103, the FPGA can use Hough transform and least squares method to achieve curve fitting of the feature point grid coordinate information. Hough transform can detect any shape, but complex shapes require more parameters. In the application scenario of road guardrail fitting, Hough transform is used to complete the straight line fitting task. Specifically, the object to be detected is mapped into Hough space, and the straight line parameters are obtained by statistically finding the coordinates of the most intersecting points. In radar point cloud processing, the point cloud coordinates are rectangular coordinates. First, they are converted to polar coordinates using the rectangular coordinate to polar coordinate conversion formula to obtain the polar radius and polar angle. All point clouds are traversed, and the number of points falling under the same polar radius and polar angle is counted. The polar radius and polar angle with the most occurrences are the parameters of the corresponding straight line to be fitted. Then, according to the relationship between the polar coordinates and rectangular coordinates of the straight line, the obtained polar coordinates are converted into straight line parameters in rectangular coordinates, thus completing the straight line fitting task. For the least squares method, it finds the best function match of the data by minimizing the sum of squared errors; the solution obtained by solving the matrix equation is the coefficient of the fitted curve.

[0033] It should be noted that the Hough transform is suitable for fitting straight road guardrails, but cannot fit irregularly shaped curves. To improve the accuracy of road guardrail fitting, the least squares method is used in this embodiment to fit the road guardrail curve.

[0034] Furthermore, in step S103, the extraction of feature points and the fitting of the road guardrail curve are performed simultaneously. That is, each time a feature point is extracted, it is immediately sent to the next step for curve fitting, without having to wait for all feature points to be extracted before curve fitting. This method can improve the efficiency of road guardrail curve fitting.

[0035] Based on the scheme defined in steps S101 to S1103 above, it can be understood that in this embodiment, the detection of road guardrails is implemented in an FPGA. Compared with the detection of road guardrails by a CPU (Central Processing Unit) in related technologies, the use of the FPGA's hardware parallel structure for data processing can improve the real-time performance of data processing, thereby improving the efficiency of road guardrail detection. Furthermore, in this embodiment, point cloud data is mapped to a mesh graph, and the meshed point cloud data is processed. A single mesh may contain multiple point clouds, and the number of meshes falling into a point cloud is less than the number of original point clouds, effectively reducing the amount of data for road guardrail feature extraction and fitting, and improving data processing efficiency. In addition, in this embodiment, the nearest neighbor sliding window search and curve fitting of the point cloud are performed in parallel, which improves the computation speed compared with the serial processing method in related technologies, thereby improving data processing efficiency.

[0036] Therefore, it can be seen that the solution provided in this application can effectively improve the efficiency of road guardrail detection and lay the foundation for the timeliness of road guardrail detection.

[0037] The implementation process of the method provided in the embodiments of this application is described below.

[0038] In some embodiments, after acquiring the point cloud data detected by the radar, the FPGA performs mesh mapping on the point cloud data.

[0039] Specifically, the FPGA acquires the spatial coordinates corresponding to each point cloud, and then converts the spatial coordinates corresponding to each point cloud into grid coordinates according to the preset coordinate transformation relationship between spatial coordinates and grid coordinates; then the number of point clouds belonging to the same grid is accumulated to obtain the number of point clouds corresponding to each grid.

[0040] In the above embodiments, the spatial coordinates corresponding to the point cloud can be Cartesian coordinates. By performing coordinate transformation on the point cloud, the corresponding grid coordinates can be obtained. It is a grid diagram, and its size is In the grid diagram, the initial value for each grid is 0, meaning that the initial number of point clouds for each grid is 0. Indicates the first Spatial coordinates of a point cloud Indicates the first Given the grid coordinates of a point cloud, the preset coordinate transformation relationship between the spatial coordinates and the grid coordinates can be determined by formulas (1) and (2): (1) (2) In formulas (1) and (2), Indicates to The amount of translation is determined by the coordinate range of the grid. and They represent respectively to and The scaling ratio for scaling; This is the floor function.

[0041] It should be noted that for a grid diagram, its coordinate range along the X-axis is... Its coordinate range in the Y-axis direction is Since a global translation of the coordinates only changes the position of the road guardrail curve without affecting its shape, for ease of calculation, in this embodiment, the abscissa of the point cloud's spatial coordinates is translated; specifically, the abscissa of the point cloud's spatial coordinates is translated to the right. This places the grid coordinates in the first quadrant of the coordinate axes.

[0042] After completing the coordinate transformation using formulas (1) and (2), the number of point clouds falling into each grid is counted to obtain the gridded point cloud data.

[0043] Furthermore, to ensure that the point cloud accurately falls within the grid of the mesh image, the grid coordinates are constrained using the size of the mesh image after the point cloud coordinates are transformed. If the grid coordinates... It falls outside the grid diagram, for example, , Then the first grid cell of the grid diagram is taken as the grid coordinate of the point cloud, i.e. .

[0044] For example, the algorithm for mesh mapping can be shown in Table 1: It should be noted that the coordinate transformation process for point cloud data involves rounding the point cloud coordinates and merging the point clouds, converting the number of point clouds into the number of grids. This reduces the amount of data to be processed and improves the efficiency of data processing. Furthermore, the gridded point cloud data obtained through the above grid mapping process can also serve as the basis for sliding window search in subsequent feature extraction, providing data support for subsequent feature extraction.

[0045] Furthermore, after completing the coordinate transformation, the FPGA also stores the meshed point cloud data. In this embodiment, the FPGA further includes multiple Block Random Access Memory (BRAMs), which are used to store the meshed point cloud data.

[0046] In some embodiments, after mapping point cloud data onto a preset mesh map to obtain meshed point cloud data, the FPGA further acquires the first mesh coordinates in the first direction and the second mesh coordinates in the second direction; then, based on the number of BRAMs in the multiple BRAMs, the second mesh coordinates are divided to obtain the quotient and remainder; then, the product of the size corresponding to the mesh map and the quotient is calculated to obtain the address offset; next, the address offset is applied to the first mesh coordinates to obtain the data storage address; finally, the number of point clouds corresponding to the first mesh is stored in the data storage address of the target BRAM.

[0047] In the above embodiments, the first direction and the second direction are different. For example, the first direction is the positive X-axis direction and the second direction is the positive Y-axis direction. The first grid is a grid among multiple grids with a point cloud quantity greater than a preset quantity. For example, the first grid is a grid with a point cloud quantity that is not 0. That is, in this embodiment of the application, the grid data of the grid with a point cloud quantity that is not 0 is stored.

[0048] In addition, in the above embodiments, the remainder obtained by dividing the second grid coordinates can be used to characterize the BRAM identifier, and the remainder can be used to determine the storage address of the gridded point cloud data in the BRAM, wherein the identifier corresponding to the BRAM is the BRAM identifier.

[0049] The following is Figure 2 Taking the storage diagram of the gridded point cloud data shown as an example, three BRAMs are deployed in the FPGA: BRAM1, BRAM2, and BRAM3. Figure 2 As shown, A two-dimensional grid of size is stored column-wise in the FPGA's BRAM, where the first column stores the 0th to 1st columns of the first BRAM. -1 address, the second column is stored in the second BRAM from 0 to... -1 address, the third column is stored in the 0th to 1st column of the third BRAM. Address -1, the fourth column is stored in the first BRAM. arrive Addresses, and so on. Then for grid coordinates... Its coordinate index in the BRAM can be determined by formula (3): (3) In formula (3), This represents the number of grid cells in the grid. For the number of BRAMs, in Figure 2 In this case, N=3; This is the data storage address for the gridded point cloud data in BRAM.

[0050] When N=3, by The modulo-3 operation determines which BRAM memory location the corresponding grid number coordinates are stored in, and the storage address is... The coordinates are obtained by adding the offset.

[0051] It should be noted that while division and modulo operators are highly efficient in FPGA design, they also significantly increase resource consumption. Therefore, in this embodiment, a custom-written method is used. Division and modulo operations are implemented in code. Specifically, in this embodiment, the FPGA further includes a division module, the operation of which may include the following steps S11 to S14: Step S11, take the high of the dividend. Bit data, where, The bit width is the same as that of the divisor.

[0052] Step S12, the dividend high Compare the bit data with the divisor. If the former is not less than the latter, the quotient of the corresponding bit is 1. Then calculate the difference between the two to get the remainder from the first step. Otherwise, the corresponding quotient is 0, and the former is directly used as the remainder.

[0053] Step S13: Concatenate the remainder from step S12 with the highest bit of the remaining data of the dividend to form new data, and then compare it with the divisor to obtain the new quotient and remainder.

[0054] Step S14: Repeat step S13 until the least significant bit of the dividend is also included in the calculation.

[0055] After the above calculation is completed, the result of the last quotient is taken as the final quotient, and the result of the last remainder is taken as the final remainder. The coordinate values ​​after mesh mapping are input into the above division module, and the remainder output by the division module is the remainder in formula (3). The value, the quotient obtained is the value in formula (1). The value is calculated, and the count value is written to the first... A BRAM The address allows for the storage of gridded point cloud data.

[0056] After mapping the point cloud data, the FPGA can extract features from the meshed point cloud data and perform curve fitting on the extracted feature points. In this embodiment, the FPGA can use a nearest neighbor sliding window search method to extract features from the meshed point cloud data.

[0057] In some embodiments, the FPGA performs a neighborhood sliding window search on the grids in the first grid layer based on the number of point clouds corresponding to each grid and a threshold window determined by the hardware parameters of the FPGA to obtain the first feature point corresponding to the road guardrail; then, it performs a neighborhood sliding window search on the grids in the second grid layer to obtain the second feature point, and at the same time, it performs curve fitting calculation on the grid coordinate information corresponding to the first feature point to obtain the road guardrail curve.

[0058] In the above embodiments, the mesh diagram includes multiple mesh layers, and each mesh layer includes multiple meshes, wherein the number of mesh layers can be [missing information]. Figure 2 The row in the grid. The first grid layer mentioned above can be any one of multiple grid layers, and the second grid layer is the next grid layer after the first grid layer in the grid search direction of the grid diagram, for example, in... Figure 2 In the grid diagram shown, the grid search direction is along the direction from the first row to the row number. Then the second grid layer is the grid layer below the first grid layer. For example, if the first grid layer is the grid layer of the first row, then the second grid layer is the grid layer of the second row.

[0059] It should be noted that in the above embodiments, the threshold window is determined based on the hardware parameters of the FPGA. That is, in this embodiment, the threshold window determined by the hardware performance of the FPGA is used to extract feature points, thereby avoiding the problem of FPGA processing performance degradation caused by setting a large threshold window, and also avoiding the problem of FPGA computing resources being wasted by setting a small threshold window.

[0060] In addition, in the above embodiments, after the feature points are extracted, the feature points are directly used as input for curve fitting, instead of extracting all feature points before curve fitting. This achieves parallel execution of feature point extraction and curve fitting, improving the efficiency of road guardrail curve generation.

[0061] For feature point extraction, the FPGA obtains the starting feature point corresponding to the previous mesh layer of the first mesh layer; then, it obtains multiple adjacent meshes adjacent to the starting feature point from the first mesh layer, and determines the first feature point based on the number of point clouds in the multiple adjacent meshes.

[0062] In the above embodiments, the adjacent grids adjacent to the starting feature point may include feature points in the previous grid layer that are opposite to the starting feature point, as well as feature points on the left and right sides of the starting feature point. The number of multiple adjacent grids is adapted to the length of the threshold window, and the first feature point is the starting feature point of the first grid layer.

[0063] For example, Figure 3 A schematic diagram of feature extraction for the double-sided guardrail is shown here. Figure 3 This section will use the feature extraction of a road guardrail on any one side as an example. Figure 3 In the middle, gray squares represent The grid contains a number of meshes, and the color depth indicates the size of the mesh; the darker the color, the larger the mesh count. In FPGA, the mesh coordinates of the feature's starting point are first used as the basis for the initial calculation. In the previous row coordinate grid coordinate grid The grid of coordinates is used as the adjacent grid, and the grid address of the adjacent grid is converted by formula (3) to obtain the BRAM that stores the number of adjacent grids and the data storage address in the BRAM. Then, the number of grids corresponding to each grid is extracted from the data storage address. Next, the feature points in the grid layer above the first grid layer are determined according to the size of the number of grids corresponding to the grid.

[0064] In some embodiments, when a target grid exists among multiple adjacent grids, the FPGA determines the target grid as a first feature point and uses the grid with the largest coordinate value among the multiple adjacent grids as the starting feature point of the next grid layer. When the number of point clouds in multiple adjacent grids is less than or equal to the target number, the threshold window is moved a preset number of grids along a first direction to obtain multiple target adjacent grids; when a target grid exists among multiple target adjacent grids, the target grid is determined as the first feature point, and the grid with the largest coordinate value among the multiple adjacent grids is used as the starting feature point of the next grid layer; when the number of point clouds in multiple target adjacent grids is less than or equal to the target number, it is determined that no feature point exists in the first grid layer. Here, the target grid is a grid with a point cloud number greater than the target number.

[0065] For example, in Figure 3 In the process, if the number of point clouds in three adjacent grids is greater than 0, the grid coordinates of multiple adjacent grids are input into the least squares fitting module for curve fitting, and the magnitudes of the three coordinate values ​​are compared. The coordinates of the largest value are used as the new starting feature point. The coordinates continue to be searched and retrieved until the window is slid to its highest point, which is the coordinate. Coordinates are When the search stops, a termination flag is sent. If none of the three grids corresponding to the coordinates searched upwards contain point clouds, the window slides one grid to the right to continue the search. Figure 3 The dashed section in the image slides to the right. If, after sliding one grid to the right, the grid in the window still doesn't contain a point cloud, it slides one grid to the left to search. If neither the left nor right grid finds a grid containing a point cloud, the search continues upwards, and so on, until the difference between the upward search distance and the maximum ordinate of the currently found point is greater than [a certain value]. If the preset threshold is reached, the search stops and an end flag is sent to the least squares fitting module.

[0066] As can be seen from the above example, in the process of searching for feature points, it is necessary to determine the starting feature point of each grid layer. For the first grid layer in the grid diagram, the FPGA can determine at least one first grid whose grid coordinates are within a preset coordinate range from multiple grids based on the grid distribution data in the grid diagram; then, the grid with the smallest grid coordinates among the at least one first grid is determined as the starting feature point of the first grid layer.

[0067] For example, in the process of During the mapping process, the FPGA can add a preset coordinate range to determine the starting feature point of the first mesh layer. For the left-side road guardrail, its corresponding coordinate range can be determined by... and To determine, among which, This represents the starting point range of the left-side road guardrail in the X direction. This refers to the starting point range of the left-hand road guardrail in the Y direction. It will fall into the area defined by... and The smallest grid coordinate within the defined coordinate range This serves as the starting feature point for the left-side road guardrail. Similarly, for the right-side road guardrail, its corresponding coordinate range can be determined by... and To determine, among which, This refers to the starting point range of the right-hand road guardrail in the X direction. It will fall into the area defined by... and The smallest grid coordinate within the defined coordinate range This serves as the starting feature point corresponding to the guardrail on the right side of the road.

[0068] Furthermore, while sending the grid coordinates corresponding to the feature points to the least squares fitting module in the FPGA, the FPGA also records the ordinates of the feature points, including the maximum and minimum values. After the search is completed, these two values ​​are output and can be used as the starting and ending points of the road guardrail curve.

[0069] In some embodiments, after extracting feature points, the FPGA can perform curve fitting calculations on the grid coordinate information corresponding to the first feature point. Specifically, the FPGA obtains feature matrices corresponding to multiple feature points, including the first feature point. Then, it performs eigenvalue decomposition on the feature matrices corresponding to the multiple feature points to obtain multiple feature elements. Next, based on the correlation between the feature elements and the coefficient matrix, it constructs a coefficient matrix corresponding to the multiple feature elements. It performs parallel calculations on feature elements belonging to the same level to obtain fitting coefficients in the coefficient matrix. Finally, the road guardrail curve can be constructed based on the fitting coefficients and the grid coordinates corresponding to the multiple feature points.

[0070] In the above embodiments, multiple feature elements are deployed on multiple levels, which include multiple layers and multiple levels, with at least one feature element deployed on each layer; for parallel computation of feature elements, the FPGA can achieve this through the following steps S1 to S3: Step S1: For the first level among multiple levels, perform parallel computation on the feature elements of multiple layers to obtain the output data of the current level; Step S2: For the next level of the current level, perform parallel computation on the output data of the current level and the corresponding feature elements of the next level of the current level; Step S3: Repeat steps S1 to S2 until the current level is the last level among multiple levels, and obtain the fitting coefficients.

[0071] To facilitate understanding, before introducing the curve fitting method used in the embodiments of this application, the principle of the least squares algorithm used in the embodiments of this application will be introduced first.

[0072] The least squares method is a commonly used algorithm for fitting polynomials. It is defined as follows: the polynomial that minimizes the sum of the absolute values ​​of the errors is the desired fitting polynomial (i.e., the least squares fitting polynomial). Assume a given set of data points... , In a given function class In the middle, seek To make the error The sum of squares is minimized, as shown in formula (4): (4) When fitting a polynomial, it satisfies formula (4). This is called the least squares fitting polynomial. For the first The y-coordinates of the data points. Clearly... for The multivariable function is therefore, the above least squares problem is to find the... For the extremum problem, the necessary condition for finding the extremum of a multivariable function is that the partial derivative at the extremum point is 0, as shown in equation (5): (5) In formula (5), .

[0073] Will Multiplying this into formula (5) and shifting the result, we get formula (6): (6) Formula (6) is about The linear equation system, whose corresponding matrix representation can be shown in formula (7): (7) The system of equations in formula (7) is a symmetric positive definite matrix with a unique solution. Solving formula (7) yields the following results. Thus, the polynomial can be obtained. This is the desired fitting polynomial.

[0074] The matrix members in formula (7) can be divided into three parts for simplification. The simplified formula is shown in formula (8). If we want to find the polynomial coefficients... Matrix, then for The inverse matrix can be multiplied on the left. Therefore, it is necessary to calculate the inverse matrix of matrix A and matrix B, and then multiply them to obtain the final polynomial fitting coefficients.

[0075] (8) The inverse matrix of matrix A is shown in formula (9). The inverse matrix of A is equal to the adjoint matrix of A divided by the determinant of A.

[0076] (9) In formula (9) The expression for can be represented by formula (10): (10) In formula (10), It represents the algebraic cofactor.

[0077] Finding the inverse of matrix A requires a large number of multiplications. Division is computationally complex and resource-intensive, making it unsuitable for deployment on FPGAs. Therefore, matrix transformations are necessary to reduce multiplication and division operations, converting the matrix into a more computationally efficient form. The least squares method uses matrices... It is a symmetric positive definite matrix. According to the theorem, there exists a lower triangular matrix whose diagonal elements are all positive. , making ( (where L is the transpose) holds, where, The lower triangular matrix is ​​shown in equation (11): (11) right To derive, , and The expression for can be shown in formula (12): (12) In formula (12), and As a scalar, and It is a column vector. for A square matrix of order, for A is a lower triangular matrix of order 1. Then A can be expressed by formula (13): (13) Formula (14) can be obtained from the matrix correspondence in formula (13): (14) Formula (14) involves complex square root calculations. To avoid these calculations, the matrix is... Decomposed into formula (15): (15) In formula (15), diagonal matrix It is a lower triangular matrix with diagonal elements all being 1. for The transpose of the matrix. A, L, and D in formula (15) can be represented by formula (16): (16) First determine and The element calculation representation in the matrix can be obtained from formula (14) to formula (17): (17) Solve using the decomposition results That is, to solve From equations (17) and (7), we can calculate... and can Solving as a whole is... From this, we can obtain Solving for Z yields the result shown in formula (18): (18) Then, Solving as a whole is... From this, we can obtain ,right The solution is shown in formula (19): (19) Finally, for To solve, and yes The transpose of can be used to solve for the final quadratic polynomial coefficient matrix. As shown in formula (20): (20) Based on the above derivation process, the least squares method for fitting a quadratic polynomial on an FPGA can be designed as a pipelined iterative process, such as... Figure 4 As shown, the input coordinates are first calculated according to formula (7), and the pipeline obtains them sequentially. Matrix and The element values ​​in the matrix are then input into the pipeline according to formulas (17)-(20) to calculate the intermediate variables of each part in turn. The calculation results of the previous pipeline can be used as the calculation input of the next pipeline. Based on the relationship between the intermediate variables, the overall design is 6 layers (e.g., ...). Figure 4 Each row in the parallel structure and 11 levels (such as...) Figure 4 The pipeline structure (Line 1, Line 2, ..., Line 11) is as follows: When the sliding window search finds a mesh containing the point cloud, a valid signal is sent; when the sliding window search reaches the coordinates of the last mesh, an end flag is sent. After 8 stages of the pipeline, the final fitting coefficients are output sequentially. As a result, there are a total of 6 division operations in the intermediate variable calculation process. Considering that the 6 divisions in the pipeline structure are not performed simultaneously, and each pipeline stage performs a maximum of 2 division operations at the same time, in this embodiment of the application, the division operation is set up as a separate module (i.e., the division module). When the subsequent pipeline stage needs to perform division, the division module can be called. This calculation method can realize the reuse of the division module and reduce the use of hardware resources.

[0078] In this embodiment, the multinomial factorization algorithm is used to avoid root-finding operations, while the parallel pipeline structure enables fast computation, saving the storage process of intermediate results to FIFO (First Input First Output) or BRAM, and reducing the use of storage resources.

[0079] In some embodiments, Figure 5 A schematic diagram of the overall structure of the FPGA is shown, such as... Figure 5 As shown, the FPGA includes a mesh mapping module 501, a data storage module 502, a feature extraction module 503, and a curve fitting module (i.e., a least squares fitting module) 504.

[0080] The grid mapping module 501 can map the spatial coordinates of the point cloud to the grid diagram to obtain the grid coordinates of the point cloud. At the same time, the grid mapping module 501 also determines the address index for storing the gridded point cloud data based on the grid coordinates of the point cloud and the number of point clouds in each grid, and stores the gridded point cloud data in the data storage module 502 through the address index.

[0081] For the feature extraction module 503, it obtains gridded point cloud data from the data storage module 502 according to the mapping relationship between grid coordinates and BRAM data storage address, and performs feature extraction using the nearest neighbor sliding window search method. Then, it sends the extracted feature points to the curve fitting module 504.

[0082] For the curve fitting module 504, it uses the implicit decomposition method to perform least squares fitting based on the feature points extracted by the feature extraction module 503, and then determines the starting point and ending point of the road guardrail curve based on the maximum and minimum values ​​of the ordinate, thereby obtaining the road guardrail curve.

[0083] In some embodiments, Figure 6 The overall flowchart of road guardrail inspection is shown, such as Figure 6 As shown, the overall process includes the following steps S601 to S607: Step S601: The millimeter-wave radar in the vehicle emits continuous waves; Step S602: The millimeter-wave radar receives the transmitted signal and generates raw point cloud data; Step S603: The FPGA preprocesses the original point cloud data, including but not limited to Doppler compensation, angular accuracy improvement, ground clutter filtering, and large-angle noise filtering. In step S604, the FPGA divides the preprocessed point cloud data into static and dynamic point cloud data to obtain static point cloud data after filtering out moving targets. Step S605: Map the static point cloud data onto the mesh map to obtain meshed point cloud data; Step S606: Perform nearest neighbor sliding search on the gridded point cloud data to obtain the feature points corresponding to the road guardrail; Step S607: Fit the feature points into a quadratic polynomial line to obtain the fitted curve of the road guardrail.

[0084] This concludes the introduction of the methods provided in the embodiments of this application.

[0085] As can be seen from the above, in the solution provided in this application embodiment, mapping point cloud coordinates to a grid can effectively reduce the number of feature points and lower computational complexity. Furthermore, in this application embodiment, through the mapping relationship between grid coordinates and BRAM addresses, the gridded point cloud can be stored in the FPGA's BRAM. Simultaneously, a nearest neighbor-based sliding window search method is used to quickly locate the feature points of the road guardrail, improving the search efficiency of feature points and providing high-quality input data for subsequent fitting. Parallel pipeline technology greatly improves computational speed, fully utilizes the FPGA's hardware resources, and can directly output fitting coefficients after fitting, improving the system's response speed.

[0086] This application also provides a detection device for road guardrails, such as... Figure 7 As shown, the device 700, applied in a programmable gate array (FPGA), includes: a data acquisition module 701, a mesh generation module 702, and a guardrail detection module 703.

[0087] The data acquisition module 701 is used to acquire point cloud data of the road guardrail detected by the radar; The grid division module 702 is used to map point cloud data onto a preset grid map to obtain gridded point cloud data. The grid map includes multiple grids, each grid includes at least one point cloud, and the gridded point cloud data includes the number of point clouds corresponding to each grid and the grid coordinates of each grid. The guardrail detection module 703 is used to perform nearest neighbor sliding window search on the gridded point cloud data to obtain feature points, and at the same time, perform curve fitting calculation on the grid coordinate information corresponding to the feature points to obtain the road guardrail curve.

[0088] In some embodiments, the grid division module is specifically used to obtain the spatial coordinates corresponding to each point cloud; convert the spatial coordinates corresponding to each point cloud into grid coordinates according to the preset coordinate transformation relationship between spatial coordinates and grid coordinates; and accumulate the number of point clouds belonging to the same grid to obtain the number of point clouds corresponding to each grid.

[0089] In some embodiments, the FPGA includes multiple Block Random Access Memory (BRAMs), and the road guardrail detection device further includes: a data storage module, configured to, after mapping point cloud data to a preset grid map to obtain gridded point cloud data, acquire the first grid coordinates in a first direction and the second grid coordinates in a second direction of a first grid, wherein the first direction is different from the second direction, and the first grid is a grid among multiple grids with a point cloud quantity greater than a preset number; perform division calculation on the second grid coordinates based on the number of BRAMs in the multiple BRAMs to obtain a quotient and a remainder, wherein the remainder is used to characterize the BRAM identifier; calculate the product of the size corresponding to the grid map and the quotient to obtain an address offset; offset the first grid coordinates by the address offset to obtain a data storage address; and store the point cloud quantity corresponding to the first grid in the data storage address of the target BRAM, wherein the identifier corresponding to the BRAM is the BRAM identifier.

[0090] In some embodiments, the mesh map includes multiple mesh layers, each mesh layer includes multiple meshes, and the guardrail detection module includes a feature extraction module and a curve fitting module. The feature extraction module is used to perform a neighborhood sliding window search on the meshes in the first mesh layer based on the number of point clouds corresponding to each mesh and a threshold window determined by the hardware parameters corresponding to the FPGA, to obtain a first feature point corresponding to the road guardrail, wherein the first mesh layer is any one of the multiple mesh layers; the curve fitting module is used to perform a neighborhood sliding window search on the meshes in the second mesh layer to obtain a second feature point, and simultaneously perform curve fitting calculation on the mesh coordinate information corresponding to the first feature point to obtain the road guardrail curve, wherein the second mesh layer is the mesh layer following the first mesh layer in the mesh search direction of the mesh map.

[0091] In some embodiments, the feature extraction module includes: a feature point acquisition module, a grid determination module, and a first extraction module. The feature point acquisition module is used to acquire the starting feature point corresponding to the grid layer preceding the first grid layer; the grid determination module is used to acquire multiple adjacent grids from the first grid layer that are adjacent to the starting feature point, wherein the number of the multiple adjacent grids is adapted to the length of the threshold window; the first extraction module is used to determine the first feature point based on the number of point clouds in the multiple adjacent grids.

[0092] In some embodiments, the first extraction module is specifically used to: determine the target grid as a first feature point when there is a target grid among multiple adjacent grids, and take the grid with the largest number of point clouds among the target grids as the starting feature point of the next grid layer, wherein the target grid is a grid with a number of point clouds greater than the target number; when the number of point clouds in multiple adjacent grids is less than or equal to the target number, move the threshold window along the first direction by a preset number of grids to obtain multiple target adjacent grids; when there is a target grid among multiple target adjacent grids, determine the target grid as a first feature point, and take the grid with the largest number of point clouds among the target grids as the starting feature point of the next grid layer; when the number of point clouds in multiple target adjacent grids is less than or equal to the target number, determine that there are no feature points in the first grid layer.

[0093] In some embodiments, when the first grid layer is the first grid layer in the grid diagram, the feature point acquisition module is specifically used to determine at least one first grid whose grid coordinates are within a preset coordinate range from multiple grids based on the grid distribution data in the grid diagram; and to determine the grid with the smallest grid coordinates among the at least one first grid as the starting feature point of the first grid layer.

[0094] In some embodiments, the curve fitting module includes: a matrix acquisition module, an eigenvalue decomposition module, a matrix construction module, a parallel computing module, and a curve construction module. The matrix acquisition module acquires a feature matrix corresponding to multiple feature points, where the multiple feature points include first feature points. The eigenvalue decomposition module decomposes the feature matrix corresponding to the multiple feature points to obtain multiple feature elements. The matrix construction module constructs a coefficient matrix corresponding to the multiple feature elements based on the correlation between the feature elements and the coefficient matrix, where the multiple feature elements are deployed at multiple levels. The parallel computing module performs parallel computing on feature elements belonging to the same level to obtain fitting coefficients in the coefficient matrix. The curve construction module constructs a road guardrail curve based on the fitting coefficients and the grid coordinates corresponding to the multiple feature points.

[0095] In some embodiments, the multiple layers include multiple layers and multiple levels, with at least one feature element deployed on each layer; the parallel computing module is used to perform the following steps: Step S1: For the first level among multiple levels, perform parallel computation on the feature elements of multiple layers to obtain the output data of the current level; Step S2: For the next level of the current level, perform parallel computation on the output data of the current level and the corresponding feature elements of the next level of the current level; Step S3: Repeat steps S1 to S2 until the current level is the last level among multiple levels, and obtain the fitting coefficients.

[0096] The road guardrail detection device provided in this application embodiment can realize all the processes implemented in the aforementioned method embodiments, and will not be repeated here to avoid repetition.

[0097] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0098] Figure 8A schematic diagram of the hardware structure of the electronic device provided in an embodiment of this application is shown.

[0099] Electronic devices may include a processor 801 and a memory 802 storing computer program instructions.

[0100] Specifically, the processor 801 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0101] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.

[0102] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the methods according to one aspect of this disclosure.

[0103] The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any of the road guardrail detection methods in the above embodiments.

[0104] In one example, the electronic device may also include a communication interface 803 and a bus 810. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 810 and complete communication with each other.

[0105] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0106] Bus 810 includes hardware, software, or both, that couples components of an electronic device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 810 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, this application contemplates any suitable bus or interconnect.

[0107] Furthermore, in conjunction with the road guardrail detection method in the above embodiments, this application embodiment can provide a computer-readable storage medium for implementation. This computer-readable storage medium stores computer program instructions; when executed by a processor, these computer program instructions implement any of the road guardrail detection methods in the above embodiments.

[0108] Furthermore, in conjunction with the road guardrail detection method described in the above embodiments, this application embodiment can provide a computer program product for implementation. When the instructions in this computer program product are executed by the processor of an electronic device, the electronic device performs any of the road guardrail detection methods described in the above embodiments.

[0109] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.

[0110] The functional modules shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0111] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0112] The foregoing flowcharts and / or block diagrams of the road guardrail detection method and apparatus according to embodiments of the present disclosure have described various aspects of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to create a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0113] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for detecting road guardrails, characterized in that, When applied to a programmable gate array (FPGA), the method includes: Acquire point cloud data of road guardrails detected by radar; The point cloud data is mapped onto a preset grid diagram to obtain gridded point cloud data. The grid diagram includes multiple grids, each grid includes at least one point cloud, and the gridded point cloud data includes the number of point clouds corresponding to each grid and the grid coordinates of each grid. While performing a nearest neighbor sliding window search on the gridded point cloud data to obtain feature points, curve fitting calculations are performed on the grid coordinate information corresponding to the feature points in parallel to obtain the road guardrail curve corresponding to the road guardrail.

2. The method according to claim 1, characterized in that, The step of mapping the point cloud data onto a preset grid map to obtain gridded point cloud data includes: Obtain the spatial coordinates corresponding to each point cloud; Based on a preset coordinate transformation relationship between spatial coordinates and grid coordinates, the spatial coordinates corresponding to each point cloud are converted into grid coordinates; The number of point clouds belonging to the same grid is accumulated to obtain the number of point clouds corresponding to each grid.

3. The method according to claim 2, characterized in that, The FPGA includes multiple Block Random Access Memory (BRAMs). After mapping the point cloud data onto a preset mesh map to obtain meshed point cloud data, the method further includes: Obtain the first grid coordinates in a first direction and the second grid coordinates in a second direction, wherein the first direction is different from the second direction, and the first grid is a grid among the plurality of grids whose point cloud number is greater than a preset number; The second grid coordinates are divided based on the number of BRAMs in the multiple BRAMs to obtain a quotient and a remainder, wherein the remainder is used to characterize the BRAM identifier; The address offset is obtained by multiplying the size corresponding to the mesh diagram by the quotient. The data storage address is obtained by offsetting the first grid coordinates by the address offset. The number of point clouds corresponding to the first grid is stored in the data storage address of the target BRAM, wherein the identifier corresponding to the BRAM is the BRAM identifier.

4. The method according to claim 3, characterized in that, The grid map includes multiple grid layers, and each grid layer includes multiple grids. While performing a nearest neighbor sliding window search on the gridded point cloud data to obtain feature points, curve fitting calculations are performed in parallel on the grid coordinate information corresponding to the feature points to obtain the road guardrail curve corresponding to the road guardrail, including: Based on the number of point clouds corresponding to each grid and the threshold window determined by the hardware parameters corresponding to the FPGA, a neighborhood sliding window search is performed on the grids in the first grid layer to obtain the first feature point corresponding to the road guardrail, wherein the first grid layer is any one of the plurality of grid layers; A neighborhood sliding window search is performed on the grid in the second grid layer to obtain the second feature point. At the same time, curve fitting calculation is performed on the grid coordinate information corresponding to the first feature point to obtain the road guardrail curve. The second grid layer is the grid layer below the first grid layer in the grid search direction of the grid map.

5. The method according to claim 4, characterized in that, The step of performing a neighborhood sliding window search on the grids in the first grid layer based on the point cloud data corresponding to each grid and a threshold window determined by the hardware parameters corresponding to the FPGA to obtain the first feature point corresponding to the road guardrail includes: Obtain the starting feature point corresponding to the previous grid layer of the first grid layer; Obtain multiple adjacent grids from the first grid layer that are adjacent to the starting feature point, wherein the number of the multiple adjacent grids is adapted to the length of the threshold window; The first feature point is determined based on the number of point clouds in the plurality of adjacent grids.

6. The method according to claim 5, characterized in that, The step of determining the first feature point based on the number of point clouds in the plurality of adjacent grids includes: When a target grid exists in multiple adjacent grids, the target grid is determined as the first feature point, and the grid with the largest coordinate value among multiple adjacent grids is taken as the starting feature point of the next grid layer. The target grid is the grid with a point cloud number greater than the target number. When the number of point clouds in multiple adjacent grids is less than or equal to the target number, the threshold window is moved by a preset number of grids along the first direction to obtain multiple target adjacent grids. When a target grid exists in multiple adjacent grids, the target grid is determined as the first feature point, and the grid with the largest coordinate value among the multiple adjacent grids is taken as the starting feature point of the next grid layer. If the number of point clouds in all the adjacent grids of the multiple targets is less than or equal to the number of targets, it is determined that there are no feature points in the first grid layer.

7. The method according to claim 5 or 6, characterized in that, When the first grid layer is the first grid layer in the grid diagram, obtaining the starting feature point corresponding to the previous grid layer of the first grid layer includes: Based on the grid distribution data in the grid diagram, at least one first grid whose grid coordinates fall within a preset coordinate range is determined from the plurality of grids; The grid with the smallest grid coordinates in the at least one first grid is determined as the starting feature point of the first grid layer.

8. The method according to claim 4, characterized in that, The step of performing curve fitting calculation on the grid coordinate information corresponding to the first feature point to obtain the road guardrail curve includes: Obtain a feature matrix corresponding to multiple feature points, wherein the multiple feature points include the first feature point; The feature matrix corresponding to the multiple feature points is decomposed to obtain multiple feature elements; Based on the relationship between the feature elements and the coefficient matrix, a coefficient matrix corresponding to the plurality of feature elements is constructed, wherein the plurality of feature elements are deployed at multiple levels; Parallel computation is performed on feature elements belonging to the same level to obtain the fitting coefficients in the coefficient matrix; The road guardrail curve is constructed based on the fitting coefficients and the grid coordinates corresponding to the multiple feature points.

9. The method according to claim 8, characterized in that, The multiple layers include multiple layers and multiple levels, and each layer has at least one feature element deployed on it; The parallel computation of feature elements belonging to the same level to obtain the fitting coefficients in the coefficient matrix includes: Step S1: For the first level among the multiple levels, perform parallel calculations on the feature elements of the multiple layers to obtain the output data of the current level; Step S2: For the next level of the current level, perform parallel calculations on the output data of the current level and the feature elements corresponding to the next level of the current level; Step S3: Repeat steps S1 to S2 until the current level is the last level among the multiple levels, and obtain the fitting coefficient.

10. A detection device for road guardrails, characterized in that, The device, used in a programmable gate array (FPGA), includes: The data acquisition module is used to acquire point cloud data of the road guardrails detected by radar; A grid partitioning module is used to map the point cloud data onto a preset grid map to obtain gridded point cloud data. The grid map includes multiple grids, each grid includes at least one point cloud, and the gridded point cloud data includes the number of point clouds corresponding to each grid and the grid coordinates of each grid. The guardrail detection module is used to perform nearest neighbor sliding window search on the gridded point cloud data to obtain feature points, and simultaneously perform curve fitting calculation on the grid coordinate information corresponding to the feature points to obtain the road guardrail curve corresponding to the road guardrail.