CN112215952B - Curve drawing method, computer storage medium and electronic device - Google Patents
Curve drawing method, computer storage medium and electronic device Download PDFInfo
- Publication number
- CN112215952B CN112215952B CN202011157667.4A CN202011157667A CN112215952B CN 112215952 B CN112215952 B CN 112215952B CN 202011157667 A CN202011157667 A CN 202011157667A CN 112215952 B CN112215952 B CN 112215952B
- Authority
- CN
- China
- Prior art keywords
- point
- position points
- elevation dimension
- smoothed
- user
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000004088 simulation Methods 0.000 claims abstract description 25
- 238000009499 grossing Methods 0.000 claims abstract description 10
- 238000004590 computer program Methods 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 claims description 5
- 238000004422 calculation algorithm Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 4
- 230000001502 supplementing effect Effects 0.000 claims description 4
- 238000004519 manufacturing process Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 10
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000002411 adverse Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 239000013589 supplement Substances 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/08—Indexing scheme for image data processing or generation, in general involving all processing steps from image acquisition to 3D model generation
Landscapes
- Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention provides a curve drawing method, a computer storage medium and an electronic device. The method is realized based on spline interpolation and comprises the following steps: acquiring coordinate data of each position point selected by a user based on the acquired point cloud data, wherein the coordinate data comprises an elevation dimension value; generating an original point selection set according to the coordinate data; smoothing the elevation dimension values of the position points in the original point selection set in sequence according to the sequence of the position points selected by the user to obtain selected points to be interpolated of the position points; and carrying out three-dimensional spline interpolation on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value. The invention can reduce the weight of interpolation of each position point selected by a user in the elevation dimension space, so as to realize the purposes of completely fitting the horizontal space and smoothly fitting the elevation dimension space, thereby satisfying the semi-automatic drawing effect of curves on any plane in service and solving the problem of large fluctuation of the plane space caused by fine errors of coordinate point selection.
Description
Technical Field
The invention relates to the technical field of automobile driving, in particular to a spline interpolation-based curve drawing method, a computer storage medium and electronic equipment.
Background
In the data production process of the high-precision map, a head line, a flower bed, a road edge, a left turning line, a right turning line and the like exist, and the curve drawing is involved at this time. At this time, if the operator creates curve data in a point-by-point selection mode, the efficiency is low, and the quality of the produced data is not high. There is a need for a curve that can be modeled based on several points selected by the user, and that will fit better as the number of selected points increases.
Currently, spline functions are generally used for the simulation of curves. There are two main ways, one is spline interpolation of two-dimensional data to simulate a curve, and the other is spline interpolation of three-dimensional data to simulate a curve. The spline function of the two-dimensional data only carries out interpolation simulation on the data of the horizontal dimension, and does not consider the data of the elevation dimension. This can result in data loss in the elevation dimension. The spline function of the three-dimensional data carries out interpolation simulation on the data of the horizontal dimension and the data of the elevation dimension according to the same weight. The data of the high-precision map is three-dimensional, and if a two-dimensional spline function is used for interpolation simulation, data loss in the elevation dimension is caused. If the three-dimensional spline function is used for interpolation simulation, because the interpolation is weighted in the horizontal dimension and the elevation dimension, when a curve with gradient needs to be drawn, the simulated curve is easy to be in a state of fluctuating up and down, so that the quality of generated map data is low, and the generation of a high-precision map is not facilitated.
Disclosure of Invention
In view of the above technical problem, the present invention has been made to provide a spline interpolation based curve drawing method, a computer storage medium, and an electronic device that solve the above problems or at least partially solve the above problems.
An object of an aspect of the present invention is to provide a method for reducing the weight of interpolation of each location point selected by a user in an elevation dimension space, so as to achieve the purpose of completely fitting a horizontal space and smoothly fitting the elevation dimension space.
A further object of one aspect of the present invention is to minimize the fluctuation in the elevation dimension, making the modeled curve more realistic.
Particularly, the invention provides a curve drawing method based on spline interpolation in one aspect, which is applied to the production process of map data and comprises the following steps:
acquiring coordinate data of each position point selected by a user based on the acquired point cloud data, wherein the coordinate data comprises an elevation dimension value;
generating an original point selection set according to the coordinate data;
smoothing the elevation dimension values of the position points in the original point selection set in sequence according to the sequence of the position points selected by the user to obtain selected points to be interpolated corresponding to the position points;
and carrying out three-dimensional spline interpolation on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value.
Optionally, the obtaining of the coordinate data of each position point selected by the user based on the obtained point cloud data includes:
displaying the point cloud corresponding to the point cloud data;
determining position points sequentially selected by a user in response to point selection operation of the user in the point cloud data;
acquiring actual position points corresponding to the position points by a reflection line tracking technology for the position points selected by a user;
and sequentially acquiring the coordinate data of each actual position point to be used as the coordinate data of the position point selected by the user.
Optionally, sequentially smoothing the elevation dimension values of the position points in the original point selection set according to the sequence of the position points selected by the user includes:
sequentially selecting each position point in the original point selection set as a current base point to be smoothed according to the sequence of the position points selected by the user;
determining a first preset number of position points adjacent to the front of the current base point to be smoothed and a second preset number of position points adjacent to the back of the current base point to be smoothed;
calculating the elevation dimension value of the current base point to be smoothed, the elevation dimension values of the first preset number of position points adjacent to the front of the current base point to be smoothed and the average value of the elevation dimension values of the second preset number of position points adjacent to the back of the current base point to be smoothed;
taking the calculated average value as an elevation dimension value of the current base point to be smoothed after smoothing;
updating the elevation dimension value of the current base point to be smoothed according to the smooth elevation dimension value;
when the average value is calculated, the elevation dimension values of the first preset number of position points adjacent to the current base point to be smoothed are the updated elevation dimension values of the first preset number of position points adjacent to the current base point to be smoothed.
Optionally, determining a first preset number of position points adjacent to the base point to be smoothed in front of the current base point to be smoothed and a second preset number of position points adjacent to the base point to be smoothed in back of the current base point to be smoothed includes:
if the number of the position points adjacent to the current base point to be smoothed is smaller than a first preset number, supplementing the number of the position points adjacent to the current base point to the first preset number by using the position point at the forefront end of the position points adjacent to the current base point to be smoothed; or
And if the number of the position points adjacent to the current base point to be smoothed is smaller than a second preset number, supplementing the number of the position points adjacent to the last end of the position points to the second preset number.
Optionally, the first preset number is set equal to the second preset number.
Optionally, performing three-dimensional spline interpolation on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value, including:
sequentially selecting points to be interpolated of adjacent position points according to the sequence of the position points selected by the user;
carrying out three-dimensional spline interpolation on the selected points to be interpolated of the adjacent position points selected each time to obtain a piecewise curve between the adjacent position points;
obtaining a spline interpolation curve of a point to be interpolated based on each piecewise curve;
calculating each position point on the spline interpolation curve according to a preset step length from the starting point of the sequence of the position points selected by the user;
and sequentially connecting the position points on the adjacent spline interpolation curves according to the sequence of the position points selected by the user to obtain the three-dimensional simulation curve with smooth elevation dimension values.
Optionally, the performing three-dimensional spline interpolation on the selected point to be interpolated includes:
and performing three-dimensional spline interpolation on the point to be interpolated based on a CatmulRom algorithm.
Optionally, after obtaining the three-dimensional simulation curve with the smoothed elevation dimension value, the method further includes:
and visually displaying the three-dimensional simulation curve.
Another aspect of the present invention provides a computer storage medium having computer program code stored thereon, which, when run on a computing device, causes the computing device to perform any of the above-described spline interpolation based curve rendering methods.
Yet another aspect of the present invention provides an electronic device, comprising:
a processor;
a memory storing computer program code which, when executed by the processor, causes the electronic device to perform any of the spline interpolation based curve rendering methods described above.
The method can combine the characteristics of three-dimensional space interpolation of a three-dimensional spline function, and can achieve the purposes of completely fitting a horizontal space and smoothly fitting an elevation dimension space by reducing the weight of each position point selected by a user in the elevation dimension space, thereby meeting the semi-automatic drawing effect of curves on any plane in service and solving the problem of large fluctuation of the plane space caused by fine errors of coordinate point selection.
Furthermore, the elevation dimension values of the positions selected by the user are smoothed by adopting a smoothing method of the moving average value, so that the adverse effect of the abnormal points on the final interpolation effect can be reduced on the basis of keeping the fluctuation trend of the elevation dimension space.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter, by way of illustration and not limitation, with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
FIG. 1 is a schematic flow diagram of a spline interpolation based curve drawing method according to one embodiment of the present invention;
FIG. 2 is a schematic flow chart diagram of a spline interpolation based curve drawing method according to another embodiment of the present invention;
FIG. 3 is a schematic block diagram of an electronic device in accordance with one embodiment of the present invention.
Detailed Description
Fig. 1 is a schematic flow chart of a spline interpolation-based curve drawing method according to an embodiment of the present invention. Referring to fig. 1, in the present embodiment, the spline interpolation based curve drawing method may include steps S102 to S108.
And S102, acquiring coordinate data of each position point selected by a user based on the acquired point cloud data. Wherein the coordinate data includes an elevation dimension value.
And step S104, generating an original point selection set according to the coordinate data.
And S106, smoothing the elevation dimension values of the position points in the original point selection set in sequence according to the sequence of the position points selected by the user to obtain the point to be interpolated corresponding to the position points.
And S108, performing three-dimensional spline interpolation on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value.
In the embodiment, firstly, coordinate data of each position point selected by a user is acquired based on the acquired point cloud data, then an original selected point set is generated according to the coordinate data, since the coordinate data comprises an elevation dimension value, then, the elevation dimension value of each position point in the original selected point set can be smoothed in sequence according to the sequence of each position point selected by the user, a selected point to be interpolated corresponding to each position point is obtained, and then, three-dimensional spline interpolation is performed on the selected point to be interpolated, so that a three-dimensional simulation curve with a smooth elevation dimension value is obtained. Based on the scheme provided by the embodiment, the interpolation weight of each position point selected by a user in the elevation dimension space can be reduced, so that the purposes of completely fitting the horizontal space and smoothly fitting the elevation dimension space are achieved, the semi-automatic drawing effect of curves on any plane in service is met, and the problem of large fluctuation of the plane space caused by slight errors of coordinate point selection is solved.
Before performing step S102, point cloud data may be acquired first. The point cloud data may be acquired by a laser radar. The point cloud data acquired by the laser radar is three-dimensional space vector data which is three-dimensional data under a three-dimensional space coordinate system. The coordinate axes of the three-dimensional space coordinate system are assumed to be an x-axis, a y-axis and a z-axis respectively, wherein a plane determined by the x-axis and the y-axis is a plane where a ground plane is located, namely a plane of a horizontal space, and the z-axis is a height direction. At this time, the coordinate point corresponding to the point cloud data may be represented as (X, Y, Z), and the Z-axis coordinate value, i.e., Z, represents an elevation dimension value of the coordinate point.
Next, step S102 may be performed, and in some embodiments, step S102 may further include the steps of:
first, the point cloud corresponding to the point cloud data can be displayed through a screen of the terminal device. The terminal equipment can be any terminal equipment such as a vehicle-mounted multimedia terminal, a mobile phone terminal, an intelligent watch, a PC terminal equipment and the like.
Secondly, the position point selected each time by the user is determined in response to the point selection operation of the user on the position point in the point cloud data. After the point cloud corresponding to the point cloud data is displayed on a screen of the terminal device, a user performs point selection operation on the position points of the point cloud, and then the position points selected by the user each time can be determined in response to the point selection operation of the user. And the point in the point cloud data selected by the user each time is the position point of the point selected by the user.
And then, acquiring each actual position point corresponding to each position point for each position point selected by the user through a reflection line tracking technology. The point cloud data is data under a carrier coordinate system, and the carrier coordinate system is a coordinate system bound with the carrier and can synchronously move along with the movement of the carrier. The carrier coordinate system may comprise, for example, a camera coordinate system, a lidar coordinate system, etc. And point cloud data acquired by the laser radar is data under a laser radar coordinate system. And the coordinate data of the actual position point is data of a point cloud corresponding to the point cloud data in a world coordinate system. The world coordinate system is the reference frame required to describe the other coordinate systems.
And finally, acquiring the coordinate data of each actual position point as the coordinate data of each position point selected by the user.
According to the embodiment, the user selects different points in sequence to collect the position points, and then the corresponding actual position points are obtained by the reflection line tracking technology for the position points selected each time, so that the coordinate data of the position points selected by the user are obtained. The scheme of the embodiment is used for acquiring the coordinate data of the position point selected by the user, and the method is simple to operate and easy to implement. The principle of the reflected ray tracing technique is described in detail in the related art, and will not be described herein.
For step 106, an implementation manner is provided in the embodiment of the present invention. In this embodiment, the position points in the original selection point set may be selected as the current base point to be smoothed in sequence according to the order of the position points selected by the user. And then, determining a first preset number of position points adjacent to the front of the current base point to be smoothed and a second preset number of position points adjacent to the back of the current base point to be smoothed. Then, an average value of the elevation dimension values of the current base point to be smoothed, the elevation dimension values of the first preset number of the position points adjacent to the front of the current base point to be smoothed and the elevation dimension values of the second preset number of the position points adjacent to the back of the current base point to be smoothed is calculated. And finally, taking the calculated average value as a smooth elevation dimension value of the current base point to be smoothed, and updating the elevation dimension value of the current base point to be smoothed according to the smooth elevation dimension value so as to calculate the smooth elevation dimension value of the next position point of the current base point to be smoothed.
In order to reduce the fluctuation of the height dimension space to the maximum extent, so that the resulting three-dimensional simulation curve is more realistic, in some embodiments, the first predetermined number may be set to be equal to the second predetermined number. For example, if the first preset number and the second preset number are both set to be 2, when the smooth elevation dimension value of the current base point to be smoothed needs to be calculated, in addition to the elevation dimension value of the current base point to be smoothed, the smooth elevation dimension value of the next 2 adjacent position points before the current base point to be smoothed and the elevation dimension value of the next 2 adjacent position points need to be added, that is, an average value is calculated based on the elevation dimension values of the five position points, and the average value can be used as the smooth elevation dimension value of the current base point to be smoothed. And then, updating the elevation dimension value of the current base point to be smoothed by using the smooth elevation dimension value of the current base point to be smoothed so as to calculate the smooth elevation dimension value of the next position point.
When the average value is calculated, the elevation dimension values of the first preset number of position points adjacent to the current base point to be smoothed are the elevation dimension values of the updated first preset number of position points adjacent to the current base point to be smoothed. It can be understood that, when calculating the average value, a smoothing method for calculating a moving average value is adopted, that is, the average value is sequentially calculated according to the sequence of the position points selected by the user, when determining the smooth elevation dimension value of each position point, a first preset number of position points adjacent to the position point in front and a second preset number of position points adjacent to the position point in back can be respectively added, and then the average value of the elevation dimension values of a plurality of position points is calculated to be used as the smooth elevation dimension value of the position point until determining the smooth elevation dimension value of the position point when the sequence of the position points selected by the user is finished. By adopting the scheme of the embodiment, the adverse effect of the abnormal point on the final interpolation effect can be reduced as much as possible on the basis of keeping the fluctuation trend of the elevation dimension space.
The outlier means that an error between the coordinate data of the location point selected by the user and the real coordinate data of the location point exceeds an allowable error range.
It should be noted that, when the smooth elevation dimension value of each location point is sequentially calculated according to the sequence of the location points selected by the user, the number of the front adjacent location points of the first selected location point may be less than the first preset number, and the number of the rear adjacent location points of the last selected location point may also be less than the second preset number. In view of this, in some embodiments, if the number of position points before and adjacent to the base point to be smoothed currently is less than the first preset number, the number of position points before and adjacent to the most front position point of the position points before and adjacent to the base point to be smoothed currently may be used to supplement the number of position points before and adjacent to the first preset number. At this time, the supplemented coordinate data of the position points is the coordinate data of the foremost position point among the previously adjacent position points, that is, when subsequently calculating the smooth elevation dimension value of the current base point to be smoothed, the elevation dimension value of the foremost position point among the previously adjacent position points needs to be weighted and calculated. Wherein, the weighting weight can be determined according to the number of the front adjacent position points needing to be supplemented. Specifically, assuming that the number of front neighboring position points that need to be supplemented is a, the weighting weight may be determined to be a + 1. In other embodiments, if the number of position points adjacent to the current base point to be smoothed is less than the second preset number, the number of position points adjacent to the last position point of the position points adjacent to the last position point may be used to supplement the number of position points adjacent to the last position point to the second preset number. In this case, the supplemented position point coordinate data is the coordinate data of the endmost position point among the position points adjacent to the end. That is, when the smooth elevation dimension value of the current base point to be smoothed is subsequently calculated, the elevation dimension value of the endmost position point in the rear adjacent position points needs to be weighted and calculated. Wherein, the weighting weight can be determined according to the number of the rear adjacent position points needing to be supplemented. Specifically, assuming that the number of rear neighboring position points that need to be supplemented is B, the weighting weight may be determined to be B + 1.
For example, if the user selects N location points in sequence, where N is a positive integer. The elevation dimension values of the N position points are sequentially recorded as Z1~ZNThe corresponding smooth elevation dimension values are respectively recorded as Z1’~ZN'. It is assumed that the first preset number and the second preset number are both set to 2. When selecting a first location point selected by the user, i.e. Z1Corresponding position point, when being used as the base point to be smoothed at present, due to Z1The corresponding position point is the starting point of the position point selected by the user, and Z does not exist in the position point selected by the user1Any position point adjacent before the corresponding position point, and thus it can be determined that the number of position points that need to be supplemented is 2. Thus, calculating Z1When, Z is used first1The corresponding position point will be equal to Z1The number of the position points adjacent to the corresponding position point is supplemented to 2, namely in Z1Increased by 2Z before the corresponding position point1Corresponding position points, 3Z in total1Then reuse the 3Z1And with Z1Elevation dimension of rear adjacent 2 location pointsValue (i.e., Z)2、Z3) Calculating Z1', i.e. Z1’=(3Z1+Z2+Z3) /5 wherein Z1The weighted weight of 3 is the number of the position points 2 that need to be supplemented plus 1.
At the calculation of Z1' later, Z can be used1' update Z1The elevation dimension values of the corresponding position points so as to continue to calculate Z according to the sequence selected by the user2'. In the calculation of Z2', need to select Z2The corresponding position point is used as the base point to be smoothed at present, because Z2The front adjacent position of the corresponding position point already has a Z1Corresponding position point, thus only needing to be in Z1Adding 1Z before the corresponding position point1The corresponding position point can pass through Z2’=(2Z1’+Z2+Z3+Z4) Calculating Z by/52', wherein, Z1The weighting weight of 2 is the number of the position points 1 to be supplemented plus 1.
Next, calculation of Z is started3', due to Z3The front adjacent position of the corresponding position point already has Z1Corresponding position point and Z2Corresponding position point, thus not needing to be in Z3Z can be passed by adding any position point before the corresponding position point3’=(Z1’+Z2+Z3+Z4+Z5) Calculating Z by/53', wherein, Z1The weighted weight of 1 is the number of location points that need to be supplemented, 0 plus 1. By analogy with one another, Z4’=(Z2’+Z3’+Z4+Z5+Z6)/5……ZN-2’=(ZN-4’+ZN-3’+ZN-2+ZN-1+ZN)、ZN-1’=(ZN-3’+ZN-2’+ZN-1+ZN+ZN)、ZN’=(ZN-2’+ZN-1’+ZN+ZN+ZN)。
It can be understood that, when calculating the smoothed elevation dimension value of the current base point to be smoothed, if the number of position points adjacent to the current base point to be smoothed is less than a first preset number (for example, set to 2), the elevation dimension value of the foremost position point among the position points adjacent to the current base point to be smoothed needs to be weighted, and the weighting weight may be the number of the position points adjacent to the current base point to be smoothed plus 1; if the number of the position points adjacent to the base point to be smoothed is less than a second preset number (for example, set to 2), the elevation dimension value of the endmost position point of the position points adjacent to the base point to be smoothed needs to be weighted, and the weighting weight may be the number of the position points adjacent to the base point to be smoothed plus 1.
In some embodiments, in step S108, the to-be-interpolated selection points of the adjacent position points may be sequentially selected according to the sequence of the position points selected by the user, and the to-be-interpolated selection points of the adjacent position points selected each time are subjected to three-dimensional spline interpolation to obtain the piecewise curve between the adjacent position points. And obtaining a spline interpolation curve of the selected point to be interpolated based on each piecewise curve. And then, starting from the starting point of the sequence of each position point selected by the user, calculating each position point on the spline interpolation curve according to a preset step length, and sequentially connecting adjacent position points on the spline interpolation curve according to the sequence of each position point selected by the user to obtain the three-dimensional simulation curve with smooth elevation dimension values. The smaller the preset step length is set, the more the obtained position points are, and the higher the accuracy of the three-dimensional simulation curve with smooth elevation dimension value is finally obtained.
The three-dimensional spline interpolation is an interpolation method based on a three-dimensional spline function, and the interpolation result is a curve. In particular, it may be implemented based on various interpolation algorithms. In an optional embodiment of the present invention, when performing three-dimensional spline interpolation on the selected point to be interpolated, the three-dimensional spline interpolation may be performed on the selected point to be interpolated based on a catmulrom algorithm.
In some embodiments, after obtaining the three-dimensional simulation curve with the smooth elevation dimension value, the three-dimensional simulation curve may be visually displayed so that the user may observe the interpolation result.
Fig. 2 is a flowchart of a spline interpolation-based curve drawing method according to another embodiment of the present invention. In this embodiment, the first predetermined number is set equal to the second predetermined number and equal to 2. Referring to fig. 2, the flowchart of the spline interpolation-based curve drawing method of the embodiment may include the following steps:
step S202, point cloud data is obtained.
And step S204, displaying the point cloud data on a screen of the terminal equipment.
Step S206, responding to the point selection operation of the user on the position points in the point cloud data, determining the position points selected by the user each time, and recording the sequence of the position points selected by the user.
And step S208, acquiring the actual position point of each position point selected by the user through a reflection line tracking technology.
And step 210, acquiring coordinate data of each actual position point as the coordinate data of each position point selected by the user.
And 212, generating an original point selection set according to the coordinate data.
And 214, sequentially selecting each position point in the original point selection set as the current base point to be smoothed according to the sequence of the position points selected by the user.
And step 216, judging whether the number of the position points adjacent to the current base point to be smoothed is more than or equal to 2. If yes, go to step 218; if not, go to step 222.
And step 218, calculating an average value of the elevation dimension values of five position points of the current base point to be smoothed, the 2 position points adjacent to the front of the current base point to be smoothed and the 2 position points adjacent to the back of the current base point to be smoothed.
And step S220, taking the calculated average value as a smooth elevation dimension value of the current base point to be smoothed.
And step S222, updating the elevation dimension value of the current base point to be smoothed according to the smoothed elevation dimension value.
In step S224, the number of the front adjacent position points is complemented to 2 by the forefront position point among the front adjacent position points, and the process returns to step S218.
In step S226, it is determined whether the number of position points adjacent to the current base point to be smoothed is greater than or equal to 2. If yes, return to step 218; if not, go to step 228.
In step S228, the number of the position points adjacent to the end point among the position points adjacent to the end point is used to supplement the number of the position points adjacent to the end point to 2, and the process returns to step S218.
Step S230, determining whether the current base point to be smoothed is an end point of the sequence of the position points selected by the user. If yes, go to step S232; if not, the process returns to step S214.
Step S232, coordinate data of each position point corresponding to the smooth elevation dimension value is obtained and recorded as a selected point to be interpolated.
And step S234, sequentially selecting points to be interpolated of adjacent position points according to the sequence of the position points selected by the user.
Step S236, a three-dimensional spline interpolation is performed on the to-be-interpolated selected points of the adjacent position points selected each time, so as to obtain a piecewise curve between the adjacent position points.
And step S238, obtaining a spline interpolation curve of the selected point to be interpolated based on each piecewise curve.
And step S240, calculating each position point on the spline interpolation curve according to a preset step length from the starting point of the sequence of each position point selected by the user.
And step S242, sequentially connecting the position points on the adjacent spline interpolation curves according to the sequence of the position points selected by the user to obtain the three-dimensional simulation curve with smooth elevation dimension values.
And step S244, performing visual display on the three-dimensional simulation curve.
An embodiment of the present invention also provides a computer storage medium based on the same inventive concept. Wherein the computer storage medium has stored thereon computer program code which, when run on a computing device, causes the computing device to perform the spline interpolation based curve drawing method of any of the above embodiments.
FIG. 3 is a schematic block diagram of an electronic device 300 in accordance with one embodiment of the present invention. Referring to fig. 3, an electronic device 300 is also provided in the present embodiment. The electronic device 300 may include a processor 310 and a memory 320.
The memory 320 stores computer program code which, when executed by the processor 310, causes the electronic device 300 to perform the spline interpolation based curve drawing method in any of the embodiments described above.
The embodiment of the invention can combine the characteristics of three-dimensional spatial interpolation of a three-dimensional spline function, and achieve the purposes of completely fitting a horizontal space and smoothly fitting an elevation dimension space by reducing the weight of each position point selected by each user in the elevation dimension spatial interpolation, thereby satisfying the effect of semi-automatically drawing a curve on any plane in service and solving the problem of large fluctuation of a plane space caused by fine errors of coordinate point selection.
Furthermore, the embodiment of the invention adopts a smoothing method of the moving average value to smooth the elevation dimension value of each position point selected by the user, and can reduce the adverse effect of the abnormal point on the final interpolation effect on the basis of keeping the fluctuation trend of the elevation dimension space.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.
Claims (9)
1. A curve drawing method based on spline interpolation is applied to the production process of map data, and comprises the following steps:
acquiring coordinate data of each position point selected by a user based on the acquired point cloud data, wherein the coordinate data comprises an elevation dimension value;
generating an original point selection set according to the coordinate data;
smoothing the elevation dimension values of the position points in the original point selection set in sequence according to the sequence of the position points selected by the user to obtain selected points to be interpolated corresponding to the position points;
performing three-dimensional spline interpolation on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value;
wherein the smoothing of the elevation dimension values of the respective location points in the original point selection set in sequence according to the order of the respective location points selected by the user comprises:
sequentially selecting each position point in the original point selection set as a current base point to be smoothed according to the sequence of each position point selected by the user;
determining a first preset number of position points adjacent to the front of the current base point to be smoothed and a second preset number of position points adjacent to the back of the current base point to be smoothed;
calculating the elevation dimension value of the current base point to be smoothed, the elevation dimension values of the first preset number of the position points adjacent to the front of the current base point to be smoothed and the average value of the second preset number of the elevation dimension values of the second preset number of the position points adjacent to the back of the current base point to be smoothed;
taking the calculated average value as a smooth elevation dimension value of the current base point to be smoothed;
updating the elevation dimension value of the current base point to be smoothed according to the smoothed elevation dimension value; and when the average value is calculated, the elevation dimension values of the first preset number of the position points adjacent to the current base point to be smoothed are the updated elevation dimension values of the first preset number of the position points adjacent to the current base point to be smoothed.
2. The spline-interpolation-based curve drawing method according to claim 1, wherein the obtaining coordinate data of each position point selected by a user based on the obtained point cloud data comprises:
displaying the point cloud corresponding to the point cloud data;
determining the position points sequentially selected by the user in response to the point selection operation of the user on the position points in the point cloud data;
acquiring each actual position point corresponding to each position point selected by a user through a reflection line tracking technology;
and sequentially acquiring the coordinate data of each actual position point to be used as the coordinate data of the position point selected by the user.
3. The spline-interpolation-based curve drawing method according to claim 1, wherein the determining a first preset number of position points before and a second preset number of position points after the current base point to be smoothed comprises:
if the number of the position points adjacent to the current base point to be smoothed in front is smaller than the first preset number, supplementing the number of the position points adjacent in front to the first preset number by using the foremost position point in the position points adjacent in front; or
And if the number of the position points adjacent to the rear of the current base point to be smoothed is smaller than the second preset number, supplementing the number of the rear adjacent position points to the second preset number by using the position point at the tail end of the rear adjacent position points.
4. A spline-interpolation-based curve-drawing method according to claim 1, wherein the first preset number is set equal to the second preset number.
5. The spline interpolation-based curve drawing method according to claim 1, wherein the three-dimensional spline interpolation is performed on the selected point to be interpolated to obtain a three-dimensional simulation curve with a smooth elevation dimension value, and the method comprises the following steps:
sequentially selecting the points to be interpolated of adjacent position points according to the sequence of the position points selected by the user;
performing three-dimensional spline interpolation on the selected points to be interpolated of the adjacent position points selected each time to obtain a piecewise curve between the adjacent position points;
obtaining a spline interpolation curve of the selected point to be interpolated based on each segmented curve;
calculating each position point on the spline interpolation curve according to a preset step length from the starting point of the sequence of each position point selected by the user;
and sequentially connecting the position points on the adjacent spline interpolation curves according to the sequence of the position points selected by the user to obtain the three-dimensional simulation curve with the smooth elevation dimension value.
6. The spline-interpolation-based curve drawing method according to claim 1, wherein the three-dimensional spline interpolation of the selected point to be interpolated comprises:
and carrying out three-dimensional spline interpolation on the selected point to be interpolated based on a CatmulRom algorithm.
7. The spline-interpolation-based curve drawing method according to claim 1, further comprising, after obtaining the three-dimensional simulation curve with the smoothed elevation dimension value:
and visually displaying the three-dimensional simulation curve.
8. A computer storage medium comprising, in combination,
the computer storage medium has stored thereon computer program code which, when run on a computing device, causes the computing device to execute the spline interpolation based curve drawing method of any of claims 1-7.
9. An electronic device, comprising:
a processor;
a memory storing computer program code which, when executed by the processor, causes the electronic device to perform the spline interpolation based curve drawing method of any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011157667.4A CN112215952B (en) | 2020-10-26 | 2020-10-26 | Curve drawing method, computer storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011157667.4A CN112215952B (en) | 2020-10-26 | 2020-10-26 | Curve drawing method, computer storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112215952A CN112215952A (en) | 2021-01-12 |
CN112215952B true CN112215952B (en) | 2021-08-13 |
Family
ID=74055333
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011157667.4A Active CN112215952B (en) | 2020-10-26 | 2020-10-26 | Curve drawing method, computer storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112215952B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112750139A (en) * | 2021-01-18 | 2021-05-04 | 腾讯科技(深圳)有限公司 | Image processing method and device, computing equipment and storage medium |
CN113239136B (en) * | 2021-05-17 | 2023-12-19 | 北京车和家信息技术有限公司 | Data processing method, device, equipment and medium |
CN118797248A (en) * | 2023-03-30 | 2024-10-18 | 北京罗克维尔斯科技有限公司 | Interpolation method, device, equipment and medium of elevation data |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014114973A (en) * | 2012-12-06 | 2014-06-26 | Japan Steel Works Ltd:The | Three-dimensional coordinate measurement system and three-dimensional coordinate measurement method |
CN105913483A (en) * | 2016-03-31 | 2016-08-31 | 百度在线网络技术(北京)有限公司 | Method and device for generating three-dimensional crossing road model |
CN108845569A (en) * | 2018-04-27 | 2018-11-20 | 厦门维斯云景信息科技有限公司 | Generate semi-automatic cloud method of the horizontal bend lane of three-dimensional high-definition mileage chart |
CN109916416A (en) * | 2019-01-29 | 2019-06-21 | 腾讯科技(深圳)有限公司 | Lane line data processing and update method, device and equipment |
CN110161513A (en) * | 2018-09-28 | 2019-08-23 | 腾讯科技(北京)有限公司 | Estimate method, apparatus, storage medium and the computer equipment of road grade |
CN110795978A (en) * | 2019-04-29 | 2020-02-14 | 当家移动绿色互联网技术集团有限公司 | Road surface point cloud data extraction method and device, storage medium and electronic equipment |
CN110866449A (en) * | 2019-10-21 | 2020-03-06 | 北京京东尚科信息技术有限公司 | Method and device for identifying target object in road |
CN112053436A (en) * | 2020-08-24 | 2020-12-08 | 西安电子科技大学 | Terrain generation method based on surface fitting |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106920281B (en) * | 2017-03-08 | 2018-08-14 | 齐鲁工业大学 | A kind of calligraphy embossment modeling method |
CN111721308B (en) * | 2020-06-10 | 2022-09-23 | 百度在线网络技术(北京)有限公司 | Three-dimensional road network map drawing method, device, equipment and medium |
-
2020
- 2020-10-26 CN CN202011157667.4A patent/CN112215952B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2014114973A (en) * | 2012-12-06 | 2014-06-26 | Japan Steel Works Ltd:The | Three-dimensional coordinate measurement system and three-dimensional coordinate measurement method |
CN105913483A (en) * | 2016-03-31 | 2016-08-31 | 百度在线网络技术(北京)有限公司 | Method and device for generating three-dimensional crossing road model |
CN108845569A (en) * | 2018-04-27 | 2018-11-20 | 厦门维斯云景信息科技有限公司 | Generate semi-automatic cloud method of the horizontal bend lane of three-dimensional high-definition mileage chart |
CN110161513A (en) * | 2018-09-28 | 2019-08-23 | 腾讯科技(北京)有限公司 | Estimate method, apparatus, storage medium and the computer equipment of road grade |
CN109916416A (en) * | 2019-01-29 | 2019-06-21 | 腾讯科技(深圳)有限公司 | Lane line data processing and update method, device and equipment |
CN110795978A (en) * | 2019-04-29 | 2020-02-14 | 当家移动绿色互联网技术集团有限公司 | Road surface point cloud data extraction method and device, storage medium and electronic equipment |
CN110866449A (en) * | 2019-10-21 | 2020-03-06 | 北京京东尚科信息技术有限公司 | Method and device for identifying target object in road |
CN112053436A (en) * | 2020-08-24 | 2020-12-08 | 西安电子科技大学 | Terrain generation method based on surface fitting |
Also Published As
Publication number | Publication date |
---|---|
CN112215952A (en) | 2021-01-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112215952B (en) | Curve drawing method, computer storage medium and electronic device | |
CN102306395B (en) | Distributed drawing method and device of three-dimensional data | |
CN111476718B (en) | Image amplification method and device, storage medium and terminal equipment | |
WO2022033009A1 (en) | Rendering processing method and apparatus, electronic device and storage medium | |
CN111899352B (en) | CATIA-based part model processing method, CATIA-based part model processing system, CATIA-based part model processing equipment and storage medium | |
CN109377552B (en) | Image occlusion calculating method, device, calculating equipment and storage medium | |
CN108230434B (en) | Image texture processing method and device, storage medium and electronic device | |
CN113920217A (en) | Method, apparatus, device and product for generating high-precision map lane lines | |
CN113470169B (en) | Game scene generation method and device, computer equipment and readable storage medium | |
CN106780749B (en) | Surface model construction method based on constrained Delaunay TIN interpolation algorithm | |
CN113034582A (en) | Pose optimization device and method, electronic device and computer readable storage medium | |
CN110378948B (en) | 3D model reconstruction method and device and electronic equipment | |
CN115457202A (en) | Method and device for updating three-dimensional model and storage medium | |
CN113808186B (en) | Training data generation method and device and electronic equipment | |
CN106875480B (en) | Method for organizing urban three-dimensional data | |
CN112084938B (en) | Method and device for improving stability of plane target representation based on graph structure | |
CN113643343A (en) | Training method and device of depth estimation model, electronic equipment and storage medium | |
CN111506680A (en) | Terrain data generation method, terrain data rendering method, terrain data generation device, terrain data rendering device, medium, server and terminal | |
CN114385553A (en) | Power transmission line model slicing method | |
US20190156456A1 (en) | Method and Device for Determining a Transition Between Two Display Images, and Vehicle | |
CN116229005B (en) | Geodesic determining method and device for three-dimensional roadway model | |
CN115578504B (en) | Image rendering method, terminal device and medium | |
CN117974865B (en) | Light scene model rendering method, device and equipment based on camera view angle | |
CN113870345B (en) | Flight positioning method and device based on three-dimensional scene, storage medium and electronic device | |
CN117078825B (en) | Rendering modification method, system, equipment and medium on point cloud data line |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220322 Address after: 430051 No. b1336, chuanggu startup area, taizihu cultural Digital Creative Industry Park, No. 18, Shenlong Avenue, Wuhan Economic and Technological Development Zone, Wuhan, Hubei Province Patentee after: Yikatong (Hubei) Technology Co.,Ltd. Address before: No.c101, chuanggu start up area, taizihu cultural Digital Industrial Park, No.18 Shenlong Avenue, Wuhan Economic Development Zone, Hubei Province Patentee before: HUBEI ECARX TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |