The invention discloses a method for calculating an approximate circle
diameter in a touch
algorithm, which comprises the following steps of: 1, calculating a central physical coordinate according to
original data obtained by touch, and taking the central physical coordinate as an expected value; step 2, calculating a
covariance; step 3, constructing a
covariance matrix; 4, performing eigenvalue
decomposition on the constructed
covariance matrix to obtain eigenvalues; step 5, calculating an initial
ellipse semi-axis length through the characteristic value; step 6, calculating an equivalent
diameter; step 7, simulating a curve equation by using a plurality of samples; and step 8, when actual touch occurs, obtaining the equivalent
diameter through the steps 1-6, and calculating to obtain the diameter of the touch object. According to the method, eigenvalue calculation
processing is carried out on the original
covariance matrix, the contour of a real touch area can be accurately fitted, coordinate distribution characteristics in a theoretical model are considered,
original data and physical size factors of a sensor are combined, and therefore the accuracy of touch size calculation is remarkably improved.