The content of the invention
In view of above-mentioned the deficiencies in the prior art, it is an object of the invention to provide the method and system of touch-screen stabilization, purport
Judge touch operation characteristic point in offer, improve the precision of touch operation.
For up to above-mentioned purpose, the invention provides following technical scheme:
The method of touch-screen stabilization, comprises the following steps:
A, when detecting touch operation, obtain specify touched in the period point coordinates a little;
B, the point spacing according to any two touch point of point coordinates calculating, and two touches for being smaller than default threshold value will be put
Point is placed in same point set;
C, the characteristic point for obtaining point set, the characteristic point are the average value minimum with the point spacing of other touch points in point set
Touch point;
D, the characteristic point reported into current application program.
The method of described touch-screen stabilization, wherein, the specified period is 100 milliseconds.
The method of described touch-screen stabilization, wherein, the step B is specifically included:
B100, one point set of establishment, and a touch point is placed in point set;
B200, judge outside point set whether there is touch point, if so, perform step B300, if it is not, then terminating;
B300, the point spacing for calculating each touch point outside each touch point and point set in point set, and whether judge described spacing
Less than default threshold value, if so, step 400 is then performed, if it is not, then performing step 100;
B400, the corresponding touch point of point spacing less than threshold value is placed in point set, and returns to B200.Described touch-screen
The method of stabilization, wherein, the step C is specifically included:
Point spacing in C100, calculating point set between each touch point and other touch points, and each touch point calculated
Point spacing average value;
C200, the point spacing average value of each touch point compared, obtain minimum point spacing average value, and obtain minimum
Point spacing evaluation of estimate performs step C300 behind corresponding touch point;
The method of described touch-screen stabilization, wherein, also include after the step C200:
C300, determine whether that other point sets are present, if so, then performing step C100;If it is not, then terminating.
It is corresponding with the above method, present invention also offers the system of touch-screen stabilization, including:
Coordinate obtaining module, for when detecting touch operation, obtain specify touched in the period a little
Point coordinates;
Touch point division module, for calculating the point spacing of any two touch point according to point coordinates, and point is smaller than
Two touch points of default threshold value are placed in same point set;
Characteristic point acquisition module, the characteristic point for obtaining point set, the characteristic point be and other touch points in point set
The touch point of the average value minimum of point spacing;
Reporting module, for the characteristic point to be reported into current application program.
The system of described touch-screen stabilization, wherein, the specified period is 100 milliseconds.
The system of described touch-screen stabilization, wherein, the touch point division module is specifically included:
Point set creation module, is placed in point set for creating a point set, and by a touch point;
Judge module, for judging to whether there is touch point outside point set, is calculated and judge module if so, then starting, if it is not,
Then start-stop module, the termination module is used for terminator;
Calculate and judge module, for calculating the point spacing of each touch point and each touch point outside point set in point set, and judge
Whether described spacing is less than default threshold value, if so, then starting division module, if it is not, then starting point set creation module;
Division module, for the corresponding touch point of point spacing less than threshold value to be placed in point set, and starts judge module.
The system of described touch-screen stabilization, wherein, the calculating and judge module are specifically included:
Average value acquisition module, for calculating the point spacing in point set between each touch point and other touch points, and is calculated
The point spacing average value of each touch point gone out;
Average value comparison module, for the point spacing average value of each touch point to be compared, obtains minimum point spacing and is averaged
Value, and obtain the corresponding touch point of point spacing evaluation of estimate of minimum.
The system of described touch-screen stabilization, wherein, in addition to:
Point set judge module, for determining whether that other point sets are present, if so, then starting average value acquisition module;If
It is no, then terminate.
The method and system of touch-screen stabilization provided by the present invention, any two points are calculated according to the point coordinates of touch point
Between point spacing, will put and be smaller than 2 points of default threshold value and be placed on same point set, so can be by continuous touch point
It is placed in a point set, then obtains the characteristic point of point set, the characteristic point of acquisition is reported into current application program, the spy
It is a little the touch point minimum with the average value of the point spacing of other touch points in point set to levy, and reflects the touch operation of user, can
Effectively avoid the influence that maloperation is brought.
Embodiment
The invention provides the method and system of touch-screen stabilization, to make the purpose of the present invention, technical scheme and effect more
Plus it is clear, clear and definite, referring to the drawings and give an actual example that the present invention is described in more detail.It should be appreciated that described herein
Specific embodiment only to explain the present invention, is not intended to limit the present invention.
Fig. 1 is referred to, Fig. 1 is the method flow diagram of touch-screen stabilization of the present invention.As shown in figure 1, institute of the present invention
The method for the touch-screen stabilization stated, including:
Step 101, when detecting touch operation, obtain specify touched in the period point coordinates a little.
When detecting user to the touch operation of touch-screen, obtain specify touched in the period point coordinates a little, these points
Coordinate had both included the point coordinates of the point of user's Active touch, also included the point coordinates that user is not intended to the point of touch, it is not intended to touch
Touch the touch such as carried out due to shake.The specified period is 100 milliseconds.
Step 102, the point spacing according to any two touch point of point coordinates calculating, and point is smaller than default threshold value
Two touch points are placed in same point set.The point spacing for calculating any two touch point according to point coordinates is to calculate each touch according to point coordinates
The point spacing a little between other touch points is touched, two touch points that point is smaller than into default threshold value, which are placed in same point set, is
A finger main points are smaller than default threshold value and just corresponding two touch point of the spacing are put into same point set, and point set is advance
Create.The step 102, specifically refers to Fig. 3, and Fig. 3 is the refined flow chart of step 102.As shown in figure 3, the step
102 specifically include:
Step T10, one point set of establishment, and a touch point is placed in point set;
Step T20, judge outside point set whether there is touch point, if so, perform step T30, if it is not, then step T50 terminate;
Step T30, the point spacing for calculating each touch point outside each touch point and point set in point set, and judge that described spacing is
It is no to be less than default threshold value, if so, step T40 is then performed, if it is not, then performing step T10;
Step T40, the corresponding touch point of point spacing less than threshold value is placed in point set, and returns to T20.
Step 102 specific steps as described above, create a point set first, any one touch point are placed in point set, root
Strong point coordinate obtains the point and the point spacing of the outer touch point of point set, and the touch point that point is smaller than into default threshold value is placed in described
Point set in, each point spacing touched with each touch point outside point set in point set is obtained again, point is smaller than default threshold value
Touch point be placed in described point set,
In above-mentioned deterministic process, if in the absence of the touch point less than default threshold value, a point set is created again,
And touch point is placed in the point set one by one by point set local official ... ... the like, untill touch point is not present outside point set.
Step 103, the characteristic point for obtaining point set, the characteristic point are to be averaged with the point spacing of other touch points in point set
It is worth minimum touch point.The characteristic point for obtaining point set specifically includes three below step:
Point spacing in first step, calculating point set between each touch point and other touch points, and each touch calculated
The point spacing average value of point;
Second step, the point spacing average value of each touch point compared, obtain minimum point spacing average value, and obtain most
Third step is performed behind the small corresponding touch point of point spacing evaluation of estimate;
Third step, determine whether other point sets exist, if so, then performing first step;If it is not, then terminating.
In order that above three step is clearer, first it is exemplified below:
Feature point set C1Including 4 touch points:P1(550,515)、P2(550,516)、P3(572,536) 、P7(577,
527);If Q1=P1、Q2=P2、Q3=P3、Q4=P7;
Step S202-1, setting variable a=d, b=d, k=0,(D=50 in the present embodiment), calculate Q1With Q2、Q3、Q4It
Between distance be respectively:1、30.4、29.5;Arithmetic mean of instantaneous value is asked to be assigned to a, i.e. a=20.3 these distance values, because a is (now
A=20.3) be less than b(Now b=50), therefore b=a is b=20.3, k=1;
Step S202-2, calculating Q2With Q1、Q3、Q4The distance between be respectively:1、29.7、29.2 ;By these distances
Value asks arithmetic mean of instantaneous value to be assigned to a, i.e. a=20, because a (now a=20) is less than b(Now b=20.3), therefore b=a be b=20, k=
2;
Step S202-3, calculating Q3With Q1、Q2、Q4The distance between be respectively:30.4、29.7、10.3 ;By these away from
Arithmetic mean of instantaneous value is asked to be assigned to a, i.e. a=23.5 from value, because a (now a=23.5) is more than b(Now b=20), therefore do not change b with
K value, i.e. b=20, k=2;
Step S202-4, calculating Q4With Q1、Q2、Q3The distance between be respectively:29.5、29.2、10.3 ;By these away from
Arithmetic mean of instantaneous value is asked to be assigned to a, i.e. a=23 from value, because a (now a=23) is more than b(Now b=20), therefore do not change b's and k
Value, i.e. b=20, k=2;
Step S202-5, the characteristic point of this feature point set are QkThat is, Q2, i.e. P2(550,516) 。
The characteristic point of other point sets can be obtained according to above-mentioned same method.
Step 104, the characteristic point reported into current application program.I.e. the correspondence of current application program touch operation
Program, current application program is reported by the characteristic point, and the current application program carries out phase according to the characteristic point information of reception
The operation answered.
Fig. 2 is referred to, Fig. 2 is the system construction drawing of touch-screen stabilization of the present invention.As shown in Fig. 2 institute of the present invention
The system for the touch-screen stabilization stated, including:
Coordinate obtaining module 201, the institute touched in the period is specified a little for when detecting touch operation, obtaining
Point coordinates, as detailed above;
Touch point division module 202, the point spacing for calculating any two touch point according to point coordinates, and it is small to put spacing
It is placed in two touch points of default threshold value in same point set, as detailed above;
Characteristic point acquisition module 203, the characteristic point for obtaining point set, the characteristic point be and other touch points in point set
Point spacing the minimum touch point of average value, as detailed above;
Reporting module 204, for the characteristic point to be reported into current application program, as detailed above.
The system of described touch-screen stabilization, it is preferred that the specified period is 100 milliseconds, as detailed above.
The system of described touch-screen stabilization, it is preferred that the touch point division module is specifically included:
Point set creation module 401, is placed in point set, as detailed above for creating a point set, and by a touch point;
Judge module 403, for judging to whether there is touch point outside point set, is calculated and judge module if so, then starting
404, if it is not, then start-stop module 402, the termination module 402 is used for terminator, as detailed above;
Calculate and judge module 404, for calculating the point spacing of each touch point and each touch point outside point set in point set, and sentence
Whether fixed described spacing is less than default threshold value, if so, then starting division module 405, if it is not, then starting point set creation module
401, as detailed above;
Division module 405, for the corresponding touch point of point spacing less than threshold value to be placed in point set, and starts judgement mould
Block, as detailed above.
The system of described touch-screen stabilization, wherein, the calculating and judge module are specifically included:
Average value acquisition module, for calculating the point spacing in point set between each touch point and other touch points, and is calculated
The point spacing average value of each touch point gone out, as detailed above;
Average value comparison module, for the point spacing average value of each touch point to be compared, obtains minimum point spacing and is averaged
Value, and the corresponding touch point of point spacing evaluation of estimate of minimum is obtained, as detailed above.
The system of described touch-screen stabilization, wherein, in addition to:
Point set judge module, for determining whether that other point sets are present, if so, then starting average value acquisition module;If
It is no, then terminate, as detailed above.
In summary, the method and system of touch-screen stabilization provided by the present invention, are calculated according to the point coordinates of touch point
Go out the point spacing of any point-to-point transmission, point is smaller than into default threshold value 2 points are placed on same point set, will can so connect
Continuous touch point is placed in a point set, then obtains the characteristic point of point set, the characteristic point of acquisition is reported into current application
Program, the characteristic point is the touch point minimum with the average value of the point spacing of other touch points in point set, and reflection user's touches
Operation is touched, the influence that maloperation is brought can be effectively avoided.
It should be appreciated that the application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can
To be improved or converted according to the above description, all these modifications and variations should all belong to the guarantor of appended claims of the present invention
Protect scope.