Trajectory processing method and device, medium and computer device
By utilizing the distance between trajectory points and the compensation vector during the trajectory completion process to generate target trajectory points, the problem of poor robustness in existing trajectory completion technologies is solved, and stable and accurate trajectory curve completion is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SENSETIME TECH DEV CO LTD
- Filing Date
- 2022-06-29
- Publication Date
- 2026-04-28
AI Technical Summary
In existing technologies, the robustness of trajectory completion results is poor, and they are greatly affected by the method of selecting reference points, making it difficult to guarantee the integrity and accuracy of the trajectory curve.
By obtaining the distance between the current target trajectory point and the current original trajectory point, the position information of the next target trajectory point to be completed is determined. Using the distance as a constraint, and combining it with the direction and length of the compensation vector, the target trajectory point is generated, avoiding the selection of a reference point and increasing the number of trajectory points to maintain the shape and accuracy of the trajectory curve.
It improves the robustness and accuracy of trajectory completion results, reduces the occurrence of poor trajectory completion results due to excessive distance between adjacent trajectory points, and ensures the integrity and shape preservation of the trajectory curve.
Smart Images

Figure CN115170609B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer vision technology, and in particular to trajectory processing methods and apparatus, media and computer equipment. Background Technology
[0002] Trajectory processing has important applications in motion trajectory tracking. In real-world scenarios, the trajectories of moving objects often suffer from gaps, necessitating trajectory completion to generate a more complete trajectory curve. Related techniques typically involve selecting reference points from the original trajectory and then performing trajectory completion based on these reference points. However, this approach is highly dependent on the method of reference point selection, resulting in poor robustness of the completed trajectory. Summary of the Invention
[0003] In a first aspect, embodiments of this disclosure provide a trajectory processing method, the method comprising: obtaining the distance between a current target trajectory point and a current original trajectory point, wherein the current target trajectory point is the most recently determined target trajectory point, and the preceding original trajectory point of the current original trajectory point is used to determine the current target trajectory point; determining the position information of the next target trajectory point to be completed located between the current target trajectory point and the current original trajectory point based on the distance; and generating the target trajectory based on the position information of each target trajectory point.
[0004] In this embodiment, after determining each target trajectory point, the distance between the most recently determined target trajectory point (i.e., the current target trajectory point) and the current original trajectory point is used as a constraint to determine a new target trajectory point (i.e., the next target trajectory point) located between the current target trajectory point and the current original trajectory point. Since this method only needs to refer to the distance between trajectory points and does not require selecting a reference point for trajectory completion, it can obtain a stable trajectory completion result, improving the robustness of the trajectory completion result. Furthermore, this embodiment determines a new target trajectory point between the current target trajectory point and the current original trajectory point, thereby increasing the number of trajectory points, which helps to maintain the original shape of the trajectory curve, thus improving the accuracy of the trajectory completion result.
[0005] Furthermore, in this embodiment, the direction of the compensation vector can be determined based on the direction from the previous original trajectory point to the current original trajectory point. This ensures that the movement trend from the current target trajectory point to the next target trajectory point is the same as the movement trend from the previous original trajectory point to the current original trajectory point on the original trajectory, thereby preserving the original shape of the trajectory curve as much as possible. The length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point, which constrains the distance between the next target trajectory point and the current target trajectory point, reducing the possibility of poor trajectory completion due to excessively large distances between adjacent target trajectory points.
[0006] In some embodiments, determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance includes: comparing the distance with a preset step distance to obtain a comparison result; selecting a reference trajectory point from the current original trajectory point and its preceding original trajectory points based on the comparison result to determine the next target trajectory point; and determining the position information of the next target trajectory point based on the position information of the reference trajectory point.
[0007] In some embodiments, selecting a reference trajectory point for determining the next target trajectory point from the current original trajectory point and its preceding original trajectory points based on the comparison result includes: determining the current original trajectory point as the reference trajectory point when the distance is less than or equal to the step distance.
[0008] In some embodiments, determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance includes: interpolating the position information of the current original trajectory point and the position information of the current target trajectory point to obtain the position information of the next target trajectory point.
[0009] In some embodiments, selecting a reference trajectory point for determining the next target trajectory point from the current original trajectory point and the previous original trajectory point based on the comparison result includes: determining the previous original trajectory point of the current original trajectory point as the reference trajectory point when the distance is greater than the step distance.
[0010] In some embodiments, determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance, includes: determining a compensation vector; the direction of the compensation vector is determined based on the direction from the previous original trajectory point of the current original trajectory point to the current original trajectory point, and the length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point of the current original trajectory point; and determining the position information of the next target trajectory point based on the compensation vector.
[0011] In some embodiments, determining the compensation vector includes: determining a target vector from the previous original trajectory point of the current original trajectory point to the current target trajectory point; determining the compensation vector based on the target vector and the step distance; wherein the magnitude of the sum of the target vector and the compensation vector is equal to the step distance.
[0012] In some embodiments, after generating the target trajectory based on the location information of each target trajectory point, the method further includes: determining the energy of the target trajectory; the energy of a trajectory is used to characterize the orderliness of each trajectory point on the trajectory; and smoothing the target trajectory based on the energy.
[0013] In some embodiments, determining the energy of the target trajectory includes: determining the minimum distance between each target trajectory point and other target trajectory points within the neighborhood of the target trajectory point; determining the total length of the target trajectory; and determining the energy of the target trajectory based on the sum of the minimum distances corresponding to each target trajectory point and the total length.
[0014] In some embodiments, after smoothing the target trajectory based on the energy, the method further includes: using the smoothed target trajectory as the original trajectory, returning to the step of obtaining the distance between the current target trajectory point and the current original trajectory point, and regenerating the target trajectory; if the energy difference between the regenerated target trajectory and the previously generated target trajectory is greater than a preset threshold, smoothing the regenerated target trajectory.
[0015] Secondly, embodiments of this disclosure provide a trajectory processing apparatus for completing an original trajectory including multiple original trajectory points to obtain a target trajectory including multiple target trajectory points. The apparatus includes: an acquisition module for acquiring the distance between a current target trajectory point and a current original trajectory point, wherein the current target trajectory point is the most recently determined target trajectory point, and the preceding original trajectory point of the current original trajectory point is used to determine the current target trajectory point; a first determination module for determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance; and a first generation module for generating the target trajectory based on the position information of each target trajectory point.
[0016] Thirdly, embodiments of this disclosure provide a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the methods described in any of the embodiments.
[0017] Fourthly, embodiments of this disclosure provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any embodiment.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0020] Figure 1 This is a schematic diagram illustrating an application scenario of an embodiment of this disclosure.
[0021] Figure 2 This is a flowchart of a trajectory processing method according to an embodiment of the present disclosure.
[0022] Figure 3 This is a schematic diagram of the numbering of trajectory points in an embodiment of this disclosure.
[0023] Figure 4 This is a schematic diagram of different paths between missing trajectory points in an embodiment of this disclosure.
[0024] Figure 5 This is a general schematic diagram of the trajectory processing process according to an embodiment of the present disclosure.
[0025] Figure 6 This is a schematic diagram of a grid according to an embodiment of the present disclosure.
[0026] Figure 7This is a flowchart of a trajectory processing method according to another embodiment of the present disclosure.
[0027] Figure 8 This is a block diagram of a trajectory processing apparatus according to an embodiment of the present disclosure.
[0028] Figure 9 This is a block diagram of a trajectory processing apparatus according to another embodiment of the present disclosure.
[0029] Figure 10 This is a schematic diagram of the structure of a computer device according to an embodiment of the present disclosure. Detailed Implementation
[0030] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0031] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items. Additionally, the term “at least one” herein means any combination of at least two of any one or more of a plurality.
[0032] It should be understood that although the terms first, second, third, etc., may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0033] To enable those skilled in the art to better understand the technical solutions in the embodiments of this disclosure, and to make the above-mentioned objectives, features and advantages of the embodiments of this disclosure more apparent and understandable, the technical solutions in the embodiments of this disclosure will be further described in detail below with reference to the accompanying drawings.
[0034] In some large-scale scenarios, it is difficult to completely cover the entire scene with a single image acquisition device. Therefore, multiple image acquisition devices are generally used to achieve scene coverage. These multiple image acquisition devices can separately acquire image sequences of moving objects in the scene. Based on the image sequences acquired by each image acquisition device, a trajectory can be determined. By stitching together the various trajectory segments, the complete trajectory of the moving object can be obtained. Figure 1 The illustration shows two image acquisition devices, C1 and C2, whose fields of view partially overlap. The image sequences acquired by C1 and C2 are {P1} and {P2}, respectively. A trajectory Tr1 (shown as the black trajectory curve in the figure) can be determined based on {P1}, and a trajectory Tr2 (shown as the gray trajectory curve in the figure) can be determined based on {P2}. By stitching Tr1 and Tr2 together, the complete trajectory of the moving object in that scene can be obtained. Those skilled in the art will understand that the above embodiments are merely illustrative examples of the application scenarios involved in this disclosure and are not intended to limit this disclosure.
[0035] However, due to the often different viewing angles of different image acquisition devices, the stitching of multiple trajectory curves often results in deviations and noise. It can be seen that... Figure 1 In the image, there is a certain deviation between the trajectory points on Tr1 and Tr2. Furthermore, within the field of view of a single image acquisition device, occlusion and environmental factors (e.g., low light) can make it difficult to completely track the trajectory of a moving object. These factors can lead to missing trajectories of moving objects; therefore, trajectory completion is necessary to generate a more complete trajectory curve.
[0036] The common technique involves selecting reference points from the original trajectory before completion and then performing trajectory completion based on these reference points. However, the trajectory completion results of this method are greatly affected by the selection of reference points, resulting in poor robustness.
[0037] Based on this, this disclosure provides a trajectory processing method, see [link to relevant documentation]. Figure 2 The method includes:
[0038] Step 201: Obtain the distance between the current target trajectory point and the current original trajectory point. The current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point of the current original trajectory point is used to determine the current target trajectory point.
[0039] Step 202: Determine the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance;
[0040] Step 203: Generate the target trajectory based on the location information of each target trajectory point.
[0041] In this embodiment, after determining each target trajectory point, the distance between the most recently determined target trajectory point (i.e., the current target trajectory point) and the current original trajectory point is used as a constraint to determine a new target trajectory point (i.e., the next target trajectory point) located between the current target trajectory point and the current original trajectory point. This method only requires reference to the distance between trajectory points and does not require selecting a reference point for trajectory completion, thus obtaining stable trajectory completion results and improving the robustness of the trajectory completion results.
[0042] The trajectory in this embodiment can be the trajectory of any moving object, including but not limited to people, animals, vehicles, robots, etc. A trajectory may include multiple trajectory points. An image acquisition device can acquire an image sequence including the moving object. The image sequence may include multiple images. By detecting each image, the position of the moving object at the time the image is acquired can be obtained, and this position is the position of a trajectory point on the trajectory. The number of image acquisition devices can be greater than or equal to one. The field of view of different image acquisition devices may partially or completely overlap, or they may not overlap at all. The trajectory determined based on the image sequence often has missing parts and needs to be completed. For ease of distinction, the trajectory before completion is called the original trajectory, and the trajectory points on the original trajectory are called original trajectory points; the trajectory after completion is called the target trajectory, and the trajectory points on the target trajectory are called target trajectory points.
[0043] In step 201, for ease of description, the original trajectory points can be numbered sequentially according to the time order in which they were acquired. See [link / reference] Figure 3 Suppose a moving object passes through four positions—A, B, C, and D—from left to right. An original trajectory point can be determined based on the image captured at each position. Since these original trajectory points are generated sequentially, they can be numbered 1, 2, 3, and 4. In some embodiments, timestamps of the images used to determine each original trajectory point can be obtained, and the original trajectory points can be numbered sequentially based on these timestamps. Similarly, for ease of description, the target trajectory points can be numbered sequentially according to the time order in which they were generated. Target trajectory points with smaller numbers were generated earlier, and those with larger numbers were generated later.
[0044] Each time a target trajectory point is determined, the most recently determined target trajectory point can be used as the current target trajectory point. For example, after determining target trajectory point number 1, target trajectory point number 1 becomes the current target trajectory point and is used to determine the next target trajectory point (i.e., target trajectory point number 2); after determining target trajectory point number 2, target trajectory point number 2 becomes the current target trajectory point and is used to determine the next target trajectory point (i.e., target trajectory point number 3). For simplicity, the original trajectory point numbered i and the target trajectory point numbered i can also be referred to as the i-th original trajectory point and the i-th target trajectory point, respectively, where i is a positive integer.
[0045] The current target trajectory point is determined based on the preceding original trajectory point of the current original trajectory point. The preceding original trajectory point refers to the original trajectory point with a number lower than the current original trajectory point. For example, assuming the target trajectory point with number 1 is determined based on the original trajectory point with number 1, then after determining the target trajectory point with number 1, the original trajectory point with number 2 becomes the current original trajectory point, and the preceding trajectory point of the current original trajectory point is the original trajectory point with number 1. As another example, assuming the target trajectory point with number 2 is determined based on the original trajectory point with number 2, then after determining the target trajectory point with number 2, the original trajectory point with number 3 becomes the current original trajectory point, and the preceding trajectory point of the current original trajectory point can be the original trajectory point with number 1 and / or the original trajectory point with number 2.
[0046] The distance between the current target trajectory point and the current original trajectory point can be calculated using Euclidean distance, Chebyshev distance, Mahalanobis distance, or Langevin distance. Taking Euclidean distance as an example, assuming the coordinates of the current target trajectory point in physical space are (x1, y1) and the coordinates of the current original trajectory point in physical space are (x2, y2), then the distance d between the current target trajectory point and the current original trajectory point can be denoted as:
[0047]
[0048] In step 202, a new target trajectory point (i.e., the next target trajectory point) located between the current target trajectory point and the current original trajectory point can be determined. This results in a target trajectory with more target trajectory points than the original trajectory. For example, assuming the original trajectory points are 10, determining a new target trajectory point can ultimately yield a target trajectory with 15 target trajectory points. Of course, the above values are merely illustrative and not intended to limit this disclosure. The number of target trajectory points on the target trajectory is related to a preset step distance, which constrains the distance between target trajectory points. A larger step distance results in more target trajectory points on the target trajectory, leading to better trajectory completion, but also longer completion time; a smaller step distance results in fewer target trajectory points on the target trajectory, leading to relatively poorer trajectory completion, but also shorter completion time. The specific method for determining the new target trajectory point is described below.
[0049] In some embodiments, the distance can be compared with a preset step distance to obtain a comparison result; a reference trajectory point for determining the next target trajectory point can be selected from the current original trajectory point and the previous original trajectory points of the current original trajectory point based on the comparison result; and the position information of the next target trajectory point can be determined based on the position information of the reference trajectory point.
[0050] Optionally, if the distance is less than or equal to the step distance, the current original trajectory point can be determined as the reference trajectory point. When the distance between the current target trajectory point and the current original trajectory point is relatively small, it can be approximately assumed that the moving object moves along a straight line from the current target trajectory point to the current original trajectory point. Therefore, the current original trajectory point is sufficient to determine the position information of the next target trajectory point.
[0051] In this case, the position information of the current original trajectory point and the position information of the current target trajectory point can be interpolated to obtain the position information of the next target trajectory point. The interpolation method can be linear interpolation (e.g., bilinear interpolation). Assuming the coordinates of the current target trajectory point in physical space are (x1, y1) and the coordinates of the current original trajectory point in physical space are (x2, y2), then the coordinates (x, y) of the next target trajectory point in physical space satisfy the following condition:
[0052]
[0053] Of course, the method of determining the next target trajectory point based on the current original trajectory point and the current target trajectory point is not limited to the bilinear interpolation described in the above example. For example, the position of the next target trajectory point can also be obtained by averaging the position of the current original trajectory point and the position of the current target trajectory point.
[0054] Optionally, if the distance is greater than the step size, the previous original trajectory point of the current original trajectory point can be determined as the reference trajectory point. When the distance between the current target trajectory point and the current original trajectory point is relatively large, it is often difficult to determine the movement trend of the moving object between the current target trajectory point and the current original trajectory point. For example... Figure 4 As shown in the diagram, assuming a trajectory includes the black dots, it can be seen that a segment is missing between the two trajectory points Q1 and Q2. When performing trajectory completion, related techniques struggle to determine whether Q1 reached Q2 along path 1 or path 2; therefore, the accuracy of completing this missing segment is generally low. In this situation, using the current original trajectory points to determine the location information of the next target trajectory point may result in significant errors.
[0055] To address the aforementioned issues, a compensation vector can be determined; based on this compensation vector, the position information of the next target trajectory point can be determined. In some embodiments, the direction of the compensation vector is determined based on the direction from the previous original trajectory point to the current original trajectory point. This ensures that the movement trend from the current target trajectory point to the next target trajectory point is the same as the movement trend from the previous original trajectory point to the current original trajectory point on the original trajectory, thereby preserving the original shape of the trajectory curve as much as possible. In other embodiments, the length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point of the current original trajectory point. This constrains the distance between the next target trajectory point and the current target trajectory point, reducing the possibility of poor trajectory completion due to excessively large distances between adjacent target trajectory points.
[0056] In related technologies, the target trajectory is generally obtained by adjusting the positions of the original trajectory points on the original trajectory without increasing the number of trajectory points. Therefore, the number of original trajectory points and target trajectory points is generally the same. However, the target trajectory obtained in this way often has a significant degree of distortion, making it difficult to guarantee the original shape of the trajectory curve, resulting in inaccurate trajectory completion results. This disclosure, on the one hand, increases the number of trajectory points, and on the other hand, uses compensation vectors to complete the trajectory for trajectory points with large distances, thus preserving the original shape of the trajectory curve as much as possible, making the trajectory completion results more accurate.
[0057] In some embodiments, a target vector from the previous original trajectory point of the current original trajectory point to the current target trajectory point can be determined; the compensation vector is determined based on the target vector and the step distance; wherein the magnitude of the sum of the target vector and the compensation vector is equal to the step distance. Assuming the coordinates of the current target trajectory point in physical space are (x1, y1), the coordinates of the current original trajectory point in physical space are (x2, y2), and the compensation vector is (m, n) with a step distance of d0, the compensation vector satisfies the following condition:
[0058] ||(x1,y1)-(x2,y2)+(m,n)||=d0.
[0059] Where ||·|| represents the modulo operation. The above condition is equivalent to:
[0060]
[0061] After obtaining the compensation vector, the current target trajectory point can be extended along the direction of the compensation vector to obtain the next target trajectory point. The extension length is equal to the length of the compensation vector. Continuing with the example above, after obtaining the compensation vector as (m, n), the coordinates of the next target trajectory point are (x1+m, x2+n).
[0062] In step 203, the target trajectory can be generated based on the position information of each target trajectory point. The following section combines... Figure 5 The overall flow of the trajectory processing method disclosed herein will be illustrated through a specific embodiment. In this embodiment, the preceding original trajectory point of the current original trajectory point is the previous original trajectory point. In the figure, an arrow pointing from an original trajectory point to a target trajectory point indicates that the target trajectory point is obtained by completing the original trajectory points connected by the arrow.
[0063] (1) An original trajectory point (e.g., original trajectory point numbered 1) can be selected from the original trajectory as the target trajectory point numbered 1. That is, the target trajectory point numbered 1 on the target trajectory is in the same position as the original trajectory point numbered 1 on the original trajectory. After this step, the current target trajectory point on the target trajectory is the target trajectory point numbered 1, and the current original trajectory point on the original trajectory is the original trajectory point numbered 2.
[0064] (2) It can be determined whether the distance between the target trajectory point numbered 1 and the original trajectory point numbered 2 is greater than the step distance. Here, it is assumed that the distance between the two is not greater than the step distance, so the target trajectory point numbered 1 and the original trajectory point numbered 2 can be interpolated to obtain the target trajectory point numbered 2. At this time, the current target trajectory point on the target trajectory is the target trajectory point numbered 2, and the current original trajectory point on the original trajectory is the original trajectory point numbered 3.
[0065] (3) It can be determined whether the distance between the target trajectory point numbered 2 and the original trajectory point numbered 3 is greater than the step distance. Here, it is assumed that the distance between the two is greater than the step distance. Then, a compensation vector can be determined based on the original trajectory point numbered 2 and the target trajectory point numbered 2, and the target trajectory point numbered 3 can be determined based on the compensation vector. After this step, the current target trajectory point on the target trajectory is the target trajectory point numbered 3, and the current original trajectory point on the original trajectory is the original trajectory point numbered 3.
[0066] (4) It can be further determined whether the distance between the target trajectory point numbered 3 and the original trajectory point numbered 3 is greater than the step distance. Here it is assumed that the distance between the two is not greater than the step distance. Then, similar to step (2), the target trajectory point numbered 3 can be determined from the original trajectory point numbered 3 by interpolation.
[0067] The method for determining other target trajectory points on the target trajectory can refer to the above process, and will not be repeated here.
[0068] In some embodiments, after acquiring the target trajectory, the target trajectory can be smoothed. Smoothing can reduce the impact of noise disturbances on the target trajectory. There are many ways to smooth the trajectory; for example, it can be smoothed based on the position of each target trajectory point. However, this smoothing method is not very effective. To improve the smoothing effect, this disclosure proposes a smoothing method based on the energy of the target trajectory. The energy of a trajectory is used to characterize the orderliness of the trajectory points, thus effectively representing the smoothness of the trajectory. The higher the orderliness of the trajectory points, i.e., the more neatly arranged the trajectory points, the smoother the trajectory, and the lower the energy of the trajectory; conversely, the lower the orderliness of the trajectory points, i.e., the more randomly arranged the trajectory points, the less smooth the trajectory, and the higher the energy of the trajectory.
[0069] Specifically, the minimum distance between each target trajectory point and other target trajectory points within its neighborhood can be determined, and the total length of the target trajectory can be determined; the energy of the target trajectory can be determined based on the sum of the minimum distances corresponding to each target trajectory point and the total length.
[0070] The target trajectory can be divided into grids, where the grid size is customizable, ensuring that each coordinate point corresponds to a target trajectory point within a specific grid. In some embodiments, the grid size is positively correlated with the step size used in the trajectory completion process. A larger step size results in a larger grid, and vice versa. The purpose of grid division is to determine other target trajectory points within the neighborhood of each target trajectory point. Since the grid size is positively correlated with the step size, it ensures that each grid contains only one target trajectory point, thus facilitating the determination of other target trajectory points within the neighborhood.
[0071] After dividing the grid, the target trajectory points within a 3x3 grid centered on the target trajectory point can be defined as other target trajectory points within the neighborhood of that target trajectory point. See also Figure 6 The grid dimension is 6x6, with each square representing a grid cell. The numbers (Q1 to Q9) within the squares represent the target trajectory points. Taking target trajectory point Q1 as an example, the 3x3 grid surrounding this target trajectory point is shown as the gray area in the figure. Therefore, other target trajectory points within the neighborhood include target trajectory points numbered Q2, Q3, and Q7. Then, the distances between target trajectory point Q1 and target trajectory points numbered Q2, Q3, and Q7 can be determined, and the minimum distance is selected. The processing method for each target trajectory point other than Q1 is the same as described above: traversing each target trajectory point yields the minimum distance corresponding to each target trajectory point. This minimum distance can be represented by a two-dimensional matrix U with the same dimension as the grid.
[0072] In some embodiments, the energy E of the target trajectory can be determined based on the difference between the length of the target trajectory and the sum of the minimum distances corresponding to each point on the target trajectory, specifically expressed in the following form:
[0073]
[0074] Where w is a user-defined weight, l0 represents the length of the target trajectory, n represents the number of target trajectory points on the target trajectory, U(·) represents the distance function, i.e., the two-dimensional matrix mentioned above, C i Let v represent the i-th target trajectory point on the target trajectory, and v represent the grid size.
[0075] In the above formula, the weight w is used to balance the overall energy tendency. The first term of the energy equation represents the numerical characteristics of the target trajectory, which can be understood as the state of the target trajectory itself. The second term represents the smoothness of the target trajectory, and w is used to balance these two terms. The smaller w is, the smoother the target trajectory is, but the higher the distortion of the target trajectory will be. For example, if there is an S-shaped region on the original target trajectory, if w is very small, it will fit this S-shaped region into a smooth curve shape. Used to represent target trajectory point C i The corresponding minimum distance can be normalized by dividing it by the grid size v.
[0076] After obtaining the energy of the target trajectory, the derivative of the energy with respect to the distance can be obtained. The product between the preset adjustment step size and the derivative of the energy is determined. The target trajectory is iteratively optimized based on the product until the preset convergence condition is met. The target trajectory that meets the convergence condition is the smoothed target trajectory.
[0077] In some embodiments, the target trajectory points on the iterated target trajectory can be determined based on the following formula:
[0078]
[0079] This formula can be obtained by differentiating the energy expression formula. Wherein, C represents the i-th target trajectory point on the target trajectory after iteration. i This represents the i-th target trajectory point on the target trajectory before iteration, and step represents the adjustment step size. Let N(i) represent the derivative of the aforementioned distance function at the i-th target trajectory point, N(i) represent the magnitude at the i-th target trajectory point, and Curv(i) represent the curvature at the i-th target trajectory point.
[0080] The convergence condition is that the difference in energy between the target trajectory before and after the iteration is less than a preset difference. In some embodiments, the number of iterations can also be used as the convergence condition. For example, if the number of iterations reaches a preset threshold, the convergence condition can be considered satisfied. Alternatively, the iteration time can also be used as the convergence condition. For example, if the iteration time reaches a preset duration, the convergence condition can be considered satisfied. Taking the former convergence condition as an example, after determining the positions of each point on the target trajectory after iteration, the difference in energy between the target trajectory before and after iteration can be calculated based on the aforementioned energy formula. If the difference is less than the preset difference, it indicates that convergence has been achieved, and iteration can be stopped; otherwise, iteration can continue.
[0081] In some embodiments, the smoothed target trajectory can be used as the original trajectory, and the step of obtaining the distance between the current target trajectory point and the current original trajectory point can be returned to regenerate the target trajectory. If the energy difference between the regenerated target trajectory and the previously generated target trajectory is greater than a preset threshold, the regenerated target trajectory is smoothed. Otherwise, the iteration ends.
[0082] This disclosure also provides a trajectory processing method, see [link to relevant documentation]. Figure 7 The method includes:
[0083] Step 701: Determine the compensation vector; the direction of the compensation vector is determined based on the direction from the previous original trajectory point to the current original trajectory point, and the length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point of the current original trajectory point; the current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point of the current original trajectory point is used to determine the current target trajectory point;
[0084] Step 702: Determine the position information of the next target trajectory point based on the compensation vector;
[0085] Step 703: Generate the target trajectory based on the location information of each target trajectory point.
[0086] In some embodiments, the operation of determining the compensation vector is performed when the distance between the current target trajectory point and the current original trajectory point is greater than a preset step distance.
[0087] In other embodiments, when the distance between the current target trajectory point and the current original trajectory point is less than or equal to a preset step distance, the position information of the current original trajectory point and the position information of the current target trajectory point are linearly interpolated to obtain the position information of the next target trajectory point.
[0088] This embodiment determines the direction of the compensation vector based on the direction from the previous original trajectory point to the current original trajectory point. This ensures that the movement trend from the current target trajectory point to the next target trajectory point is the same as the movement trend from the previous original trajectory point to the current original trajectory point on the original trajectory, thereby preserving the original shape of the trajectory curve as much as possible. Furthermore, determining the length of the compensation vector based on the distance between the current target trajectory point and the previous original trajectory point of the current original trajectory point constrains the distance between the next target trajectory point and the current target trajectory point, reducing the possibility of poor trajectory completion due to excessively large distances between adjacent target trajectory points.
[0089] For specific details of this method embodiment, please refer to the foregoing method embodiment, which will not be repeated here.
[0090] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0091] See Figure 8 This disclosure also provides a trajectory processing apparatus, the apparatus comprising:
[0092] The acquisition module 801 is used to acquire the distance between the current target trajectory point and the current original trajectory point, wherein the current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point of the current original trajectory point is used to determine the current target trajectory point;
[0093] The first determining module 802 is used to determine the position information of the next target trajectory point to be completed, which is located between the current target trajectory point and the current original trajectory point, based on the distance.
[0094] The first generation module 803 is used to generate the target trajectory based on the position information of each target trajectory point.
[0095] See Figure 9 This disclosure also provides a trajectory processing apparatus, the apparatus comprising:
[0096] The second determining module 901 is used to determine a compensation vector; the direction of the compensation vector is determined based on the direction from the previous original trajectory point of the current original trajectory point to the current original trajectory point, and the length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point of the current original trajectory point; the current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point of the current original trajectory point is used to determine the current target trajectory point.
[0097] The third determining module 902 is used to determine the position information of the next target trajectory point based on the compensation vector;
[0098] The second generation module 903 is used to generate the target trajectory based on the position information of each target trajectory point.
[0099] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0100] This specification also provides a computer device, which includes at least a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the methods described in any of the foregoing embodiments.
[0101] Figure 10 This diagram illustrates a more specific hardware structure of a computing device provided in an embodiment of this specification. The device may include: a processor 1001, a memory 1002, an input / output interface 1003, a communication interface 1004, and a bus 1005. The processor 1001, memory 1002, input / output interface 1003, and communication interface 1004 are interconnected internally via the bus 1005.
[0102] The processor 1001 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification. The processor 1001 may also include a graphics card, such as an Nvidia Titan X graphics card or a 1080Ti graphics card.
[0103] The memory 1002 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1002 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1002 and is called and executed by the processor 1001.
[0104] The input / output interface 1003 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0105] The communication interface 1004 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0106] Bus 1005 includes a pathway for transmitting information between various components of the device (e.g., processor 1001, memory 1002, input / output interface 1003, and communication interface 1004).
[0107] It should be noted that although the above-described device only shows the processor 1001, memory 1002, input / output interface 1003, communication interface 1004, and bus 1005, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0108] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the methods described in any of the foregoing embodiments.
[0109] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0110] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions of the embodiments of this specification, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this specification.
[0111] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0112] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate. When implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware. Alternatively, some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0113] The above description is merely a specific implementation of the embodiments of this specification. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles of the embodiments of this specification, and these improvements and modifications should also be considered within the protection scope of the embodiments of this specification.
Claims
1. A trajectory processing method, characterized in that, The method includes: Obtain the distance between the current target trajectory point and the current original trajectory point, wherein the current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point is used to determine the current target trajectory point; Based on the distance, determine the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point; The target trajectory is generated based on the location information of each target trajectory point.
2. The method according to claim 1, characterized in that, The step of determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance, includes: The distance is compared with the preset step size distance to obtain the comparison result; Based on the comparison result, a reference trajectory point for determining the next target trajectory point is selected from the current original trajectory point and the previous original trajectory point of the current original trajectory point; The position information of the next target trajectory point is determined based on the position information of the reference trajectory point.
3. The method according to claim 2, characterized in that, The step of selecting a reference trajectory point for determining the next target trajectory point from the current original trajectory point and the previous original trajectory point based on the comparison result includes: If the distance is less than or equal to the step distance, the current original trajectory point is determined as the reference trajectory point.
4. The method according to claim 3, characterized in that, The step of determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance, includes: The position information of the current original trajectory point and the position information of the current target trajectory point are interpolated to obtain the position information of the next target trajectory point.
5. The method according to claim 2, characterized in that, The step of selecting a reference trajectory point for determining the next target trajectory point from the current original trajectory point and the previous original trajectory point based on the comparison result includes: If the distance is greater than the step distance, the previous original trajectory point of the current original trajectory point is determined as the reference trajectory point.
6. The method according to claim 5, characterized in that, The step of determining the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance, includes: Determine the compensation vector; the direction of the compensation vector is determined based on the direction from the previous original trajectory point to the current original trajectory point, and the length of the compensation vector is determined based on the distance between the current target trajectory point and the previous original trajectory point. The position information of the next target trajectory point is determined based on the compensation vector.
7. The method according to claim 6, characterized in that, The determination of the compensation vector includes: Determine the target vector from the previous original trajectory point of the current original trajectory point to the current target trajectory point; The compensation vector is determined based on the target vector and the step distance; wherein the magnitude of the sum of the target vector and the compensation vector is equal to the step distance.
8. The method according to claim 1, characterized in that, After generating the target trajectory based on the location information of each target trajectory point, the method further includes: Determine the energy of the target trajectory; the energy of a trajectory is used to characterize the orderliness of the trajectory points. The target trajectory is smoothed based on the energy.
9. The method according to claim 8, characterized in that, The energy used to determine the target trajectory includes: Determine the minimum distance between each target trajectory point and other target trajectory points within its neighborhood; Determine the total length of the target trajectory; The energy of the target trajectory is determined based on the sum of the minimum distances corresponding to each target trajectory point and the total length.
10. The method according to claim 8 or 9, characterized in that, After smoothing the target trajectory based on the energy, the method further includes: Using the smoothed target trajectory as the original trajectory, return to the step of obtaining the distance between the current target trajectory point and the current original trajectory point, and regenerate the target trajectory; If the energy difference between the regenerated target trajectory and the previously generated target trajectory is greater than a preset threshold, the regenerated target trajectory is smoothed.
11. A trajectory processing device, characterized in that, The device includes: The acquisition module is used to acquire the distance between the current target trajectory point and the current original trajectory point. The current target trajectory point is the most recently determined target trajectory point, and the previous original trajectory point is used to determine the current target trajectory point. The first determining module is used to determine the position information of the next target trajectory point to be completed, located between the current target trajectory point and the current original trajectory point, based on the distance; The first generation module is used to generate target trajectories based on the location information of each target trajectory point.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method described in any one of claims 1 to 10.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Motion control method and device of unmanned equipment, equipment and storage medium
CN113093715A