Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind of method and system obtaining touch-screen equipment curve manipulation track, be intended to solve the coordinate points that in prior art, multipoint touch screen receives do not identify containing group, can not fast according to the defect in the coordinate points curve of output touch trajectory path received.
Technical scheme of the present invention is as follows:
Obtain a method for touch-screen equipment curve manipulation track, wherein, comprising:
The coordinate figure of A, acquisition contact action touch point;
B, judge whether touch trajectory is straight line, if straight line then exports linear operating track according to described coordinate figure; If not, then perform step C;
C, according to coordinate figure putting in order on coordinate, to identify belonging to the coordinate figure of flex point in curvilinear path successively;
D, basis identify the coordinate figure of flex point and the coordinate figure of touch-control starting point and touch-control terminal, export the curvilinear path route that this touch point is corresponding.
The method of described acquisition touch-screen equipment curve manipulation track, wherein, described step B comprises:
B1, according to the time sequencing of coordinate figure obtaining touch point, identify this touch control operation starting point and touch-control terminal;
B2, calculate the distance of other touch points to described starting point and touch-control terminal line, judge whether the distance calculated all is less than predetermined threshold value, if be all less than, then judge that touch trajectory is as straight line, otherwise is curvilinear path.
The method of described acquisition touch-screen equipment curve manipulation track, wherein, described step C comprises:
C1, utilize AKIMA difference arithmetic to calculate in curvilinear path to be arranged in two touch point tangent slopes before and after touch point, and judge whether described touch point is flex point according to two slopes calculated.
The method of described acquisition touch-screen equipment curve manipulation track, wherein, described step C comprises:
C2, the coordinate figure of other touch points except flex point to be deleted.
The method of described acquisition touch-screen equipment curve manipulation track, wherein, described step D also comprises:
D1, between the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point according to several coordinate figures of the equidistant insertion of preset value, and according to the coordinate figure of described flex point and the coordinate figure of touch-control starting point and touch-control terminal and several coordinate figure curve of output path after inserting.
Obtain a system for touch-screen equipment curve manipulation track, wherein, comprising:
Coordinate figure acquisition module, for obtaining the coordinate figure of contact action touch point;
Track determination module, for judging according to described coordinate figure whether touch trajectory is straight line, if straight line then exports linear operating track; If not, be then judged to be curvilinear path;
Flex point identification module, for according to coordinate figure putting in order on coordinate, identifies belonging to the coordinate figure of flex point in curvilinear path successively;
Curvilinear path output module, for according to identifying the coordinate figure of flex point and the coordinate figure of touch-control starting point and touch-control terminal, exports the curvilinear path route that this touch point is corresponding.
The system of described acquisition touch-screen equipment curve manipulation track, wherein, described track determination module comprises:
Starting point recognition unit, for the time sequencing of the coordinate figure according to acquisition touch point, identifies this touch control operation starting point and touch-control terminal;
Trajectory analysis unit, for calculating the distance of other touch points to described starting point and touch-control terminal line, judges whether the distance calculated all is less than predetermined threshold value, if be all less than, then judge that touch trajectory is as straight line, otherwise is curve.
The system of described acquisition touch-screen equipment curve manipulation track, wherein, flex point identification module comprises:
Slope calculation unit SCU, utilizes AKIMA difference arithmetic to calculate in curvilinear path to be arranged in two touch point tangent slopes before and after touch point, and judges whether described touch point is flex point according to two slopes calculated.
The system of described acquisition touch-screen equipment curve manipulation track, wherein, flex point identification module comprises:
Noise culling unit, for deleting the coordinate figure of other touch points except flex point.
The system of described acquisition touch-screen equipment curve manipulation track, wherein, curvilinear path output module comprises:
Numerical value plug-in unit, for between the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point according to the some coordinate figures of the equidistant insertion of preset value, and according to the coordinate figure of described flex point and the coordinate figure of touch-control starting point and touch-control terminal and several coordinate figure curve of output path after inserting.
Beneficial effect, a kind of method and system obtaining touch-screen equipment curve manipulation track of the present invention, by obtaining the coordinate figure of contact action touch point; Judge whether touch trajectory is straight line according to described coordinate figure, if not, then according to coordinate figure putting in order on coordinate, identify belonging to the coordinate figure of flex point in curvilinear path successively, and according to the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point, export the curvilinear path route that this touch point is corresponding.The method of the invention and system use the flex point of Knowledge of Discrete Mathematics fast searching curvilinear path, reject a large amount of noise, while guarantee accuracy, significantly decrease data volume again, be applicable to the recording of the correlation function test case such as the gesture operation of touch-screen equipment, pattern unblock.
Embodiment
The invention provides a kind of method and system obtaining touch-screen equipment curve manipulation track, for making object of the present invention, technical scheme and effect clearly, clearly, the present invention is described in more detail below.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The invention provides a kind of method obtaining touch-screen equipment curve manipulation track, as shown in Figure 1, comprising:
The coordinate figure of S1, acquisition contact action touch point.
User is when the touch-screen by touch-screen equipment sends touch control operation, then touch control device receives the coordinate figure of user when this contact action corresponding to finger touch point.
S2, judge whether touch trajectory is straight line, if straight line then exports linear operating track according to described coordinate figure; If not, then perform step S3.
Described step S2 comprises:
S21, according to the time sequencing of coordinate figure obtaining touch point, identify this touch control operation starting point and touch-control terminal;
S22, calculate the distance of other touch points to described starting point and touch-control terminal line, and judge whether described distance is all less than predetermined threshold value, if be all less than, then judge that touch trajectory is as straight line, otherwise be curvilinear path.
After the coordinate figure of correspondence getting this touch point, described coordinate figure is analyzed, judges that the track of this touch control operation is straight line or curve.
Concrete, being illustrated in figure 2 according to the track of coordinate figure to touch control operation is the schematic diagram of straight line or curve determination methods, as shown in Figure 2, in touch-screen equipment operation, produce two operation trace ACP and ABP, A are the starting point of operation trace, P is operation trace touch-control terminal.This algorithm specifies, when the distance of straight line AP operation trace arriving a little starting point and touch-control terminal formation is all less than threshold d, this operation being classified as is a straight path process; When distance operation trace existing the straight line AP that point is formed to starting point and touch-control terminal is greater than threshold d, this operation being classified as is a curvilinear path process.
Can obtain straight line AP according to two point form is, be translated into general expression, wherein, according to distance between beeline and dot formulacalculate the distance of the point on track to straight line AP, the distance value calculated and the threshold value preset are compared, can determine this operation is straight path or curvilinear path.
S3, according to coordinate figure putting in order on coordinate, to identify belonging to the coordinate figure of flex point in curvilinear path successively.
If the track determining this touch control operation is curve, then putting in order according to coordinate figure identifies the coordinate wherein belonging to knee point, concrete, and flex point is known method for distinguishing and comprised the following steps:
S31, utilize AKIMA difference arithmetic to calculate in curvilinear path to be arranged in two touch point tangent slopes before and after touch point, and judge whether described touch point is flex point according to two slopes calculated.
As shown in Figure 3, with curve A CP for touch-screen equipment one curve manipulation track, wherein C is a flex point of this curve.According to the characteristic of flex point, flex point place is the point of curve rise and fall trend cataclysm, therefore can judge whether C is flex point according to 2 B and D place tangent slopes before and after flex point C.Suppose that the slope of tangent line Lb is Kb, the slope of tangent line Ld is Kd, then can conclude that C is flex point in the following two cases, 1):, 2):or.
Preferably, arbitrary touch point can be asked by AKIMA difference arithmeticplace's tangent slope, by each two points before and after E point, if the coordinate being arranged at before and after E point 2 is respectively:with, then can obtain E point tangent slope by formula is:
;
Wherein;
Whentime, E point place tangent slope is:.
S32, the coordinate figure of other touch points except flex point to be deleted.
By except touch-control starting point, touch-control terminal and identify after coordinate figure corresponding to touch point into flex point preserve, delete other coordinate figures.
S4, basis identify the coordinate figure of flex point and the coordinate figure of touch-control starting point and touch-control terminal, export the curvilinear path route that this touch point is corresponding.
Only by the starting point of record, touch-control terminal and flex point in this step, restore the curve of curvilinear path, therefore eliminate noise, greatly reduce the treatment capacity of data, curvilinear path can be gone out by fast restore.
In order to make the curvilinear path that restores level and smooth, also comprise at described step S4:
S41, between the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point according to several coordinate figures of the equidistant insertion of preset value, and according to the coordinate figure of described flex point and the coordinate figure of touch-control starting point and touch-control terminal and several coordinate figure curve of output path after inserting.
In order to be described in more details method provided by the invention, as shown in Figure 4, be the flow chart of steps of the method for the invention specific embodiment, as described in Figure, in a particular application, comprise the following steps:
Point on the track that H1, first basis collect.
H2, judge that whether it is a curvilinear path operation, if not curvilinear path, then perform step H3; Otherwise perform step H4.
H3, record starting point and touch-control terminal after, perform step H4.
H4, the operation of output straight path.
H5 if curvilinear path, then finds knee point by Knowledge of Discrete Mathematics;
H6, record coordinate figure corresponding to touch-control starting point, touch-control terminal and flex point.
H7, the several point of then sparse between these points insertion.
H8, according to the touch-control starting point of record and touch-control terminal, and the coordinate figure of the flex point found out, reduction curve manipulation track.
Based on the above method, present invention also offers a kind of system obtaining touch-screen equipment curve manipulation track, as Fig. 5, comprising:
Coordinate figure acquisition module 110, for obtaining the coordinate figure of contact action touch point;
Track determination module 120, for judging according to described coordinate figure whether touch trajectory is straight line, if straight line then exports linear operating track; If not, be then judged to be curvilinear path;
Flex point identification module 130, for according to coordinate figure putting in order on coordinate, identifies belonging to the coordinate figure of flex point in curvilinear path successively;
Curvilinear path output module 140, for according to identifying the coordinate figure of flex point and the coordinate figure of touch-control starting point and touch-control terminal, exports the curvilinear path route that this touch point is corresponding.
Described track determination module comprises:
Starting point recognition unit, for the time sequencing of the coordinate figure according to acquisition touch point, identifies this touch control operation starting point and touch-control terminal;
Trajectory analysis unit, for calculating the distance of other touch points to described starting point and touch-control terminal line, judges whether the distance calculated all is less than predetermined threshold value, if be all less than, then judge that touch trajectory is as straight line, otherwise is curve.
Flex point identification module comprises:
Slope calculation unit SCU, utilizes AKIMA difference arithmetic to calculate in curvilinear path to be arranged in two touch point tangent slopes before and after touch point, and judges whether described touch point is flex point according to two slopes calculated.
Flex point identification module comprises:
Noise culling unit, for deleting the coordinate figure of other touch points except flex point.
Curvilinear path output module comprises:
Numerical value plug-in unit, for between the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point according to the some coordinate figures of the equidistant insertion of preset value, and according to the coordinate figure of described flex point and the coordinate figure of touch-control starting point and touch-control terminal and several coordinate figure curve of output path after inserting.
A kind of method and system obtaining touch-screen equipment curve manipulation track of the present invention, by obtaining the coordinate figure of contact action touch point; Judge whether touch trajectory is straight line according to described coordinate figure, if not, then according to coordinate figure putting in order on coordinate, identify belonging to the coordinate figure of flex point in curvilinear path successively, and according to the coordinate figure of the coordinate figure and touch-control starting point and touch-control terminal that identify flex point, export the curvilinear path route that this touch point is corresponding.The method of the invention and system use the flex point of Knowledge of Discrete Mathematics fast searching curvilinear path, reject a large amount of noise, while guarantee accuracy, significantly decrease data volume again, be applicable to the recording of the correlation function test case such as the gesture operation of touch-screen equipment, pattern unblock.
Should be understood that, application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can be improved according to the above description or convert, and all these improve and convert the protection domain that all should belong to claims of the present invention.