Curve generation method, device, electronic device and readable medium
By screening and classifying motion coordinate points, using similarities and angles to add them to curve or straight line coordinate point sets, curves are generated, which solves the problems of complex calculation and low efficiency in traditional curve drawing, and improves the efficiency of curve generation.
Patent Information
- Application Number
- CN202110688312.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-21
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-06-21
AI Technical Summary
In the traditional curve drawing process, the calculation process is complex and the amount of data processing is large, which leads to increased hardware processing pressure and reduced efficiency.
By obtaining the motion coordinate points and attribute parameters of the target object, add the motion coordinate points to the curve or straight line coordinate point set according to preset conditions, generate a curve, and use similarity and angle to filter and classify the coordinate points to reduce the amount of data calculation. .
It reduces the hardware pressure in the curve generation process, improves the efficiency of curve drawing, reduces the number of coordinate points, and reduces the amount of data calculations.
Smart Images

Figure CN113240773B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field, and in particular to a curve generating method, a curve generating device, an electronic device and a computer-readable medium. Background Art
[0002] As people's daily needs increase, they often need to draw travel trajectories, roads, routes, etc. In this process, the corresponding curves are often drawn based on the traditional curve drawing method, and then the curves are processed to obtain the corresponding target objects, such as movement trajectories, roads, and routes. However, for the traditional curve drawing process, if the calculation process is complex or the amount of calculation is large, it is easy to increase the amount of calculation for curve drawing, increase the pressure on hardware processing, and thus reduce the efficiency of curve drawing. Summary of the invention
[0003] The embodiments of the present invention provide a curve generation method, device, electronic device and computer-readable storage medium to solve or partially solve the problems of large data processing volume and low curve generation efficiency in the curve drawing process in the related art.
[0004] The embodiment of the present invention discloses a method for generating a curve, comprising:
[0005] Acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of the target object;
[0006] Obtaining attribute parameters of the motion coordinate point;
[0007] According to the attribute parameters, the motion coordinate points that meet the preset conditions are added to a preset target point set, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set;
[0008] A curve corresponding to the coordinate point set is generated according to the curve coordinate point set and the straight line coordinate point set.
[0009] Optionally, the attribute parameter includes at least coordinate information, and the adding, according to the attribute parameter, the motion coordinate point that meets a preset condition to a preset target point set includes:
[0010] Using the coordinate information of the two adjacent motion coordinate points, determining the target vector corresponding to the two adjacent motion coordinate points;
[0011] Determine the similarity between two adjacent target vectors;
[0012] According to the similarity between two adjacent target vectors in the coordinate point set, the motion coordinate points that meet the preset conditions are added to the preset target point set.
[0013] Optionally, determining the similarity between two adjacent target vectors includes:
[0014] Using two adjacent target vectors, calculating the angle between the two adjacent target vectors;
[0015] Obtaining the similarity corresponding to the angle;
[0016] The larger the angle is, the smaller the similarity is; and the smaller the angle is, the greater the similarity is.
[0017] Optionally, the adding, according to the similarity between two adjacent target vectors in the coordinate point set, the motion coordinate points satisfying the preset conditions to the preset target point set includes:
[0018] Adding the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold to a preset curve coordinate point set;
[0019] The motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold are used as straight line coordinate points;
[0020] From the plurality of continuous straight line coordinate points, a first motion coordinate point and a last motion coordinate point are extracted and added to a preset straight line coordinate point set.
[0021] Optionally, the attribute parameter further includes a collection time sequence, and the generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes:
[0022] Acquire a first acquisition time sequence of each curve coordinate point in the curve coordinate point set, and a second acquisition time sequence of each straight line coordinate point in the straight line coordinate point set;
[0023] According to the sequence of the first acquisition timing and the second acquisition timing, coordinate point processing is performed on the curve coordinate point set and the straight line coordinate point set to generate a curve for the coordinate point set.
[0024] Optionally, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to a motion path of the vehicle, and the method further includes:
[0025] Obtaining a road width for the curve;
[0026] The road width and the curve are used to generate road information corresponding to the motion path.
[0027] Optionally, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion process of the vehicle, and generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes:
[0028] A motion trajectory corresponding to the vehicle motion process is generated according to the curve coordinate point set and the straight line coordinate point set.
[0029] The embodiment of the present invention further discloses a curve generating device, comprising:
[0030] A coordinate point set acquisition module, used to acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of a target object;
[0031] An attribute parameter acquisition module, used to acquire the attribute parameters of the motion coordinate point;
[0032] A coordinate point processing module, used for adding the motion coordinate points satisfying the preset conditions to a preset target point set according to the attribute parameters, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set;
[0033] The curve generating module is used to generate a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set.
[0034] Optionally, the attribute parameters at least include coordinate information, and the coordinate point processing module includes:
[0035] A target vector determination submodule, configured to determine a target vector corresponding to the two adjacent motion coordinate points by using the coordinate information of the two adjacent motion coordinate points;
[0036] A similarity determination submodule, used to determine the similarity between two adjacent target vectors;
[0037] The coordinate point processing submodule is used to add the motion coordinate points that meet the preset conditions to the preset target point set according to the similarity between two adjacent target vectors in the coordinate point set.
[0038] Optionally, the similarity determination submodule is specifically used for:
[0039] Using two adjacent target vectors, calculating the angle between the two adjacent target vectors;
[0040] Obtaining the similarity corresponding to the angle;
[0041] The larger the angle is, the smaller the similarity is; and the smaller the angle is, the greater the similarity is.
[0042] Optionally, the coordinate point processing submodule is specifically used for:
[0043] Adding the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold to a preset curve coordinate point set;
[0044] The motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold are used as straight line coordinate points;
[0045] From the plurality of continuous straight line coordinate points, a first motion coordinate point and a last motion coordinate point are extracted and added to a preset straight line coordinate point set.
[0046] Optionally, the attribute parameter further includes a collection timing, and the curve generating module includes:
[0047] A timing acquisition submodule, used for acquiring a first acquisition timing of each curve coordinate point in the curve coordinate point set, and a second acquisition timing of each straight line coordinate point in the straight line coordinate point set;
[0048] The curve generation submodule is used to perform coordinate point processing on the curve coordinate point set and the straight line coordinate point set according to the sequence of the first acquisition timing and the second acquisition timing to generate a curve for the coordinate point set.
[0049] Optionally, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to a motion path of the vehicle, and the device further includes:
[0050] A road width acquisition module, used to acquire the road width for the curve;
[0051] The road information generating module is used to generate road information corresponding to the motion path by using the road width and the curve.
[0052] Optionally, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion process of the vehicle, and the curve generation module is specifically used for:
[0053] A motion trajectory corresponding to the vehicle motion process is generated according to the curve coordinate point set and the straight line coordinate point set.
[0054] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0055] The memory is used to store computer programs;
[0056] The processor is used to implement the above-mentioned method when executing the program stored in the memory.
[0057] The embodiment of the present invention further discloses one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the method as described above.
[0058] The embodiments of the present invention include the following advantages:
[0059] In an embodiment of the present invention, in the process of drawing a curve, a coordinate point set can be obtained, wherein the coordinate point set can include the motion coordinate points of the target object, and then the attribute parameters of each motion coordinate point are obtained, and according to the attribute parameters, the motion coordinate points that meet the preset conditions are added to the preset target point set, and the target point set can include a curve coordinate point set and a straight line coordinate point set, and then a curve is generated for the coordinate point set based on the curve coordinate point set and the straight line coordinate point set, so as to screen and classify the coordinate points according to the attribute parameters of the motion coordinate points, reduce the number of coordinate points, reduce the amount of data calculation, reduce hardware pressure, and thus improve the efficiency of curve generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a flow chart of steps of a curve generation method provided in an embodiment of the present invention;
[0061] Figure 2 is a schematic diagram of coordinate points provided in an embodiment of the present invention;
[0062] Figure 3 is a structural block diagram of a curve generating device provided in an embodiment of the present invention;
[0063] Figure 4 is a block diagram of an electronic device provided in an embodiment of the present invention;
[0064] Figure 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0065] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0066] As an example, in people's daily lives, it is often necessary to draw curves (wherein a straight line can be a special curve). For example, during a user's travel, it is necessary to draw a curve for the moving path to obtain the corresponding moving trajectory; in the map navigation process, it is necessary to draw a curve to obtain the corresponding navigation route; in the vehicle's memory parking, it is necessary to draw a curve according to the vehicle's moving path to obtain the corresponding road, and so on.
[0067] For example, taking the memory parking of a vehicle as an example, when it is used for the first time, the owner is required to manually drive the vehicle to drive the parking route in the target area once, and complete the learning process of the "memory route" after parking. Then, when it is used for the second time, the vehicle can assist the user to drive the vehicle from the starting point of the set route to the end point of the set route based on the "memory route", and park in the parking space that has been memorized by the system to realize automatic parking of the vehicle. By learning different parking lots, the vehicle can complete automatic parking according to actual scenarios, effectively improving the user's driving experience. Among them, in the process of memory parking, since it is necessary to first learn the "record route", the learning process involves the learning of 3D parking roads, that is, the vehicle needs to draw the driving road corresponding to the parking lot. In the process of drawing the parking lot road, all the coordinate points corresponding to the vehicle's moving path are often processed, involving the calculation of all the coordinate points, so the amount of calculation is large, which is easy to increase the amount of calculation for curve drawing, increase the hardware processing pressure, and thus reduce the efficiency of road drawing.
[0068] In this regard, one of the core inventive points of an embodiment of the present invention is to obtain the attribute parameters of each motion coordinate point after obtaining the motion coordinate points of the target object, and then add the motion coordinate points that meet the preset conditions to the curve coordinate point set or the straight line coordinate point set according to the attribute parameters, so as to realize screening and classification of the motion coordinate points according to the attribute parameters, reduce the number of coordinate points, and reduce the amount of calculation of coordinate data in the curve generation process. Therefore, in the process of generating curves according to the motion coordinate points in the curve coordinate point set and the straight line coordinate point set, the computing pressure of the hardware can be greatly reduced, and the efficiency of curve drawing can be improved.
[0069] Specifically, refer to Figure 1 , shows a flow chart of the steps of a curve generation method provided in an embodiment of the present invention, which may specifically include the following steps:
[0070] Step 101, obtaining a coordinate point set, wherein the coordinate point set includes motion coordinate points of a target object;
[0071] In the embodiment of the present invention, the target object may be a vehicle, an unmanned aerial vehicle, a mobile terminal, etc., and a corresponding positioning sensor may be configured in the target object so that the coordinate points of the moving path can be collected during the movement.
[0072] It should be noted that for the collection of motion coordinate points, a spatial coordinate system for the target object can be established, such as using the x-axis and y-axis to establish a horizontal plane, and the z-axis as a representation of the vertical height, etc., so that the target object can obtain its motion coordinate points during the movement process or after the movement is completed, and all the motion coordinate points corresponding to one movement can be combined into a coordinate point set to draw the corresponding curve.
[0073] For example, the driving path of a vehicle is drawn according to a set of coordinate points, the road learned in vehicle memory parking is drawn, the flight trajectory of an unmanned aerial vehicle and the moving path of a mobile terminal are drawn, etc., and the present invention does not impose any limitation on this.
[0074] Step 102, obtaining attribute parameters of the motion coordinate point;
[0075] The attribute parameters of the motion coordinate point may include coordinate information, acquisition timing, etc., wherein the coordinate information can be used to characterize the position of the motion coordinate point in the coordinate system, such as (x, y, x), etc. Through the coordinate information of two motion coordinate points, the distance between the two points can be calculated, and then the motion distance of the target object can be determined; the acquisition timing can be used to characterize the time when the coordinate point is acquired. Through different acquisition timings, the order of the motion coordinate points can be determined, and then the motion direction of the target object can be determined.
[0076] Step 103, according to the attribute parameters, adding the motion coordinate points that meet the preset conditions to a preset target point set, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set;
[0077] In the embodiment of the present invention, if coordinate calculation is performed on all the motion coordinate points in the motion process of the target object, the data processing volume is large, which is easy to increase the calculation pressure of the hardware and reduce the efficiency of curve generation. In this regard, the coordinate information of two adjacent motion coordinate points can be used to determine the target vectors corresponding to the two adjacent motion coordinate points, and then the similarity between the two adjacent target vectors can be determined. Then, according to the similarity between the two adjacent target vectors in the coordinate point set, the motion coordinate points that meet the preset conditions are added to the preset curve coordinate point set or straight line coordinate point set, so as to reduce the number of coordinate points, reduce the amount of data calculation, reduce the hardware pressure, and thus improve the efficiency of curve generation.
[0078] In a specific implementation, by comparing two adjacent target vectors, the similarity corresponding to the two target vectors can be obtained, and the motion coordinate points can be screened and classified according to the similarity. Specifically, the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold value can be added to the preset curve coordinate point set, and the motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold value can be used as straight line coordinate points, and the first motion coordinate point and the last motion coordinate point are extracted from multiple continuous straight line coordinate points and added to the preset straight line coordinate point set. On the one hand, the motion coordinate points can be divided into curve coordinate points and straight line coordinate points according to the similarity of the vectors. On the other hand, for the straight line coordinate points, only the first and last two motion coordinate points corresponding to a straight line can be extracted and added to the straight line coordinate point set, which effectively reduces the intermediate coordinate points and the amount of calculation data of the coordinate points, thereby reducing the hardware pressure and facilitating the generation of subsequent curves.
[0079] It should be noted that, for the similarity between two adjacent target vectors, the angle between the two target vectors can be calculated, and the similarity corresponding to the angle can be obtained. The larger the angle, the smaller the similarity; the smaller the angle, the greater the similarity.
[0080] For example, the cosine value of the angle between two vectors can be obtained by the dot product of two unit vectors. The cosine value can be used to obtain the similarity of the two vectors in the interval [0, 90], where the similarity is positively correlated with the dot product, that is, the larger the dot product, the greater the similarity, and the smaller the dot product, the smaller the similarity. It can be obtained that the similarity is negatively correlated with the angle, that is, the larger the angle, the smaller the similarity, and the smaller the angle, the greater the similarity. Through the angle between two adjacent target vectors corresponding to three consecutive motion coordinate points, the degree of deviation of the third motion coordinate point can be identified. If the third motion coordinate point deviates more from the direction of the ray formed by the first two motion coordinate points, the lower the similarity; if the deviation is less, the higher the similarity, so through the vector similarity judgment, the straight line coordinate points with high similarity and no effect on the accuracy of the curve can be filtered, and the curve can be described with fewer point sets, so that the amount of data calculation can be effectively reduced in the curve generation process, the hardware pressure can be reduced, and the curve generation efficiency can be improved.
[0081] In one example, referring to Figure 2 , which shows a schematic diagram of coordinate points provided in an embodiment of the present invention, taking a coordinate point set (A, B, C, D, E, F), the vectors formed between two adjacent coordinate points are respectively Assumptions and The angle formed is θ, and point E is projected on The point of the vector quotient is E', then we can get EE' = m*sinθ, that is, The offset in the direction can then be obtained according to the sine function, and then the corresponding similarity can be obtained. Then, according to the similarity, it can be determined whether the coordinate point is a curve coordinate point. For example, it can be obtained that points A, B, C, and D belong to straight line coordinate points, and points D, E, and F belong to curve coordinate points. In addition, for straight line coordinate points, only the first and last two coordinate points can be extracted, that is, point A and point D are added to the straight line coordinate point set, so that through the screening and classification of coordinate points, the corresponding curve coordinate point set (D, E, F) and straight line coordinate point set (A, D) can be obtained, which effectively reduces the intermediate coordinate points and the amount of calculation data of the coordinate points, thereby reducing the hardware pressure and facilitating the generation of subsequent curves.
[0082] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that under the guidance of the ideas of the embodiments of the present invention, those skilled in the art can also make settings according to actual needs, and the present invention is not limited to this.
[0083] Step 104: Generate a curve corresponding to the coordinate point set according to the curve coordinate point set and the straight line coordinate point set.
[0084] In an embodiment of the present invention, after the motion coordinate points of the coordinate point set are screened to obtain the curve coordinate point set and the straight line coordinate point set, the coordinate point set only records the corresponding coordinate points, and the acquisition timing of each motion coordinate point needs to be combined to generate a curve for the coordinate point set.
[0085] In a specific implementation, the first acquisition timing of each curve coordinate point in the curve coordinate point set and the second acquisition timing of each straight line coordinate point in the straight line coordinate point set can be obtained, and then the curve for the coordinate point set is generated by processing the coordinate points of the curve coordinate point set and the straight line coordinate point set according to the sequence of the first acquisition timing and the second acquisition timing. Specifically, the motion coordinate points in the curve coordinate point set and the straight line coordinate point set can be added to the coordinate system in sequence according to the acquisition timing of each motion coordinate point to form a corresponding curve, so as to screen and classify the coordinate points according to the attribute parameters of the motion coordinate points, reduce the number of coordinate points, reduce the amount of data calculation, reduce the hardware pressure, and thus improve the efficiency of curve generation.
[0086] It should be noted that in addition to generating a curve for a coordinate point set based on a curve coordinate point set and a straight line coordinate point set according to the acquisition sequence, the moving coordinate points in the curve coordinate point set and the straight line coordinate point set can also be added to the coordinate system according to the vector direction of the target vector. In this process, each moving coordinate point can point to the next coordinate point, thereby forming a corresponding curve. The present invention does not impose any restrictions on this.
[0087] In one example, assuming that the target object is a vehicle, before using the vehicle's memory parking function, the driver needs to manually drive the vehicle to drive the parking route in the target area, and complete the "memory route" learning process after parking. In this process, the vehicle can learn the road according to the driving route to obtain the driving road conditions in the target area. Specifically, the vehicle can obtain the coordinate point set corresponding to the driving route, and then obtain the attribute parameters of each motion coordinate point, and then add the motion coordinate points that meet the preset conditions to the curve coordinate point set or the straight line coordinate point set according to the attribute parameters, and then generate a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set, and then obtain the road width for the curve, and then use the road width and the curve to generate road information corresponding to the motion path, and then complete the road learning process in the "memory route" process, so as to screen and classify the coordinate points according to the attribute parameters of the motion coordinate points, reduce the number of coordinate points, reduce the amount of data calculation, reduce the operation pressure of the vehicle, and thus improve the efficiency of road learning in the memory parking process.
[0088] In another example, the curve may be a motion trajectory of a target object. For example, when the target object is a vehicle, the vehicle may obtain corresponding motion coordinate points after traveling a certain route, and add motion coordinate points that meet preset conditions to a curve coordinate point set or a straight line coordinate point set according to attribute parameters of each motion coordinate point. Then, based on the curve coordinate point set and the straight line coordinate point set, a motion trajectory corresponding to the movement of the vehicle along the route is generated, thereby screening and classifying the coordinate points according to the attribute parameters of the motion coordinate points, reducing the number of coordinate points, reducing the amount of data calculation, reducing the computing pressure of the vehicle, and thus improving the efficiency of generating the vehicle's motion trajectory.
[0089] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It can be understood that under the guidance of the ideas of the embodiments of the present invention, the generation of curves can also be applied to user terminals, unmanned aerial vehicles, etc., and the present invention is not limited to this.
[0090] In an embodiment of the present invention, in the process of drawing a curve, a coordinate point set can be obtained, wherein the coordinate point set can include the motion coordinate points of the target object, and then the attribute parameters of each motion coordinate point are obtained, and according to the attribute parameters, the motion coordinate points that meet the preset conditions are added to the preset target point set, and the target point set can include a curve coordinate point set and a straight line coordinate point set, and then a curve is generated for the coordinate point set based on the curve coordinate point set and the straight line coordinate point set, so as to screen and classify the coordinate points according to the attribute parameters of the motion coordinate points, reduce the number of coordinate points, reduce the amount of data calculation, reduce hardware pressure, and thus improve the efficiency of curve generation.
[0091] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0092] Reference Figure 3 , shows a structural block diagram of a curve generation device provided in an embodiment of the present invention, which may specifically include the following modules:
[0093] A coordinate point set acquisition module 301 is used to acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of a target object;
[0094] The attribute parameter acquisition module 302 is used to acquire the attribute parameters of the motion coordinate point;
[0095] A coordinate point processing module 303 is used to add the motion coordinate points that meet the preset conditions to a preset target point set according to the attribute parameters, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set;
[0096] The curve generating module 304 is used to generate a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set.
[0097] In an optional embodiment of the present invention, the attribute parameters at least include coordinate information, and the coordinate point processing module 303 includes:
[0098] A target vector determination submodule, configured to determine a target vector corresponding to the two adjacent motion coordinate points by using the coordinate information of the two adjacent motion coordinate points;
[0099] A similarity determination submodule, used to determine the similarity between two adjacent target vectors;
[0100] The coordinate point processing submodule is used to add the motion coordinate points that meet the preset conditions to the preset target point set according to the similarity between two adjacent target vectors in the coordinate point set.
[0101] In an optional embodiment of the present invention, the similarity determination submodule is specifically used for:
[0102] Using two adjacent target vectors, calculating the angle between the two adjacent target vectors;
[0103] Obtaining the similarity corresponding to the angle;
[0104] The larger the angle is, the smaller the similarity is; and the smaller the angle is, the greater the similarity is.
[0105] In an optional embodiment of the present invention, the coordinate point processing submodule is specifically used for:
[0106] Adding the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold to a preset curve coordinate point set;
[0107] The motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold are used as straight line coordinate points;
[0108] From the plurality of continuous straight line coordinate points, a first motion coordinate point and a last motion coordinate point are extracted and added to a preset straight line coordinate point set.
[0109] In an optional embodiment of the present invention, the attribute parameter further includes a collection timing, and the curve generation module 304 includes:
[0110] A timing acquisition submodule, used for acquiring a first acquisition timing of each curve coordinate point in the curve coordinate point set, and a second acquisition timing of each straight line coordinate point in the straight line coordinate point set;
[0111] The curve generation submodule is used to perform coordinate point processing on the curve coordinate point set and the straight line coordinate point set according to the sequence of the first acquisition timing and the second acquisition timing to generate a curve for the coordinate point set.
[0112] In an optional embodiment of the present invention, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion path of the vehicle, and the device further includes:
[0113] A road width acquisition module, used to acquire the road width for the curve;
[0114] The road information generating module is used to generate road information corresponding to the motion path by using the road width and the curve.
[0115] In an optional embodiment of the present invention, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion process of the vehicle, and the curve generation module 304 is specifically used for:
[0116] A motion trajectory corresponding to the vehicle motion process is generated according to the curve coordinate point set and the straight line coordinate point set.
[0117] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0118] In addition, an embodiment of the present invention further provides an electronic device, such as Figure 4 As shown, it includes a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0119] Memory 403, used for storing computer programs;
[0120] The processor 401 is used to execute the program stored in the memory 403 to implement the following steps:
[0121] Acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of the target object;
[0122] Obtaining attribute parameters of the motion coordinate point;
[0123] According to the attribute parameters, the motion coordinate points that meet the preset conditions are added to a preset target point set, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set;
[0124] A curve corresponding to the coordinate point set is generated according to the curve coordinate point set and the straight line coordinate point set.
[0125] In an optional embodiment of the present invention, the attribute parameters at least include coordinate information, and adding the motion coordinate points that meet the preset conditions to the preset target point set according to the attribute parameters includes:
[0126] Using the coordinate information of the two adjacent motion coordinate points, determining the target vector corresponding to the two adjacent motion coordinate points;
[0127] Determine the similarity between two adjacent target vectors;
[0128] According to the similarity between two adjacent target vectors in the coordinate point set, the motion coordinate points that meet the preset conditions are added to the preset target point set.
[0129] In an optional embodiment of the present invention, the determining the similarity between two adjacent target vectors includes:
[0130] Using two adjacent target vectors, calculating the angle between the two adjacent target vectors;
[0131] Obtaining the similarity corresponding to the angle;
[0132] The larger the angle is, the smaller the similarity is; and the smaller the angle is, the greater the similarity is.
[0133] In an optional embodiment of the present invention, adding the motion coordinate points satisfying the preset conditions to the preset target point set according to the similarity between two adjacent target vectors in the coordinate point set includes:
[0134] Adding the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold to a preset curve coordinate point set;
[0135] The motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold are used as straight line coordinate points;
[0136] From the plurality of continuous straight line coordinate points, a first motion coordinate point and a last motion coordinate point are extracted and added to a preset straight line coordinate point set.
[0137] In an optional embodiment of the present invention, the attribute parameter further includes a collection time sequence, and the generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes:
[0138] Acquire a first acquisition time sequence of each curve coordinate point in the curve coordinate point set, and a second acquisition time sequence of each straight line coordinate point in the straight line coordinate point set;
[0139] According to the sequence of the first acquisition timing and the second acquisition timing, coordinate point processing is performed on the curve coordinate point set and the straight line coordinate point set to generate a curve for the coordinate point set.
[0140] In an optional embodiment of the present invention, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion path of the vehicle, and the method further includes:
[0141] Obtaining a road width for the curve;
[0142] The road width and the curve are used to generate road information corresponding to the motion path.
[0143] In an optional embodiment of the present invention, the target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion process of the vehicle, and generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes:
[0144] A motion trajectory corresponding to the vehicle motion process is generated according to the curve coordinate point set and the straight line coordinate point set.
[0145] The communication bus mentioned in the above vehicle can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0146] The communication interface is used for communication between the above terminal and other devices.
[0147] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0148] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0149] like Figure 5 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 501 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the curve generation method described in the above embodiment.
[0150] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the curve generation method described in the above embodiment.
[0151] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0152] 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 sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0153] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A method for generating a curve, characterized in that: include: Acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of the target object; Acquire attribute parameters of the motion coordinate point, wherein the attribute parameters include at least coordinate information; According to the attribute parameters, the motion coordinate points that meet the preset conditions are added to a preset target point set, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set; Generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set; Wherein, according to the attribute parameters, the motion coordinate points satisfying the preset conditions are added to a preset target point set, and the target point set includes a curve coordinate point set and a straight line coordinate point set, including: Using the coordinate information of two adjacent motion coordinate points, determine the target vector corresponding to the two adjacent motion coordinate points; Using two adjacent target vectors, calculating the angle between the two adjacent target vectors, and obtaining the similarity corresponding to the angle; wherein, the larger the angle, the smaller the similarity; and the smaller the angle, the greater the similarity; The motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold are added to a preset curve coordinate point set; the motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold are used as straight line coordinate points, and the first motion coordinate point and the last motion coordinate point are extracted from the multiple continuous straight line coordinate points and added to the preset straight line coordinate point set.
2. The method according to claim 1, characterized in that: The attribute parameters also include a collection time sequence, and the generating of a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes: Acquire a first acquisition time sequence of each curve coordinate point in the curve coordinate point set, and a second acquisition time sequence of each straight line coordinate point in the straight line coordinate point set; According to the sequence of the first acquisition timing and the second acquisition timing, coordinate point processing is performed on the curve coordinate point set and the straight line coordinate point set to generate a curve for the coordinate point set.
3. The method according to claim 1, characterized in that The target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion path of the vehicle, and the method further includes: Obtaining a road width for the curve; The road width and the curve are used to generate road information corresponding to the motion path.
4. The method according to claim 1, characterized in that: The target object is a vehicle, the coordinate point set is a set of motion coordinate points corresponding to the motion process of the vehicle, and generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set includes: A motion trajectory corresponding to the vehicle motion process is generated according to the curve coordinate point set and the straight line coordinate point set.
5. A curve generating device, characterized in that: include: A coordinate point set acquisition module, used to acquire a coordinate point set, wherein the coordinate point set includes motion coordinate points of a target object; An attribute parameter acquisition module, used to acquire attribute parameters of the motion coordinate point, wherein the attribute parameters include at least coordinate information; A coordinate point processing module, used for adding the motion coordinate points satisfying the preset conditions to a preset target point set according to the attribute parameters, wherein the target point set includes a curve coordinate point set and a straight line coordinate point set; A curve generating module, used for generating a curve for the coordinate point set according to the curve coordinate point set and the straight line coordinate point set; Wherein, the coordinate point processing module includes: A target vector determination submodule, used to determine the target vector corresponding to the two adjacent motion coordinate points by using the coordinate information of the two adjacent motion coordinate points; A similarity determination submodule is used to use two adjacent target vectors to calculate the angle between the two adjacent target vectors, and obtain the similarity corresponding to the angle; wherein, the larger the angle, the smaller the similarity; and the smaller the angle, the greater the similarity; The coordinate point determination submodule is used to add the motion coordinate points corresponding to two adjacent target vectors whose similarity is less than or equal to a preset threshold to a preset curve coordinate point set; use the motion coordinate points corresponding to two adjacent target vectors whose similarity is greater than the preset threshold as straight line coordinate points, and extract the first motion coordinate point and the last motion coordinate point from the multiple continuous straight line coordinate points and add them to the preset straight line coordinate point set.
6. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 4 when executing the program stored in the memory.
7. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 4.
