Trajectory Denoising Method and Related Devices and Equipment
By replacing the connection direction between trajectory points and calculating new trajectory points, the problem of removing noise in trajectory is solved, and the smoothness and application effect of trajectory are improved.
Patent Information
- Application Number
- CN202110633573.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-07
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2041-06-07
AI Technical Summary
The prior art is difficult to effectively remove noise in the trajectory, affecting the drawing, display and identification effects of the trajectory.
By obtaining multiple first track points of the trajectory to be denoised, the first connection direction between each two adjacent track points is sequentially replaced by a preset direction to obtain the second connection direction; the second track point of each first track point in the corresponding second connection direction is calculated, and the first track point is replaced with the second track point, and finally the denoising process is performed based on these replaced track points.
The trajectory denoising processing is realized, the smoothness and application effect of the trajectory are improved, and the accuracy and reliability of the trajectory data are enhanced.
Smart Images

Figure CN113469900B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of trajectory denoising, and in particular to a trajectory denoising method and related devices and equipment. Background Art
[0002] With the rapid development of science and technology, trajectory application technology is gradually being applied to all walks of life. For example, in human-computer interaction, the movement trajectory of human gestures or limbs is obtained through sensing devices; GPS (Global Positioning System) obtains the movement trajectory of the target object through satellites, etc. By applying the obtained trajectory in related ways, the spatiotemporal dynamics of individuals and groups can be portrayed.
[0003] However, in practical applications, the acquired trajectories often contain certain noise points due to problems such as human body jitter or equipment accuracy. When using these trajectory data, if these noise points cannot be effectively removed, it will affect the final results, such as trajectory drawing and display, trajectory recognition, etc.
[0004] Currently, how to denoise trajectories is a challenge in trajectory application technology. Summary of the invention
[0005] The present application provides a trajectory denoising method and related devices and equipment to solve the problem that it is difficult to denoise a trajectory in the prior art.
[0006] To solve the above technical problems, the present application provides a trajectory denoising method, comprising: obtaining multiple first trajectory points of a trajectory to be denoised; replacing the first connection direction between every two adjacent trajectory points with a corresponding preset direction in turn to obtain a second connection direction; calculating the second trajectory point of each first trajectory point in the corresponding second connection direction, and replacing the corresponding first trajectory point with the second trajectory point; denoising the trajectory to be denoised based on each second trajectory point and the second connection direction; wherein the trajectory points include the first trajectory point and the second trajectory point.
[0007] Among them, the first connection direction between every two adjacent trajectory points is replaced by the corresponding preset direction in turn to obtain the second connection direction between the replaced trajectory points; the second trajectory point of each first trajectory point in the corresponding second connection direction is calculated, and the corresponding first trajectory point is replaced with the second trajectory point. The steps include: taking the direction between every two adjacent first trajectory points as the first connection direction; replacing each first connection direction by the corresponding preset direction to obtain each second connection direction; obtaining the vertical intersection point from the next first trajectory point of every two adjacent first trajectory points to the corresponding second connection direction, replacing the next trajectory point with the vertical intersection point, and taking the vertical intersection point as the second trajectory point corresponding to the next trajectory point, until all the first trajectory points are replaced.
[0008] Among them, the first connection direction between every two adjacent trajectory points is replaced by the corresponding preset direction in turn to obtain the second connection direction between the replaced trajectory points; the second trajectory point of each first trajectory point in the corresponding second connection direction is calculated, and the corresponding first trajectory point is replaced by the second trajectory point. The steps include: taking the direction between the first first trajectory point and the next first trajectory point as the first connection direction; replacing the first connection direction by the corresponding preset direction to obtain the second connection direction; obtaining the vertical intersection point from the next first trajectory point to the corresponding second connection direction, replacing the next first trajectory point with the vertical intersection point, and taking the vertical intersection point as the second trajectory point corresponding to the next first trajectory point; taking the direction between the second trajectory point and the next first trajectory point as the first connection direction; repeating the step of replacing the first connection direction by the corresponding preset direction to obtain the second connection direction until all the first trajectory points are replaced.
[0009] The step of replacing the first connection direction with the corresponding preset direction to obtain the second connection direction includes: in response to the angle between the first connection direction and the preset direction being within the angle range of the preset direction, replacing the corresponding first connection direction with the preset direction.
[0010] Among them, in response to the angle between the first connecting line direction and the preset direction being within the angle range of the preset direction, the step of replacing the corresponding first connecting line direction with the preset direction also includes: dividing the two-dimensional plane where the trajectory to be denoised is located into preset angle ranges of preset directions with the origin as the center, and determining the middle angle of each angle range as the preset direction corresponding to the angle range.
[0011] The step of dividing the two-dimensional plane where the trajectory to be denoised is located into a preset angle range of a preset direction with the origin as the center includes: dividing the two-dimensional plane where the trajectory to be denoised is located into an angle range of P preset directions with the origin as the center; wherein the angle range of each preset direction is [P n*360 / P-360 / 2P,P n *360 / P+360 / 2P), P n Including [0, 1…, P-1], P is a multiple of 4, including 4*n, and n is a positive integer.
[0012] The step of calculating the vertical intersection point includes: obtaining the next trajectory point T by the following formula: N To the perpendicular intersection point T' of the corresponding second connecting line direction N :
[0013] T′ N.x =(B*B*T N.x -A*B*T N.y -A*C) / (A*A+B*B) (1)
[0014] T′ N.y =(-A*B*T N.x +A*C*T N.y -B*C) / (A*A+B*B) (2)
[0015] Among them, AX+BY+C=0, B=-1,C=-A*T N-1.x -B*T N-1.y , P n Including [0, 1…, P-1], X, Y are variables, T′ N.x is the horizontal coordinate of the vertical intersection point, T′ N.y is the ordinate of the vertical intersection point, T N.x is the horizontal coordinate of the next trajectory point, T N.y is the ordinate of the next trajectory point, T N-1.x is the horizontal coordinate of the previous trajectory point between every two adjacent trajectory points, T N-1.y is the ordinate of the previous trajectory point between every two adjacent trajectory points.
[0016] Among them, the step of denoising the trajectory to be denoised based on each second trajectory point and the second connection direction also includes: connecting based on each second trajectory point and the second connection direction to obtain each replacement vector of the denoised trajectory; in response to the presence of a target vector between each replacement vector whose direction is discontinuous with that between adjacent vectors, eliminating the target vector and connecting the starting point and the end point of the target vector; drawing the trajectory to be denoised based on each replacement vector after eliminating the target vector to obtain the denoised trajectory.
[0017] Among them, the step of obtaining multiple first trajectory points of the trajectory to be denoised includes: obtaining multiple first trajectory points and their coordinates by identifying trajectory key points of the trajectory to be denoised; or receiving trajectory data of the trajectory to be denoised sent by a sensor to obtain multiple first trajectory points and their coordinates.
[0018] To solve the above technical problems, the present application also provides a trajectory denoising device, including: an acquisition module, used to acquire multiple first trajectory points of the trajectory to be denoised; a first replacement module, used to replace the first connection direction between every two adjacent trajectory points with a corresponding preset direction in turn, to obtain the second connection direction between the replaced trajectory points; a second replacement module, used to calculate the second trajectory point of each first trajectory point in the corresponding second connection direction, and replace the corresponding first trajectory point with the second trajectory point; a denoising module, used to denoise the trajectory to be denoised based on each second trajectory point and the second connection direction; wherein the trajectory points include first trajectory points and second trajectory points.
[0019] The present application also provides an electronic device, including a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement any of the above-mentioned trajectory denoising methods.
[0020] The present application also provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, any of the above-mentioned trajectory denoising methods is implemented.
[0021] In the above scheme, the present application replaces the first line direction between every two adjacent trajectory points with the corresponding preset direction in sequence to obtain the second line direction, then calculates the second trajectory point of each first trajectory point in the corresponding second line direction, and replaces the corresponding first trajectory point with the second trajectory point; wherein the trajectory point includes the first trajectory point and the second trajectory point, and finally denoises the trajectory to be denoised based on the second trajectory point and the second line direction. This embodiment replaces the first trajectory points of the trajectory to be denoised and the first line direction between the first trajectory points, and can standardize the trajectory of the trajectory to be denoised by the preset direction corresponding to the second line direction and the second trajectory point corresponding to the preset direction, thereby realizing the denoising processing of the trajectory to be denoised and improving the smoothness of the trajectory to be denoised. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of an embodiment of a trajectory denoising method of the present application;
[0023] Figure 2 It is a flowchart of another embodiment of the trajectory denoising method of the present application;
[0024] Figure 3 is a schematic diagram of an embodiment of plane direction division;
[0025] Figure 4 is a schematic diagram of an embodiment of direction replacement;
[0026] Figure 5is a schematic diagram of an embodiment of eliminating the second connecting line direction before and after the target vector;
[0027] Figure 6 It is a flowchart of another embodiment of the trajectory denoising method of the present application;
[0028] Figure 7 It is a schematic diagram of the framework of an embodiment of a trajectory denoising device of the present application;
[0029] Figure 8 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0030] Fig. 9 A schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0031] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0032] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0033] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of the associated objects. There can be three kinds of relationships. For example, A and / or B can be: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally means that the associated objects before and after are in an "or" relationship. In addition, "more" in this article means two or more than two.
[0034] See also Figure 1 , Figure 1 It is a flow chart of an embodiment of a trajectory denoising method of the present application.
[0035] Specifically, the following steps may be included:
[0036] Step S11: obtaining a plurality of first trajectory points of the trajectory to be denoised.
[0037] A plurality of first trajectory points of the trajectory to be denoised are obtained. The trajectory to be denoised may include a plurality of continuous trajectories such as a gesture trajectory, a limb trajectory, and a motion trajectory. The plurality of first trajectory points may be each key point or each point on the trajectory to be denoised. The plurality of first trajectory points are sequentially connected in the order of the trajectory to be denoised, so as to obtain the trajectory to be denoised.
[0038] Step S12: sequentially replacing the first connection direction between every two adjacent trajectory points with the corresponding preset direction to obtain a second connection direction.
[0039] Connecting every two adjacent track points in sequence to obtain a first connecting direction between every two adjacent track points. The track points of this embodiment include a first track point and a second track point.
[0040] By replacing each first connection direction with a preset direction corresponding to each first connection direction, the corresponding second connection direction is obtained, that is, all the second connection directions finally obtained are a connection combination of multiple preset directions.
[0041] Among them, the preset direction is a preset fixed direction. By replacing the messy first connection direction in different directions of the trajectory to be denoised with a preset fixed second connection direction, the direction is standardized, which can improve the smoothness of the trajectory to be denoised to a certain extent.
[0042] Step S13: Calculate the second trajectory point of each first trajectory point in the corresponding second connecting line direction, and replace the corresponding first trajectory point with the second trajectory point.
[0043] Calculate the second trajectory point of each first trajectory point in the corresponding second line direction, and replace the corresponding first trajectory point with the second trajectory point, that is, replace the corresponding first trajectory point with the calculated second trajectory point. Thus, the starting point and the end point of the second line direction are determined by the first trajectory point and the second trajectory point. The second trajectory point can be a mapping point of the first trajectory point in the corresponding second line direction, such as a vertical intersection point, a multi-equal point, etc., wherein, when calculating the second trajectory point of the first trajectory point on a trajectory to be denoised in the corresponding second line direction, the calculation method of each second trajectory point is the same, wherein, when the mapping point is a vertical intersection point, it can better map the characteristics of each first trajectory point, so that the second trajectory point obtained after replacement can better reflect the characteristics of the first trajectory point and avoid feature distortion.
[0044] In a specific application scenario, when all trajectory points are first trajectory points, the first connection direction between every two adjacent first trajectory points can be replaced by the corresponding preset direction in turn to obtain the corresponding second connection directions; then the second trajectory points of all first trajectory points except the first first trajectory point in the corresponding second connection direction are calculated respectively, and then the corresponding first trajectory point is replaced by the second trajectory point to obtain the replaced first first trajectory point and multiple second trajectory points, thereby completing trajectory denoising based on the above trajectory points.
[0045] In another specific application scenario, when the trajectory points include both the first trajectory point and the second trajectory point, the first connection direction between the first first trajectory point and the second first trajectory point is first replaced by the corresponding preset direction to obtain a second connection direction, and then the second trajectory point corresponding to the second first trajectory point in the second connection direction is calculated, and the second first trajectory point is replaced with the second trajectory point to complete the replacement of a first connection direction with a first trajectory point. Then, the first connection direction between the above second trajectory point and the third first trajectory point is replaced by the corresponding preset direction to obtain the corresponding second connection direction, the second trajectory point of the third first trajectory point in the second connection direction is calculated, and the third first trajectory point is replaced with the second trajectory point. The above method is used to sequentially replace the first trajectory point with the first connection direction in the order of the trajectory points until all the first trajectory points on the trajectory to be denoised are replaced, and the replaced first first trajectory point and multiple second trajectory points are obtained, thereby completing trajectory denoising based on the above trajectory points.
[0046] Step S14: De-noising the trajectory to be de-noised based on each second trajectory point and the second connection direction.
[0047] After replacing all the first trajectory points and the first connection directions, the second trajectory points and the second connection directions are obtained. The second trajectory points and the second connection directions are connected in the order of the trajectory to be denoised, so as to complete the denoising of the trajectory to be denoised and obtain the denoised trajectory.
[0048] Through the above method, the trajectory denoising method of this embodiment replaces the first line direction between every two adjacent trajectory points with the corresponding preset direction in turn to obtain the second line direction, then calculates the second trajectory point of each first trajectory point in the corresponding second line direction, and replaces the corresponding first trajectory point with the second trajectory point; wherein the trajectory point includes the first trajectory point and the second trajectory point, and finally denoises the trajectory to be denoised based on the second trajectory point and the second line direction. This embodiment replaces the first trajectory points of the trajectory to be denoised and the first line direction between the first trajectory points, and can standardize the trajectory of the trajectory to be denoised by the preset direction corresponding to the second line direction and the second trajectory point corresponding to the preset direction, thereby realizing the denoising processing of the trajectory to be denoised and improving the smoothness of the trajectory to be denoised.
[0049] See also Figure 2 , Figure 2 This is a flow chart of another embodiment of the trajectory denoising method of the present application. This embodiment will be described by taking the trajectory points including the first trajectory point and the second trajectory point as an example. Specifically, the following steps may be included:
[0050] Step S21: obtaining a plurality of first trajectory points of the trajectory to be denoised.
[0051] The target object's trajectory to be denoised is obtained, and the trajectory to be denoised includes a plurality of first trajectory points and their coordinates. The target object's trajectory to be denoised may include a motion trajectory of a gesture, a motion trajectory of a limb, a motion trajectory of a moving object such as a person, an animal or a vehicle, etc., and the specific target object is not limited here.
[0052] In this embodiment, by (T 1 、T 2 , ..., T N ) represents each first trajectory point and its coordinates, where N is the number of first trajectory points of the trajectory to be denoised.
[0053] Among them, the method of obtaining the trajectory of the target object can be to obtain the trajectory to be denoised of the target object through devices such as sensors, cameras, GPS positioning systems or Beidou positioning systems. The specific acquisition method can be determined based on the type of the target object.
[0054] In a specific application scenario, after obtaining the denoised trajectory of the target object, key points can be identified on the denoised trajectory to obtain each first trajectory point and its coordinate information. The key point identification can be performed by a trained deep neural network or manual identification.
[0055] In a specific application scenario, when the target object is a gesture, the motion trajectory of the gesture can be obtained through the touch screen sensor, and then key points of the motion trajectory of the gesture are identified to obtain information including each first trajectory point and its coordinate information.
[0056] Step S22: taking the direction between the first first track point and the next first track point as the first connection direction.
[0057] For the first trajectory point T 1 and the next first trajectory point T 2 Connect and get T 1 With T 2 The first connection direction S 1-2 . In this embodiment, the first connection direction refers to the actual direction of the trajectory to be denoised before being replaced. The second connection direction refers to the direction of the trajectory after being replaced. The first trajectory point refers to the actual trajectory point of the trajectory to be denoised before being replaced. The second trajectory point refers to the trajectory point after being replaced.
[0058] Step S23: replacing the first connection direction with a corresponding preset direction to obtain a second connection direction.
[0059] The first connection direction is replaced by a preset direction corresponding to the first connection direction to obtain a second connection direction corresponding to the first connection direction. The source of the first connection direction can be obtained from step S22 or step S26.
[0060] In a specific application scenario, the first connection direction S 1-2 The corresponding preset direction is the first connection direction S 1-2 Replace and get the second connection direction C 1-2 .
[0061] The preset direction is determined as follows:
[0062] The plane direction of the two-dimensional plane where the trajectory to be denoised is located is divided into P preset directions with the preset point as the center, where the plane direction is the 360-degree direction of the preset point in the above two-dimensional plane. The range of each preset direction is [P n *360 / P-360 / 2P,P n *360 / P+360 / 2P), and each preset direction is P n *360 / P,P n That is, [0, 1…, P-1]. P is a multiple of 4, i.e., 4*n, 4, 8, 12, etc. n is a positive integer. When P is a multiple of 4, the relative preset directions can be located on a straight line, so that there is a symmetric relationship between the corresponding directions, and the coherence between the preset directions is improved. And the larger the value of P, the smoother the trajectory after denoising.
[0063] Determine within which preset direction the first line direction between two adjacent track points on the track is located, and use the preset direction to replace the first line direction between the two adjacent track points. Specifically, translate the starting point of the first line direction between the two adjacent track points to the preset point, and determine the angle value of the direction by the angle between the first line direction and the positive direction of the x-axis on the coordinate axis with the preset point as the center, and then determine within which preset direction the direction is located based on the angle value. The starting point of the first line direction between the two track points refers to selecting the previous track point of the two adjacent track points in the order of the track to be denoised.
[0064] See also Figure 3 , Figure 3 1 is a schematic diagram of an embodiment of plane direction division. In this embodiment, the case where P is 4 is used for description.
[0065] In this embodiment, the preset point O is taken as the origin, and the 360 degrees of the two-dimensional plane where O is located is divided into [-45°, 45°), [45°, 135°), [135°, 225°) and [225°, 315°), where 315° and -45° are the same angle. The preset point O can be any point in the two-dimensional plane.
[0066] Specifically, the preset direction in the range of [-45°, 45°) is Q1, and its angle is 0°. The preset direction in the range of [45°, 135°) is Q2, and its angle is 90°. The preset direction in the range of [135°, 225°) is Q3, and its angle is 180°. The preset direction in the range of [225°, 315°) is Q4, and its angle is 270°.
[0067] See also Figure 4 , Figure 4 It is a schematic diagram of an embodiment of direction replacement.
[0068] In this embodiment, when the adjacent trajectory points T 5 and trajectory point T 6 Direction T 5-6 The angle between the positive direction of the x-axis is 15°, which is within [-45°, 45°). The preset direction Q1 within [-45°, 45°) is used to replace the direction T between the two trajectory points. 5-6 , specifically, direction T 5-6 At the starting point coordinate T of the original trajectory 5 unchanged, direction T 5-6 The direction of is changed to be the same as the preset direction Q1, that is, the preset direction Q1 replaces the direction T 5-6 , wherein this step only replaces the direction between the trajectory points, the starting point of the direction is the original starting point, but the end point is not determined, wherein the determination of the end point is performed by step S24.
[0069] In a specific application scenario, by determining the first connection direction S 1-2 The first connecting line direction S is determined by the angle between the positive direction of the x-axis on the coordinate axis with the preset point as the center 1-2 The angle range to which it belongs, and the preset direction corresponding to the angle range is aligned with the first connection direction S 1-2 Replace and get the second connection direction C 1-2 Among them, the second connection direction C 1-2 Same as the corresponding preset direction.
[0070] Step S24: obtaining a vertical intersection point from the next first track point to the corresponding second connection direction, and replacing the next first track point with the vertical intersection point, so as to use the vertical intersection point as the second track point corresponding to the next first track point.
[0071] After the second connecting line direction is determined, the vertical intersection point from the next first track point corresponding to the second connecting line direction to the corresponding second connecting line direction is obtained, and the next first track point is replaced by the vertical intersection point, so as to use the vertical intersection point as the second track point corresponding to the next first track point. The vertical intersection point refers to a vertical line drawn in the second connecting line direction based on the next first track point, and the intersection point of the vertical line and the second connecting line direction is the vertical intersection point corresponding to the next first track point in the second connecting line direction, that is, the second track point.
[0072] The specific coordinates of the vertical intersection are calculated as follows:
[0073] The next trajectory point T is obtained by the following formula N To the vertical intersection point / second trajectory point T' of the corresponding preset direction N :
[0074] T′ N.x =(B*B*T N.x -A*B*T N.y -A*C) / (A*A+B*B) (1)
[0075] T′ N.y =(-A*B*T N.x +A*C*T N.y -B*C) / (A*A+B*B) (2)
[0076] Among them, AX+BY+C=0, B=-1,C=-A*T N-1.x -B*T N-1.y , P n Including [0, 1…, P-1], X, Y are variables, T′ N.x is the horizontal coordinate of the vertical intersection point, T′ N.y is the ordinate of the vertical intersection point, T N.x is the horizontal coordinate of the next trajectory point, T N.y is the ordinate of the next trajectory point, T N-1.x is the horizontal coordinate of the previous trajectory point between every two adjacent trajectory points, T N-1.y is the ordinate of the previous trajectory point between every two adjacent trajectory points.
[0077] The coordinates of the vertical intersection point, i.e., the second trajectory point, are determined by the above formula, so as to determine the starting point and the end point of the corresponding second connection direction in combination with the previous trajectory point and the second trajectory point. At this time, the replacement of the first connection direction of the denoised trajectory and the corresponding subsequent trajectory point is completed.
[0078] Step S25: Determine whether all first track points have been replaced.
[0079] After the first connection direction and the next first track point are replaced, it is determined whether all first track points have been replaced. If they have been replaced, step S27 is executed; if they have not been replaced, step S26 is executed.
[0080] In a specific application scenario, a preset number of replacements can be set, and then it can be determined whether all first track points have been replaced by judging whether the current number of replacements has reached the preset number of replacements. In another specific application scenario, it can be determined whether the last first track point of the track to be denoised is replaced by a second track point to determine whether all first track points have been replaced.
[0081] Step S26: taking the direction between the second track point and the next first track point as the first connection direction.
[0082] The direction between the replaced second track point and the next first track point is used as a new first connection direction. Then, based on the new first connection direction, step S23 is executed to replace the new first connection direction and the next first track point, and the cycle is repeated until all first connection directions and first track points are replaced.
[0083] In a specific application scenario, the first trajectory point T is 2 Replace with the second trajectory point T′ 2 After that, this step converts the second trajectory point T′ 2 and the next first trajectory point T 3 The direction between them is taken as the first connection direction S 2-3 Then, the steps S23 to S26 are cycled sequentially until all the first track points are replaced.
[0084] Step S27: Connect based on each second trajectory point and the second connection direction to obtain each replacement vector of the denoised trajectory; in response to the presence of a target vector between each replacement vector whose direction is discontinuous with that between adjacent vectors, eliminate the target vector and connect the starting point and the end point of the target vector; draw the trajectory to be denoised based on each replacement vector after eliminating the target vector to obtain the denoised trajectory.
[0085] After all the coordinates of the first trajectory points and the first connection direction are replaced, they are connected based on the second trajectory points and the second connection direction to obtain the replacement vectors of the denoised trajectory. In response to the presence of a target vector in the multiple replacement vectors that is discontinuous in direction with the adjacent vectors, that is, a burr protrusion appears on the trajectory, the target vector is removed and the starting point and the end point of the target vector are connected; the trajectory to be denoised is drawn based on the replacement vectors of the removed target vector to obtain the denoised trajectory.
[0086] See also Figure 5 , Figure 5 It is a schematic diagram of an embodiment of eliminating the second connecting line direction before and after the target vector.
[0087] If there are target vectors between the second connecting lines in vector group a that are discontinuous with the adjacent directions, all target vectors that are different from the adjacent directions are eliminated, and the starting point and the end point of the blank position after the target vector is eliminated are connected to construct a new vector, and the burr removal is completed to obtain vector group b. The trajectory is drawn based on the vector group b after denoising to obtain the denoised trajectory.
[0088] Through the above method, the trajectory denoising method of this embodiment takes the direction between the first first trajectory point and the next first trajectory point as the first line direction; replaces the first line direction with the corresponding preset direction to obtain the second line direction; then obtains the vertical intersection point from the next first trajectory point to the corresponding second line direction, replaces the next first trajectory point with the vertical intersection point, and takes the vertical intersection point as the second trajectory point corresponding to the next first trajectory point; takes the direction between the second trajectory point and the next first trajectory point as the first line direction; and repeatedly performs the step of replacing the first line direction with the corresponding preset direction to obtain the second line direction until all the first trajectory points and the first line directions are replaced, thereby replacing and denoising the first trajectory points and the first line direction of the trajectory to be denoised in turn, and standardizing the trajectory of the trajectory to be denoised by the preset direction corresponding to the second line direction and the second trajectory point corresponding to the preset direction, thereby realizing the denoising processing of the trajectory to be denoised and improving the smoothness of the trajectory to be denoised.
[0089] See also Figure 6 , Figure 6 This is a flow chart of another embodiment of the trajectory denoising method of the present application. This embodiment will be described by taking the trajectory points including only the first trajectory point as an example. Specifically, the following steps may be included:
[0090] Step S31: obtaining a plurality of first trajectory points of the trajectory to be denoised.
[0091] This step is the same as step S21 in the aforementioned embodiment. Please refer to the above text and will not be repeated here.
[0092] Step S32: taking the direction between every two adjacent first track points as the first connection direction.
[0093] Every two adjacent first track points among the plurality of first track points of the track to be denoised are connected according to the sequence of the track to be denoised, so as to obtain a first connection direction between every two adjacent first track points.
[0094] In a specific application scenario, when there are 7 track points in the denoised track, which are T1, T2, ..., T7 in sequence, the directions of the first connecting lines between every two adjacent first track points are: S 1-2 , S 2-3 , S 3-4 , S 4-5 , S 5-6 , S 6-7 , a total of 7 first connection directions.
[0095] Step S33: replacing each first connection direction with a corresponding preset direction to obtain each second connection direction.
[0096] The first connection directions are replaced by preset directions corresponding to the first connection directions to obtain second connection directions corresponding to the first connection directions.
[0097] In a specific application scenario, when the first connection directions are: S 1-2 , S 2-3 , S 3-4 , S 4-5 , S 5-6 , S 6-7 When each first connection direction is replaced by the corresponding preset direction, each second connection direction is obtained: C 1-2 , C 2-3 , C 3-4 , C 4-5 , C 5-6 , C 6-7 .
[0098] The method of replacing the first connection direction by the preset direction in this embodiment is the same as the replacement method in step S23 in the aforementioned embodiment. Please refer to the above text and will not be repeated here.
[0099] In this step, all first connection line directions may be replaced with corresponding second connection line directions to modify the direction between each two adjacent first track points in the track to be denoised.
[0100] Step S34: Obtain the vertical intersection point from the next first trajectory point of every two adjacent first trajectory points to the corresponding second connection direction, and use the vertical intersection point to replace the next trajectory point, so as to use the vertical intersection point as the second trajectory point corresponding to the next trajectory point, until all the first trajectory points are replaced.
[0101] After modifying the direction between each two adjacent first track points in the trajectory to be denoised, obtain the vertical intersection point from the next first track point of each two adjacent first track points to the corresponding second connection direction, and use the vertical intersection point to replace the next track point of each two adjacent first track points, so as to use the vertical intersection point as the second track point corresponding to the next track point, until all the first track points are replaced. At this point, the directions and coordinates between the track points on the trajectory to be denoised are replaced.
[0102] At this time, denoising of the trajectory to be denoised is achieved through the first first trajectory point and multiple second trajectory points.
[0103] The method of calculating the vertical intersection in this step is the same as that in the above-mentioned embodiment. Please refer to the above text and will not be repeated here.
[0104] Step S35: Connect based on each second trajectory point and the second connection direction to obtain each replacement vector of the denoised trajectory; in response to the presence of a target vector between each replacement vector whose direction is discontinuous with that between adjacent vectors, eliminate the target vector and connect the starting point and the end point of the target vector; draw the trajectory to be denoised based on each replacement vector after eliminating the target vector to obtain the denoised trajectory.
[0105] This step is the same as step S27 in the aforementioned embodiment. Please refer to the above text and will not be repeated here.
[0106] The trajectory denoising method of this embodiment is as follows: the direction between every two adjacent first trajectory points is used as the first connection direction; each first connection direction is replaced by a corresponding preset direction to obtain a second connection direction; a vertical intersection point from the latter first trajectory point of every two adjacent first trajectory points to the corresponding second connection direction is obtained, and the latter trajectory point is replaced by the vertical intersection point, so as to use the vertical intersection point as the second trajectory point corresponding to the latter trajectory point, until all the first trajectory points are replaced, thereby replacing and denoising the first trajectory point and the first connection direction of the trajectory to be denoised at one time, and the trajectory of the trajectory to be denoised is standardized by the preset direction corresponding to the second connection direction and the second trajectory point corresponding to the preset direction, so as to realize the denoising processing of the trajectory to be denoised and improve the smoothness of the trajectory to be denoised.
[0107] See also Figure 7 , Figure 7It is a framework diagram of an embodiment of a trajectory denoising device of the present application. The trajectory denoising device 70 includes an acquisition module 71, a first replacement module 72, a second replacement module 73 and a denoising module 74. The acquisition module 71 is used to acquire multiple first trajectory points of the trajectory to be denoised; the first replacement module 72 is used to replace the first connection direction between every two adjacent trajectory points with the corresponding preset direction in turn to obtain the second connection direction; the second replacement module 73 is used to calculate the second trajectory point of each first trajectory point in the corresponding second connection direction, and replace the corresponding first trajectory point with the second trajectory point; the denoising module 74 is used to denoise the trajectory to be denoised based on each second trajectory point and the second connection direction; wherein the trajectory point includes the first trajectory point and the second trajectory point.
[0108] The first replacement module 72 and the second replacement module 73 are also used to take the direction between two adjacent first trajectory points as the first connection direction; replace the first connection direction with the corresponding preset direction to obtain the second connection direction; obtain the vertical intersection of the latter first trajectory point of every two adjacent first trajectory points to the corresponding second connection direction, and replace the latter trajectory point with the vertical intersection to use the vertical intersection as the second trajectory point corresponding to the latter trajectory point; repeat the step of taking the direction between two adjacent first trajectory points as the first connection direction until all the first trajectory points are replaced.
[0109] The first replacement module 72 and the second replacement module 73 are also used to take the direction between the first first trajectory point and the next first trajectory point as the first connection direction; replace the first connection direction by the corresponding preset direction to obtain the second connection direction; obtain the vertical intersection from the next first trajectory point to the corresponding second connection direction, and replace the next first trajectory point with the vertical intersection to take the vertical intersection as the second trajectory point corresponding to the next first trajectory point; take the direction between the second trajectory point and the next first trajectory point as the first connection direction; repeat the steps of replacing the first connection direction by the corresponding preset direction to obtain the second connection direction until all the first trajectory points are replaced.
[0110] The first replacement module 72 is further configured to replace the corresponding first connection direction with the preset direction in response to an angle between the first connection direction and the preset direction being within an angle range of the preset direction.
[0111] The first replacement module 72 is further used to divide the two-dimensional plane where the trajectory to be denoised is located into preset angle ranges of preset directions with the origin as the center, and determine the middle angle of each angle range as the preset direction corresponding to the angle range.
[0112] The first replacement module 72 is also used to divide the two-dimensional plane where the trajectory to be denoised is located into P preset direction angle ranges with the origin as the center; wherein the angle range of each preset direction is [P n *360 / P-360 / 2P,P n *360 / P+360 / 2P), P n Including [0, 1…, P-1], P is a multiple of 4, including 4*n, and n is a positive integer.
[0113] The second replacement module 73 is also used to obtain the next trajectory point T by the following formula N To the perpendicular intersection point T' of the corresponding second connecting line direction N :
[0114] T′ N.x =(B*B*T N.x -A*B*T N.y -A*C) / (A*A+B*B) (1)
[0115] T′ N.y =(-A*B*T N.x +A*C*T N.y -B*C) / (A*A+B*B) (2)
[0116] Among them, AX+BY+C=0, B=-1,C=-A*T N-1.x -B*T N-1.y , P n Including [0, 1…, P-1], X, Y are variables, T′ N.x is the horizontal coordinate of the vertical intersection point, T′ N.y is the ordinate of the vertical intersection point, T N.x is the horizontal coordinate of the next trajectory point, T N.y is the ordinate of the next trajectory point, T N-1.x is the horizontal coordinate of the previous trajectory point between every two adjacent trajectory points, T N-1.y is the ordinate of the previous trajectory point between every two adjacent trajectory points.
[0117] The denoising module 74 is also used to eliminate the target vector and connect the starting point and the end point of the target vector in response to the presence of a target vector between each second connection line direction that is different from the direction between adjacent directions; draw the trajectory to be denoised based on the second connection line direction in which the target vector is eliminated to obtain the denoised trajectory.
[0118] The acquisition module 71 is further used to obtain a plurality of first trajectory points and their coordinates by identifying trajectory key points of the trajectory to be denoised; or to receive trajectory data of the trajectory to be denoised sent by a sensor to obtain a plurality of first trajectory points and their coordinates.
[0119] The above scheme can realize denoising and smoothing of the trajectory and improve the application effect of the trajectory.
[0120] See also Figure 8 , Figure 8 : is a schematic diagram of a framework of an embodiment of an electronic device of the present application. The electronic device 80 includes a memory 81 and a processor 82 coupled to each other, and the processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-mentioned trajectory denoising method embodiments. In a specific implementation scenario, the electronic device 80 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 80 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0121] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps of any of the above-mentioned speech detection method embodiments. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.
[0122] The above scheme can realize denoising and smoothing of the trajectory and improve the application effect of the trajectory.
[0123] See also Fig. 9 , Fig. 9 The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor, and the program instructions 901 are used to implement the steps of any of the above trajectory denoising method embodiments.
[0124] The above scheme can realize denoising and smoothing of the trajectory and improve the application effect of the trajectory.
[0125] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0126] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0127] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0128] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A trajectory denoising method, characterized in that, the trajectory denoising method includes: obtaining a plurality of first trajectory points of the trajectory to be denoised; successively replacing the first connection direction between every two adjacent first trajectory points with a corresponding preset direction to obtain a second connection direction; wherein, the coordinates of the first trajectory point that is the starting point of the first connection direction remain unchanged and serve as the starting point of the second connection direction; wherein, the two-dimensional plane where the trajectory to be denoised is located is evenly divided into angular ranges of a plurality of preset directions with the origin as the center, and the middle angle of each angular range is determined as the preset direction corresponding to the angular range; calculating second trajectory points of each of the first trajectory points in the corresponding second connection direction, and replacing the corresponding first trajectory points with the second trajectory points; denoising the trajectory to be denoised based on each of the second trajectory points and the second connection direction; wherein, connecting based on each of the second trajectory points and the second connection direction to obtain each replacement vector of the denoised trajectory; in response to the existence of a target vector among the replacement vectors whose direction is discontinuous with that between adjacent vectors, removing the target vector, and connecting the starting point and the ending point of the target vector; and drawing the trajectory to be denoised based on the replacement vectors after removing the target vector to obtain the denoised trajectory.
2. The trajectory denoising method according to claim 1, characterized in that, the step of successively replacing the first connection direction between every two adjacent first trajectory points with a corresponding preset direction to obtain a second connection direction; and the step of calculating second trajectory points of each of the first trajectory points in the corresponding second connection direction and replacing the corresponding first trajectory points with the second trajectory points include: taking the direction between every two adjacent first trajectory points as the first connection direction; replacing each of the first connection directions with a corresponding preset direction to obtain each of the second connection directions; obtaining the perpendicular intersection point of the latter first trajectory point among every two adjacent first trajectory points to the corresponding second connection direction, and using the perpendicular intersection point to replace the latter first trajectory point, so as to take the perpendicular intersection point as the second trajectory point corresponding to the latter first trajectory point until all the first trajectory points are replaced.
3. The trajectory denoising method according to claim 1, characterized in that, the step of successively replacing the first connection direction between every two adjacent first trajectory points with a corresponding preset direction to obtain a second connection direction; and the step of calculating second trajectory points of each of the first trajectory points in the corresponding second connection direction and replacing the corresponding first trajectory points with the second trajectory points include: taking the direction between the first first trajectory point and the latter first trajectory point as the first connection direction; replacing the first connection direction with a corresponding preset direction to obtain the second connection direction; obtaining the perpendicular intersection point of the latter first trajectory point to the corresponding second connection direction, and using the perpendicular intersection point to replace the latter first trajectory point, so as to take the perpendicular intersection point as the second trajectory point corresponding to the latter first trajectory point; Take the direction between the second trajectory point after replacing the first trajectory point and the next new first trajectory point as the new first connection direction; Repeat the step of replacing the first connection direction with the corresponding preset direction to obtain the second connection direction until all the first trajectory points are replaced.
4. The trajectory denoising method according to claim 2 or 3, characterized in that, The step of replacing the first connection direction with the corresponding preset direction to obtain the second connection direction includes: In response to the angle between the first connection direction and the preset direction being within the angular range of the preset direction, use the preset direction to replace the corresponding first connection direction.
5. The trajectory denoising method according to claim 1, characterized in that, The step of dividing the two-dimensional plane where the trajectory to be denoised is located into multiple angular ranges of preset directions with the origin as the center includes: Divide the two-dimensional plane where the trajectory to be denoised is located into P angular ranges of preset directions with the origin as the center; Among them, the angular range of each preset direction is [P n *360 / P - 360 / 2P, P n *360 / P + 360 / 2P), P n includes [0, 1, …, P - 1], P is a multiple of 4, including 4*n, where n is a positive integer.
6. The trajectory denoising method according to claim 2 or 3, characterized in that, The step of calculating the vertical intersection point includes: Obtain the subsequent first trajectory point T through the following formula N The perpendicular intersection point T to the corresponding second connection direction N ′: T N ′ .x = (B * B * T N.x - A * B * T N.y - A * C) / (A * A + B * B) (1) T N ′ .y = (-A * B * T N.x + A * C * T N.y - B * C) / (A * A + B * B) (2) where AX + BY + C = 0, B = -1, C = -A * T N-1.x -B * T N-1.y , P n includes [0, 1…, P - 1], X, Y are variables, T N ′ .x is the abscissa of the vertical intersection point, T N ′ .y is the ordinate of the vertical intersection point, T N.x is the abscissa of the latter first trajectory point, T N.y is the ordinate of the latter first trajectory point, T N-1.x is the abscissa of the previous first trajectory point in every two adjacent first trajectory points, T N-1.y is the ordinate of the previous first trajectory point in every two adjacent first trajectory points.
7. The trajectory denoising method according to claim 1, characterized in that, The step of obtaining multiple first trajectory points of the trajectory to be denoised includes: By identifying the trajectory key points of the trajectory to be denoised, obtain the multiple first trajectory points and their coordinates; or Receive the trajectory data of the trajectory to be denoised sent by the sensor, and obtain the multiple first trajectory points and their coordinates.
8. A trajectory denoising device, characterized in that, The trajectory denoising device includes: An acquisition module, configured to acquire multiple first trajectory points of the trajectory to be denoised; A first replacement module, configured to sequentially replace the first connection direction between every two adjacent first trajectory points with the corresponding preset direction to obtain a second connection direction; wherein, the coordinates of the first trajectory point that is the starting point of the first connection direction remain unchanged and serve as the starting point of the second connection direction; wherein, the two-dimensional plane where the trajectory to be denoised is located is divided into P angular ranges of preset directions with the origin as the center, and the middle angle of each angular range is determined as the preset direction corresponding to the angular range; A second replacement module, configured to calculate the second trajectory points of each of the first trajectory points in the corresponding second connection direction, and replace the corresponding first trajectory points with the second trajectory points; A denoising module, configured to denoise the trajectory to be denoised based on each of the second trajectory points and the second connection direction; wherein, connect based on each of the second trajectory points and the second connection direction to obtain each replacement vector of the denoised trajectory; in response to there being a target vector among the replacement vectors whose direction is discontinuous from that between adjacent vectors, remove the target vector, and connect the starting point and the ending point of the target vector; draw the trajectory to be denoised based on the replacement vectors after removing the target vector to obtain the denoised trajectory.
9. An electronic device, characterized in that, It includes a mutually coupled memory and a processor, and the processor is used to execute program instructions stored in the memory to implement the trajectory denoising method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which program instructions are stored, characterized in that when the program instructions are executed by a processor, the trajectory denoising method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cluster-analysis-based de-noising method and apparatus for trajectory
CN106650771A
Terminal positioning method and device
CN111246386A