A temporary road detection method and system based on triangulation
Through the triangulation algorithm and YOLOv4 target detection network, the problems of low temporary road detection efficiency and insufficient safety in driverless technology are solved, and efficient and robust temporary road path planning is achieved.
Patent Information
- Application Number
- CN202210357534.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-04-02
AI Technical Summary
Existing driverless technology has problems with low efficiency, small safety redundancy, and unstable curve detection in temporary road detection. In particular, it cannot effectively handle temporary roads guided by traffic cones.
Adopt a temporary road detection method based on triangulation, train the YOLOv4 target detection network by collecting cone bucket image data sets, obtain the 3D point cloud coordinates of the cone bucket, and use the Delaunay triangulation algorithm to calculate the triangle edge loss value, and the adaptive output can driving path to ensure the safety and robustness of the path.
It achieves temporary road detection with fast speed, high safety redundancy and robustness, avoids the problems of unstable curve detection and small drivable road area, and improves the overall performance of temporary road detection.
Smart Images

Figure CN114742794B
Abstract
Description
Technical Field
[0001] The invention relates to the field of unmanned driving technology, and in particular to a temporary road detection method and system based on triangulation. Background Art
[0002] At present, unmanned driving technology has become the focus of research in various research institutions. The road conditions it faces are complex and changeable. Temporary roads are one of the special road conditions. Traffic cones are often used to temporarily build roads during road maintenance, traffic accidents, and temporary road control to avoid further expansion of accidents and traffic diversion. Although unmanned driving technology has achieved many research results, there are few reports on the research of temporary road detection.
[0003] There are two main methods for detecting temporary roads for unmanned driving: one is to rely on a priori high-precision maps, use sensors to obtain environmental information to locate unmanned vehicles in real time, and perform scene registration with high-precision maps to obtain the optimal drivable area; the other is to directly calculate the drivable area based on sensor data without a priori maps. The former method can plan drivable roads more accurately, but it is necessary to load the high-precision map of the area in advance, which increases the cost of map construction. On the other hand, the probability of temporary roads is relatively random, and this method cannot ensure that unmanned vehicles drive along the expected route. The latter method plans the drivable area in real time through the scene information obtained by sensors. There are two main methods for calculating the drivable area. One is to use the quadrilateral centroid method to select the four cones closest to the unmanned vehicle on both sides of the road, calculate the centroid position of the quadrilateral they constitute, and use this as the drivable path point; the other is to use Hough transform to construct straight lines between the cones on both sides of the road, and then fit them into lane lines. The area between the lane lines on both sides is used as the drivable area for unmanned vehicles. The former method has a small safety redundancy and low efficiency due to the small drivable road area detected. The latter method is not stable for curve detection because it performs segmented fitting on straight lines and cannot fit the ideal drivable area. Conventional lane line detection algorithms cannot handle temporary roads guided by traffic cones well. Summary of the invention
[0004] In view of the above problems, the object of the present invention is to provide a temporary road detection method and system based on triangulation, which has high speed, high safety redundancy and strong robustness.
[0005] To achieve the above-mentioned purpose, the present invention adopts the following technical scheme: a temporary road detection method based on triangulation, which comprises: collecting a cone barrel image data set, using the data set to train a YOLOv4 target detection network, and obtaining a cone barrel recognition model; obtaining scene point cloud data, obtaining the cone barrel color and its point cloud coordinates, and identifying the cone barrel and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the cone barrel color; triangulating the identified cone barrel, calculating the loss value of each triangle edge, calculating the path loss value according to the set loss function, and outputting the drivable area and path of the temporary road according to the loss value.
[0006] Furthermore, the cone barrel image dataset is collected, and the YOLOv4 target detection network is trained using the dataset to obtain the cone barrel recognition model, including:
[0007] Use image capture equipment to acquire red and blue cone image data sets;
[0008] Annotate samples of the data set, and use the annotated sample files and the cone barrel image as a training set;
[0009] The YOLOv4 target detection network is trained using the training set until the network converges, and the converged network parameters are saved as the cone barrel recognition model.
[0010] Further, the identifying of the cone barrel and its color, and the 3D point cloud coordinates corresponding to the color of the cone barrel includes:
[0011] Input the cone barrel image to be detected into the cone barrel recognition model, and output the cone barrel color recognition result and the cone barrel detection frame;
[0012] Using laser radar to obtain the scene point cloud data, filtering out the ground point cloud, and outputting a cone bucket point cloud cluster set;
[0013] Combine and calibrate the image capture device and the laser radar to determine the relative position relationship between the two in space, and obtain the transformation matrix and the 3D point cloud coordinates of the cone barrel;
[0014] The transformation matrix is used to project the 3D point cloud coordinates of the cone barrel to the 2D image plane, the point cloud coordinates within the cone barrel detection frame in the 2D image plane are averaged, and the cone barrel color recognition result and its 3D point cloud coordinates within the cone barrel detection frame are output.
[0015] Furthermore, the output cone bucket point cloud clustering set includes:
[0016] Downsampling the cone point cloud after filtering out the ground point cloud;
[0017] For a point cloud p in the downsampled cone bucket point cloud, search for the k point clouds closest to it in Euclidean distance;
[0018] Traverse k point clouds, determine the Euclidean distance between each point cloud in the k point clouds and point cloud p, and if the Euclidean distance is less than the set threshold, store it in the point cloud candidate set P;
[0019] Re-search the point cloud with the closest Euclidean distance to a certain point cloud in the point cloud candidate set P until there is no new point cloud stored in the set P, and the clustering is completed;
[0020] If the number of point clouds in the point cloud candidate set P meets the preset threshold interval, the clustering result is retained and the search and traversal of the remaining point clouds is repeated until all point clouds are traversed;
[0021] In the point cloud clustering results, the center coordinates of each cluster of cone bucket point clouds are output as the cone bucket position.
[0022] Further, triangulating the identified cone barrel includes:
[0023] Construct a virtual triangle, which must contain all cones.
[0024] The cone barrels are sequentially stored in the virtual triangle area according to their corresponding 3D point cloud coordinates using a point-by-point insertion method, and the cone barrels are connected to form a triangulated network with the cone barrels as vertices;
[0025] During the storage process, each time a cone bucket is inserted, the entire triangulated network needs to be tested for empty circle characteristics, and the triangle edges that do not meet the preset conditions are filtered out to make the constructed triangulated network meet the Delaunay triangulation network.
[0026] Further, the calculation of the loss value of each triangle edge and the calculation of the path loss value according to the set loss function include:
[0027] Traverse all the triangle edges in the triangulation network and calculate the mean length M of the triangle edges connected by the two different colored cone barrels as vertices s , and the mean length M of the triangle edges connecting vertices of the same color and adjacent positions d ;
[0028] According to the length mean M s Calculate the length loss value W of the triangle edge formed by two cones of different colors, according to the length mean M d Calculate the length loss value D of the triangle formed by cone barrels of the same color and adjacent positions;
[0029] According to the midpoint coordinates of two adjacent triangle edges formed by cone barrels of different colors, the angle loss value θ of adjacent path points is calculated;
[0030] An adaptive loss function is set according to the length loss value W, the length loss value D and the angle loss value θ, and the path loss value is calculated in real time.
[0031] Further, the outputting of the drivable area and path of the temporary road according to the loss value includes:
[0032] If the loss value meets the preset conditions, the triangle edges that do not meet the conditions are filtered out, and the midpoints of the remaining triangle edges are connected in sequence according to the midpoint coordinates to construct the best driving path;
[0033] The point set with red vertices of the triangle edges is stored in set R, and the blue point set is stored in set B. The point set in set R is sorted according to their distance from the vehicle, and the points are connected in sequence to obtain the left lane line. Similarly, set B is processed to obtain the right lane line. The area between the left and right lane lines is the drivable area for the vehicle.
[0034] A temporary road detection system based on triangulation comprises: a data processing module for collecting cone barrel image data set, using the data set to train a YOLOv4 target detection network to obtain a cone barrel recognition model; a cone barrel recognition module for acquiring scene point cloud data, the color of the cone barrel and its point cloud coordinates, and recognizing the cone barrel and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the color of the cone barrel; an output module for triangulating the recognized cone barrel, calculating the loss value of each triangle edge, calculating the path loss value according to a set loss function, and outputting the drivable area and path of the temporary road according to the loss value.
[0035] A computer-readable storage medium storing one or more programs, wherein the one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any of the above methods.
[0036] A computing device comprises: one or more processors, a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any of the above methods.
[0037] The present invention adopts the above technical solution, which has the following advantages:
[0038] 1. The present invention uses a triangulation method to associate each cone barrel according to the empty circle characteristics, and divides the red and blue cone barrels into left and right lane line markings respectively. All cone barrels participate in lane line planning and driving path calculation, avoiding the problems of unstable curve detection, small drivable road area and low road safety redundancy.
[0039] 2. The present invention sets an adaptive loss function, which makes full use of the color and position information of the cones and filters out the triangle edges of the cones that do not meet the conditional threshold, thereby avoiding the problem of failure in drivable road planning due to problems such as misidentification of cones and irregular spacing of cones. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is an overall flow chart of a temporary road detection method based on triangulation in one embodiment of the present invention;
[0041] Figure 2 is a detailed flow chart of a temporary road detection method based on triangulation in one embodiment of the present invention;
[0042] Figure 3 Schematic diagram of Delaunay triangulation of a cone barrel in one embodiment of the present invention;
[0043] Figure 4 is a schematic diagram of a drivable area of a temporary road in one embodiment of the present invention;
[0044] Figure 5 It is a schematic diagram of the structure of a computing device in one embodiment of the present invention. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution of the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings of the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all of the embodiments. Based on the described embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field belong to the scope of protection of the present invention.
[0046] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0047] The present invention provides a temporary road detection method and system based on triangulation, which includes: collecting cone barrel image data set, using the data set to train the YOLOv4 target detection network, and obtaining a cone barrel recognition model; obtaining scene point cloud data, obtaining the cone barrel color and its point cloud coordinates, and identifying the cone barrel and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the cone barrel color; triangulating the identified cone barrel, calculating the loss value of each triangle edge, calculating the path loss value according to the set loss function, and outputting the drivable area and path of the temporary road according to the loss value. The detection method of the present invention has high speed, high safety redundancy, and strong robustness.
[0048] In one embodiment of the present invention, a temporary road detection method based on triangulation is provided. This embodiment takes the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Figure 1 As shown, the method comprises the following steps:
[0049] 1) Collect cone image datasets, use the datasets to train the YOLOv4 target detection network, and obtain the cone recognition model;
[0050] 2) Obtain scene point cloud data, obtain the cone barrel color and its point cloud coordinates, and identify the cone barrel and its color, as well as the 3D point cloud coordinates corresponding to the cone barrel color according to the point cloud coordinates;
[0051] 3) Triangulate the identified cones, calculate the loss value of each triangle edge, calculate the path loss value according to the set loss function, and output the drivable area and path of the temporary road according to the loss value.
[0052] In the above step 1), if Figure 2 As shown, a cone barrel image dataset is collected, and the dataset is used to train the YOLOv4 target detection network to obtain a cone barrel recognition model, including the following steps:
[0053] 1.1) Use image capture equipment to acquire red and blue cone image datasets;
[0054] In this embodiment, the image capturing device is a camera.
[0055] 1.2) Label the samples of the data set and use the labeled sample files and cone barrel images as the training set;
[0056] 1.3) Use the training set to train the YOLOv4 target detection network until the network converges, and save the converged network parameters as the cone bucket recognition model.
[0057] In the above step 2), identifying the cone barrel and its color, and the 3D point cloud coordinates corresponding to the cone barrel color, includes the following steps:
[0058] 2.1) Input the cone barrel image to be detected into the cone barrel recognition model, and output the cone barrel color recognition result and cone barrel detection frame;
[0059] 2.2) Use laser radar to obtain scene point cloud data, filter out ground point cloud, and output cone bucket point cloud cluster set;
[0060] Among them, since each frame of the original point cloud contains a large number of ground point clouds, they need to be filtered out, and the plane fitting model is used to detect the ground point clouds;
[0061] The plane fitting model is:
[0062] Ax+By+Cz+D=0 (1)
[0063] Where A, B, C, and D are model coefficients, and the vector [A, B, C] is the normal vector of the plane.
[0064] The random sampling consistency method is used to estimate the parameters of the above formula, where the maximum number of iterations is 7000, and the distance threshold from the point cloud to the plane of the plane fitting model is preferably 0.05. If the orthogonal projection distance from the point to the plane in the original point cloud is less than the distance threshold, the point cloud belongs to the ground, and it is filtered out and the point cloud above the ground is retained.
[0065] 2.3) Combine and calibrate the image capture device and the laser radar to determine the relative position relationship between the two in space, and obtain the transformation matrix and the 3D point cloud coordinates of the cone barrel;
[0066] 2.4) Use the transformation matrix to project the 3D coordinates of the cone bucket to the 2D image plane, average the point cloud coordinates within the cone bucket detection frame in the 2D image plane, and output the cone bucket color recognition result and its 3D point cloud coordinates within the cone bucket detection frame.
[0067] In the above step 2.2), the Euclid algorithm is used to cluster and segment the downsampled cone bucket point cloud, and the cone bucket point cloud cluster set is output, which includes the following steps:
[0068] 2.2.1) Downsampling the cone point cloud after filtering out the ground point cloud;
[0069] In this embodiment, a voxel grid filtering method is used to downsample the cone bucket point cloud after filtering out the ground, wherein the voxel grid threshold is preferably 0.01.
[0070] 2.2.2) For a point cloud p in the downsampled cone bucket point cloud, search for the k point clouds closest to it in Euclidean distance;
[0071] In this embodiment, a KDTree query algorithm is used to search for k point clouds with the closest Euclidean distance.
[0072] 2.2.3) Traverse k point clouds and determine the Euclidean distance between each point cloud in the k point clouds and point cloud p. If the Euclidean distance is less than the set threshold l, store it in the point cloud candidate set P;
[0073] 2.2.4) Repeat step 2.2.2) in the point cloud candidate set P, and re-search the point cloud with the closest Euclidean distance to a certain point cloud until no new point cloud is stored in the set P, and the clustering is completed;
[0074] 2.2.5) Determine whether the number of point clouds in the set P meets the preset threshold interval. If the number of point clouds in the point cloud candidate set P meets the threshold interval, retain the clustering result and repeat the search and traversal of the remaining point clouds until all point clouds are traversed;
[0075] In this embodiment, the preset threshold interval is [M min , M max ], where M min With M max Respectively represent the minimum and maximum number of point clouds clustered in the set P. Preferably, M min =5,M max =100.
[0076] 2.2.6) In the point cloud clustering results, the center coordinates of each cluster of cone bucket point clouds are output as the cone bucket position.
[0077] In the above step 2.3), the bundle adjustment method is used to calibrate the image capture device (i.e., camera) and the laser radar, which specifically includes the following steps:
[0078] 2.3.1) Use Zhang Zhengyou calibration method to calibrate the camera intrinsic parameters and obtain the camera intrinsic parameter matrix K.
[0079] 2.3.2) Use the camera and lidar to collect images and point cloud data at the same time, use the Rviz tool to visualize the point cloud, select A evenly distributed point cloud 3D coordinates with obvious obstacle features, and record A image 2D coordinates corresponding to the above obstacle point cloud in the image.
[0080] 2.3.3) Construct a PnP model for minimizing the reprojection error, as shown in formula (2):
[0081]
[0082] In the formula, e is the error term, I v represents the 2D coordinates of the vth image, P v Indicates the 3D coordinates of the vth point cloud, zv Represents the coordinate of the vth point cloud on the Z axis in the camera coordinate system, Represents the transformation matrix between the laser radar coordinate system and the camera coordinate system. The Gauss-Newton method is used to iteratively optimize equation (2) to solve the transformation matrix
[0083] 2.3.4) Traverse the cone bucket point cloud after the above clustering and use the transformation matrix It is transformed from the lidar coordinate system to the camera coordinate system, and the color classification results of each cone barrel and the 3D point cloud coordinates corresponding to the cone barrel color are output.
[0084] In the above step 3), the identified cone barrel is triangulated, including the following steps:
[0085] 3.1) Construct a virtual triangle, which must contain all cones;
[0086] 3.2) Using the point-by-point insertion method, the cones are sequentially stored in the virtual triangle area according to their corresponding 3D point cloud coordinates, and the cones are connected to form a triangulated network with the cones as vertices;
[0087] 3.3) During the storage process, each time a cone bucket is inserted, the entire triangulated network needs to be tested for empty circle characteristics, and the triangle edges that do not meet the preset conditions are filtered out, so that the constructed triangulated network meets the Delaunay triangulation network, such as Figure 3 shown.
[0088] In this embodiment, the cone image data set is converted into a landmark point set, and each point contains color information and position coordinates, where the position coordinates only select the corresponding values of the two coordinate axes parallel to the ground. The point set is triangulated to obtain a triangle edge set T that meets the conditions. r .
[0089] In the above step 3), the loss value of each triangle edge is calculated, and the path loss value is calculated according to the set loss function, including the following steps:
[0090] 3.4) Traverse all triangle edges in the triangulation network (i.e., the triangle edge set T r ), calculate the mean length M of the triangle edges connected by the two different colored cone barrels as vertices s , and the mean length M of the triangle edges connecting vertices of the same color and adjacent positions d ;
[0091] Among them, the length mean M s for:
[0092]
[0093] The mean length of the triangle edges connecting vertices of the same color and adjacent positions is M d for:
[0094]
[0095]
[0096]
[0097] Where n is the number of triangle edges, m and k are the number of red and blue vertices respectively, (X ri , Y ri ) is the position coordinate of the red vertex corresponding to the i-th triangle edge, (X bi , Y bi ) is the position coordinate of the blue vertex corresponding to the i-th triangle edge, (X ru , Y ru ) and (X r(u+1) , Y r(u+1) ) are red and adjacent vertex coordinates, (X bj , Y bj ) and (X b(j+1) , Y b(j+1) ) are blue and have adjacent vertex coordinates.
[0098] d r is the sum of the lengths of the lines connecting all two adjacent vertices that are red, d l It is the sum of the lengths of the lines connecting all two adjacent blue vertices.
[0099] 3.5) According to the length mean M s Calculate the length loss value W of the triangle edge formed by two cones of different colors, according to the length mean M d Calculate the length loss value D of the triangle formed by cone barrels of the same color and adjacent positions;
[0100] Among them, the length loss value W of the triangle edge formed by two cone barrels of different colors is:
[0101]
[0102] The length loss value D of the triangle formed by cone barrels of the same color and adjacent positions is:
[0103]
[0104] In the formula, (X r , Y r ) and (X b , Y b ) are the coordinates of the red and blue vertices of the triangles formed by cones of different colors, (X m1 , Ym1 ) and (X m2 , Y m2 ) are the midpoint coordinates of two adjacent triangle edges formed by cone barrels of different colors.
[0105] 3.6) Calculate the angle loss value θ of adjacent path points based on the midpoint coordinates of two adjacent triangle edges formed by cones of different colors;
[0106] Among them, the angle loss value θ calculated by the midpoint coordinates of adjacent path points is:
[0107] θ=π-arcsinθ1
[0108]
[0109] a=(X m2 -X m1 ) 2 +(Y m2 -Y m1 ) 2
[0110] b=(X m0 -X m1 ) 2 +(Y m0 -Y m1 ) 2
[0111] c=(X m0 -X m2 ) 2 +(Y m0 -Y m2 ) 2
[0112] In the formula, θ1 is an intermediate variable. If θ1>1, then θ1=1; if θ1<-1, then θ1=-1.
[0113] 3.7) An adaptive loss function is set according to the length loss value W, the length loss value D and the angle loss value θ, and the path loss value is calculated in real time;
[0114] Among them, the adaptive loss function is:
[0115]
[0116] Where W c , W k , W w , W d They are cone misidentification coefficient, path point angle coefficient, lane width scaling coefficient, path point length scaling coefficient, N c is the number of cone bucket misidentifications, and L is the loss value.
[0117] In the above step 3), outputting the drivable area and path of the temporary road according to the loss value includes the following steps:
[0118] 3.8) If the loss value meets the preset conditions, filter out the triangle edges that do not meet the conditions, and connect the midpoints of the remaining triangle edges in turn according to the midpoint coordinates to construct the optimal driving path;
[0119] In this embodiment, the preset condition is that the loss value L<1.5.
[0120] 3.9) Store the red points of the triangle edges into set R and the blue points into set B. Sort the points in set R by their distance from the vehicle and connect the points in sequence to get the left lane line. Similarly, process set B to get the right lane line. The area between the left and right lane lines is the drivable area for the vehicle, as shown in Figure 4 shown.
[0121] In one embodiment of the present invention, a temporary road detection system based on triangulation is provided, which includes:
[0122] The data processing module collects the cone image data set, uses the data set to train the YOLOv4 target detection network, and obtains the cone recognition model;
[0123] The cone recognition module obtains the scene point cloud data, obtains the cone color and its point cloud coordinates, and recognizes the cone and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the cone color;
[0124] The output module triangulates the identified cones, calculates the loss value of each triangle edge, calculates the path loss value according to the set loss function, and outputs the drivable area and path of the temporary road according to the loss value.
[0125] The system provided in this embodiment is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for specific processes and detailed contents, which will not be repeated here.
[0126] like Figure 5As shown, it is a schematic diagram of the structure of a computing device provided in an embodiment of the present invention. The computing device can be a terminal, which can include: a processor, a communication interface, a memory, a display screen and an input device. Among them, the processor, the communication interface and the memory complete mutual communication through a communication bus. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. When the computer program is executed by the processor, a detection method is implemented; the internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface is used to communicate with an external terminal in a wired or wireless manner. The wireless method can be realized through WIFI, a management network, NFC (near field communication) or other technologies. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the housing of the computing device, or an external keyboard, touchpad or mouse. The processor can call the logic instructions in the memory to execute the following method: collect a cone barrel image data set, use the data set to train the YOLOv4 target detection network, and obtain a cone barrel recognition model; obtain scene point cloud data, obtain the color of the cone barrel and its point cloud coordinates, and identify the cone barrel and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the color of the cone barrel; triangulate the identified cone barrel, calculate the loss value of each triangle edge, calculate the path loss value according to the set loss function, and output the drivable area and path of the temporary road according to the loss value.
[0127] In addition, the logic instructions in the above-mentioned memory 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. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0128] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present application, and does not constitute a limitation on the computing device to which the scheme of the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0129] In one embodiment of the present invention, a computer program product is provided, wherein the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, wherein the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the methods provided by the above-mentioned method embodiments, for example, including: collecting a cone image data set, using the data set to train a YOLOv4 target detection network to obtain a cone recognition model; obtaining scene point cloud data, obtaining the cone color and its point cloud coordinates, and identifying the cone and its color, as well as the 3D point cloud coordinates corresponding to the cone color according to the point cloud coordinates; triangulating the identified cone, calculating the loss value of each triangle edge, calculating the path loss value according to the set loss function, and outputting the drivable area and path of the temporary road according to the loss value.
[0130] In one embodiment of the present invention, a non-transitory computer-readable storage medium is provided, which stores server instructions, and the computer instructions enable a computer to execute the methods provided by the above embodiments, for example, including: collecting a cone image data set, using the data set to train a YOLOv4 target detection network to obtain a cone recognition model; obtaining scene point cloud data, obtaining the color of the cone and its point cloud coordinates, and identifying the cone and its color, as well as the 3D point cloud coordinates corresponding to the color of the cone based on the point cloud coordinates; triangulating the identified cone, calculating the loss value of each triangle edge, calculating the path loss value according to the set loss function, and outputting the drivable area and path of the temporary road according to the loss value.
[0131] The above embodiment provides a computer-readable storage medium, whose implementation principle and technical effect are similar to those of the above method embodiment, and will not be repeated here.
[0132] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, 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, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A temporary road detection method based on triangulation, It is characterized in that include: Collect cone image datasets, use the datasets to train the YOLOv4 target detection network, and obtain the cone recognition model; Obtain scene point cloud data, obtain the cone barrel color and its point cloud coordinates, and identify the cone barrel and its color, as well as the 3D point cloud coordinates corresponding to the cone barrel color according to the point cloud coordinates; Triangulate the identified cones, calculate the loss value of each triangle edge, calculate the path loss value according to the set loss function, and output the drivable area and path of the temporary road according to the loss value; Calculate the loss value of each triangle edge and calculate the path loss value according to the set loss function, including the following steps: Traverse all the triangle edges in the triangulation network and calculate the mean length M of the triangle edges connected by the two different colored cone barrels as vertices s , and the mean length M of the triangle edges connecting vertices of the same color and adjacent positions d ; Among them, the length mean M s for: The mean length of the triangle edges connecting vertices of the same color and adjacent positions is M d for: Where n is the number of triangle edges, m and k are the number of red and blue vertices respectively, (X ri , Y ri ) is the position coordinate of the red vertex corresponding to the i-th triangle edge, (X bi , Y bi ) is the position coordinate of the blue vertex corresponding to the i-th triangle edge, (X ru , Y ru ) and (X r(u+1) , Y r(u+1) ) are red and adjacent vertex coordinates, (X bj , Y bj ) and (X b(j+1) , Y b(j+1) ) are blue and have adjacent vertex coordinates; d r is the sum of the lengths of the lines connecting all two adjacent vertices that are red, d l The sum of the lengths of the lines connecting all two adjacent blue vertices; According to the length mean M s Calculate the length loss value W of the triangle edge formed by two cones of different colors, according to the length mean M d Calculate the length loss value D of the triangle formed by cone barrels of the same color and adjacent positions; Among them, the length loss value W of the triangle edge formed by two cone barrels of different colors is: The length loss value D of the triangle formed by cone barrels of the same color and adjacent positions is: In the formula, (X r , Y r ) and (X b , Y b ) are the coordinates of the red and blue vertices of the triangles formed by cones of different colors, (X m1 , Y m1 ) and (X m2 , Y m2 ) are the midpoint coordinates of two adjacent triangle edges formed by cones of different colors; According to the midpoint coordinates of two adjacent triangle edges formed by cone barrels of different colors, the angle loss value θ of adjacent path points is calculated; Among them, the angle loss value θ calculated by the midpoint coordinates of adjacent path points is: θ=π-arcsinθ 1 a=(X m2 -X m1 ) 2 +(And m2 -AND m1 ) 2 b=(X m0 -X m1 ) 2 +(Y m0 -Y m1 ) 2 c=(X m0 -X m2 ) 2 +(And m0 -AND m2 ) 2 In the formula, θ 1 is an intermediate variable, if θ 1 >1, then θ 1 =1, if θ 1 <-1, then θ 1 = -1; An adaptive loss function is set according to the length loss value W, the length loss value D and the angle loss value θ, and the path loss value is calculated in real time; Among them, the adaptive loss function is: Where W c , W k , W w , W d They are cone misidentification coefficient, path point angle coefficient, lane width scaling coefficient, path point length scaling coefficient, N c is the number of cone bucket misidentifications, and L is the loss value.
2. The temporary road detection method based on triangulation as claimed in claim 1, It is characterized in that The method of collecting a cone barrel image dataset and using the dataset to train a YOLOv4 target detection network to obtain a cone barrel recognition model includes: Use image capture equipment to acquire red and blue cone image data sets; Annotate samples of the data set, and use the annotated sample files and the cone barrel image as a training set; The YOLOv4 target detection network is trained using the training set until the network converges, and the converged network parameters are saved as the cone barrel recognition model.
3. The temporary road detection method based on triangulation as claimed in claim 1, It is characterized in that The identifying of the cone barrel and its color, and the 3D point cloud coordinates corresponding to the cone barrel color, includes: Input the cone barrel image to be detected into the cone barrel recognition model, and output the cone barrel color recognition result and the cone barrel detection frame; Using laser radar to obtain the scene point cloud data, filtering out the ground point cloud, and outputting a cone bucket point cloud cluster set; Combine and calibrate the image capture device and the laser radar to determine the relative position relationship between the two in space, and obtain the transformation matrix and the 3D point cloud coordinates of the cone barrel; The transformation matrix is used to project the 3D point cloud coordinates of the cone barrel to the 2D image plane, the point cloud coordinates within the cone barrel detection frame in the 2D image plane are averaged, and the cone barrel color recognition result and its 3D point cloud coordinates within the cone barrel detection frame are output.
4. The temporary road detection method based on triangulation as claimed in claim 3, It is characterized in that The output cone bucket point cloud clustering set includes: Downsampling the cone point cloud after filtering out the ground point cloud; For a point cloud p in the downsampled cone bucket point cloud, search for the k point clouds closest to it in Euclidean distance; Traverse k point clouds, determine the Euclidean distance between each point cloud in the k point clouds and point cloud p, and if the Euclidean distance is less than the set threshold, store it in the point cloud candidate set P; Re-search the point cloud with the closest Euclidean distance to a certain point cloud in the point cloud candidate set P until there is no new point cloud stored in the set P, and the clustering is completed; If the number of point clouds in the point cloud candidate set P meets the preset threshold interval, the clustering result is retained and the search and traversal of the remaining point clouds is repeated until all point clouds are traversed; In the point cloud clustering results, the center coordinates of each cluster of cone bucket point clouds are output as the cone bucket position.
5. The temporary road detection method based on triangulation as claimed in claim 1, It is characterized in that The step of triangulating the identified cone barrel comprises: Construct a virtual triangle, which must contain all cones. The cone barrels are sequentially stored in the virtual triangle area according to their corresponding 3D point cloud coordinates using a point-by-point insertion method, and the cone barrels are connected to form a triangulated network with the cone barrels as vertices; During the storage process, each time a cone bucket is inserted, the entire triangulated network needs to be tested for empty circle characteristics, and the triangle edges that do not meet the preset conditions are filtered out to make the constructed triangulated network meet the Delaunay triangulation network.
6. The temporary road detection method based on triangulation as claimed in claim 5, It is characterized in that The outputting of the drivable area and path of the temporary road according to the loss value includes: If the loss value meets the preset conditions, the triangle edges that do not meet the conditions are filtered out, and the midpoints of the remaining triangle edges are connected in sequence according to the midpoint coordinates to construct the best driving path; The point set with red vertices of the triangle edges is stored in set R, and the blue point set is stored in set B. The point set in set R is sorted according to their distance from the vehicle, and the points are connected in sequence to obtain the left lane line. Similarly, set B is processed to obtain the right lane line. The area between the left and right lane lines is the drivable area for the vehicle.
7. A temporary road detection system based on triangulation, used to implement the temporary road detection method based on triangulation as claimed in any one of claims 1 to 6, It is characterized in that include: The data processing module collects the cone image data set, uses the data set to train the YOLOv4 target detection network, and obtains the cone recognition model; The cone recognition module obtains the scene point cloud data, obtains the cone color and its point cloud coordinates, and recognizes the cone and its color according to the point cloud coordinates, as well as the 3D point cloud coordinates corresponding to the cone color; The output module triangulates the identified cones, calculates the loss value of each triangle edge, calculates the path loss value according to the set loss function, and outputs the drivable area and path of the temporary road according to the loss value.
8. A computer-readable storage medium storing one or more programs, It is characterized in that The one or more programs include instructions, which, when executed by a computing device, cause the computing device to perform any one of the methods of claims 1 to 6.
9. A computing device, It is characterized in that include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing any one of the methods described in claims 1 to 6.
