Abnormity touch-screen automatic correcting method and system
Technical field
The present invention relates to a kind of touch-screen automatic correcting method and system, particularly relate to a kind of special-shaped touch-screen automatic correcting method and system.
Background technology
The advantages such as touch-screen is a kind of common equipment that substitutes keyboard, mouse in present electronic device terminal and the human-computer interaction interface, and it has easy and simple to handle, directly perceived, and bearing accuracy is higher, and functional definition is convenient, and software programming is flexible.
General touch-screen input system forms by touching detection part, touch screen controller and microcontroller; Touch detection part and be installed in the indicator screen front, for detection of user touch location, send touch screen controller after the acceptance; And the Main Function of touch screen controller is to receive touch information from touch point detection device, and converts it to contact coordinate. give again microcontroller. and its can receive simultaneously the order that microcontroller sends and be carried out.
Based on the difference of principle, touch-screen can be divided into resistance-type, condenser type, surface acoustic wave type etc.Wherein resistance-type is to use wider a kind of touch-screen, and its principle is the coordinate that obtains the contact by measuring horizontal and vertical resistance value.
Touch-screen commonly used all is the standard rectangle, and orientation range is symmetrical, and the orientation range amplitude approaches the full width of cloth.Nonetheless, want the bearing accuracy that reaches higher, still need before use to enter the self-correcting program, demarcate through the physical coordinates at the angle of 3 to 4 points, for example, suppose it is 6.4 inches screens, 640X480 resolution, then their pixel coordinate is respectively (20,20), (20,460), (620,460) and (620,20).Like this, the use method of undetermined coefficients just can be calculated the translation relation between the coordinate system, and then can further operate, but is not that each use all will be proofreaied and correct, as long as coordinate does not drift about, does not just need again to proofread and correct.So after once proofreading and correct, as long as those several parameters are preserved, directly use the parameter that preserved last time to get final product when need next time.
Yet, for special-shaped touch-screen, because its scrambling if adopt said method often can not accurately proofread and correct, therefore can not adopt the automatic correcting method of regular touch-screen.
Summary of the invention
The deficiency that exists for overcoming above-mentioned prior art, the present invention's purpose is to provide a kind of special-shaped touch-screen automatic correcting method and system, and it is corrected accurately, can improve the bearing accuracy of special-shaped touch-screen.
For reaching above-mentioned and other purpose, the invention provides a kind of special-shaped touch-screen automatic correcting method, comprise the steps:
In four corners of this abnormity touch-screen and up and down six points are selected in the edge center position, and set the flat distance of the WAWQ that is positioned at the upside corner and be a, and the flat distance of the WAWQ in downside corner is b, and the vertical range of 2 of edge center positions is c up and down;
Carry out the test of six point calibrations, obtain respectively the AD value of these six points;
Sampled in arbitrfary point on the screen, and utilize the AD value of these six points to calculate the position of this arbitrfary point distance center point by a computing formula; And
According to the coordinate position of touch-screen geometric center in display screen, translation is done in the position of this arbitrfary point distance center point of obtain obtain the coordinate of this arbitrfary point in operating system.
Further, this computing formula is:
YT=c*[(yT-y6)-(y5-y6)/2]/(y5-y6);
XT divides three sections calculating:
If (y2+y4)/2<yT<(y1+y3)/2, XT={{[2*yT-(y2+y4) then]/[(y1+y3)-(y2+y4)] } * (b-a)+a}*[2*xT-(x5+x6)]/[x3-x1+x4-x2];
If yT<(y2+y4)/2 or yT>(y1+y3)/2, then table look-up according to c* (yT-y6)/(y5-y6) numerical value and obtain the numerical value of horizontal width d corresponding to this yT, and XT=d*[2*xT-(x5+x6)]/[x3-x1+x4-x2]; Wherein, x1, y1, x2, y2...., x6, y6 are respectively the AD value of these six points, and XT, YT are the position of this arbitrfary point distance center point.
Further, the numerical range of a, b, c is 0-4095.
Further, need to adjust a according to the actual dot matrix of screen, b, c numerical value, numerical value will meet screen proportion.
Further, x1, y1, x2, y2...., x6, the expression scope of y6 is 0-4095.
For reaching above-mentioned and other purpose, the present invention also provides a kind of special-shaped touch-screen self correcting system, comprises at least:
Check point is selected module, reach up and down six points of edge center position selection in four corners of this abnormity touch-screen, and set the flat distance of the WAWQ be positioned at the upside corner and be a, the flat distance of the WAWQ in downside corner is b, the vertical range of 2 of edge center positions is up and down;
The AD value is obtained module, carries out the test of six point calibrations, obtains respectively six groups of AD values of these six points;
The sampling module is used for being sampled in arbitrfary point on this abnormity touch-screen;
Calculate module, calculate the position of this arbitrfary point distance center point according to the AD value of these six points by a computing formula; And
The translation module is done translation according to the coordinate position of touch-screen geometric center in display screen and is obtained the coordinate of this arbitrfary point in operating system.
Further, this computing formula is:
YT=c*[(yT-y6)-(y5-y6)/2]/(y5-y6);
XT divides three sections calculating:
If (y2+y4)/2<yT<(y1+y3)/2, XT={{[2*yT-(y2+y4) then]/[(y1+y3)-(y2+y4)] } * (b-a)+a}*[2*xT-(x5+x6)]/[x3-x1+x4-x2];
If yT<(y2+y4)/2 or yT>(y1+y3)/2, then table look-up according to c* (yT-y6)/(y5-y6) numerical value and obtain the numerical value of horizontal width d corresponding to this yT, and XT=d*[2*xT-(x5+x6)]/[x3-x1+x4-x2]; Wherein, x1, y1, x2, y2...., x6, y6 are respectively the AD value of these six points, and XT, YT are the position of this arbitrfary point distance center point.
Further, the numerical range of a, b, c is 0-4095.
Further, x1, y1, x2, y2...., x6, the expression scope of y6 is 0-4095.
Compared with prior art, a kind of special-shaped touch-screen automatic correcting method of the present invention and system, utilize the AD value of six selected points by the position of the arbitrfary point distance center point of computing formula calculating acquisition sampling, obtain sampled point at the coordinate of operating system by translation, reached the purpose of comparatively accurately proofreading and correct special-shaped touch-screen, made special-shaped touch-screen have higher bearing accuracy.
Description of drawings
Fig. 1 is the flow chart of steps of a kind of special-shaped touch-screen automatic correcting method of the present invention;
Fig. 2 is the front schematic view of the special-shaped touch-screen of preferred embodiment of the present invention;
Fig. 3 is the system architecture diagram of a kind of special-shaped touch-screen self correcting system of the present invention.
Embodiment
Below by specific instantiation and accompanying drawings embodiments of the present invention, those skilled in the art can understand other advantage of the present invention and effect easily by content disclosed in the present specification.The present invention also can be implemented or be used by other different instantiation, and the every details in this instructions also can be based on different viewpoints and application, carries out various modifications and change under the spirit of the present invention not deviating from.
Fig. 1 is the flow chart of steps of a kind of special-shaped touch-screen automatic correcting method of the present invention.In preferred embodiment of the present invention, special-shaped touch-screen is the resistance-type abnormity touch-screen of trapezoidal shape, and as shown in Figure 1, a kind of special-shaped touch-screen automatic correcting method of the present invention comprises the steps:
Step 101, reach up and down six points of edge center position selection in four corners of this abnormity touch-screen, and it is flat apart from being a to set the WAWQ that is positioned at the upside corner, the flat distance of the WAWQ in downside corner is b, and the vertical range of 2 of edge center positions is c up and down, and Fig. 2 is the front schematic view of the special-shaped touch-screen of preferred embodiment of the present invention, as shown in Figure 2, setting 1,3 horizontal range is a, 2,4 horizontal ranges are b, 5,6 vertical ranges are c, a, b, the numerical range 0-4095 of c, adjust a according to the actual dot matrix needs of screen, b, c numerical value, numerical value will meet screen proportion;
Step 102 is carried out the test of six point calibrations, obtains respectively the AD value of these six points, such as x1, and y1, x2, y2...., x6, y6, the expression scope of these AD values is 0-4095;
Step 103 is sampled to arbitrfary point T on the screen, and the AD value of utilizing these six points calculates the position XT of this arbitrfary point T distance center point by a computing formula, YT, wherein, and XT, the scope of YT is+/-2047, specifically, this computing formula is:
YT=c*[(yT-y6)-(y5-y6)/2]/(y5-y6);
XT divides three sections calculating:
If (y2+y4)/2<yT<(y1+y3)/2, XT={{[2*yT-(y2+y4) then]/[(y1+y3)-(y2+y4)] } * (b-a)+a}*[2*xT-(x5+x6)]/[x3-x1+x4-x2];
If yT<(y2+y4)/2 or yT>(y1+y3)/2, then table look-up according to c* (yT-y6)/(y5-y6) numerical value and obtain numerical value (d and a of horizontal width d corresponding to this yT, b meets ratio), and XT=d*[2*xT-(x5+x6)]/[x3-x1+x4-x2].
Step 104, according to the coordinate position X0 of touch-screen geometric center in display screen, Y0 does translation and obtains the coordinate of this arbitrfary point T point in operating system, i.e. X=XT+X0, Y=YT+Y0.
Fig. 3 is the system architecture diagram of a kind of special-shaped touch-screen self correcting system of the present invention.As shown in Figure 3, a kind of special-shaped touch-screen self correcting system of the present invention comprises: check point selects module 301, AD value to obtain module 302, sampling module 303, calculate module 304 and translation module 305.
Wherein check point selects module 301 to reach up and down six points of edge center position selection in four corners of this abnormity touch-screen, and it is flat apart from being a to set the WAWQ that is positioned at the upside corner, the flat distance of the WAWQ in downside corner is b, the vertical range of 2 of edge center positions is c up and down, wherein the numerical range of a, b, c is 0-4095, adjusts a, b according to the actual dot matrix needs of screen, c numerical value, numerical value will meet screen proportion; The AD value is obtained module 302 and is carried out the test of six point calibrations, obtains respectively six groups of AD values of these six points, such as x1, and y1, x2, y2...., x6, y6, the expression scope of these AD values is 0-4095; Sampling module 303 is used for arbitrfary point T on this abnormity touch-screen is sampled; Calculate module 304, calculate the position XT of this arbitrfary point T distance center point according to the AD value of these six points by a computing formula, YT, wherein, and XT, the scope of YT is+/-2047, specifically, this computing formula is:
YT=c*[(yT-y6)-(y5-y6)/2]/(y5-y6);
XT divides three sections calculating:
If (y2+y4)/2<yT<(y1+y3)/2, XT={{[2*yT-(y2+y4) then]/[(y1+y3)-(y2+y4)] } * (b-a)+a}*[2*xT-(x5+x6)]/[x3-x1+x4-x2];
If yT<(y2+y4)/2 or yT>(y1+y3)/2, then table look-up according to c* (yT-y6)/(y5-y6) numerical value and obtain numerical value (d and a of horizontal width d corresponding to this yT, b meets ratio), and XT=d*[2*xT-(x5+x6)]/[x3-x1+x4-x2].
Translation module 305, according to the coordinate position X0 of touch-screen geometric center in display screen, Y0 does translation and obtains the coordinate of T point in operating system, X=XT+X0, Y=YT+Y0.
As seen, the present invention's special-shaped touch-screen automatic correcting method and system, utilize the AD value of six selected points by the position of the arbitrfary point distance center point of computing formula calculating acquisition sampling, obtain sampled point at the coordinate of operating system by translation, reached the purpose of comparatively accurately proofreading and correct special-shaped touch-screen, made special-shaped touch-screen have higher bearing accuracy.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not is used for restriction the present invention.Any those skilled in the art all can be under spirit of the present invention and category, and above-described embodiment is modified and changed.Therefore, the scope of the present invention should be listed such as claims.