CN-121979410-A - Method for calculating approximate circle diameter in touch algorithm
Abstract
The invention discloses a method for calculating approximate circle diameter in a touch algorithm, which comprises the following steps of step 1, calculating a center physical coordinate according to original data obtained by touch, taking the center physical coordinate as an expected value, step 2, calculating covariance, step 3, constructing a covariance matrix, step 4, carrying out eigenvalue decomposition on the constructed covariance matrix to obtain an eigenvalue, step 5, calculating initial elliptical half-axis length through the eigenvalue, step 6, calculating equivalent diameter, step 7, simulating a curve equation through a plurality of sample touches, and step 8, obtaining the equivalent diameter through steps 1 to 6 when actual touch occurs, and calculating the diameter of a touch object. According to the invention, the characteristic value calculation processing is carried out on the original covariance matrix, so that the outline of the real touch area can be accurately fitted, the coordinate distribution characteristic in the theoretical model is considered, and the original data and physical size factors of the sensor are combined, so that the accuracy of touch size calculation is remarkably improved.
Inventors
- Yi Shufa
- WEI GUOYING
Assignees
- 南京观海微电子有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260209
Claims (4)
- 1. The method for calculating the approximate circle diameter in the touch algorithm is characterized by comprising the following steps of: step 1, calculating central physical coordinates (X0, Y0) of a touch area according to original data obtained by touch, and taking an abscissa X0 and an ordinate Y0 of the central physical coordinates as expected values E (X) and E (Y) in the invention; step 2, calculating Cov [ X, X ] = E [ (X-E (X)) 2], cov [ X, Y ] = E [ (X-E (X)) (Y-E (Y)) ], cov [ Y, Y ] = E [ (Y-E (Y)) 2], wherein X and Y are respectively the horizontal and vertical coordinate values of each point in the touch area; step 3, constructing a covariance matrix of 2 times 2 C = [[Cov[X,X], Cov[X,Y]], [Cov[Y,X], Cov[Y,Y]]]; Step 4, decomposing eigenvalues of the constructed covariance matrix C, and solving an eigenvalue equation Obtaining two characteristic values And ; Step 5, through the characteristic value And Calculating the initial elliptic half-shaft length: Wherein the initial value of the long half shaft Initial value of short half shaft ; Step 6, setting a sampling frame number N, and continuously collecting long and short axes a (i) and b (i) of each frame (i=1, 2, & gt, N; calculating a long axis average value a_avg= Σa (i)/N, and a short axis average value b_avg= Σb (i)/N, and then an equivalent diameter d= (a_avg+b_avg)/2; Step 7, establishing an approximate correction equation y=kd+offset for the calculated equivalent diameter by touching a plurality of samples, wherein y is the actual diameter of the sample, and obtaining a slope k and an offset value offset through least square fitting; And 8, when actual touch occurs, obtaining an equivalent diameter D through the steps 1 to 6, bringing the equivalent diameter D into an approximate correction equation y=kD+offset in the step 7, and calculating to obtain the diameter y of the touch object.
- 2. The method for calculating the approximate circle diameter in the touch algorithm according to claim 1, wherein in the step 1, weighting is performed on all coordinate data in the touch area, the weight coefficient is distributed according to the capacitance change value of each point, the larger the capacitance change value is, the higher the weight is set, and the center physical coordinate is calculated by using the coordinate data after the weighting.
- 3. The method for calculating the approximate circle diameter according to the touch algorithm of claim 1, wherein in the step 5, confidence intervals are set, values with low confidence degrees at both ends of the normal distribution are removed, only values in the confidence intervals are reserved, and the values a0 and b0 are corrected according to the set confidence intervals, so that the corrected values are carried into the subsequent step.
- 4. The method for calculating an approximate circle diameter in a touch algorithm according to claim 1, wherein the sampling frame number n=100-500.
Description
Method for calculating approximate circle diameter in touch algorithm Technical Field The invention belongs to the technical field of display, relates to a touch screen control technology, and particularly relates to a method for calculating an approximate circle diameter in a touch algorithm. Background As various electronic products with touch screen technologies such as mobile phones, tablet computers and learning machines are increasingly widely applied to lives of people, the touch screen products are self-contained, the touch screen is used as a first medium of man-machine interaction, a user can feel a first feeling of the user when operating the touch screen, and the requirements of people on the electronic products are higher and higher, so that the requirements of various brands on the touch effect of a touch IC are gradually improved, but the quality of the touch effect is greatly related to algorithms in the touch IC, thereby promoting manufacturers of the touch IC to increase research and development investment of the touch algorithms, the touch algorithms can accurately calculate the diameter of an object touched on the screen according to original data acquired by the touch IC, and the calculated result is reported to a CPU of a host. For the diameter estimation of a touch object, the object is basically processed into a circular calculated diameter in an approximation way, an ellipse fitting method based on a covariance matrix is adopted in the prior art, the core thought is to construct the covariance matrix by carrying out statistical analysis on a plurality of coordinate points in a coordinate system, then the coordinate point area is approximated to be an ellipse, the square root of the eigenvalue is taken as the length of a major half axis and a minor half axis of the ellipse by calculating the eigenvalue of the covariance matrix, and then the length of the major axis of the ellipse is approximated to be the diameter. However, the theory and the actual engineering characteristics are different, the calculation theory is based on a large number of specific coordinate points in a coordinate system, in engineering application, a touch screen of a full-screen mobile phone which is mainstream in the market is orderly arranged in the whole screen size by 18 x 32 sensors with the physical size of 4mm, as shown in fig. 2, when a finger touches the screen, a sensor covered under the finger can be collected by a touch control IC to acquire a capacitance value, even if one sensor is not covered by the finger, but a point is touched, the touch control IC can also detect the change of the capacitance value on the sensor, and according to the original data, the calculation result is reported to a host CPU. The single sensor has a physical width of 4mm, and an ellipse model constructed by only relying on a covariance matrix is often difficult to accurately capture the true outline of a touch area, so that the calculated diameter error is larger, and the requirement that the error is within 1mm cannot be stably met. Disclosure of Invention Aiming at the technical defect that the prior art of an elliptical model constructed by means of covariance matrixes cannot meet the requirement of error precision, the invention discloses a method for calculating the approximate circle diameter in a touch algorithm. The method for calculating the approximate circle diameter in the touch algorithm comprises the following steps: step 1, calculating central physical coordinates (X0, Y0) of a touch area according to original data obtained by touch, and taking an abscissa X0 and an ordinate Y0 of the central physical coordinates as expected values E (X) and E (Y) in the invention; step 2, calculating Cov [ X, X ] = E [ (X-E (X)) 2], cov [ X, Y ] = E [ (X-E (X)) (Y-E (Y)) ], cov [ Y, Y ] = E [ (Y-E (Y)) 2], wherein X and Y are respectively the horizontal and vertical coordinate values of each point in the touch area; step 3, constructing a covariance matrix of 2 times 2 C = [[Cov[X,X], Cov[X,Y]], [Cov[Y,X], Cov[Y,Y]]]。 Step 4, decomposing eigenvalues of the constructed covariance matrix C, and solving an eigenvalue equation Obtaining two characteristic valuesAnd。 Step 5, through the characteristic valueAndCalculating the initial elliptic half-shaft length: Wherein the initial value of the long half shaft Initial value of short half shaft; Step 6, setting a sampling frame number N, and continuously collecting long and short axes a (i) and b (i) of each frame (i=1, 2, & gt, N; calculating a long axis average value a_avg= Σa (i)/N, and a short axis average value b_avg= Σb (i)/N, and then an equivalent diameter d= (a_avg+b_avg)/2; Step 7, establishing an approximate correction equation y=kd+offset for the calculated equivalent diameter by touching a plurality of samples, wherein y is the actual diameter of the sample, and obtaining a slope k and an offset value offset through least square fitting; And 8, when actual touch occ