CN114327148B - Handwriting point reporting prediction method - Google Patents

Handwriting point reporting prediction method Download PDF

Info

Publication number
CN114327148B
CN114327148B CN202111675966.1A CN202111675966A CN114327148B CN 114327148 B CN114327148 B CN 114327148B CN 202111675966 A CN202111675966 A CN 202111675966A CN 114327148 B CN114327148 B CN 114327148B
Authority
CN
China
Prior art keywords
report
point
sequence
prediction
seqp
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111675966.1A
Other languages
Chinese (zh)
Other versions
CN114327148A (en
Inventor
刘孟珂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hongyuxing Technology Co ltd
Original Assignee
Shenzhen Hongyuxing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Hongyuxing Technology Co ltd filed Critical Shenzhen Hongyuxing Technology Co ltd
Priority to CN202111675966.1A priority Critical patent/CN114327148B/en
Publication of CN114327148A publication Critical patent/CN114327148A/en
Application granted granted Critical
Publication of CN114327148B publication Critical patent/CN114327148B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a handwriting point reporting prediction method, which comprises the following steps: s1: acquiring handwriting data of a plurality of original report points generated in real-time writing, and forming an original sequence seqY according to the original report point generation sequence, wherein the handwriting data of the original report points comprises coordinates x, y and time stamps t for generating the report points; s2: carrying out duplication removal on the report points in the original sequence seqY to obtain a predicted sequence seqP; s3: and performing parameter setting and characteristic judgment on the obtained prediction sequence seqP, and obtaining single prediction time pt and the number n of original report points required by single prediction according to the result of the characteristic judgment. According to the invention, the position to be drawn by the handwriting pen can be predicted through the report point coordinate information and characteristics of the handwriting, and the predicted report point is drawn in advance, so that the difference between the point displayed on the screen and the actual position of the handwriting pen is reduced, the handwriting input becomes smoother, the delay is lower, and the user experience is improved.

Description

Handwriting point reporting prediction method
Technical Field
The invention relates to the technical field of handwriting prediction, in particular to a handwriting point reporting prediction method.
Background
At present, more and more tablet computers are provided with handwriting pens, so that handwriting input (meeting records and drawing doodling) is supported, and convenience and interestingness of daily note and communication of people are improved. However, due to the delay of hardware report transmission and software rendering and drawing, the strokes displayed on the screen have a certain distance from the actual position of the pen point in the writing process. Such delays and distances cause strokes not to be presented on the screen in real time, which in turn leads to a poor writing and clicking experience for the user.
Disclosure of Invention
The invention aims to provide a handwriting point reporting prediction method, which can predict a place to be drawn by a handwriting pen through the point reporting coordinate information and characteristics of handwriting, and draw the predicted point in advance so as to reduce the difference between a point displayed on a screen and the actual position of the handwriting pen, thereby ensuring that the handwriting input becomes smoother, the delay is lower, and the user experience is improved.
In order to realize the purpose, the following technical scheme is adopted:
a handwriting report point prediction method comprises the following steps:
s1: acquiring handwriting data of a plurality of original report points generated in real-time writing, and forming an original sequence seqY according to the original report point generation sequence, wherein the handwriting data of the original report points comprises coordinates x, y and time stamps t for generating the report points;
s2: carrying out duplication removal on the report points in the original sequence seqY to obtain a predicted sequence seqP;
s3: performing parameter setting and feature judgment on the obtained prediction sequence seqP, and obtaining single prediction time pT and the number n of original report points required by single prediction according to the result of the feature judgment, wherein the parameters required to be set comprise the maximum prediction time pT and the number nS of the maximum original report points required by prediction;
s4: and performing curve fitting on the n original report points acquired in the S3 based on a least square method, and obtaining the positions of the report points to be predicted based on the fitted curve and the single prediction time pt.
Further, the S2 specifically includes the following steps:
s21: assuming that the number of original report points in seqY is nY, the latest point in the sequence is lastY, any point in the sequence is tempY, and the number of report points in the predicted sequence seqP is nP;
s22: initializing the index position of seqY to the second last point in the sequence, initializing tempY to lastY, and storing the tempY in seqP;
s23: comparing the report point at the seqY index position with the tempY, if the timestamps t of the report point and the tempY index position are not equal and at least one of the x coordinate and the y coordinate is not equal, determining that the report point and the tempY coordinate are not repeated, and switching to S24, otherwise, switching to S25;
s24: updating tempY to a report point at the index position of seqY, and then storing the tempY into seqP;
s25: the seqY index position minus 1;
s26: and if the seqY index position is larger than or equal to zero and the nP is smaller than the nS, turning to S23, otherwise, ending.
Further, the characteristic judgment in S3 specifically includes the following steps:
s31: judging whether the number of report points in the prediction sequence seqP is more than or equal to 4, and if so, calculating the average velocity v of the three newly generated report points in the sequence;
s32: judging whether the average velocity v is greater than or equal to a preset velocity threshold value vT, if so, judging whether the report point in the prediction sequence seqP is on a straight line, otherwise, finishing the prediction;
s33: if the report point in the prediction sequence seqP is judged to be on the same straight line, continuously judging whether a curvature inflection point exists, and if not, switching to S36;
s34: if there is a curvature inflection point, recording and storing an index position indexL of the last inflection point in the prediction sequence seqP, wherein n is nP-indexL, and pT is pT (double (n/nS)), wherein nP is the number of report points in the prediction sequence seqP, and if there is no curvature inflection point, calculating a step length d between every two adjacent report points in the prediction sequence and a direction value E of each report point;
s35: if the step length between the two latest adjacent report points in the prediction sequence seqP is smaller than the previous step length, or the sum sT of the absolute values of the differences between the direction values of the two adjacent report points in the sequence is smaller than or equal to a preset first threshold value sT1, n is 2, and pt is deltaT, where deltaT is the time interval between the two latest report points in the sequence; if the sum sT of absolute values of the differences between two adjacent dot direction values in the sequence is greater than a preset second threshold value sT2, n is (int) sT nS/(2 nP-3)), where nP is the number of dots in the predicted sequence seqP and n < nP;
s36: calculating the curvature q of each report point in the prediction sequence seqP, if the curvature q of at least one report point is greater than a preset curvature threshold qT1, determining that the report point is on the curve, where n is 2 and pT is deltaT, where deltaT is the time interval between the two latest report points in the prediction sequence, and if not, determining that the report point is still on a straight line, and going to S33.
Further, if the number of nodes in the prediction sequence seqP in S31 is only 2 or 3, then n is 2; when deltaT is less than or equal to 8ms, pt is equal to deltaT, otherwise, pt is equal to 8ms, wherein deltaT is the time interval between the latest two reports in the sequence.
Further, the step of determining in S32 whether the breakpoint in the predicted sequence seqP is on a straight line specifically includes the following steps:
s321: calculating the linear distance d1 between the first report point and the latest report point in the seqP;
s322: calculating the linear distance between every two adjacent report points in the seqP, and accumulating and summing the linear distances to record d 2;
s33: and calculating the ratio of d1 to d2, and judging that the report point is on a straight line when the ratio is greater than a preset ratio threshold value dT.
Further, the step of calculating the direction value of each report point in S34 specifically includes the following steps:
s341: recording one report point in the seqP as P, and recording the adjacent front and back report points as Pf and Pb respectively;
s342: pf is taken as a starting point, P is taken as an end point to form a vector P1, P is taken as a starting point, and pb is taken as an end point to form a vector P2;
s343: if the cross product of P1 and P2 is positive, the trend from Pf to pb through P is counterclockwise, and the direction value of P point is 1; if the cross product result of P1 and P2 is negative, the trend from Pf to pb through P is clockwise, and the direction value of P point is-1; if the cross product result of P1 and P2 is 0, then Pf, P and pb are collinear, and the direction value of P is 0;
s344: and repeating the steps S341 to S343 to obtain the direction value of each report point in the seqP.
Further, when curve fitting is performed in S4, if n is less than or equal to 1, the prediction is finished; if n is 2 or 3, performing least square first-order fitting; if n is more than or equal to 4, performing least square second-order fitting.
Further, in S4, after the position information of the predicted waypoint is obtained, the position information is stored in the sequence seqR, and the distance error between each predicted waypoint and the actual waypoint is calculated and stored.
By adopting the scheme, the invention has the beneficial effects that:
according to the method, the position to be drawn by the handwriting pen can be predicted through the report point coordinate information and the characteristics of the handwriting, and the predicted report point is drawn in advance, so that the difference between the point displayed on the screen and the actual position of the handwriting pen is reduced, the handwriting input becomes smoother, the delay is lower, and the user experience degree is improved.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a logic block diagram of the present invention;
FIG. 3 is a logic diagram of the present invention for deduplication against a breakpoint;
FIG. 4 is a logic diagram of the distance error calculation between the predicted and actual repoint of the present invention;
FIG. 5 is a diagram of actual predicted effects according to one embodiment of the present invention;
FIG. 6 is a diagram of actual predicted effects in another embodiment of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and the specific embodiments.
Referring to fig. 1 to 6, the present invention provides a method for predicting a trace point, comprising the following steps:
s1: acquiring handwriting data of a plurality of original report points generated in real-time writing, and forming an original sequence seqY according to the original report point generation sequence, wherein the handwriting data of the original report points comprise coordinates x, y and time stamps t for generating the report points;
s2: carrying out duplication removal on the report points in the original sequence seqY to obtain a predicted sequence seqP;
s3: performing parameter setting and feature judgment on the obtained prediction sequence seqP, and obtaining single prediction time pT and the number n of original report points required by single prediction according to the result of the feature judgment, wherein the parameters required to be set comprise the maximum prediction time pT and the number nS of the maximum original report points required by prediction;
s4: and performing curve fitting on the n original report points acquired in the S3 based on a least square method, and obtaining the positions of the report points to be predicted based on the fitted curve and the single prediction time pt.
Wherein, the S2 specifically includes the following steps:
s21: assuming that the number of original report points in seqY is nY, the latest point in the sequence is lastY, any point in the sequence is tempY, and the number of report points in the predicted sequence seqP is nP;
s22: initializing the index position of seqY to the second last point in the sequence, initializing tempY to lastY, and storing the tempY in seqP;
s23: comparing the report point at the seqY index position with the tempY, if the timestamps t of the report point and the tempY index position are not equal and at least one of the x coordinate and the y coordinate is not equal, determining that the report point and the tempY coordinate are not repeated, and switching to S24, otherwise, switching to S25;
s24: updating tempY to a report point at the index position of seqY, and then storing the tempY into seqP;
s25: the seqY index position minus 1;
s26: and if the seqY index position is larger than or equal to zero and the nP is smaller than the nS, turning to S23, otherwise, ending.
The characteristic judgment in S3 specifically includes the following steps:
s31: judging whether the number of report points in the prediction sequence seqP is more than or equal to 4, and if so, calculating the average velocity v of the three newly generated report points in the sequence;
s32: judging whether the average velocity v is greater than or equal to a preset velocity threshold value vT, if so, judging whether the report point in the prediction sequence seqP is on a straight line, otherwise, finishing the prediction;
s33: if the report point in the prediction sequence seqP is judged to be on the same straight line, continuously judging whether a curvature inflection point exists, and if not, switching to S36;
s34: if there is a curvature inflection point, recording and storing an index position indexL of the last inflection point in the prediction sequence seqP, wherein n is nP-indexL, and pT is pT (double (n/nS)), where nP is the number of report points in the prediction sequence seqP, and if there is no curvature inflection point, calculating a step length d between every two adjacent report points in the prediction sequence and a direction value E of each report point;
s35: if the step length between the two latest adjacent report points in the prediction sequence seqP is smaller than the previous step length, or the sum sT of the absolute values of the differences between the direction values of the two adjacent report points in the sequence is smaller than or equal to a preset first threshold value sT1, n is 2, and pt is deltaT, where deltaT is the time interval between the two latest report points in the sequence; if the sum sT of absolute values of the differences between two adjacent dot direction values in the sequence is greater than a preset second threshold value sT2, n is (int) sT nS/(2 nP-3)), where nP is the number of dots in the predicted sequence seqP and n < nP;
s36: calculating the curvature q of each report point in the prediction sequence seqP, if the curvature q of at least one report point is greater than a preset curvature threshold qT1, determining that the report point is on the curve, where n is 2 and pT is deltaT, where deltaT is the time interval between the two latest report points in the prediction sequence, and if not, determining that the report point is still on a straight line, and going to S33.
When the number of the punctuations in the prediction sequence seqP in S31 is only 2 or 3, then n is 2; when deltaT is less than or equal to 8ms, pt is equal to deltaT, otherwise, pt is equal to 8ms, wherein deltaT is the time interval between the latest two reports in the sequence.
In S32, determining whether the breakpoint in the predicted sequence seqP is on a straight line, specifically includes the following steps:
s321: calculating the linear distance d1 between the first report point and the latest report point in the seqP;
s322: calculating the linear distance between every two adjacent report points in the seqP, and accumulating and summing the linear distances to record d 2;
s33: and calculating the ratio of d1 to d2, and judging that the report point is on a straight line when the ratio is greater than a preset ratio threshold value dT.
In S34, calculating a direction value of each report point specifically includes the following steps:
s341: recording one report point in the seqP as P, and recording the adjacent front and rear report points as Pf and Pb respectively;
s342: pf is taken as a starting point, P is taken as an end point to form a vector P1, P is taken as a starting point, and pb is taken as an end point to form a vector P2;
s343: if the cross product of P1 and P2 is positive, the trend from Pf to pb through P is counterclockwise, and the direction value of P point is 1; if the cross product result of P1 and P2 is negative, the trend from Pf to pb through P is clockwise, and the direction value of P point is-1; if the cross product result of P1 and P2 is 0, then Pf, P and pb are collinear, and the direction value of P is 0;
s344: and repeating the steps S341 to S343 to obtain the direction value of each report point in the seqP.
When curve fitting is performed in the S4, if n is less than or equal to 1, the prediction is finished; if n is 2 or 3, performing least square first-order fitting; if n is more than or equal to 4, performing least square second-order fitting.
After the position information of the predicted report point is obtained in S4, the position information is stored in the sequence seqR, and the distance error between each predicted report point and the actual report point is calculated and stored.
The working principle of the invention is as follows:
as shown in fig. 1 to 6, when a user writes on a screen with a stylus pen, a series of report points corresponding to motion information of a stroke are generated, and because there is instability in the report points on the screen, the report points generated by the stylus pen are inevitably repeated, so before predicting the report points, first, report point deduplication needs to be performed, that is, according to a natural time sequence, a plurality of nonrepeating report points are taken out from an original sequence in a reverse order as a prediction sequence, and then, according to the number nP of the report points of the prediction sequence (the maximum number of the report points does not exceed the set maximum number nS for prediction), the coordinates (x, y, t), the rate curvature and other characteristics, the x direction and the y direction are fitted by combining with a first-order model or a second-order model of a least square method, so that the coordinates (x direction and y direction) to be drawn by handwriting input at a certain time in the future can be predicted (x, y, the most of the handwriting input is performed in the first-order mode, and the least square method is performed p ,y p ,t p ) (ii) a Finally, the prediction result and the prediction are combinedThe latest report points in the sequence are connected, a line segment is drawn and displayed in advance, the improvement of the handwriting input and the writing property is realized, and specifically:
referring to fig. 3, firstly, duplicate removal needs to be performed on the report points in the original sequence seqY to obtain the predicted sequence seqP, and the specific steps are as follows:
1) assuming that the number of original report points in seqY is nY, the latest point in the sequence is lastY, any point in the sequence is tempY, and the number of report points in the predicted sequence seqP is nP;
2) initializing the index position of seqY to the second last point in the sequence, initializing tempY to lastY, and storing the tempY in seqP;
3) comparing the report point at the seqY index position with the tempY, if the timestamps t of the report point and the tempY index position are not equal and at least one of the x coordinate and the y coordinate is not equal, determining that the report point and the tempY coordinate are not repeated, turning to 4, and otherwise, turning to 5;
4) updating tempY to a report point at the index position of seqY, and then storing the tempY into seqP;
5) the seqY index position minus 1;
6) and if the seqY index position is greater than or equal to zero and the nP is less than nS, turning to 3, otherwise, ending.
Subsequently, parameter setting is performed on seqP, which mainly includes a maximum prediction time pT (in this embodiment, maximum 28ms) and the number nS of maximum original report points required for prediction (in this embodiment, maximum 16 points); the single prediction time pT and the number n of points required for prediction (namely, the latest n points in seqP are used for prediction) are respectively initialized to pT and nS, and the least square order k is second order by default; predicting the time interval between the latest two report points in the sequence seqP to be deltaT; in this embodiment, if the number of prediction sequence nodes is only 2 or 3, n is equal to 2, when deltaT is less than or equal to 8ms, pt is equal to deltaT, otherwise pt is equal to 8 ms.
Subsequently, the feature judgment is performed on the predicted sequence seqP, and when the number of report points of the predicted sequence increases to a certain number (for example, 4), the feature judgment is performed on the predicted sequence, which includes rate, whether the report points are on a straight line, whether there is an inflection point, step length change, report point direction change, and the like, specifically:
knowing the coordinates x, y and t of the report points, the average speed of the latest three report points in the seqP is easily obtained as v; when the writing speed is very slow, the writing following requirement is low, and the point reporting prediction significance is not large, so that when v is smaller than a preset speed threshold value vT, prediction is closed (a prediction result is directly returned to 0); when the average speed v is larger than or equal to vT, judging whether the report point in the seqP is on a straight line; firstly, calculating the linear distance d1 between the first report point and the last report point in seqP, wherein the sum of the linear distances between two adjacent report points is d2, and when d1/d2 is greater than a preset proportional threshold dT, directly judging that the straight line is on the straight line; otherwise, calculating the curvature q of each report point in the seqP, if the curvature of at least one report point is greater than a preset curvature threshold qT1, determining that the report point is on the curve, where n is 2 and pT is deltaT, and otherwise, the report point is still on the straight line; if the nodes are judged to be on the straight line, whether curvature inflection points exist needs to be continuously judged, when the product of the curvature difference value of a certain node and two adjacent nodes before and after the certain node is negative, and the curvature of the node is greater than a preset curvature threshold value qT2, the predicted sequence seqP is considered to have the curvature inflection points, and the index position indexL of the last curvature inflection point in the predicted sequence seqP is recorded, at this time, n is-indexL, pT is pT (double (n/nS)), double is used for converting the ratio of n/nS into a double-precision value type, wherein, nP is the number of nodes in the predicted sequence seqP.
When the curvature inflection point does not exist in the prediction sequence seqP, the step length and the direction change condition of the point report need to be considered; the linear distance between two adjacent report points in the prediction sequence seqP is called the step length, and mathematically, the three points have the forward and reverse directions; any point in seqP in the prediction sequence is marked as P (except the first point or the last point), and the front and back adjacent report points are Pf and Pb respectively; pf is taken as a starting point, P is taken as an end point to form a vector P1, P is taken as a starting point, and pb is taken as an end point to form a vector P2; if the cross product of P1 and P2 is positive, the trend from Pf to pb through P is counterclockwise, and the direction value of P point is 1; if the cross product result of P1 and P2 is negative, the trend from Pf to pb through P is clockwise, and the direction value of P point is-1; if the cross product result of P1 and P2 is 0, then Pf, P and pb are collinear, and the direction value of P is 0; repeating the steps to obtain the direction value of each report point in the seqP; if the step length between the two latest adjacent report points in the prediction sequence seqP is less than the previous step length, or the sum sT of the absolute values of the differences between the direction values of the two adjacent report points in the sequence is less than or equal to a preset first threshold value sT1, then n is 2 and pt is deltaT, where deltaT is the time interval between the two latest report points in the sequence; if the sum sT of the absolute values of the differences between two adjacent pointing direction values in the sequence is greater than a preset second threshold value sT2, n is (int) sT × nS/(2 × nP-3)), where nP is the number of pointing in the prediction sequence seqP, n < nP, and int here is the type of converting the following calculation result into an integer value.
After n and pt are obtained, curve fitting is carried out on the n report points through a least square method, the least square method is a mathematical optimization technology, and the principle is that the optimal function matching of data is found through the sum of squares of minimized errors; least squares polynomial curve fitting, given n points, does not require the curve to pass exactly through these points, but rather the approximate curve y f (x) of the curve y (f (x)).
In this embodiment, before performing the least square fitting, the prediction parameters need to be constrained, that is, the fluctuation range of the prediction time pT before and after two times is between-1 and +2 and pT is not greater than pT; if n is not greater than 1, directly returning the prediction result to 0, representing that the prediction fails, and ending the prediction; if n is 2 or 3 and k is equal to 2, performing least square first-order prediction; the other cases k are all 3, and the least square second-order prediction is carried out, specifically:
the input data is the latest n newspaper points (x) in seqP 1 ,y 1 ,t 1 ),(x 2 ,y 2 ,t 2 ),…,(x n ,y n ,t n ) The output is the coordinate (x) of the result to be predicted p ,y p ,t p ) Fitting separately to the x and y directions is required.
First is the x-direction, given a data point P i (t i ,x i ) The deviation between the approximate curve x phi (t) and x f (t) is minimized, and the approximate curve is calculated at the point P i Has a deviation of delta i =φ(t i ) -x, wherein i ═ 1, 2, 3 … n; according to the sum of squares of deviations
Figure BDA0003451301760000081
Minimum and fit the curve with a binomial equation.
Let the fitting polynomial be: x is a 0 +a 1 t+…a k t k The sum of the distances of the individual points from this curve, i.e. the sum of the squared deviations, is given by:
Figure BDA0003451301760000091
for determining the coefficients a of an approximation curve 0 ,a 1 ,…a k Solving each a to the right side of the deviation sum-of-squares equation i The partial derivation and simplification of (a) can result in:
Figure BDA0003451301760000092
further simplifying as follows:
Figure BDA0003451301760000093
expressed in matrix form and simplified to obtain: t is A ═ X, wherein,
Figure BDA0003451301760000094
t can be obtained from T A ═ X T *T*A=T T X, after simplification, a ═ T (T) T *T) -1 *T T X is each coefficient a of the fitted curve i Then a is followed i The prediction result can be known by back-bringing the fitting polynomial
t p =t n +pt,
Figure BDA0003451301760000095
Repeating the fitting process for the y direction to obtain:
Figure BDA0003451301760000096
thus far predicting the result (x) p ,y p ,t p ) The prediction result is determined, and the prediction result can refer to fig. 5 and fig. 6.
In addition, in this embodiment, as shown in fig. 4, after the position information of each predicted newspaper point is obtained, the position information is stored in the sequence seqR, the distance error DE between each predicted newspaper point and the actual newspaper point is calculated and stored, and if a pen-up event is detected, all DE are added and averaged to obtain ADE (average distance error) so as to evaluate the ADE.
The present invention is not limited to the above preferred embodiments, and any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (7)

1. A handwriting report point prediction method is characterized by comprising the following steps:
s1: acquiring handwriting data of a plurality of original report points generated in real-time writing, and forming an original sequence seqY according to the original report point generation sequence, wherein the handwriting data of the original report points comprises coordinates x, y and time stamps t for generating the report points;
s2: carrying out duplication removal on the report points in the original sequence seqY to obtain a predicted sequence seqP;
s3: performing parameter setting and feature judgment on the obtained prediction sequence seqP, and obtaining single prediction time pT and the number n of original report points required by single prediction according to the result of the feature judgment, wherein the parameters required to be set comprise the maximum prediction time pT and the number nS of the maximum original report points required by prediction;
s4: performing curve fitting on the n original report points acquired in the S3 based on a least square method, and obtaining the positions of the report points to be predicted based on the fitted curve and the single prediction time pt;
the characteristic judgment in S3 specifically includes the following steps:
s31: judging whether the number of report points in the prediction sequence seqP is more than or equal to 4, and if so, calculating the average velocity v of the three newly generated report points in the sequence;
s32: judging whether the average velocity v is greater than or equal to a preset velocity threshold value vT, if so, judging whether the report point in the prediction sequence seqP is on a straight line, otherwise, finishing the prediction;
s33: if the report point in the prediction sequence seqP is judged to be on the same straight line, continuously judging whether a curvature inflection point exists, and if not, switching to S36;
s34: if there is a curvature inflection point, recording and storing an index position indexL of the last inflection point in the prediction sequence seqP, wherein n is nP-indexL, and pT is pT (double (n/nS)), wherein nP is the number of report points in the prediction sequence seqP, and if there is no curvature inflection point, calculating a step length d between every two adjacent report points in the prediction sequence and a direction value E of each report point;
s35: if the step length between the two latest adjacent report points in the prediction sequence seqP is less than the previous step length, or the sum sT of the absolute values of the differences between the direction values of the two adjacent report points in the sequence is less than or equal to a preset first threshold value sT1, then n is 2 and pt is deltaT, where deltaT is the time interval between the two latest report points in the sequence; if the sum sT of the absolute values of the differences between two adjacent report point direction values in the sequence is greater than a preset second threshold value sT2, n is (int) sT × nS/(2 × nP-3)), where nP is the number of report points in the prediction sequence seqP, and n < nP;
s36: calculating the curvature q of each report point in the prediction sequence seqP, if the curvature q of at least one report point is greater than a preset curvature threshold qT1, determining that the report point is on the curve, where n is 2 and pT is deltaT, where deltaT is the time interval between the two latest report points in the prediction sequence, and if not, determining that the report point is still on a straight line, and going to S33.
2. The handwriting point prediction method according to claim 1, wherein said S2 specifically comprises the following steps:
s21: assuming that the number of original report points in seqY is nY, the latest point in the sequence is lastY, any point in the sequence is tempY, and the number of report points in the predicted sequence seqP is nP;
s22: initializing the index position of seqY to the second last point in the sequence, initializing tempY to lastY, and storing the tempY in seqP;
s23: comparing the report point at the seqY index position with the tempY, if the timestamps t of the report point and the tempY index position are not equal and at least one of the x coordinate and the y coordinate is not equal, determining that the report point and the tempY coordinate are not repeated, and switching to S24, otherwise, switching to S25;
s24: updating tempY to a report point at the index position of seqY, and then storing the tempY into seqP;
s25: the seqY index position minus 1;
s26: and if the seqY index position is larger than or equal to zero and the nP is smaller than the nS, turning to S23, otherwise, ending.
3. The handwriting point scoring prediction method according to claim 1, wherein when the number of points in the prediction sequence seqP in S31 is only 2 or 3, then n-2; when deltaT is less than or equal to 8ms, pt is equal to deltaT, otherwise, pt is equal to 8ms, wherein deltaT is the time interval between the two latest reporting points in the sequence.
4. The handwriting point prediction method according to claim 1, wherein in S32, it is determined whether the points in the prediction sequence seqP are on a straight line, specifically including the following steps:
s321: calculating the linear distance d1 between the first report point and the latest report point in the seqP;
s322: calculating the linear distance between every two adjacent report points in the seqP, and accumulating and summing the linear distances to record d 2;
s33: and calculating the ratio of d1 to d2, and judging that the report point is on a straight line when the ratio is greater than a preset ratio threshold value dT.
5. A handwriting point prediction method according to claim 1, wherein said step of calculating a direction value of each point in S34 specifically comprises the steps of:
s341: recording one report point in the seqP as P, and recording the adjacent front and back report points as Pf and Pb respectively;
s342: pf is taken as a starting point, P is taken as an end point to form a vector P1, P is taken as a starting point, and pb is taken as an end point to form a vector P2;
s343: if the cross product of P1 and P2 is positive, the trend from Pf to pb through P is counterclockwise, and the direction value of P point is 1; if the cross product result of P1 and P2 is negative, the trend from Pf to pb through P is clockwise, and the direction value of P point is-1; if the cross product result of P1 and P2 is 0, the Pf, P and pb three points are collinear, and the direction value of the P point is recorded as 0;
s344: and repeating the steps S341 to S343 to obtain the direction value of each report point in the seqP.
6. The handwriting point-scoring prediction method according to claim 1, wherein when curve fitting is performed in S4, if n is less than or equal to 1, the prediction is finished; if n is 2 or 3, performing least square first-order fitting; if n is more than or equal to 4, performing least square second-order fitting.
7. The handwriting point reporting method according to claim 1, wherein in S4, after obtaining the position information of the predicted report, it is stored in the sequence seqR, and the distance error between each predicted report and the real report is calculated and stored.
CN202111675966.1A 2021-12-31 2021-12-31 Handwriting point reporting prediction method Active CN114327148B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111675966.1A CN114327148B (en) 2021-12-31 2021-12-31 Handwriting point reporting prediction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111675966.1A CN114327148B (en) 2021-12-31 2021-12-31 Handwriting point reporting prediction method

Publications (2)

Publication Number Publication Date
CN114327148A CN114327148A (en) 2022-04-12
CN114327148B true CN114327148B (en) 2022-08-12

Family

ID=81022715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111675966.1A Active CN114327148B (en) 2021-12-31 2021-12-31 Handwriting point reporting prediction method

Country Status (1)

Country Link
CN (1) CN114327148B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114860111B (en) * 2022-05-23 2024-06-18 Oppo广东移动通信有限公司 Touch track updating method and device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5995081A (en) * 1996-01-12 1999-11-30 Nec Corporation Handwriting type input display device
WO2007035827A2 (en) * 2005-09-20 2007-03-29 Forward Input, Inc. System and method for continuous stroke word-based text input
CN108628532A (en) * 2018-04-28 2018-10-09 掌阅科技股份有限公司 Method for drafting, computing device and the computer storage media of broken line person's handwriting
CN112329695A (en) * 2020-11-18 2021-02-05 安徽文香信息技术有限公司 Dynamic handwriting recognition method based on intelligent blackboard
CN112835455A (en) * 2019-11-22 2021-05-25 华为技术有限公司 Method and equipment for predicting drawing point of stylus pen
CN113641260A (en) * 2020-05-11 2021-11-12 华为技术有限公司 Touch trajectory prediction method, related device, equipment and computer storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5995081A (en) * 1996-01-12 1999-11-30 Nec Corporation Handwriting type input display device
WO2007035827A2 (en) * 2005-09-20 2007-03-29 Forward Input, Inc. System and method for continuous stroke word-based text input
CN108628532A (en) * 2018-04-28 2018-10-09 掌阅科技股份有限公司 Method for drafting, computing device and the computer storage media of broken line person's handwriting
CN112835455A (en) * 2019-11-22 2021-05-25 华为技术有限公司 Method and equipment for predicting drawing point of stylus pen
CN113641260A (en) * 2020-05-11 2021-11-12 华为技术有限公司 Touch trajectory prediction method, related device, equipment and computer storage medium
CN112329695A (en) * 2020-11-18 2021-02-05 安徽文香信息技术有限公司 Dynamic handwriting recognition method based on intelligent blackboard

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
T. Kahveci ; A. Singh ; A. Gurel.An efficient index structure for shift and scale invariant search of mufti-attribute time sequences.《Proceedings 18th International Conference on Data Engineering》.2002, *
基于改进神经网络的离线签名笔迹识别;梁曦璐;《中国优秀硕士学位论文全文数据库》;20170915;全文 *

Also Published As

Publication number Publication date
CN114327148A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
Ng et al. PEGASUS: A policy search method for large MDPs and POMDPs
Ibanez et al. Monte Carlo valuation of American options through computation of the optimal exercise frontier
M Abdelmoniem et al. An efficient statistical-based gradient compression technique for distributed training systems
Beck et al. Gradient-based algorithms with applications to signal-recovery problems.
CN114327148B (en) Handwriting point reporting prediction method
CN102214302A (en) Recognition device, recognition method, and program
CN111159483B (en) Tensor calculation-based social network diagram abstract generation method
Chen et al. Smooth convex approximation to the maximum eigenvalue function
Somervuo Online algorithm for the self-organizing map of symbol strings
Li et al. Bcdiff: Bidirectional consistent diffusion for instantaneous trajectory prediction
CN112232565A (en) Two-stage time sequence prediction method, prediction system, terminal and medium
Bonham et al. Contracting on Information about Value
Gzyl et al. Determination of the distribution of total loss from the fractional moments of its exponential
Chen et al. An improved incomplete AP clustering algorithm based on K nearest neighbours
McKinlay A characterisation of transient random walks on stochastic matrices with Dirichlet distributed limits
Bibinger Inference on the intraday spot volatility from high-frequency order prices with irregular microstructure noise
CN110417594B (en) Network construction method and device, storage medium and electronic equipment
Ghanbari et al. Proximal quasi-Newton methods for convex optimization
Mu et al. Convergence analysis of a stochastic progressive hedging algorithm for stochastic programming
Pedersen et al. Applications of Deep Learning in Option Pricing and Calibration
Wen et al. An analysis of switchback designs in reinforcement learning
Fang et al. Linking statistical estimation and decision making through simulation
Heinrich et al. Asymptotically exact streaming algorithms
Škulj Perturbation bounds and degree of imprecision for uniquely convergent imprecise Markov chains
Knape et al. Approximating perpetuities

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant