Traffic sign generation method and device
By obtaining point cloud data of traffic roads and calculating point coordinates of traffic signs, the problems of poor fit between traffic signs and maps in the prior art and low efficiency are solved, and more efficient traffic sign generation is achieved.
Patent Information
- Application Number
- CN202411856342.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-25
AI Technical Summary
The problems of poor fit between traffic signs and maps generated in the prior art and low efficiency.
By obtaining point cloud data of traffic roads, determining the starting point and ending point of traffic signs and their coordinates, determining the sign template of traffic signs based on the overall shape of point cloud data, calculating the coordinates of other points, and updating the point coordinates based on the proportional coefficients, finally drawing and connecting points to generate traffic signs.
The fit and generation efficiency of traffic signs and maps are improved, and the problems of poor fit and low efficiency of traffic signs and maps in the prior art are solved.
Smart Images

Figure CN119888101A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of map drawing technology, and in particular to a method and device for generating traffic signs. Background Art
[0002] When making a three-dimensional map, it is necessary to generate various traffic signs indicating the direction of the road fork at the road fork on the map. At present, traffic signs are drawn on the map with the help of various drawing tools, which lack unified standards. Traffic signs cannot fit the shape of the actual road fork on the map well, and there is also a problem of low efficiency. Summary of the invention
[0003] In view of this, embodiments of the present application provide a traffic sign generation method, device, electronic device and computer-readable storage medium to solve the problems of poor consistency between traffic signs generated in the prior art and maps and low efficiency.
[0004] In a first aspect of an embodiment of the present application, a method for generating a traffic sign is provided, comprising: obtaining point cloud data of a traffic road, and determining the starting point and the ending point of the traffic sign of the traffic road as well as the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point from the point cloud data; determining a sign template of the traffic sign according to the overall shape of the point cloud data; taking the horizontal coordinate and the vertical coordinate of the starting point as a reference, calculating the horizontal coordinate and the vertical coordinate of other points of the traffic sign according to the sign template; calculating the vertical coordinate of other points according to the vertical coordinate of the starting point and the ending point, and the horizontal coordinate or vertical coordinate of the starting point, the ending point and other points; determining a scale coefficient of the traffic sign and the sign template, and updating the horizontal coordinate and vertical coordinate of the starting point, the ending point and other points based on the scale coefficient; drawing the starting point, the ending point and other points according to the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point, the ending point and other points respectively; connecting the starting point, the ending point and other points to obtain the traffic sign.
[0005] According to a second aspect of an embodiment of the present application, a traffic sign generating device is provided, comprising: an acquisition module configured to acquire point cloud data of a traffic road, and determine the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point from the point cloud data; a determination module configured to determine the sign template of the traffic sign according to the overall shape of the point cloud data; a first calculation module configured to calculate the horizontal coordinates and vertical coordinates of other points of the traffic sign according to the sign template based on the horizontal coordinate and vertical coordinate of the starting point; a second calculation module configured to calculate the vertical coordinates of other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and other points; an update module configured to determine the scale factor of the traffic sign and the sign template, and update the horizontal coordinates and vertical coordinates of the starting point, the ending point and other points based on the scale factor; a drawing module configured to draw the starting point, the ending point and other points according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and other points respectively; and a connection module configured to connect the starting point, the ending point and other points to obtain the traffic sign.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: obtaining point cloud data of a traffic road, and determining the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point from the point cloud data; determining the sign template of the traffic sign according to the overall shape of the point cloud data; taking the horizontal coordinate and vertical coordinate of the starting point as the reference, calculating the horizontal coordinate and vertical coordinate of other points of the traffic sign according to the sign template; calculating the vertical coordinate of other points according to the vertical coordinate of the starting point and the ending point, and the horizontal coordinate or vertical coordinate of the starting point, the ending point and other points; determining the scale coefficient of the traffic sign and the sign template, and updating the horizontal coordinate and vertical coordinate of the starting point, the ending point and other points based on the scale coefficient; drawing the starting point, the ending point and other points according to the horizontal coordinate, vertical coordinate and vertical coordinate of the starting point, the ending point and other points respectively; connecting the starting point, the ending point and other points to obtain the traffic sign. The above technical means can solve the problems of poor fit between the generated traffic sign and the map and low efficiency in the prior art, thereby improving the fit between the traffic sign and the map and the efficiency of generating traffic signs. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 It is a flow chart of a traffic sign generation method provided in an embodiment of the present application;
[0011] Figure 2 It is a flowchart of a method for calculating a proportional coefficient of a traffic sign provided in an embodiment of the present application;
[0012] Figure 3 It is a structural schematic diagram of a traffic sign generating device provided in an embodiment of the present application;
[0013] Figure 4 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0014] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0015] A method and device for generating a traffic sign according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0016] Figure 1 It is a flow chart of a traffic sign generation method provided in an embodiment of the present application. Figure 1 The traffic sign generation method can be executed by a computer or a server, or software on a computer or a server. Figure 1 As shown, the traffic sign generation method includes:
[0017] S101, acquiring point cloud data of a traffic road, and determining the starting point and the ending point of a traffic sign of the traffic road as well as the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point from the point cloud data;
[0018] S102, determining a sign template of the traffic sign according to the overall shape of the point cloud data;
[0019] S103, taking the abscissa and ordinate of the starting point as a reference, calculating the abscissa and ordinate of other points of the traffic sign according to the sign template;
[0020] S104, calculating the vertical coordinates of other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and other points;
[0021] S105, determining a proportionality coefficient between the traffic sign and the sign template, and updating the horizontal coordinates and vertical coordinates of the starting point, the end point and other points based on the proportionality coefficient;
[0022] S106, drawing the starting point, the ending point and other points according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and other points respectively;
[0023] S107, connecting the starting point, the end point and other points to obtain a traffic sign.
[0024] Obtain the point cloud data of the three-dimensional map of the traffic road, and determine a starting point and an ending point of the traffic sign from the point cloud data. The traffic sign indicates the direction of the road fork, including straight arrows, left turn arrows, right turn arrows, U-turn arrows, etc. The traffic sign is a prompt that you can change lanes from one road (recorded as the first road) to another road (recorded as the second road). Generally, a point on the first road is randomly selected from the preset range of the road fork as the starting point, and a point on the second road is randomly selected from the preset range of the road fork as the ending point. When the starting point and the ending point are determined, the horizontal coordinates, vertical coordinates and vertical coordinates (that is, x, y, z coordinates) of the starting point and the ending point can be obtained from the point cloud data.
[0025] According to the overall shape of the point cloud data, that is, the lane change situation at the road fork, the sign template of the traffic sign is determined. The sign template has standardized straight arrows, left turn arrows, right turn arrows, U-turn arrows, etc. The outline of the sign template is composed of multiple points. The starting point is known, because the distance between other points and the starting point on the traffic sign is known, the starting point can be used as a reference, and the horizontal and vertical coordinates of other points of the traffic sign can be calculated according to the sign template. There are multiple other points.
[0026] Calculate the vertical coordinates of other points based on the vertical coordinates of the starting point and the ending point, and the horizontal coordinates of the starting point, the ending point and other points. Or calculate the vertical coordinates of other points based on the vertical coordinates of the starting point and the ending point, and the vertical coordinates of the starting point, the ending point and other points. Update the horizontal and vertical coordinates of the starting point, the ending point and other points based on the scale factor of the traffic sign and the sign template. Determine the starting point, the ending point and other points on the three-dimensional map according to the horizontal, vertical and vertical coordinates of the starting point, the ending point and other points, connect the starting point, the ending point and other points, and obtain the traffic sign on the three-dimensional map.
[0027] According to the technical solution provided by the embodiment of the present application, the point cloud data of the traffic road is obtained, and the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point are determined from the point cloud data; the sign template of the traffic sign is determined according to the overall shape of the point cloud data; the horizontal coordinates and vertical coordinates of other points of the traffic sign are calculated according to the sign template based on the horizontal coordinates and vertical coordinates of the starting point; the vertical coordinates of other points are calculated according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and other points; the scale coefficient of the traffic sign and the sign template is determined, and the horizontal coordinates and vertical coordinates of the starting point, the ending point and other points are updated based on the scale coefficient; the starting point, the ending point and other points are drawn according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and other points respectively; the starting point, the ending point and other points are connected to obtain the traffic sign. The above technical means can solve the problems of poor fit between the generated traffic sign and the map and low efficiency in the prior art, thereby improving the fit between the traffic sign and the map and the efficiency of generating traffic signs.
[0028] Furthermore, the vertical coordinates of other points are calculated based on the vertical coordinates of the starting point and the ending point, and the horizontal coordinates of the starting point, the ending point and other points, including:
[0029] Calculate the vertical coordinates of other points according to the following formula:
[0030]
[0031] Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of other points, the starting point and the ending point, respectively. 所求 , X 起点 and X 终点 They are the horizontal coordinates of other points, the starting point and the ending point respectively.
[0032] In the above formula, Z 所求 is an unknown variable, and the others are known. The above formula can be used to calculate Z 所求 .
[0033] Furthermore, the vertical coordinates of other points are calculated based on the vertical coordinates of the starting point and the ending point, and the vertical coordinates of the starting point, the ending point and other points, including:
[0034] Calculate the vertical coordinates of other points according to the following formula:
[0035]
[0036] Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of other points, the starting point and the end point, respectively. 所求 , Y 起点 and Y 终点 They are the ordinates of other points, the starting point, and the ending point respectively.
[0037] In the above formula, Z 所求 is an unknown variable, and the others are known. The above formula can be used to calculate Z 所求 .
[0038] Furthermore, determining the proportional coefficient of the traffic sign and the sign template includes: calculating the spatial distance between the starting point and the ending point based on the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point; determining the angle corresponding to the traffic sign; and determining the proportional coefficient based on the spatial distance and angle between the starting point and the ending point.
[0039] The three-dimensional coordinates of the starting point and the end point are known, and the spatial distance between the starting point and the end point can be calculated using the spatial distance calculation formula between points.
[0040] The angle corresponding to the traffic sign can be pre-set, or the angle corresponding to the traffic sign can be determined according to the following method, including: taking the starting point as the center, rotating the end point to a position where the horizontal coordinate of the end point is the same as the horizontal coordinate of the starting point, and obtaining the horizontal coordinate, vertical coordinate and vertical coordinate of the rotation point; calculating the spatial distance between the starting point and the rotation point based on the horizontal coordinate, vertical coordinate and vertical coordinate of the starting point and the rotation point; based on the spatial distance between the starting point and the end point and the spatial distance between the starting point and the rotation point, using inverse trigonometric functions to calculate the angle.
[0041] The above method is actually to find the angle between the line between the starting point and the end point and the perpendicular line passing through the starting point. The line between the starting point and the rotation point represents the perpendicular line passing through the starting point. The line between the starting point and the end point, the line between the starting point and the rotation point and the angle are in a sine relationship, so the inverse sine function can be used to solve the angle.
[0042] Further, the proportional coefficient is determined according to the spatial distance and the angle between the starting point and the ending point, including: calculating the proportional coefficient L according to the following formula:
[0043] L = R * sin (θ) / 3;
[0044] Among them, R is the spatial distance between the starting point and the ending point, and θ is the angle.
[0045] The 3 in the above formula may be other constants.
[0046] Furthermore, the horizontal and vertical coordinates of the starting point, the ending point and other points are updated based on the proportional coefficient, including: multiplying the proportional coefficient by the horizontal coordinates of the starting point, the ending point and other points respectively to obtain the updated horizontal coordinates of the starting point, the ending point and other points; multiplying the proportional coefficient by the vertical coordinates of the starting point, the ending point and other points respectively to obtain the updated vertical coordinates of the starting point, the ending point and other points.
[0047] Figure 2 FIG. 1 is a flow chart of a method for calculating a proportional coefficient of a traffic sign provided in an embodiment of the present application. Figure 2 As shown, the method includes:
[0048] S201, calculating the spatial distance between the starting point and the ending point according to the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point;
[0049] S202, taking the starting point as the center, rotating the end point to a position where the horizontal coordinate of the end point is the same as the horizontal coordinate of the starting point, and obtaining the horizontal coordinate, vertical coordinate and vertical coordinate of the rotation point;
[0050] S203, calculating the spatial distance between the starting point and the rotation point according to the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the rotation point;
[0051] S204, calculating the angle using an inverse trigonometric function based on the spatial distance between the starting point and the end point and the spatial distance between the starting point and the rotation point;
[0052] S205, calculate the proportionality coefficient L according to the following formula:
[0053] L = R * sin (θ) / 3;
[0054] Among them, R is the spatial distance between the starting point and the ending point, and θ is the angle.
[0055] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0056] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0057] Figure 3 Schematic diagram of a traffic sign generating device provided in an embodiment of the present application. Figure 3 As shown, the traffic sign generating device includes:
[0058] The acquisition module 301 is configured to acquire point cloud data of a traffic road, and determine the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point from the point cloud data;
[0059] A determination module 302 is configured to determine a sign template of the traffic sign according to the overall shape of the point cloud data;
[0060] The first calculation module 303 is configured to calculate the horizontal coordinates and vertical coordinates of other points of the traffic sign according to the sign template based on the horizontal coordinates and vertical coordinates of the starting point;
[0061] The second calculation module 304 is configured to calculate the vertical coordinates of other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and other points;
[0062] An updating module 305 is configured to determine a scale factor of the traffic sign and the sign template, and update the horizontal coordinates and vertical coordinates of the starting point, the ending point and other points based on the scale factor;
[0063] A drawing module 306 is configured to draw the starting point, the ending point and other points according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and other points respectively;
[0064] The connection module 307 is configured to connect the starting point, the ending point and other points to obtain a traffic sign.
[0065] Obtain the point cloud data of the three-dimensional map of the traffic road, and determine a starting point and an ending point of the traffic sign from the point cloud data. The traffic sign indicates the direction of the road fork, including straight arrows, left turn arrows, right turn arrows, U-turn arrows, etc. The traffic sign is a prompt that you can change lanes from one road (recorded as the first road) to another road (recorded as the second road). Generally, a point on the first road is randomly selected from the preset range of the road fork as the starting point, and a point on the second road is randomly selected from the preset range of the road fork as the ending point. When the starting point and the ending point are determined, the horizontal coordinates, vertical coordinates and vertical coordinates (that is, x, y, z coordinates) of the starting point and the ending point can be obtained from the point cloud data.
[0066] According to the overall shape of the point cloud data, that is, the lane change situation at the road fork, the sign template of the traffic sign is determined. The sign template has standardized straight arrows, left turn arrows, right turn arrows, U-turn arrows, etc. The outline of the sign template is composed of multiple points. The starting point is known, because the distance between other points and the starting point on the traffic sign is known, the starting point can be used as a reference, and the horizontal and vertical coordinates of other points of the traffic sign can be calculated according to the sign template. There are multiple other points.
[0067] Calculate the vertical coordinates of other points based on the vertical coordinates of the starting point and the ending point, and the horizontal coordinates of the starting point, the ending point and other points. Or calculate the vertical coordinates of other points based on the vertical coordinates of the starting point and the ending point, and the vertical coordinates of the starting point, the ending point and other points. Update the horizontal and vertical coordinates of the starting point, the ending point and other points based on the scale factor of the traffic sign and the sign template. Determine the starting point, the ending point and other points on the three-dimensional map according to the horizontal, vertical and vertical coordinates of the starting point, the ending point and other points, connect the starting point, the ending point and other points, and obtain the traffic sign on the three-dimensional map.
[0068] According to the technical solution provided by the embodiment of the present application, the point cloud data of the traffic road is obtained, and the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point are determined from the point cloud data; the sign template of the traffic sign is determined according to the overall shape of the point cloud data; the horizontal coordinates and vertical coordinates of other points of the traffic sign are calculated according to the sign template based on the horizontal coordinates and vertical coordinates of the starting point; the vertical coordinates of other points are calculated according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and other points; the scale coefficient of the traffic sign and the sign template is determined, and the horizontal coordinates and vertical coordinates of the starting point, the ending point and other points are updated based on the scale coefficient; the starting point, the ending point and other points are drawn according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and other points respectively; the starting point, the ending point and other points are connected to obtain the traffic sign. The above technical means can solve the problems of poor fit between the generated traffic sign and the map and low efficiency in the prior art, thereby improving the fit between the traffic sign and the map and the efficiency of generating traffic signs.
[0069] In some embodiments, the second calculation module 304 is further configured to calculate the vertical coordinates of other points according to the following formula:
[0070]
[0071] Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of other points, the starting point and the ending point, respectively.所求 , X 起点 and X 终点 They are the horizontal coordinates of other points, the starting point and the ending point respectively.
[0072] In the above formula, Z 所求 is an unknown variable, and the others are known. The above formula can be used to calculate Z 所求 .
[0073] In some embodiments, the second calculation module 304 is further configured to calculate the vertical coordinates of other points according to the following formula:
[0074]
[0075] Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of other points, the starting point and the end point, respectively. 所求 , Y 起点 and Y 终点 They are the ordinates of other points, the starting point, and the ending point respectively.
[0076] In the above formula, Z 所求 is an unknown variable, and the others are known. The above formula can be used to calculate Z 所求 .
[0077] In some embodiments, the update module 305 is also configured to calculate the spatial distance between the starting point and the ending point based on the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point; determine the angle corresponding to the traffic sign; and determine the proportional coefficient based on the spatial distance and angle between the starting point and the ending point.
[0078] The three-dimensional coordinates of the starting point and the end point are known, and the spatial distance between the starting point and the end point can be calculated using the spatial distance calculation formula between points.
[0079] In some embodiments, the update module 305 is also configured to rotate the end point to a position where the horizontal coordinate of the end point is the same as the horizontal coordinate of the starting point with the starting point as the center, and obtain the horizontal coordinate, vertical coordinate and vertical coordinate of the rotation point; calculate the spatial distance between the starting point and the rotation point based on the horizontal coordinate, vertical coordinate and vertical coordinate of the starting point and the rotation point; and calculate the angle using inverse trigonometric functions based on the spatial distance between the starting point and the end point and the spatial distance between the starting point and the rotation point.
[0080] The above method is actually to find the angle between the line between the starting point and the end point and the perpendicular line passing through the starting point. The line between the starting point and the rotation point represents the perpendicular line passing through the starting point. The line between the starting point and the end point, the line between the starting point and the rotation point and the angle are in a sine relationship, so the inverse sine function can be used to solve the angle.
[0081] In some embodiments, the updating module 305 is further configured to calculate the proportionality coefficient L according to the following formula:
[0082] L = R * sin (θ) / 3;
[0083] Among them, R is the spatial distance between the starting point and the ending point, and θ is the angle.
[0084] The 3 in the above formula may be other constants.
[0085] In some embodiments, the update module 305 is also configured to multiply the proportional coefficient by the horizontal coordinates of the starting point, the ending point and other points to obtain the updated horizontal coordinates of the starting point, the ending point and other points; and multiply the proportional coefficient by the vertical coordinates of the starting point, the ending point and other points to obtain the updated vertical coordinates of the starting point, the ending point and other points.
[0086] In some embodiments, the update module 305 is further configured to calculate the spatial distance between the starting point and the ending point based on the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the ending point; with the starting point as the center, the ending point is rotated to a position where the horizontal coordinate of the ending point is the same as the horizontal coordinate of the starting point, and the horizontal coordinate, vertical coordinate and vertical coordinate of the rotation point are obtained; the spatial distance between the starting point and the rotation point is calculated based on the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point and the rotation point; based on the spatial distance between the starting point and the ending point and the spatial distance between the starting point and the rotation point, the angle is calculated using an inverse trigonometric function; and the proportional coefficient L is calculated according to the following formula:
[0087] L = R * sin (θ) / 3;
[0088] Among them, R is the spatial distance between the starting point and the ending point, and θ is the angle.
[0089] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0090] Figure 4 Schematic diagram of an electronic device 4 provided in an embodiment of the present application. Figure 4As shown, the electronic device 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 403 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 403, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 401 executes the computer program 403, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0091] The electronic device 4 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 4 may include, but is not limited to, a processor 401 and a memory 402. Those skilled in the art will appreciate that Figure 4 The electronic device 4 is merely an example and does not limit the electronic device 4 , and may include more or less components than those shown in the figure, or different components.
[0092] The processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0093] The memory 402 may be an internal storage unit of the electronic device 4, for example, a hard disk or memory of the electronic device 4. The memory 402 may also be an external storage device of the electronic device 4, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. The memory 402 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 402 is used to store computer programs and other programs and data required by the electronic device.
[0094] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned 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 above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0095] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, and the computer program code may be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0096] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application 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. 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 application, and should all be included in the protection scope of the present application.
Claims
1. A traffic sign generation method, characterized in that: include: Acquire point cloud data of a traffic road, and determine the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point from the point cloud data; Determining a sign template of the traffic sign according to the overall shape of the point cloud data; Taking the abscissa and ordinate of the starting point as reference, calculate the abscissa and ordinate of other points of the traffic sign according to the sign template; Calculate the vertical coordinates of the other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and the other points; Determine a scale factor between the traffic sign and the sign template, and update the horizontal coordinates and vertical coordinates of the starting point, the ending point and the other points based on the scale factor; Plotting the starting point, the ending point and the other points according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and the other points respectively; The starting point, the ending point and the other points are connected to obtain the traffic sign.
2. The method according to claim 1, characterized in that Calculating the vertical coordinates of the other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates of the starting point, the ending point, and the other points includes: The vertical coordinates of the other points are calculated according to the following formula: Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of the other points, the starting point and the ending point respectively, 所求 , X 起点 and X 终点 are the horizontal coordinates of the other points, the starting point and the ending point respectively.
3. The method according to claim 1, characterized in that Calculating the vertical coordinates of the other points according to the vertical coordinates of the starting point and the ending point, and the vertical coordinates of the starting point, the ending point, and the other points, includes: The vertical coordinates of the other points are calculated according to the following formula: Among them, Z 所求 , Z 起点 and Z 终点 are the vertical coordinates of the other points, the starting point and the ending point respectively, 所求 , Y 起点 and Y 终点 are the ordinates of the other points, the starting point and the ending point respectively.
4. The method according to claim 1, characterized in that: Determining a proportionality coefficient between the traffic sign and the sign template includes: Calculate the spatial distance between the starting point and the ending point according to the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point; Determining the angle corresponding to the traffic sign; The proportionality coefficient is determined according to the spatial distance between the starting point and the ending point and the angle.
5. The method according to claim 4, characterized in that Determining the angle corresponding to the traffic sign includes: Taking the starting point as the center, the end point is rotated to a position where the horizontal coordinate of the end point is the same as the horizontal coordinate of the starting point, to obtain the horizontal coordinate, vertical coordinate and vertical coordinate of the rotation point; Calculate the spatial distance between the starting point and the rotation point according to the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the rotation point; The angle is calculated using an inverse trigonometric function based on a spatial distance between the starting point and the ending point and a spatial distance between the starting point and the rotation point.
6. The method according to claim 4, characterized in that Determining the proportionality coefficient according to the spatial distance between the starting point and the ending point and the angle includes: The proportionality coefficient L is calculated according to the following formula: L = R * sin (θ) / 3; Wherein, R is the spatial distance between the starting point and the ending point, and θ is the angle.
7. The method according to claim 1, characterized in that Updating the horizontal coordinates and the vertical coordinates of the starting point, the ending point and the other points based on the proportional coefficient includes: Multiplying the proportionality coefficient by the horizontal coordinates of the starting point, the ending point and the other points respectively to obtain updated horizontal coordinates of the starting point, the ending point and the other points; The proportional coefficient is multiplied by the vertical coordinates of the starting point, the ending point and the other points respectively to obtain updated vertical coordinates of the starting point, the ending point and the other points.
8. A traffic sign generating device, characterized in that: include: An acquisition module is configured to acquire point cloud data of a traffic road, and determine the starting point and the ending point of the traffic sign of the traffic road and the horizontal coordinate, the vertical coordinate and the vertical coordinate of the starting point and the ending point from the point cloud data; A determination module, configured to determine a sign template of the traffic sign according to the overall shape of the point cloud data; A first calculation module is configured to calculate the horizontal coordinates and vertical coordinates of other points of the traffic sign according to the sign template based on the horizontal coordinates and vertical coordinates of the starting point; A second calculation module is configured to calculate the vertical coordinates of the other points according to the vertical coordinates of the starting point and the ending point, and the horizontal coordinates or vertical coordinates of the starting point, the ending point and the other points; An updating module, configured to determine a scale factor between the traffic sign and the sign template, and update the horizontal coordinates and vertical coordinates of the starting point, the ending point and the other points based on the scale factor; A drawing module is configured to draw the starting point, the ending point and the other points according to the horizontal coordinates, vertical coordinates and vertical coordinates of the starting point, the ending point and the other points respectively; The connection module is configured to connect the starting point, the ending point and the other points to obtain the traffic sign.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.