Traffic element drawing method, electronic equipment and medium
By obtaining the K calibration points of road signs in point cloud data, determining the target points on the external graphics and drawing them, the problem of low efficiency of traditional manual drawing is solved, and automated drawing is realized, and efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411741463.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional manual road signs are less efficient when based on point cloud data, making it difficult to efficiently complete contour drawing.
By obtaining K calibration points on the element outline of the target traffic element based on point cloud data, multiple target points on the target external graph are determined, and the element outline of the target traffic element in the point cloud data is drawn based on these target points.
Automatic drawing of road sign contours in point cloud data is realized, which improves drawing efficiency, reduces labor costs, and improves drawing accuracy.
Smart Images

Figure CN119672242A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of map technology, and in particular relates to a method for drawing traffic elements, an electronic device and a medium. Background Art
[0002] In the production process of high-precision maps, traditional manual production methods have always occupied an important position. However, this method has many limitations. Among them, the problem is particularly prominent in drawing road signs based on point clouds. Point cloud data, as a high-precision three-dimensional spatial data, can provide rich information for drawing road signs.
[0003] Currently, it is usually done manually according to the outline of the road signs in the point cloud data. However, this method of manually drawing the outline is inefficient. Summary of the invention
[0004] The embodiments of the present application provide a traffic element drawing method, electronic device and medium, which can improve the efficiency of drawing the outline of road signs in point cloud data.
[0005] In a first aspect, an embodiment of the present application provides a method for drawing traffic elements, the method comprising:
[0006] Acquire K calibration points on the element contour of the target traffic element based on the point cloud data, where K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data;
[0007] Determine multiple target points on a target circumscribed figure according to the K calibration points; the multiple target points are located in the same plane, and the target circumscribed figure is a circumscribed figure of a geometric figure formed by the K calibration points;
[0008] Based on the multiple target points, the element outline of the target traffic element in the point cloud data is drawn.
[0009] In a second aspect, an embodiment of the present application provides a traffic element drawing device, the device comprising:
[0010] A first acquisition module is used to acquire K calibration points on the element contour of the target traffic element based on the point cloud data, wherein K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data;
[0011] A second acquisition module is used to determine a plurality of target points on a target circumscribed figure according to the K calibration points; the plurality of target points are located in the same plane, and the target circumscribed figure is a circumscribed figure of a geometric figure formed by the K calibration points;
[0012] A drawing module is used to draw the element outline of the target traffic element in the point cloud data according to the multiple target points.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing computer program instructions;
[0014] When the processor executes the computer program instructions, the traffic element drawing method as described in the first aspect is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the method for drawing traffic elements as described in the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the traffic element drawing method as described in the first aspect.
[0017] In this embodiment, K calibration points on the element contour of the target traffic element are obtained based on the point cloud data, where K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data; multiple target points on the target circumscribed figure are determined based on the K calibration points; the multiple target points are located in the same plane, and the target circumscribed figure is the circumscribed figure of the geometric figure formed by the K calibration points; based on the multiple target points, the element contour of the target traffic element in the point cloud data is drawn. Through the above steps, the electronic device can automatically draw the element contour of the target traffic element based on the K calibration points, and manual drawing is no longer required, which greatly improves the efficiency of drawing the element contour of the target traffic element in the point cloud data. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0019] Figure 1 It is a flow chart of a method for drawing traffic elements provided in an embodiment of the present application;
[0020] Figure 2 It is a schematic diagram of the distribution of calibration points and target points on the target traffic element provided in the embodiment of the present application;
[0021] Figure 3 is a structural schematic diagram of a traffic element drawing device provided in an embodiment of the present application;
[0022] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0024] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0025] In each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the disclosed embodiment will be obtained.
[0026] In order to solve the problems in the prior art, the embodiments of the present application provide a method for drawing traffic elements, an electronic device and a medium. The following first introduces the method for drawing traffic elements provided by the embodiments of the present application.
[0027] The traffic element drawing method provided in the embodiment of the present application obtains the element contour of the target traffic element based on the point cloud data, and then determines multiple target points on the target circumscribed figure according to the K calibration points on the element contour, the target circumscribed figure is the circumscribed figure of the geometric figure formed by the K calibration points, and the target circumscribed figure can be a circle, rectangle, triangle, etc.; according to the multiple target points, the element contour of the target traffic element is drawn. In the above manner, the element contour of the target traffic element can be automatically drawn based on the K calibration points, thereby improving the efficiency of contour drawing.
[0028] The traffic element drawing method provided in the present application can be deployed and executed on a computer device, which can be a vehicle-mounted device (such as a vehicle-mounted controller, a vehicle-mounted processor or other vehicle-mounted units, etc.), or a terminal outside the vehicle, an independent server, a cloud, a server cluster, a distributed system, an Internet of Things device or an Internet of Vehicles device, etc. This embodiment does not limit this, and those skilled in the art can set up a computer device to implement the traffic element drawing method according to actual needs.
[0029] Figure 1 FIG. 1 is a flow chart of a method for drawing traffic elements provided by an embodiment of the present application. Figure 1 As shown, the traffic element drawing method provided in the embodiment of the present application is applied to an electronic device and includes the following steps 101 to 103, wherein:
[0030] Step 101: acquiring K calibration points on the element contour of the target traffic element based on the point cloud data, wherein K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data.
[0031] It is understandable that the above-mentioned point cloud data can be acquired by one or more devices including the collection unit on the vehicle, the roadside unit in the traffic scene (such as the point cloud collection device set up at the intersection, etc.), the drone, and other point cloud devices. For example, it can be obtained by the collection unit on the vehicle or the roadside unit through laser scanning of the target scene, or by aerial photography by a drone, etc.; the point cloud data in the embodiment of the present application can be a collection of a set of vectors in a three-dimensional coordinate system, these vectors are recorded in the form of points, and each point contains three-dimensional coordinate information.
[0032] It should be understood that the above-mentioned target traffic elements may include three-dimensional objects and / or two-dimensional plane graphics. The three-dimensional objects may include but are not limited to any one or any combination of traffic lights, highway gates, speed limit signs and restricted traffic signs set up on the roadside, etc.; the aforementioned plane graphics may include but are not limited to any one or any combination of road signs in high-precision maps such as circular signs, arrow signs, diamond signs, motor vehicle lane signs, speed limit signs, diversion signs, etc., and may also be signs of any other arbitrary shapes, which are not limited in this embodiment.
[0033] In the above, the circular signs may include circular signs for indicating going straight, turning left, turning right or driving around a roundabout, or circular signs for indicating prohibited passage, etc.
[0034] The K calibration points may be determined by manual instructions, for example, manually selecting K points as calibration points on the element contour formed by the point cloud data of the target traffic element. The K calibration points may also be determined by an algorithm, for example, detecting the edge of the element contour in the point cloud data by an edge detection algorithm, and then selecting K calibration points on the detected edge, for example, randomly selecting K calibration points on the edge, or selecting K calibration points evenly distributed on the edge, which is not limited here.
[0035] Step 102, determining a plurality of target points on a target circumscribed figure according to the K calibration points; the plurality of target points are located in the same plane, and the target circumscribed figure is a circumscribed figure of a geometric figure formed by the K calibration points.
[0036] The target circumscribed figure can be a circle, a rectangle, or other shapes. It can be set according to actual conditions and is not limited here.
[0037] For example, if K is 3, then three calibration points can form a triangle, and the circumscribed figure of the triangle can be a circle or a rectangle; if K is 4, then four calibration points can form a quadrilateral, and the circumscribed figure of the quadrilateral can be a circle or a rectangle.
[0038] Step 103: Draw the element outline of the target traffic element in the point cloud data according to the multiple target points.
[0039] After determining multiple target points, the element outline of the target traffic element can be drawn according to the multiple target points. For example, adjacent target points can be connected to draw the outline. It should be noted that the more target points there are, the more regular and accurate the outline of the drawn target traffic element is.
[0040] In the above, when drawing the element contour of the target traffic element in the point cloud data, the two-dimensional shape of the element contour can be drawn. For example, if the target traffic element is a circular mark, the circle of the circular mark is drawn, which is a two-dimensional shape; the three-dimensional shape of the element contour can also be drawn. For example, if the target traffic element is a cylinder, the target circumscribed figure can be a circle, and then the circle can be drawn first, and then the circle can be drawn in the depth direction. The depth direction can refer to the direction perpendicular to the plane where the circle is located. The element contour drawn in this way is the three-dimensional contour of the cylinder (that is, a hollow cylinder). The specific drawing method is not limited here.
[0041] In this embodiment, K calibration points on the element contour of the target traffic element are obtained based on the point cloud data, where K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data; multiple target points on the target circumscribed figure are determined based on the K calibration points; the multiple target points are located in the same plane, and the target circumscribed figure is the circumscribed figure of the geometric figure formed by the K calibration points; based on the multiple target points, the element contour of the target traffic element in the point cloud data is drawn. In the above manner, the element contour of the target traffic element can be automatically drawn based on the K calibration points, and there is no need to manually draw the entire element contour of the target traffic element, which not only improves the drawing efficiency, but also greatly reduces the labor cost and improves the drawing accuracy.
[0042] In an embodiment of the present application, the K is greater than or equal to 3, and the step of determining a plurality of target points on the target circumscribed graph according to the K calibration points includes:
[0043] When the initial plane where the K calibration points are located is the target plane, multiple target points are determined on the target circumscribed figure formed by the K calibration points; that is, in this case, multiple points can be directly determined from the target circumscribed circle as target points, and the multiple points can be determined randomly, or multiple points with equal spacing can be selected from the target circumscribed circle according to a certain arc distance.
[0044] In the case where the initial plane where the K calibration points are located is not the target plane, each calibration point is converted to the target plane to obtain K conversion points; multiple first points are determined from the circumscribed figure formed by the K conversion points; each first point is converted to the initial plane to obtain the multiple target points. In the process of determining multiple first points from the circumscribed figure formed by the K conversion points, multiple points can be determined as multiple first points randomly or at equal intervals from the circumscribed figure formed by the K conversion points or according to other selection methods. Those skilled in the art can set the specific method of selecting multiple first points from the circumscribed figure according to actual needs.
[0045] In this embodiment, the K calibration points are on the same plane, and the same plane where the K calibration points are located is called an initial plane.
[0046] It should be noted that in the embodiment of the present application, the target plane is a plane composed of different coordinate axes of an M-dimensional coordinate system (M is an integer not less than 2) established with the coordinate origin O; wherein, when M is 2, the M-dimensional coordinate system is a two-dimensional coordinate system, and the plane composed of the X-axis and the Y-axis of the two-dimensional coordinate system can be used as the target plane; when M is an integer greater than 3, the M-dimensional coordinate system is a three-dimensional coordinate system and a multi-dimensional coordinate system with a dimension greater than 3, and the number of coordinate axes of the M-dimensional coordinate axis is greater than or equal to 3, and any two different coordinate axes in the M-dimensional coordinate axis can form a plane, and the total number of planes formed by different coordinate axes of the M-dimensional coordinate axis is greater than or equal to 3. In this case, at least one plane among all planes formed by different coordinate axes in the M-dimensional coordinate axis can be used as the target plane, or all planes formed by different coordinate axes in the M-dimensional coordinate axis can be used as the target plane.
[0047] To facilitate understanding, here is a specific example of the relationship between the target plane and the initial plane:
[0048] Example 1: You can select any point in the three-dimensional space as the coordinate origin O, and make three mutually perpendicular X-axis, Y-axis and Z-axis through the coordinate origin O to form a three-dimensional coordinate system as the aforementioned M-dimensional coordinate system. The plane formed by the X-axis and Y-axis of the three-dimensional coordinate system is the XY plane, the plane formed by the X-axis and Z-axis of the three-dimensional coordinate system is the XZ plane, and the plane formed by the Y-axis and Z-axis of the three-dimensional coordinate system is the YZ plane. Then, you can judge whether the initial plane where the K calibration points are located is the target plane through, but not limited to, the following examples 1.1. and 1.2:
[0049] Example 1.1: The XY plane, YZ plane, and YZ plane of the three-dimensional coordinate system are all taken as the target plane; in this example, if the Z-axis coordinates of the K calibration points are all 0 (that is, the initial plane where the K calibration points are located is the XY plane of the three-dimensional coordinate system), or, the X-axis coordinates of the K calibration points are all 0 (that is, the initial plane is the YZ plane in the three-dimensional coordinate system), or, the Y-axis coordinates of the K calibration points are all 0 (that is, the initial plane is the XZ plane in the three-dimensional coordinate system), then the initial plane where the K calibration points are located can be determined to be the target plane; only when the initial plane is different from the aforementioned XY plane, YZ plane, and YZ plane, it is determined that the initial plane where the K calibration points are located is not the target plane.
[0050] Example 1.2: Only the XY plane of the three-dimensional coordinate system is used as the target plane; in this example, when the Z-axis coordinates of the K calibration points are all 0 (that is, the initial plane where the K calibration points are located is the XY plane of the three-dimensional coordinate system), the initial plane where the K calibration points are located is determined to be the target plane; when the initial plane is not the aforementioned XY plane, the initial plane where the K calibration points are located is determined not to be the target plane.
[0051] In the embodiment of the present application, when the initial plane is not the target plane, in order to improve the calculation efficiency, K calibration points can be converted to the target plane to obtain K conversion points, and the converted K conversion points are located on the target plane, that is, the K conversion points can be regarded as points on the two-dimensional target plane; for example, when the target plane only includes one plane among all the planes composed of different coordinate axes in the aforementioned M-dimensional coordinate axis, each calibration point can be converted to the one plane to obtain each conversion point corresponding to each calibration point. For example, when the target plane is the XY plane of the aforementioned three-dimensional coordinate system, each calibration point can be converted to the XY plane to obtain each conversion point corresponding to each calibration point, that is, in this case, the value of each conversion point on the Z axis is 0. When calculating, only the coordinate values of each conversion point on the X axis and the Y axis can be considered to simplify the calculation process and improve the calculation efficiency. When the target plane includes at least two planes among all the planes composed of different coordinate axes in the aforementioned M-dimensional coordinate axis, one plane can be selected from the at least two planes as a reference plane, and then each calibration point can be converted to the reference plane to obtain each conversion point corresponding to each calibration point.
[0052] In this embodiment, when the initial plane where the K calibration points are located is the target plane, multiple target points are determined on the target circumscribed figure formed by the K calibration points; when the initial plane where the K calibration points are located is not the target plane, the K calibration points are respectively converted to the target plane to obtain K conversion points, and multiple first points on the circumscribed figure formed by the K conversion points are calculated, and then these multiple first points are converted to the initial plane to obtain K target points. Since the K conversion points converted to the target plane can be regarded as two-dimensional coordinate points, the multiple first points can be determined by two-dimensional coordinate operation. Compared with three-dimensional coordinate operation, the calculation process is simplified and the calculation complexity is reduced.
[0053] In another embodiment of the present application, each of the calibration points is converted to the target plane to obtain K conversion points, including:
[0054] Determine the vectors corresponding to the calibration points; and respectively perform vector rotation on the vectors corresponding to the calibration points to transform the calibration points to the target plane to obtain K transformation points; the vector rotation may be implemented by, but is not limited to, at least one of a quaternion, a rotation matrix, and an Euler angle;
[0055] Exemplarily, if the coordinates of a calibration point on the initial plane in the three-dimensional coordinate system are (x, y, z), the vector corresponding to the calibration point can be the displacement from the origin O(0, 0, 0) of the three-dimensional coordinate system to the coordinates (x, y, z), that is, a vector with the origin O as the starting point and the calibration point as the end point, and the vector is expressed as (x, y, z).
[0056] In this embodiment, K calibration points on the initial plane are transformed to the target plane through vector rotation to obtain K conversion points. These K conversion points can be regarded as two-dimensional coordinates, and subsequent calculations can be performed using two-dimensional coordinate operations. Compared with three-dimensional coordinate operations, the calculation process is simplified and the calculation complexity is reduced.
[0057] In another embodiment of the present application, the vectors corresponding to the respective calibration points are respectively rotated to convert the respective calibration points to the target plane to obtain K conversion points, including:
[0058] Obtain the normal vector of the initial plane; obtain a quaternion based on the normal vector of the initial plane and the normal vector of the target plane; respectively calculate the vectors corresponding to each of the calibration points with the quaternion to obtain the target vectors of each of the calibration points in the target plane, each of the target vectors corresponds to a conversion point; wherein the quaternion can be used to rotate the normal vector of the initial plane to the normal vector of the target plane.
[0059] Example 2: Since a plane can be determined based on three points, in the embodiment of the present application, three calibration points p1, p2, and p3 can be selected from the K calibration points to determine the initial plane where the K calibration points are located. In this example, the three selected calibration points are respectively recorded as: p1 = (p1 x ,p1 y ,p1 z ), p2=(p2 x ,p2 y ,p2 z ), p3=(p3 x ,p3 y ,p3 z ). Then, through the spatial coordinates of p1, p2, and p3, the normal of the initial plane where the three calibration points are located can be calculated.
[0060] The vector from point p1 to point p2 is The vector from point p1 to point p3 is Calculating vectors and The vector cross product of gets the normal vector of the initial plane
[0061] The three-dimensional coordinate system is constructed in the manner of Example 1 in the above embodiment. The target plane is the XY plane of the three-dimensional coordinate system as an example for explanation. The normal vector of the target plane is recorded as Calculation will Rotate to The quaternion of Normalized to get By "unit vector Rotate to unit vector The quaternion q is obtained using the "quaternion" calculation formula (the specific calculation method can be found in the following description).
[0062] The quaternion q is calibrated to the vectors formed by the fixed points p1, p2, and p3 and Perform vector rotation to obtain the conversion points a1, a2, and a3 of each calibration point rotated to the XY plane (i.e., the target plane):
[0063] Target vector Target vector Target vector Let a1=(a1 x ,a1 y ,a1 z ),a2=(a2 x ,a2 y ,a2 z ),a3=(a3 x ,a3 y ,a3 z ); where a1 z =a2 z =a3 z , that is, the conversion points a1, a2, and a3 are located in the XY plane (i.e., the target plane) of the three-dimensional coordinate system.
[0064] In this embodiment, K calibration points are converted to the target plane by quaternions to obtain K conversion points on the target plane, so that multiple first points can be determined by two-dimensional coordinate calculation of the conversion points in the subsequent process. Compared with three-dimensional coordinate calculation, the calculation process is simplified and the calculation complexity is reduced. In this embodiment, quaternions are used to perform three-dimensional vector rotation on K calibration points, which can avoid the deadlock problem when using Euler angles for vector rotation, and can also avoid complex calculations when using rotation matrices for vector rotation.
[0065] In an embodiment of the present application, the converting each of the first points to the initial plane to obtain the multiple target points includes:
[0066] Determine the vectors corresponding to the multiple first points; respectively perform vector rotation on the vectors corresponding to the multiple first points to transform the multiple first points to the initial plane to obtain the multiple target points.
[0067] Specifically, since the first point is a point on the target plane, the first point also needs to be converted to the initial plane. In the process of determining the vectors corresponding to the multiple first points, the vectors corresponding to the respective first points can be obtained according to the coordinates of the respective first points on the target plane. The vector rotation in this embodiment can be to calculate the vectors corresponding to the respective first points in the multiple first points and the quaternion respectively. For example, the quaternion q can be obtained according to Example 2 in the above embodiment, but is not limited thereto, and the inverse of the quaternion q is taken, which is recorded as q -1 , q -1 Apply to each first point b1~bn respectively, and then determine the vector corresponding to each first point (Wherein, for each first point, a vector with the origin coordinates of the three-dimensional coordinate system as the starting point and the first point as the end point can be used as the vector corresponding to each first point), and then in the process of performing vector rotation on the vectors corresponding to the plurality of first points to transform the plurality of first points to the initial plane, the vectors corresponding to the plurality of first points can be based on the vectors corresponding to the plurality of first points. pass Rotate to get the vector of the target point corresponding to each first point Vectors through each target point Determine each target point b1′ to bn′ (that is, determine the coordinates of each target point in the three-dimensional coordinate system), where 1 to n in the above items are the identifiers of each first point in the plurality of first points, is the vector corresponding to the first point bn identified as n; bn′ is the target point corresponding to the first point bn, is the vector corresponding to the target point bn′ corresponding to the first point bn.
[0068] In the above method, multiple first points can be converted to the initial plane to obtain multiple target points, which are the points on the circumscribed figure composed of K calibration points. Compared with three-dimensional coordinate calculation, two-dimensional coordinate calculation is used to determine the coordinates of multiple first points, and then multiple first points are converted to the initial plane through quaternions to obtain points on the circumscribed figure composed of K calibration points, which simplifies the calculation process and reduces the calculation complexity.
[0069] In yet another embodiment of the present application, the plane figure includes a circle, and the circumscribed figure formed by the K conversion points includes a circumscribed circle;
[0070] The step of determining a plurality of first points on the circumscribed graph formed by the K conversion points comprises:
[0071] Determine the center and radius of the circumscribed circle; and determine a plurality of first points on the circumference of the circumscribed circle based on the center and the radius.
[0072] Specifically, since the K conversion points are located on the target plane, these K conversion points can be regarded as coordinate points in two-dimensional space, and two-dimensional coordinate operations can be used to determine the center and radius of the circumscribed circle formed by the K conversion points. Determine the three conversion points on the circumscribed circle among the K conversion points, and construct a three-dimensional coordinate system in accordance with the method of Example 1 in the above embodiment. Take the XY plane in the three-dimensional coordinate system as the target plane for explanation. According to the method of calculating the center and radius of the three conversion points in the two-dimensional coordinates, the center of the circumscribed circle on the XY plane is obtained as a0=(a0 x ,a0 y ) and radius r. The specific calculation method can be found in the following description.
[0073] The number of interpolation points can be preset or determined based on user input. The number of interpolation points is the number of first points. The larger the number of interpolation points, the more regular and accurate the contour of the circular target drawn subsequently.
[0074] For example, with the vector (0, 1) as the 0 degree angle (12 o'clock direction), the coordinates of the first point on the circumference with the angle radian can be expressed as (a0 x +r*cos(radian),a0 y +r*sin(radian)), accordingly, its three-dimensional coordinates can be expressed as (a0 x +r*cos(radian),a0 y +r*sin(radian), 0), the multiple first points may be evenly distributed on the circumference. It should be noted that the multiple first points may not be evenly distributed on the circumference, which is not limited here.
[0075] In this embodiment, the center and radius of the circumscribed circle of K conversion points can be calculated on the target plane using two-dimensional coordinate operations, and then multiple first points on the circumference of the circumscribed circle can be calculated based on the number of interpolation points, the coordinates of the center and the radius of the circle. Compared with the three-dimensional coordinate operation method, the calculation process is simplified and the calculation complexity is reduced.
[0076] In another embodiment of the present application, the step of obtaining K calibration points on the element contour includes:
[0077] Receiving a first input, where the first input is used to determine M calibration points, where M is an integer greater than or equal to 3;
[0078] In response to the first input, K calibration points are selected from the M calibration points, and the K calibration points are located in the same plane.
[0079] In the above, the first input may be a manual click input on the circular target contour, and each click determines a calibration point.
[0080] Exemplarily, if the M calibration points are not in the same plane (in this case, the number M is greater than 3), three calibration points are selected from the selected M calibration points. Three calibration points can be randomly selected from the M calibration points; or the first two calibration points that are farthest from the first calibration point are selected from the M calibration points, and these two calibration points and the first calibration point are used as three calibration points to determine the initial plane. The points among the M calibration points that are not in the initial plane are deleted to obtain K calibration points to ensure that the K calibration points are in the same plane, wherein the aforementioned first calibration point is the calibration point selected by the first click, or the calibration point selected by the last click, etc., and is not limited here.
[0081] It should be noted that the three calibration points selected above are not on the same straight line.
[0082] In the above, K calibration points located in the same plane are selected from the M calibration points determined by the first input to participate in the subsequent automatic drawing of the target traffic element. It is no longer necessary to manually draw the entire element outline of the target traffic element, which can greatly reduce the workload of manually drawing the element outline and improve the drawing efficiency.
[0083] In another embodiment of the present application, before acquiring K calibration points on the element contour of the target traffic element based on the point cloud data, the method further includes:
[0084] In response to a reference point quantity indication for the target traffic element, determining the number of reference point quantity indications as K; and / or
[0085] The number of preset calibration points that match the plane shape and / or three-dimensional shape of the target traffic element is determined as the K.
[0086] In the above, the number of preset calibration points can be set according to the actual situation, and different shapes correspond to different numbers of preset calibration points. For example, if the plane shape of the target traffic element is a circle, the number of preset calibration points is 3; if the plane shape of the target traffic element is a rectangle, the number of preset calibration points is 4. K can be determined by the calibration point data indication, or it can be determined according to the plane shape and / or three-dimensional shape of the target traffic element, so that the determination method of K is more flexible and meets the needs of more scenarios.
[0087] The following example illustrates the method for drawing traffic elements provided in the embodiment of the present application, taking the target traffic element as a circular road sign, the plane figure as a circle, the target circumscribed figure as a circumscribed circle, and K as 3 as an example. A three-dimensional coordinate system is constructed in accordance with the method of Example 1 in the above embodiment. The method includes the following steps:
[0088] 1) Receive a selection input, wherein the selection input is used to select three calibration points p1, p2, and p3 on the circular contour edge of the circular road sign in the point cloud data. Where p1 = (p1 x ,p1 y ,p1 z ), p2=(p2 x ,p2 y ,p2 z ), p3=(p3 x ,p3 y ,p3 z ).
[0089] 2) Calculate the normal of the plane where the three points are located through the spatial coordinates of p1, p2, and p3 The vector from point p1 to point p2 is The vector from point p1 to point p3 is Calculate the vector cross product of vector v1 and v2 to get the vector
[0090] 3) Let the normal vector of the XY plane be calculate Rotate to The quaternion of Normalized to get Among them, the quaternion is described as (x, y, z, w), w is related to the angle of rotation; for a rotation around a unit vector The rotation angle θ can be expressed as quaternion To express;
[0091] Among them, the calculation method of the four elements can refer to the following method:
[0092] For two unit vectors and Let the angle be θ;
[0093] vector and The dot product of
[0094] According to the vector dot product formula
[0095] We can get θ = arccos(a x b x +a y b y +a z b z );
[0096] By vector cross multiplication, we can get Plane Normal
[0097] beg Model
[0098] Will Normalized
[0099] Quaternions
[0100] The calculation method of the four elements can also refer to the following method:
[0101] Plane Normal remember
[0102] calculate
[0103] Take the quaternion q = (n x ,n y ,n z ,cosθ+1);
[0104] After normalizing q, we get This is the desired quaternion.
[0105] 4) Apply the quaternion q to p1, p2, and p3 to obtain the coordinates of the corresponding points rotated to the XY plane. Let a1=(a1 x ,a1 y ,a1 z ), a2=(a2 x ,a2 y ,a2 z ),a3=(a3 x ,a3 y ,a3 z ); where a1 z =a2 z =a3 z ; The multiplication of a quaternion and a vector represents the new vector obtained by rotating the vector according to the quaternion.
[0106] 5) Since a1, a2, and a3 are all in the XY plane, we can use the formula for calculating the center and radius of a circle based on the three points in the two-dimensional plane to obtain a0=(a0 x ,a0 y ) and radius r; therefore, the specific calculation method of the center a0 and radius r of the circumscribed circle of the triangle formed by the three points a1, a2, and a3 is as follows:
[0107] Assume a1=(x1,y1), a2=(x2,y2), a3=(x3,y3), then:
[0108] a0 x =((y2-y1)×(y3 2 -y1 2 +x3 2 -x1 2 )-(y3-y1)×(y2 2 -y1 2
[0109] +x2 2 -x1 2 )) / (2×(x3-x1)×(y2-y1)-2×(x2-x1)
[0110] ×(y3-y1))
[0111] a0 y =((x2-x1)×(x3 2 -x1 2 +y3 2 -y1 2 )-(x3-x1)×(x2 2 -x1 2 +y2 2 -y1 2 )) / (2×(y3-y1)×(x2-x1)-2×(y2-y1)×(x3-x1))
[0112]
[0113] 6) Calculate the coordinates of the points b1 to bn on the circumference of the circle according to the number of interpolation points on the circle through a0 and r;
[0114] 7) Take the inverse of the quaternion q, denoted by q -1 , q -1 Apply to b1~bn respectively to obtain b1′~bn′; b1′~bn′ is the set of points on the circumference of the triangle formed by the three points p1, p2, and p3.
[0115] 8) Outputting the coordinates of b1′ to bn′ to the rendering module can draw a circular pattern that fits the outline of the circular road sign.
[0116] like Figure 2 As shown in the figure, the white circle marking points are the calibration points p1, p2, and p3 selected by the user, and the white square marking points are the target points on the circle formed by the calibration points p1, p2, and p3 generated according to the method provided in the embodiment of the present application. By connecting the target points, the outline of the circular road sign can be drawn.
[0117] When drawing the contour of the circular road sign, the above method can reduce the number of calibration points involved in manual drawing to 3, reducing the workload of manual work and the requirements for the quality of point cloud data. In addition, the three-point circle drawing algorithm generates multiple target points on the contour, which greatly improves the accuracy of the drawn contour, making the drawn circle more regular and accurate, and also improves production efficiency.
[0118] Figure 3 FIG. 1 shows a structural diagram of a traffic element drawing device provided in an embodiment of the present application. Figure 3 As shown, the traffic element drawing device 300 includes:
[0119] A first acquisition module 301 is used to acquire K calibration points on the element contour of the target traffic element based on the point cloud data, where K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data;
[0120] The second acquisition module 302 is used to determine a plurality of target points on a target circumscribed figure according to the K calibration points; the plurality of target points are located in the same plane, and the target circumscribed figure is a circumscribed figure of a geometric figure formed by the K calibration points;
[0121] The drawing module 303 is used to draw the element outline of the target traffic element in the point cloud data according to the multiple target points.
[0122] The traffic element drawing device 300 provided in the embodiment of the present application can implement each process implemented in the aforementioned traffic element drawing method embodiment and achieve the same technical effect. To avoid repetition, it will not be described here.
[0123] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0124] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.
[0125] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0126] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0127] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect or the second aspect of the present disclosure.
[0128] The processor 401 implements any one of the information auditing methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0129] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0130] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0131] Bus 410 includes hardware, software or both, and the parts of information audit method or verification equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0132] In addition, in combination with the traffic element drawing method in the above embodiment, the embodiment of the present application also provides a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the traffic element drawing methods in the above embodiment is implemented.
[0133] An embodiment of the present application further provides a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes any one of the traffic element drawing methods in the above embodiments.
[0134] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiment, several specific steps are described as examples. However, the method process of the present application is not limited to the specific steps described, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0135] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0136] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0137] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box 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, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0138] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for drawing traffic elements, characterized in that: The method comprises: Acquire K calibration points on the element contour of the target traffic element based on the point cloud data, where K is an integer greater than 1, and the calibration points are three-dimensional space points determined based on the point cloud data; Determine multiple target points on a target circumscribed figure according to the K calibration points; the multiple target points are located in the same plane, and the target circumscribed figure is a circumscribed figure of a geometric figure formed by the K calibration points; Based on the multiple target points, the element outline of the target traffic element in the point cloud data is drawn.
2. The method for drawing traffic elements according to claim 1, characterized in that: K is greater than or equal to 3, and determining a plurality of target points on the target circumscribed graph according to the K calibration points comprises: In a case where the initial plane where the K calibration points are located is the target plane, a plurality of target points are determined on the target circumscribed figure formed by the K calibration points; When the initial plane where the K calibration points are located is not the target plane, each of the calibration points is converted to the target plane to obtain K conversion points; multiple first points are determined from the circumscribed figure formed by the K conversion points; each of the first points is converted to the initial plane to obtain the multiple target points.
3. The method for drawing traffic elements according to claim 2, characterized in that: Each of the calibration points is converted to the target plane to obtain K conversion points, including: Determine the vector corresponding to each of the calibration points; Perform vector rotation on the vectors corresponding to the respective calibration points respectively, so as to transform the respective calibration points to the target plane, and obtain K transformation points.
4. The method for drawing traffic elements according to claim 3, characterized in that: The vector rotation is performed on the vectors corresponding to the respective calibration points to convert the respective calibration points to the target plane to obtain K conversion points, including: Obtaining a normal vector of the initial plane; Calculating according to the normal vector of the initial plane and the normal vector of the target plane to obtain a quaternion, wherein the quaternion is used to rotate the normal vector of the initial plane to the normal vector of the target plane; The vectors corresponding to the respective calibration points are calculated with the quaternion respectively to obtain the target vectors of the respective calibration points on the target plane, and each target vector corresponds to a conversion point.
5. The method for drawing traffic elements according to claim 2, characterized in that: The step of converting each of the first points to the initial plane to obtain the plurality of target points comprises: Determine a plurality of vectors corresponding to the first points; The vectors corresponding to the plurality of first points are respectively rotated to transform the plurality of first points to the initial plane to obtain the plurality of target points.
6. The method according to any one of claims 2 to 5, characterized in that: The target traffic element includes a plane figure.
7. The method according to claim 2, characterized in that The target traffic element includes a circle, and the circumscribed figure formed by the K conversion points includes a circumscribed circle; The step of determining a plurality of first points on the circumscribed graph formed by the K conversion points comprises: Determining the center and radius of the circumscribed circle; A plurality of first points are determined on the circumference of the circumscribed circle according to the center of the circle and the radius.
8. The method according to claim 1, characterized in that Before acquiring K calibration points on the element contour of the target traffic element based on the point cloud data, the method further includes: In response to a reference point quantity indication for the target traffic element, determining the number of reference point quantity indications as K; and / or The number of preset calibration points that match the plane shape and / or three-dimensional shape of the target traffic element is determined as the K.
9. An electronic device, characterized in that: include: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the traffic element drawing method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the method for drawing traffic elements according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Method for automatically generating real-scene image with measurable traffic elements
CN120431272A