Trajectory smoothing and prediction method and apparatus

CN117572981BActive Publication Date: 2026-10-30WESTERN CHINA SCI CITY INNOVATION CENT OF INTELLIGENT & CONNECTED VEHICLES (CHONGQING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311561719.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2026-10-30
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

然而,现有的中值滤波算法只是将数据排序后取中间值,鲁棒性较差,无法保证滑动轨迹的平滑处理效果

Benefits of technology

[0025]本发明提供的一种轨迹平滑与预测方法及其装置,与现有技术相比,能够获取触控设备上当前滑动轨迹点的轨迹数据,其中,所述轨迹数据包括x轴方向上的第一轨迹数据和y轴方向上的第二轨迹数据,之后根据所述当前滑动轨迹点的轨迹数据,以及所述当前滑动轨迹点对应的前两个滑动轨迹点的轨迹数据,判定所述当前滑动轨迹点是否为异常轨迹点,若所述当前滑动轨迹点为异常轨迹点,则过滤掉所述当前滑动轨迹点的轨迹数据,并对所述当前滑动轨迹点进行轨迹预测,若所述当前滑动轨迹点不是异常轨迹点,则确定位于所述当前滑动轨迹点之前的第一预设数量的滑动轨迹点分别对应的权重系数,并基于所述权重系数,对所述当前滑动轨迹点的轨迹数据进行滤波处理,得到平滑后的轨迹数据。由此可知,相比于传统中值滤波算法将一组数据排序后取中值的方式,本发明改进后的滤波算法增加了权重系数,从而增强了滤波算法的鲁棒性,此外,相比于传统对异常轨迹点加以抑制的方式,本发明将当前的滑动轨迹点抛弃,并基于之前的滑动轨迹点进行轨迹预测,从而能够彻底消除异常,即本发明通过将改进的滤波算法与预测算法相结合,能够消除轨迹噪声,改善轨迹精度,获得更加平滑的轨迹。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117572981B_ABST
    Figure CN117572981B_ABST
Patent Text Reader

Abstract

The application discloses a trajectory smoothing and predicting method and device, and relates to the technical field of touch control, which comprises the following steps: obtaining trajectory data of a current sliding trajectory point on a touch device; determining whether the current sliding trajectory point is an abnormal trajectory point according to the trajectory data of the current sliding trajectory point and the trajectory data of the previous two sliding trajectory points corresponding to the current sliding trajectory point; if the current sliding trajectory point is an abnormal trajectory point, filtering out the trajectory data of the current sliding trajectory point and performing trajectory prediction on the current sliding trajectory point; if the current sliding trajectory point is not an abnormal trajectory point, determining weight coefficients corresponding to the first preset number of sliding trajectory points before the current sliding trajectory point respectively, and performing filtering processing on the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data. The application can enhance the robustness of the filtering algorithm and ensure the smoothing processing effect of the sliding trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of touch technology, and more specifically, to a trajectory smoothing and prediction method and apparatus. Background Technology

[0002] Touch technology has now penetrated into various fields, such as corporate achievement displays, geographic information systems, the power industry, real estate sales centers, science and technology museums, and museums. People have increasingly higher demands for touch devices. For the most common operations like touch and swiping, accurate capture, tracking, and real-time response have become crucial. Furthermore, in today's fiercely competitive market, reducing resource consumption and lowering chip costs play a key role in enhancing product competitiveness.

[0003] Currently, median filtering algorithms are commonly used to smooth swipe trajectories on touch devices. However, existing median filtering algorithms simply sort the data and take the median value, resulting in poor robustness and failing to guarantee the smoothing effect of swipe trajectories. Summary of the Invention

[0004] This invention provides a trajectory smoothing and prediction method and apparatus, which mainly enhances the robustness of filtering algorithms and ensures the smoothing effect of sliding trajectories.

[0005] According to a first aspect of the present invention, a trajectory smoothing and prediction method is provided, comprising:

[0006] Acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction;

[0007] Based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, determine whether the current sliding trajectory point is an abnormal trajectory point;

[0008] If the current sliding trajectory point is an abnormal trajectory point, then the trajectory data of the current sliding trajectory point is filtered out, and trajectory prediction is performed on the current sliding trajectory point;

[0009] If the current sliding trajectory point is not an abnormal trajectory point, then the weight coefficients corresponding to the first preset number of sliding trajectory points before the current sliding trajectory point are determined, and the trajectory data of the current sliding trajectory point is filtered based on the weight coefficients to obtain smoothed trajectory data.

[0010] According to a second aspect of the present invention, another trajectory smoothing and prediction apparatus is provided, comprising:

[0011] The acquisition unit is used to acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction;

[0012] The determination unit is used to determine whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point.

[0013] The prediction unit is used to filter out the trajectory data of the current sliding trajectory point and predict the trajectory of the current sliding trajectory point if the current sliding trajectory point is an abnormal trajectory point.

[0014] The filtering unit is used to determine the weight coefficients corresponding to a first preset number of sliding trajectory points before the current sliding trajectory point if the current sliding trajectory point is not an abnormal trajectory point, and to filter the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data.

[0015] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, performs the following steps:

[0016] Acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction;

[0017] Based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, determine whether the current sliding trajectory point is an abnormal trajectory point;

[0018] If the current sliding trajectory point is an abnormal trajectory point, then the trajectory data of the current sliding trajectory point is filtered out, and trajectory prediction is performed on the current sliding trajectory point;

[0019] If the current sliding trajectory point is not an abnormal trajectory point, then the weight coefficients corresponding to the first preset number of sliding trajectory points before the current sliding trajectory point are determined, and the trajectory data of the current sliding trajectory point is filtered based on the weight coefficients to obtain smoothed trajectory data.

[0020] According to a fourth aspect of the present invention, an electronic device is provided, 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 perform the following steps:

[0021] Acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction;

[0022] Based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, determine whether the current sliding trajectory point is an abnormal trajectory point;

[0023] If the current sliding trajectory point is an abnormal trajectory point, then the trajectory data of the current sliding trajectory point is filtered out, and trajectory prediction is performed on the current sliding trajectory point;

[0024] If the current sliding trajectory point is not an abnormal trajectory point, then the weight coefficients corresponding to the first preset number of sliding trajectory points before the current sliding trajectory point are determined, and the trajectory data of the current sliding trajectory point is filtered based on the weight coefficients to obtain smoothed trajectory data.

[0025] This invention provides a trajectory smoothing and prediction method and apparatus, which, compared with the prior art, can acquire trajectory data of the current sliding trajectory point on a touch device. The trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction. Then, based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points, it is determined whether the current sliding trajectory point is an abnormal trajectory point. If the current sliding trajectory point is an abnormal trajectory point, its trajectory data is filtered out, and trajectory prediction is performed. If the current sliding trajectory point is not an abnormal trajectory point, weight coefficients are determined for a first preset number of sliding trajectory points preceding the current sliding trajectory point, and the trajectory data of the current sliding trajectory point is filtered based on these weight coefficients to obtain smoothed trajectory data. Therefore, compared to the traditional median filtering algorithm that sorts a set of data and takes the median, the improved filtering algorithm of this invention adds weight coefficients, thereby enhancing the robustness of the filtering algorithm. In addition, compared to the traditional method of suppressing abnormal trajectory points, this invention discards the current sliding trajectory point and performs trajectory prediction based on the previous sliding trajectory points, thereby completely eliminating anomalies. That is, by combining the improved filtering algorithm with the prediction algorithm, this invention can eliminate trajectory noise, improve trajectory accuracy, and obtain a smoother trajectory.

[0026] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This diagram illustrates a flow chart of a trajectory smoothing and prediction method provided by an embodiment of the present invention.

[0029] Figure 2 This diagram illustrates the overall process of smoothing and prediction provided by an embodiment of the present invention.

[0030] Figure 3 This diagram illustrates the structure of a trajectory smoothing and prediction device provided in an embodiment of the present invention.

[0031] Figure 4 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention is shown. Detailed Implementation

[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and drawings of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0034] Existing median filtering algorithms simply sort the data and take the median value, resulting in poor robustness and an inability to guarantee a smooth sliding trajectory.

[0035] To overcome the above-mentioned shortcomings, embodiments of the present invention provide a trajectory smoothing and prediction method, such as... Figure 1 As shown, the method includes:

[0036] Step 101: Obtain the trajectory data of the current sliding trajectory point on the touch device.

[0037] The trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction.

[0038] This invention is primarily applicable to scenarios involving smoothing sliding trajectories on touch devices. The executing entity of this invention is a device or equipment capable of smoothing sliding trajectories.

[0039] In this embodiment of the invention, before performing trajectory smoothing, parameter initialization is required. The initialization parameters may specifically include filter weight parameters, outlier detection thresholds, etc. When a user operates on a touch device, the trajectory data of each sliding trajectory point can be imported in a pipeline and divided into first trajectory data in the x-axis direction and second trajectory data in the y-axis direction, with each direction processed separately.

[0040] Step 102: Based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, determine whether the current sliding trajectory point is an abnormal trajectory point.

[0041] In this embodiment of the invention, before performing anomaly detection on the trajectory data of the newly imported current sliding trajectory point, it is necessary to determine the number of existing sliding trajectory points. If the number of existing sliding trajectory points is too small, anomaly detection cannot be performed, and filtering is directly applied. The method for this process includes: determining whether the number of existing sliding trajectory points is greater than a second preset amount; if the number of existing sliding trajectory points is greater than the second preset amount, determining whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point; if the number of existing sliding trajectory points is less than or equal to the second preset amount, directly filtering the trajectory data of the current sliding trajectory point. The second preset amount can be set according to actual business needs.

[0042] For example, if the second preset number is set to 3, and the number of existing sliding trajectory points is greater than 3, then anomaly detection is performed on the current sliding trajectory point; if the number of existing sliding trajectory points is less than or equal to 3, then the trajectory data of the current sliding trajectory point is directly filtered.

[0043] Furthermore, in the specific process of anomaly detection, anomaly detection can be performed based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points (the first sliding trajectory point and the second sliding trajectory point). Specifically, step 102 includes: calculating the first instantaneous velocity change between the current sliding trajectory point and the first sliding trajectory point based on the trajectory data corresponding to the current sliding trajectory point and the first sliding trajectory point; calculating the second instantaneous velocity change between the first sliding trajectory point and the second sliding trajectory point based on the trajectory data corresponding to the first sliding trajectory point and the second sliding trajectory point; and determining whether the current sliding trajectory point is an anomaly based on the first instantaneous velocity change and the second instantaneous velocity change.

[0044] Further, determining whether the current sliding trajectory point is an abnormal trajectory point based on the first instantaneous velocity change and the second instantaneous velocity change includes: calculating a first ratio between the first instantaneous velocity change and the second instantaneous velocity change, and a second ratio between the second instantaneous velocity change and the first instantaneous velocity change; if the first ratio or the second ratio is greater than a preset threshold, then the current sliding trajectory point is determined to be an abnormal trajectory point; if both the first ratio and the second ratio are less than the preset threshold, then the current sliding trajectory point is determined not to be an abnormal trajectory point.

[0045] Specifically, assume the current sliding trajectory point is the i-th point P. i The first two sliding trajectory points are P i-1 and P i-2 Calculate P respectively i With P i-1 The first instantaneous velocity change M, and P i-1 With P i-2 The second instantaneous velocity change N is calculated, and then the ratios M / N and N / M are calculated respectively. If either of the two ratios is greater than a set threshold, the current sliding trajectory point is determined to be an abnormal point; otherwise, the current sliding trajectory point is determined not to be an abnormal point.

[0046] Step 103: If the current sliding trajectory point is an abnormal trajectory point, then filter out the trajectory data of the current sliding trajectory point and perform trajectory prediction on the current sliding trajectory point.

[0047] In this embodiment of the invention, if the current sliding trajectory point is determined to be an abnormal point, the current sliding trajectory point is discarded, and the trajectory data (coordinate information) of the current sliding trajectory point is predicted based on the linear relationship between previous sliding trajectory points. Based on this, the method includes: determining the linear relationship between sliding trajectory points preceding the current sliding trajectory point; and predicting the trajectory of the current sliding trajectory point based on the linear relationship to obtain the predicted trajectory data corresponding to the current sliding trajectory point.

[0048] Step 104: If the current sliding trajectory point is not an abnormal trajectory point, determine the weight coefficients corresponding to the first preset number of sliding trajectory points before the current sliding trajectory point, and filter the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data.

[0049] In this embodiment of the invention, if it is determined that the current sliding trajectory point is not an anomaly, then the current sliding trajectory point needs to be filtered. During the filtering process, this embodiment uses trajectory data from a first preset number of sliding trajectory points preceding the current sliding trajectory point. Therefore, it is necessary to first determine the weight coefficients corresponding to the previous sliding trajectory points. The method for determining these weight coefficients includes: determining the correlation between each sliding trajectory point and the current sliding trajectory point based on the time interval between each of the preset number of sliding trajectory points and the current sliding trajectory point; and determining the weight coefficients corresponding to each sliding trajectory point based on the correlation.

[0050] Specifically, if it is determined that the current sliding trajectory point is not an abnormal point, a filtering process is performed. The filtering algorithm used in this embodiment of the invention is an improved median filtering algorithm. It is not simply sorting and taking the median value, but adding a weight coefficient. The weight coefficient can be determined according to the characteristics of the touch trajectory, that is, the most recent past situation, which will continue into the future to some extent. Therefore, the closer the trajectory point is to the current sliding trajectory point in time, the larger its corresponding weight coefficient is.

[0051] It should be noted that the weighting coefficients in the embodiments of the present invention can be set during initialization.

[0052] Furthermore, after determining the weighting coefficients, the trajectory data corresponding to each sliding trajectory point can be weighted and summed based on the weighting coefficients corresponding to each sliding trajectory point to obtain the smoothed trajectory data.

[0053] Furthermore, to ensure the smoothing effect, this embodiment of the invention can also perform secondary filtering to remove noise that was not filtered out in the primary filtering, thereby further improving the accuracy of the trajectory. The secondary filtering can also be performed using the same method as the primary filtering. Finally, the smoothed trajectory data is output in a pipeline.

[0054] The trajectory smoothing and prediction method provided in this invention enhances the robustness of the filtering algorithm by increasing the weight coefficients. Furthermore, compared to the traditional method of suppressing abnormal trajectory points, this invention discards the current sliding trajectory point and performs trajectory prediction based on the previous sliding trajectory points, thereby completely eliminating anomalies. In other words, by combining the improved filtering algorithm with the prediction algorithm, this invention can eliminate trajectory noise, improve trajectory accuracy, and obtain a smoother trajectory.

[0055] Furthermore, as Figure 1 In a specific implementation, embodiments of the present invention provide a trajectory smoothing and prediction device, such as... Figure 3 As shown, the device includes: a sampling unit 31, an anomaly detection unit 32, a prediction unit 33, a smoothing unit 34, and an output unit 35.

[0056] The sampling unit 31 can be used to acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction.

[0057] The anomaly detection unit 32 can be used to determine whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point.

[0058] The prediction unit 33 can be used to filter out the trajectory data of the current sliding trajectory point and predict the trajectory of the current sliding trajectory point if the current sliding trajectory point is an abnormal trajectory point.

[0059] The smoothing unit 34 can be used to determine the weight coefficients corresponding to a first preset number of sliding trajectory points before the current sliding trajectory point if the current sliding trajectory point is not an abnormal trajectory point, and to filter the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data.

[0060] The output unit 35 can be used to output the smoothed trajectory data.

[0061] In a specific application scenario, when the first two sliding trajectory points include the first sliding trajectory point and the second sliding trajectory point, the anomaly detection unit 32 includes: a calculation module and a judgment module.

[0062] The calculation module can be used to calculate the first instantaneous velocity change between the current sliding trajectory point and the first sliding trajectory point based on the trajectory data corresponding to the current sliding trajectory point and the first sliding trajectory point, respectively.

[0063] The calculation module can also be used to calculate the second instantaneous velocity change of the first sliding trajectory point and the second sliding trajectory point based on the trajectory data corresponding to the first sliding trajectory point and the second sliding trajectory point, respectively.

[0064] The determination module can be used to determine whether the current sliding trajectory point is an abnormal trajectory point based on the first instantaneous velocity change and the second instantaneous velocity change.

[0065] Furthermore, the determination module can be specifically used to calculate a first ratio between the first instantaneous velocity change and the second instantaneous velocity change, and a second ratio between the second instantaneous velocity change and the first instantaneous velocity change; if the first ratio or the second ratio is greater than a preset threshold, then the current sliding trajectory point is determined to be an abnormal trajectory point; if both the first ratio and the second ratio are less than the preset threshold, then the current sliding trajectory point is determined not to be an abnormal trajectory point.

[0066] In a specific application scenario, the prediction unit 33 can be used to determine the linear relationship between sliding trajectory points located before the current sliding trajectory point; based on the linear relationship, the current sliding trajectory point is used to predict the trajectory, thereby obtaining the predicted trajectory data corresponding to the current sliding trajectory point.

[0067] In a specific application scenario, the smoothing unit 34 can be specifically used to determine the correlation between each sliding trajectory point and the current sliding trajectory point based on the time interval between each sliding trajectory point and the current sliding trajectory point in the preset number of sliding trajectory points; and to determine the weight coefficient corresponding to each sliding trajectory point based on the correlation.

[0068] Furthermore, the smoothing unit 34 can also be specifically used to perform weighted summation of the trajectory data corresponding to each sliding trajectory point based on the weight coefficients corresponding to each sliding trajectory point, so as to obtain smoothed trajectory data.

[0069] In specific application scenarios, the device also includes a determination unit.

[0070] The determination unit can be used to determine whether the number of existing sliding trajectory points is greater than a second preset amount; if the number of existing sliding trajectory points is greater than the second preset amount, then based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point, it can determine whether the current sliding trajectory point is an abnormal trajectory point; if the number of existing sliding trajectory points is less than or equal to the second preset amount, then the trajectory data of the current sliding trajectory point is directly filtered.

[0071] It should be noted that other corresponding descriptions of the functional modules involved in the trajectory smoothing and prediction device provided in this embodiment of the invention can be found in [reference]. Figure 1 The corresponding description of the method shown will not be repeated here.

[0072] Based on the above, Figure 1 Accordingly, this embodiment of the invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the following steps: acquiring trajectory data of a current sliding trajectory point on a touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction; determining whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point; if the current sliding trajectory point is an abnormal trajectory point, filtering out the trajectory data of the current sliding trajectory point and performing trajectory prediction on the current sliding trajectory point; if the current sliding trajectory point is not an abnormal trajectory point, determining the weight coefficients corresponding to a first preset number of sliding trajectory points preceding the current sliding trajectory point, and filtering the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data.

[0073] Based on the above, Figure 1 The method shown and as Figure 3 The embodiment of the device shown in the invention also provides a physical structural diagram of an electronic device, such as... Figure 4As shown, the electronic device includes a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor. Both the memory 42 and the processor 41 are mounted on a bus 43. When the processor 41 executes the program, it performs the following steps: acquiring trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction; determining whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point; if the current sliding trajectory point is an abnormal trajectory point, filtering out the trajectory data of the current sliding trajectory point and performing trajectory prediction on the current sliding trajectory point; if the current sliding trajectory point is not an abnormal trajectory point, determining the weight coefficients corresponding to a first preset number of sliding trajectory points preceding the current sliding trajectory point, and filtering the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data.

[0074] In this embodiment of the invention, the improved filtering algorithm increases the weight coefficient, thus enhancing the robustness of the filtering algorithm. In addition, compared with the traditional method of suppressing abnormal trajectory points, this invention discards the current sliding trajectory point and performs trajectory prediction based on the previous sliding trajectory point, thereby completely eliminating anomalies. That is, by combining the improved filtering algorithm with the prediction algorithm, this invention can eliminate trajectory noise, improve trajectory accuracy, and obtain a smoother trajectory.

[0075] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of one embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing the present invention.

[0076] Those skilled in the art will understand that the modules in the apparatus of the embodiments can be distributed in the apparatus of the embodiments as described in the embodiments, or they can be located in one or more devices different from this embodiment with corresponding changes. The modules of the above embodiments can be combined into one module, or they can be further divided into multiple sub-modules.

[0077] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A trajectory smoothing and prediction method, characterized in that, include: Acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction; Based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, determine whether the current sliding trajectory point is an abnormal trajectory point; If the current sliding trajectory point is an abnormal trajectory point, then the trajectory data of the current sliding trajectory point is filtered out, and trajectory prediction is performed on the current sliding trajectory point; If the current sliding trajectory point is not an abnormal trajectory point, then the weight coefficients corresponding to a first preset number of sliding trajectory points preceding the current sliding trajectory point are determined, and the trajectory data of the current sliding trajectory point is filtered based on the weight coefficients to obtain smoothed trajectory data; wherein, the step of filtering the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data includes: weighting the trajectory data corresponding to each sliding trajectory point based on the weight coefficients corresponding to each of the preset number of sliding trajectory points to obtain smoothed trajectory data.

2. The method according to claim 1, characterized in that, When the first two sliding trajectory points include the first sliding trajectory point and the second sliding trajectory point, the step of determining whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the first two sliding trajectory points corresponding to the current sliding trajectory point includes: Based on the trajectory data corresponding to the current sliding trajectory point and the first sliding trajectory point, calculate the first instantaneous velocity change between the current sliding trajectory point and the first sliding trajectory point; Based on the trajectory data corresponding to the first sliding trajectory point and the second sliding trajectory point, calculate the second instantaneous velocity change of the first sliding trajectory point and the second sliding trajectory point respectively; Based on the first instantaneous velocity change and the second instantaneous velocity change, it is determined whether the current sliding trajectory point is an abnormal trajectory point.

3. The method according to claim 2, characterized in that, Based on the first instantaneous velocity change and the second instantaneous velocity change, determining whether the current sliding trajectory point is an abnormal trajectory point includes: Calculate the first ratio between the first instantaneous velocity change and the second instantaneous velocity change, and the second ratio between the second instantaneous velocity change and the first instantaneous velocity change, respectively. If the first ratio or the second ratio is greater than a preset threshold, then the current sliding trajectory point is determined to be an abnormal trajectory point; If both the first ratio and the second ratio are less than the preset threshold, then the current sliding trajectory point is determined not to be an abnormal trajectory point.

4. The method according to claim 1, characterized in that, The trajectory prediction of the current sliding trajectory point includes: Determine the linear relationship between sliding trajectory points preceding the current sliding trajectory point; Based on the linear relationship, trajectory prediction is performed on the current sliding trajectory point to obtain the predicted trajectory data corresponding to the current sliding trajectory point.

5. The method according to claim 1, characterized in that, The determination of the weight coefficients corresponding to the first preset number of sliding trajectory points located before the current sliding trajectory point includes: Based on the time interval between each sliding trajectory point and the current sliding trajectory point in the preset number of sliding trajectory points, the association relationship between each sliding trajectory point and the current sliding trajectory point is determined; Based on the aforementioned correlation, the weight coefficients corresponding to each sliding trajectory point are determined.

6. The method according to any one of claims 1-5, characterized in that, Before determining whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point, the method further includes: Determine whether the number of existing sliding trajectory points is greater than the second preset amount; If the number of existing sliding trajectory points is greater than the second preset amount, then based on the trajectory data of the current sliding trajectory point and the trajectory data of the two previous sliding trajectory points corresponding to the current sliding trajectory point, it is determined whether the current sliding trajectory point is an abnormal trajectory point. If the number of existing sliding trajectory points is less than or equal to the second preset number, then the trajectory data of the current sliding trajectory point is directly filtered.

7. A trajectory smoothing and prediction device, characterized in that, include: A sampling unit is used to acquire trajectory data of the current sliding trajectory point on the touch device, wherein the trajectory data includes first trajectory data in the x-axis direction and second trajectory data in the y-axis direction; An anomaly detection unit is used to determine whether the current sliding trajectory point is an abnormal trajectory point based on the trajectory data of the current sliding trajectory point and the trajectory data of the two preceding sliding trajectory points corresponding to the current sliding trajectory point. The prediction unit is used to filter out the trajectory data of the current sliding trajectory point and predict the trajectory of the current sliding trajectory point if the current sliding trajectory point is an abnormal trajectory point. A smoothing unit is configured to, if the current sliding trajectory point is not an abnormal trajectory point, determine the weight coefficients corresponding to a first preset number of sliding trajectory points preceding the current sliding trajectory point, and filter the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data; wherein, the smoothing unit filters the trajectory data of the current sliding trajectory point based on the weight coefficients to obtain smoothed trajectory data, and is configured to: perform weighted processing on the trajectory data corresponding to each sliding trajectory point based on the weight coefficients corresponding to each of the preset number of sliding trajectory points to obtain smoothed trajectory data.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data filtering and smoothing method applied to touch screen

    CN101639896A

  • Anti-noise method and device of touch screen

    CN105045426A