A method of predicting a touch trajectory and an apparatus thereof
By updating the predicted state transition matrix in the Kalman filter and utilizing the angle between the movement direction of the touch point and the coordinate axis, the problem of inaccurate prediction of complex touch trajectories in the prior art is solved, and more accurate touch trajectory prediction is achieved.
Patent Information
- Application Number
- CN202211158001.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-22
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-09-22
AI Technical Summary
Existing touch trajectory prediction algorithms do not have high accuracy in predicting complex touch trajectories such as curved and large hand trajectories.
The predicted state transition matrix is updated using a Kalman filter. By obtaining the angle between the movement direction of the touch point and the coordinate axis, the predicted state matrix is adjusted in real time to better predict the movement direction of the touch point.
It improves the prediction accuracy for linear and complex touch trajectories, especially for curved and large hand trajectories.
Smart Images

Figure CN115509386B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the touch technology field, and in particular to a touch trajectory prediction method and device thereof. BACKGROUND
[0002] The existing touch trajectory prediction algorithm often has good prediction results only for straight-line trajectories, but with the optimization of touch algorithms, complex touch trajectories such as curved touch trajectories and large-palm touch trajectories are also increasingly applied, but the prediction accuracy for complex touch trajectories is not high. SUMMARY
[0003] The present application provides a touch trajectory prediction method and device thereof.
[0004] The first aspect of the present application provides a touch trajectory prediction method, comprising:
[0005] obtaining an optimal touch state of a current touch point output by a Kalman filter;
[0006] from the optimal touch state, obtaining an angle between a moving direction of the current touch point and a first coordinate axis;
[0007] updating a prediction state transition matrix of the Kalman filter according to the angle of the current touch point;
[0008] obtaining a predicted touch state of a next touch point according to the optimal touch state of the current touch point and the prediction state transition matrix.
[0009] In the present application, the prediction state transition matrix in the Kalman filter can be updated in real time according to the angle associated with the moving direction, which can continuously adjust the prediction state transition matrix during the prediction process, so that the prediction state matrix can reflect the state transition information of the moving direction, thereby better predicting the moving direction of the touch point, rather than continuing to predict the next touch point along the moving direction of the previous touch point, so that not only the straight-line touch trajectory has good prediction effect, but also the prediction result for complex touch trajectories is also relatively accurate.
[0010] The second aspect of the present application provides a touch trajectory prediction device, comprising:
[0011] a first obtaining module configured to obtain an optimal touch state of a current touch point output by a Kalman filter;
[0012] a second obtaining module configured to obtain an angle between a moving direction of the current touch point and a first coordinate axis from the optimal touch state;
[0013] a first updating module, configured to update a prediction state transition matrix of the Kalman filter according to the included angle of the current touch point;
[0014] a third obtaining module, configured to obtain a predicted touch state of a next touch point according to the optimal touch state of the current touch point and the prediction state transition matrix.
[0015] The third aspect of the present application provides an electronic device, comprising the touch trajectory prediction apparatus provided in the second aspect of the present application.
[0016] The fourth aspect of the present application provides a touch chip, comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to implement the touch trajectory prediction method provided in the first aspect of the present application.
[0017] The fifth aspect of the present application provides a non-transitory computer readable storage medium, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the touch trajectory prediction method provided in the first aspect of the present application.
[0018] The sixth aspect of the present application provides a computer program product, comprising a computer program, which, when executed by a processor in a communication device, implements the touch trajectory prediction method provided in the first aspect of the present application.
[0019] Additional aspects and advantages of the present application will be in part apparent and in part pointed out hereinafter. BRIEF DESCRIPTION OF DRAWINGS
[0020] The above and / or additional aspects and advantages of the present application will become apparent and be readily appreciated from the following description, including the accompanying drawings, wherein:
[0021] Figure 1 A flowchart of a touch trajectory prediction method provided by an embodiment of the present application;
[0022] Figure 2 A flowchart of another touch trajectory prediction method provided by an embodiment of the present application;
[0023] Figure 3 A flowchart of another touch trajectory prediction method provided by an embodiment of the present application;
[0024] Figure 4 A structural diagram of a touch trajectory prediction apparatus provided by an embodiment of the present application;
[0025] Figure 5 FIG. 8 is a structural schematic diagram of another touch trajectory prediction device according to an embodiment of the present application;
[0026] Figure 6 FIG. 9 is a structural schematic diagram of an electronic device according to an embodiment of the present application;
[0027] Figure 7 FIG. 10 is a structural schematic diagram of another electronic device according to an embodiment of the present application;
[0028] Figure 8 FIG. 11 is a structural schematic diagram of a touch chip according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] The exemplary embodiments are described herein with reference to the accompanying drawings, in which examples are shown. The description of the exemplary embodiments is intended to be illustrative, and not to limit the scope of the present application, as defined by the appended claims. Many modifications and variations to the exemplary embodiments are possible and are within the scope of the present application, as those skilled in the art will understand in light of the detailed description. Accordingly, it is to be understood that such modifications and variations can be made to the exemplary embodiments disclosed herein, and that such modifications and variations are also within the scope of this application.
[0030] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0031] It is to be understood that the singular forms "a", "an", and "the" include plural referents unless the context clearly dictates otherwise. It is to be further understood that the terms "comprise", "comprising", "comprises", "including", "includes" or "contain" or "containing" when used in this specification, specify the presence of stated features, integers, steps, operations, elements, or components but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, or groups thereof.
[0032] Embodiments of the present application are described in detail below with reference to the attached drawing figures, wherein the same or like reference numerals and characters are used throughout the drawing figures to denote same or like components. The embodiments described below are merely examples for explaining the present application and are not intended to limit the present application.
[0033] A touch trajectory prediction method and device thereof according to an embodiment of the present application are described below with reference to the accompanying drawings.
[0034] Please refer to Figure 1 , Figure 1 A flowchart of a method for predicting a touch trajectory is provided in an embodiment of the present application. As shown in Figure 1 , the method can include but is not limited to the following steps:
[0035] S101, obtaining an optimal touch state of a current touch point output by a Kalman filter.
[0036] The method for predicting a touch trajectory provided in the embodiment of the present application can be applied to an electronic device with a touch screen. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a wearable device, a smart television, a vehicle-mounted computer, etc.
[0037] In the embodiment of the present application, the electronic device can track a touch trajectory on the touch screen. In some implementations, a screen-under sensor can be arranged below the touch screen of the electronic device, and the touch point can be sensed through the screen-under sensor, and then the touch trajectory can be tracked.
[0038] The electronic device can track a touch trajectory through a Kalman filter, that is, predict the state of a next touch point based on the state of a current touch point. In the embodiment of the present application, in order to increase the estimation accuracy of the Kalman filter on the state of the touch point, a plurality of dimensions of the touch state of the touch point can be predefined.
[0039] Optionally, the touch state of the touch point can include the position of the touch point, the moving speed of the touch point, the moving direction of the touch point, the angular speed of the moving direction of the touch point, and the angle between the moving direction and a specified coordinate axis. The position of the touch point includes the coordinates of the first coordinate axis and the second coordinate axis respectively. The first coordinate axis can be the X axis, and the second coordinate axis can be the Y axis.
[0040] For example, x can represent the X axis coordinate (horizontal coordinate) of the touch point; y can represent the Y axis coordinate (vertical coordinate) of the touch point; θ can represent the angle between the moving direction of the touch point and the X coordinate axis; v linear may represent the moving speed; ω can represent the angular speed. The touch state of the touch point can represent a touch state matrix X:
[0041]
[0042] In the embodiment of the present application, the Kalman filter outputs an optimal touch point of a current touch point, and the optimal touch point is the basis for predicting a next touch point, that is, after the Kalman filter outputs the optimal touch point of the current touch point, the model parameter update of the Kalman filter can be entered to predict the touch trajectory of the next touch point, so as to predict the predicted touch state of the next touch point.
[0043] S102, obtain an angle between a moving direction of the current touch point and the first coordinate axis from the optimal touch state of the current touch point.
[0044] In the embodiment of the application, the angle θ between the moving direction of the current touch point and the first coordinate axis, such as the X axis, can be obtained from the optimal touch state of the current touch point. It should be noted that the touch point changes in real time during the user's sliding operation, and accordingly the moving direction of the touch point at different positions also changes, and accordingly the angle between the moving direction and the first coordinate axis is different.
[0045] S103, update the prediction state transition matrix of the Kalman filter according to the angle of the current touch point.
[0046] The prediction formula of the touch state of the next touch point based on the current touch point is as follows:
[0047] ω k+1 =ω k
[0048]
[0049] θ k+1 =θ k +ω k+1 δt
[0050]
[0051]
[0052] ω k+1 may represent the angular velocity of the movement of the next touch point; ω k may represent the angular velocity of the movement of the current touch point; may represent the moving speed of the next touch point; may represent the moving speed of the current touch point; θ k+1 may represent the angle between the moving direction of the next touch point and the X axis; θ k may represent the angle between the moving direction of the current touch point and the X axis; x k+1 may represent the coordinate of the X axis of the next touch point; x k may represent the coordinate of the X axis of the current touch point; y k+1 may represent the coordinate of the Y axis of the next touch point; y k may represent the coordinate of the Y axis of the current touch point.
[0053] In the embodiment of the application, since the prediction model is a nonlinear model, it can be linearly approximated to a prediction state transition matrix A:
[0054]
[0055] Since the angle between the moving direction of the touch point at different time and the horizontal coordinate is different, the prediction state transition matrix A is also adjusted accordingly. Since the Kalman filter in the embodiment of the present application can adjust the prediction state transition matrix based on the moving direction when predicting the trajectory, that is, the state transition matrix can also reflect the state transition information in the moving direction, so that the moving direction of the touch point can be better predicted, instead of continuing to predict the next touch point along the moving direction of the last touch point, so that not only the straight-line touch trajectory has better prediction effect, but also the prediction result of the complex touch trajectory is also more accurate.
[0056] In S104, the predicted touch state of the next touch point is obtained according to the optimal touch state of the current touch point and the prediction state transition matrix.
[0057] The prediction formula of the next touch point of the Kalman filter is as follows:
[0058]
[0059] wherein, represents the predicted touch state of the next touch point, which can be called a predicted touch state matrix; represents the optimal touch state of the current touch point, which can be called an optimal touch state matrix; A represents a prediction state transition matrix.
[0060] That is, after the current optimal touch state and the prediction state transition matrix are determined, the Kalman filter can determine the predicted touch state of the next touch point based on the above disclosure.
[0061] In the embodiment of the present application, the optimal touch state of the current touch point output by the Kalman filter is obtained, the angle between the moving direction of the current touch point and the first coordinate axis is obtained from the optimal touch state, the prediction state transition matrix of the Kalman filter is updated according to the angle, and the predicted touch state of the next touch point is obtained according to the optimal touch state of the current touch point and the prediction state transition matrix. In the present application, the prediction state transition matrix in the Kalman filter can be updated in real time according to the angle associated with the moving direction, which can continuously adjust the prediction state transition matrix during the prediction process, so that the prediction state matrix can reflect the state transition information in the moving direction, thereby better predicting the moving direction of the touch point, instead of continuing to predict the next touch point along the moving direction of the last touch point, so that not only the straight-line touch trajectory has better prediction effect, but also the prediction result of the complex touch trajectory is also more accurate.
[0062] Please refer to Figure 2 , Figure 2 A flowchart of a touch trajectory prediction method provided by the embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the touch trajectory prediction method provided by the embodiment of the present application includes the following steps:Figure 2 The method can include, but is not limited to, the following steps:
[0063] S201, obtaining an optimal touch state of a current touch point output by a Kalman filter.
[0064] S202, obtaining an angle between a moving direction of the current touch point and a first coordinate axis from the optimal touch state.
[0065] S203, updating a prediction state transition matrix of the Kalman filter according to the angle corresponding to the current touch point.
[0066] S204, obtaining a predicted touch state of a next touch point according to the optimal touch state of the current touch point and the prediction state transition matrix.
[0067] For specific descriptions of steps S201-S204, refer to the descriptions of the related contents in the above embodiments, which will not be repeated here.
[0068] S205, obtaining an observation position of the next touch point, and determining an observation touch state of the next touch point according to the observation position of the next touch point.
[0069] In the embodiments of the present application, the electronic device can obtain the observation position of the next touch point, i.e., the actual position of the next touch point, through the under-screen sensor. After obtaining the observation position of the next touch point, other observation parameters of the next touch point can be determined according to the observation position of the next touch point to obtain the observation touch state of the next touch point.
[0070] The other observation parameters can include: an angle between a moving direction of the next touch point and the first coordinate axis, e.g., the X axis, an observation moving speed of the next touch point, and an observation angular velocity of the next touch point.
[0071] It should be noted that the observation touch state of the touch point and the optimal touch state of the touch point have the same structure, and the observation touch state can be defined as Z:
[0072]
[0073] wherein x' and y' in Z are the horizontal coordinate and the vertical coordinate of the next touch point reported by the touch screen; θ' can represent the observation angle between the moving direction of the next touch point and the X axis; v linear ' can represent the observation moving speed of the next touch point; and ω' can represent the observation angular velocity of the next touch point.
[0074] As a possible implementation, the observed position of the current touch point is obtained, and the observed angle between the moving direction of the next touch point and the first coordinate axis is obtained according to the observed position of the current touch point and the observed position of the next touch point. That is, for the moving direction θ' of the (k+1)th touch, it is obtained by calculating the angle between the vector formed by the kth touch point and the (k+1)th touch point and the horizontal axis.
[0075] Optionally, the observed moving speed and the observed angular speed of the next touch point are obtained according to the observed position of the current touch point and the observed position of the next touch point.
[0076] In some implementations, the determination of the observed moving speed includes: obtaining the distance between the two touch points according to the observed position of the current touch point and the observed position of the next touch point, obtaining the moving time from the current touch point to the next touch point, and determining the observed moving speed of the next touch point according to the distance and the moving time. That is, for the observed moving speed v' of the (k+1)th touch, it is obtained by dividing the distance between the kth touch point and the (k+1)th touch point by the moving time. linear
[0077] In some implementations, the determination of the observed angular speed includes: obtaining the angular interval between the two touch points according to the observed position of the current touch point and the observed position of the next touch point, obtaining the moving time from the current touch point to the next touch point, and determining the observed angular speed of the next touch point according to the angular interval and the moving time. That is, for the observed angular speed ω' of the (k+1)th touch, it is obtained by dividing the angular interval between the kth touch point and the (k+1)th touch point by the moving time.
[0078] S206, according to the observed touch state of the next touch point, the predicted touch state of the next touch point is corrected to obtain the optimal touch state of the next touch point.
[0079] After obtaining the observed touch state of the next touch point, the Kalman gain of the Kalman filter can be adjusted according to the actual touch state of the next touch point to optimize the Kalman filter, thereby improving the accuracy of subsequent prediction of the Kalman filter.
[0080] Optionally, the Kalman gain matrix of the Kalman filter corresponding to the next touch point is obtained. Further, according to the Kalman gain matrix, the preset observed state transition matrix and the observed touch state of the next touch point, the predicted touch state of the next touch point is corrected to obtain the optimal touch state of the next touch point output by the Kalman filter, so as to continue to predict the subsequent touch points.
[0081] S207, the next touch point is updated as a new current touch point.
[0082] After updating the next touch point to the new current touch point, you can return to step S201 to continue trajectory prediction for the newly detected next touch point.
[0083] In this application, the predicted state transition matrix in the Kalman filter can be updated in real time according to the angle associated with the movement direction. It can continuously adjust the predicted state transition matrix during the prediction process, so that the predicted state matrix can reflect the state transition information of the movement direction. This allows for better prediction of the movement direction of the touch point, rather than continuing to predict the next touch point along the movement direction of the previous touch point. Therefore, it not only has a better prediction effect for linear touch trajectories, but also has more accurate prediction results for complex touch trajectories.
[0084] In this embodiment, a novel Kalman filter model is proposed. This model incorporates the direction of movement and angular velocity to predict the trajectory of the touch point, making the model's output more consistent with real-world motion and resulting in more accurate predictions. In applications based on these predictions, the accuracy of touch point mapping and tracking can be improved.
[0085] Based on the above embodiments, after obtaining the observed touch state of the next touch point, the predicted touch state of the next touch point can be corrected according to the observed touch state to obtain the optimal touch state of the next touch point. For details, please refer to [link to relevant documentation]. Figure 3 The process of correcting the predicted touch state for the next touch point includes, but is not limited to, the following steps:
[0086] S301, determine the covariance matrix of the Kalman filter corresponding to the current touch point and the preset prediction error matrix.
[0087] The Kalman filter can include a covariance matrix P, an observation state transition matrix H, a prediction error matrix Q, and an observation error matrix R from the under-screen sensor. The observation state transition matrix H, the Kalman filter error matrix Q, and the under-screen sensor observation error matrix R can be pre-configured as a fixed matrix according to actual needs. For example, the observation state transition matrix H can be:
[0088]
[0089] After completing a prediction, the Kalman filter outputs a covariance matrix corresponding to the current touch point. It should be noted that the covariance matrix of this Kalman filter is initialized to 0 at the beginning and can be continuously updated during the prediction process.
[0090] S302, based on the predicted state transition matrix, the covariance matrix corresponding to the current touch point, and the prediction error matrix, obtain the covariance matrix of the Kalman filter corresponding to the next touch point.
[0091] Optionally, the covariance matrix of the Kalman filter corresponding to the next touch point can be updated using the following formula:
[0092]
[0093] in, P represents the covariance matrix corresponding to the next touch point; k A represents the covariance matrix corresponding to the current touch point; A represents the predicted state torque matrix after the Kalman filter update; A T denoted as the transpose of the predicted state torque matrix A; Q represents the preset prediction error matrix of the Kalman filter.
[0094] S303, based on the covariance matrix, prediction error matrix, preset observation error matrix and prediction state transition matrix corresponding to the next touch point, determine the Kalman gain matrix of the Kalman gain matrix corresponding to the next touch point.
[0095] Optionally, the Kalman gain matrix of the Kalman filter corresponding to the next touch point can be updated using the following formula:
[0096]
[0097] Among them, K k+1 This represents the Kalman gain matrix corresponding to the next touch point; H represents the covariance matrix corresponding to the next touch point; H represents the observation state torque matrix of the Kalman filter; H T H represents the transpose of the observed state torque matrix; R represents the observation error matrix preset by the under-screen sensor.
[0098] S304. Based on the Kalman gain matrix, the preset observation state transition matrix, and the observed touch state, the predicted touch state of the next touch point is corrected to obtain the optimal touch state of the next touch point.
[0099] Optionally, the predicted touch state of the next touch point can be corrected using the following formula:
[0100]
[0101] in, This represents the optimal touch state for the next touch point as output by the Kalman filter. Indicates the predicted touch state of the next touch point; K k+1 Z represents the Kalman gain matrix corresponding to the next touch point; k+1H represents the observed touch state of the next touch point; H represents the observed state torque matrix of the Kalman filter.
[0102] Furthermore, the correction process provided in the embodiments of this application may also include the following steps:
[0103] S305, based on the Kalman gain matrix and the observation state transition matrix, corrects the covariance matrix corresponding to the next touch point to obtain the final covariance matrix corresponding to the next touch point.
[0104] Optionally, the covariance matrix of the next touch point can be corrected using the following formula:
[0105]
[0106] Among them, P k+1 K represents the final covariance matrix after the next touch point correction; k+1 This represents the Kalman gain matrix corresponding to the next touch point; H represents the covariance matrix corresponding to the next touch point; H represents the observation state torque matrix of the Kalman filter.
[0107] In this application, the predicted state transition matrix in the Kalman filter can be updated in real time according to the angle associated with the movement direction. It can continuously adjust the predicted state transition matrix during the prediction process, so that the predicted state matrix can reflect the state transition information of the movement direction. This allows for better prediction of the movement direction of the touch point, rather than continuing to predict the next touch point along the movement direction of the previous touch point. Therefore, it not only has a better prediction effect for linear touch trajectories, but also has more accurate prediction results for complex touch trajectories.
[0108] It should be noted that the embodiments provided in this application can be applied to touch fields such as trajectory prediction, touch point tracking, gesture prediction, stroke recognition, and handwriting recognition.
[0109] Figure 4 This is a schematic diagram of the structure of a touch trajectory prediction device according to an embodiment of this application. Figure 4 As shown, the touch trajectory prediction device 400 includes: a first acquisition module 401, a second acquisition module 402, an update module 403, and a third acquisition module 404, wherein:
[0110] The first acquisition module 401 is used to acquire the optimal touch state of the current touch point output by the Kalman filter.
[0111] The second acquisition module 402 is used to acquire the angle between the movement direction of the current touch point and the first coordinate axis from the optimal touch state.
[0112] The first update module 403 is used to update the prediction state transition matrix of the Kalman filter according to the included angle of the current touch point.
[0113] The third acquisition module 404 is used to acquire the predicted touch state of the next touch point based on the optimal touch state of the current touch point and the predicted state transition matrix.
[0114] In this application, the predicted state transition matrix in the Kalman filter can be updated in real time according to the angle associated with the movement direction. It can continuously adjust the predicted state transition matrix during the prediction process, so that the predicted state matrix can reflect the state transition information of the movement direction. This allows for better prediction of the movement direction of the touch point, rather than continuing to predict the next touch point along the movement direction of the previous touch point. Therefore, it not only has a better prediction effect for linear touch trajectories, but also has more accurate prediction results for complex touch trajectories.
[0115] Figure 5 This is a schematic diagram of the structure of a touch trajectory prediction device according to an embodiment of this application. Figure 5 As shown, the touch trajectory prediction device 500 includes: a first acquisition module 501, a second acquisition module 502, an update module 503, and a third acquisition module 504.
[0116] The first acquisition module 501 is used to acquire the optimal touch state of the current touch point output by the Kalman filter.
[0117] The second acquisition module 502 is used to acquire the angle between the movement direction of the current touch point and the first coordinate axis from the optimal touch state.
[0118] The first update module 503 is used to update the prediction state transition matrix of the Kalman filter according to the included angle of the current touch point.
[0119] The third acquisition module 504 is used to acquire the predicted touch state of the next touch point based on the optimal touch state of the current touch point and the predicted state transition matrix.
[0120] Optionally, the touch trajectory prediction device 50 may further include:
[0121] The fourth acquisition module 505 is used to acquire the observation position of the next touch point and determine the observed touch state of the next touch point based on the observation position;
[0122] The correction module 506 is used to correct the predicted touch state based on the observed touch state to obtain the optimal touch state of the next touch point;
[0123] The second update module 507 is used to update the next touch point to a new current touch point and return to obtain the included angle of the new current touch point and subsequent steps.
[0124] Optionally, the fourth acquisition module 505 is further configured to:
[0125] Obtain the observation position of the current touch point, and based on the observation position of the current touch point and the observation position of the next touch point, obtain the observation angle between the movement direction of the next touch point and the first coordinate axis;
[0126] Based on the observed position of the current touch point and the observed position of the next touch point, the observed moving speed and observed moving angular velocity of the next touch point are obtained.
[0127] Optionally, the fourth acquisition module 505 is further configured to:
[0128] The distance between the two touch points is obtained based on the observed position of the current touch point and the observed position of the next touch point;
[0129] Get the movement time from the current touch point to the next touch point;
[0130] The observed movement speed of the next touch point is determined based on the distance and the movement time.
[0131] Optionally, the fourth acquisition module 505 is further configured to:
[0132] Based on the observed position of the current touch point and the observed position of the next touch point, the interval angle between the two touch points is obtained;
[0133] Get the movement time from the current touch point to the next touch point;
[0134] The observed angular velocity of the next touch point is determined based on the interval angle and the movement time.
[0135] Optionally, the correction module 506 is further configured to:
[0136] Obtain the Kalman gain matrix of the Kalman filter corresponding to the next touch point;
[0137] Based on the Kalman gain matrix, the preset observation state transition matrix, and the observed touch state, the predicted touch state is corrected to obtain the optimal touch state for the next touch point.
[0138] Optionally, the correction module 506 is further configured to:
[0139] Determine the covariance matrix and the preset prediction error matrix of the Kalman filter corresponding to the current touch point;
[0140] Based on the predicted state transition matrix, the covariance matrix corresponding to the current touch point, and the prediction error matrix, the covariance matrix of the Kalman filter corresponding to the next touch point is obtained.
[0141] The Kalman gain matrix is determined based on the covariance matrix corresponding to the next touch point, the prediction error matrix, the preset observation error matrix, and the prediction state transition matrix.
[0142] Optionally, the correction module 506 is further configured to:
[0143] Based on the Kalman gain matrix and the observation state transition matrix, the covariance matrix corresponding to the next touch point is corrected to obtain the final covariance matrix corresponding to the next touch point.
[0144] It should be noted that for details not disclosed in the touch trajectory prediction device of the embodiments of this application, please refer to the details disclosed in the touch trajectory prediction method provided in the above embodiments of this application, which will not be repeated here.
[0145] This application also provides an electronic device, including: a processor; and a memory for storing processor-executable instructions, wherein the processor is configured to execute the instructions to implement the touch trajectory prediction method as described above.
[0146] To implement the above embodiments, this application also proposes a storage medium. When the instructions in the storage medium are executed by the processor of an electronic device, the electronic device is able to perform the touch trajectory prediction method as described above.
[0147] To implement the above embodiments, this application also provides a computer program product. When executed by the processor of an electronic device, this computer program product enables the electronic device to perform the touch trajectory prediction method as described above.
[0148] Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment. For example... Figure 6 As shown, the electronic device 600 includes a touch trajectory prediction device. This touch trajectory prediction device can be as follows: Figure 4 The device shown can also be as follows: Figure 5The device described herein can be a mobile electronic device or a non-mobile electronic device. For example, a mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., while a non-mobile electronic device can be a network-attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application does not impose specific limitations on the embodiments described.
[0149] Figure 7 This is a structural block diagram of an electronic device according to an exemplary embodiment. Figure 7 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0150] like Figure 7 As shown, the electronic device 700 includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from memory 116 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processor 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0151] The following components are connected to I / O interface 705: memory 706 including hard disk; and communication section 707 including network interface card such as LAN (Local Area Network) card, modem, etc., communication section 707 performs communication processing via a network such as the Internet; drive 708 is also connected to I / O interface 705 as needed.
[0152] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 707. When the computer program is executed by the processor 701, it performs the functions defined in the methods of this application.
[0153] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory including instructions, which can be executed by a processor 701 of an electronic device 700 to perform the above-described method. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0154] In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0155] Figure 8 This is a structural block diagram of a touch chip according to an exemplary embodiment. Figure 8 The touch chip shown is merely an example and should not be construed as limiting the functionality or scope of the embodiments described in this application. Figure 8 As shown, the touch chip 800 includes a processor 801 and a memory 802. The memory 802 is used to store program code, and the processor 801 is connected to the memory 802 to read the program code from the memory 802 to implement the touch trajectory prediction method in the above embodiment.
[0156] Alternatively, the number of processors 801 can be one or more.
[0157] Optionally, the touch chip may also include an interface 803, and there may be multiple interfaces 803. This interface 803 can connect to an application and can receive data from external devices such as sensors.
[0158] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0159] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for predicting touch trajectories, characterized in that, The method is applicable to electronic devices with touchscreens, including: Obtain the optimal touch state of the current touch point from the output of the Kalman filter; From the optimal touch state, obtain the angle between the current touch point's movement direction and the first coordinate axis; Update the predicted state transition matrix of the Kalman filter based on the included angle of the current touch point; Based on the optimal touch state of the current touch point and the predicted state transition matrix, the predicted touch state of the next touch point is obtained; Wherein, the predicted state transition matrix A is: 。 2. The method according to claim 1, characterized in that, After obtaining the predicted touch state of the next touch point based on the optimal touch state of the current touch point and the predicted state transition matrix, the method further includes: Obtain the observed position of the next touch point, and determine the observed touch state of the next touch point based on the observed position of the next touch point; Based on the observed touch state, the predicted touch state is corrected to obtain the optimal touch state for the next touch point; Update the next touch point to the new current touch point and return to obtain the included angle of the new current touch point and subsequent steps.
3. The method according to claim 2, characterized in that, Determining the observed touch state of the next touch point based on its observed position includes: Obtain the observation position of the current touch point, and based on the observation position of the current touch point and the observation position of the next touch point, obtain the observation angle between the movement direction of the next touch point and the first coordinate axis; Based on the observed position of the current touch point and the observed position of the next touch point, the observed moving speed and observed moving angular velocity of the next touch point are obtained.
4. The method according to claim 3, characterized in that, The process of determining the observed moving speed includes: The distance between the two touch points is obtained based on the observed position of the current touch point and the observed position of the next touch point; Get the movement time from the current touch point to the next touch point; The observed movement speed of the next touch point is determined based on the distance and the movement time.
5. The method according to claim 3, characterized in that, The process of determining the observed angular velocity includes: Based on the observed position of the current touch point and the observed position of the next touch point, the interval angle between the two touch points is obtained; Get the movement time from the current touch point to the next touch point; The observed angular velocity of the next touch point is determined based on the interval angle and the movement time.
6. The method according to any one of claims 2-5, characterized in that, The step of correcting the predicted touch state based on the observed touch state to obtain the optimal touch state for the next touch point includes: Obtain the Kalman gain matrix of the Kalman filter corresponding to the next touch point; Based on the Kalman gain matrix, the preset observation state transition matrix, and the observed touch state, the predicted touch state is corrected to obtain the optimal touch state for the next touch point.
7. The method according to claim 6, characterized in that, The step of obtaining the Kalman gain matrix of the Kalman filter corresponding to the next touch point includes: Determine the covariance matrix and the preset prediction error matrix of the Kalman filter corresponding to the current touch point; Based on the predicted state transition matrix, the covariance matrix corresponding to the current touch point, and the prediction error matrix, the covariance matrix of the Kalman filter corresponding to the next touch point is obtained. The Kalman gain matrix is determined based on the covariance matrix corresponding to the next touch point, the prediction error matrix, the preset observation error matrix, and the prediction state transition matrix.
8. The method according to claim 7, characterized in that, The method further includes: Based on the Kalman gain matrix and the observation state transition matrix, the covariance matrix corresponding to the next touch point is corrected to obtain the final covariance matrix corresponding to the next touch point.
9. A device for predicting touch trajectory, characterized in that, The device is installed in an electronic device with a touch screen and includes: The first acquisition module is used to acquire the optimal touch state of the current touch point output by the Kalman filter; The second acquisition module is used to acquire the angle between the movement direction of the current touch point and the first coordinate axis from the optimal touch state; The first update module is used to update the prediction state transition matrix of the Kalman filter according to the included angle of the current touch point; The third acquisition module is used to acquire the predicted touch state of the next touch point based on the optimal touch state of the current touch point and the predicted state transition matrix. Wherein, the predicted state transition matrix A is: 。 10. The apparatus according to claim 9, characterized in that, The device further includes: The fourth acquisition module is used to acquire the observation position of the next touch point and determine the observed touch state of the next touch point based on the observation position of the next touch point; The correction module is used to correct the predicted touch state based on the observed touch state to obtain the optimal touch state for the next touch point. The second update module is used to update the next touch point to the new current touch point and return the angle of the new current touch point and subsequent steps.
11. The apparatus according to claim 10, characterized in that, The fourth acquisition module is also used for: Obtain the observation position of the current touch point, and based on the observation position of the current touch point and the observation position of the next touch point, obtain the observation angle between the movement direction of the next touch point and the first coordinate axis; Based on the observed position of the current touch point and the observed position of the next touch point, the observed moving speed and observed moving angular velocity of the next touch point are obtained.
12. The apparatus according to claim 11, characterized in that, The fourth acquisition module is also used for: The distance between the two touch points is obtained based on the observed position of the current touch point and the observed position of the next touch point; Get the movement time from the current touch point to the next touch point; The observed movement speed of the next touch point is determined based on the distance and the movement time.
13. The apparatus according to claim 11, characterized in that, The fourth acquisition module is also used for: Based on the observed position of the current touch point and the observed position of the next touch point, the interval angle between the two touch points is obtained; Get the movement time from the current touch point to the next touch point; The observed angular velocity of the next touch point is determined based on the interval angle and the movement time.
14. The apparatus according to any one of claims 10-13, characterized in that, The correction module is also used for: Obtain the Kalman gain matrix of the Kalman filter corresponding to the next touch point; Based on the Kalman gain matrix, the preset observation state transition matrix, and the observed touch state, the predicted touch state is corrected to obtain the optimal touch state for the next touch point.
15. The apparatus according to claim 14, characterized in that, The correction module is also used for: Determine the covariance matrix and the preset prediction error matrix of the Kalman filter corresponding to the current touch point; Based on the predicted state transition matrix, the covariance matrix corresponding to the current touch point, and the prediction error matrix, the covariance matrix of the Kalman filter corresponding to the next touch point is obtained. The Kalman gain matrix is determined based on the covariance matrix corresponding to the next touch point, the prediction error matrix, the preset observation error matrix, and the prediction state transition matrix.
16. The apparatus according to claim 15, characterized in that, The correction module is also used for: Based on the Kalman gain matrix and the observation state transition matrix, the covariance matrix corresponding to the next touch point is corrected to obtain the final covariance matrix corresponding to the next touch point.
17. An electronic device, characterized in that, include: The touch trajectory prediction device as described in any one of claims 9-16.
18. A touch chip, characterized in that, include: Memory, used to store program code; A processor, connected to the memory, is configured to read the program code from the memory to execute the method of any one of claims 1 to 8.
19. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1 to 8.
20. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Target trajectory prediction method based on Kalman filtering multi-motion model switching
CN113763434A