Touch screen coordinate calibration method, device, equipment, storage medium and product
By constructing a triangular mesh and calculating the affine transformation matrix to calibrate the touchscreen coordinates, the problem of nonlinear distortion of the touchscreen was solved, improving touch accuracy and the accuracy of human-computer interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN HE SHENG DA OPTOELECTRONICS CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-30
Smart Images

Figure CN122308650A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of touch screen technology, and in particular to coordinate calibration methods, apparatus, devices, storage media, and products for touch screens. Background Technology
[0002] In practical applications, due to the influence of the physical manufacturing process, material properties, and environmental factors (such as temperature and humidity) of the touch screen, the electrical signals generated by the touch sensor often exhibit nonlinear distortion. This nonlinear distortion means that the mapping relationship between touch coordinates and display coordinates is not a simple linear proportional relationship, but rather shows different degrees of deviation in different areas of the screen. For example, the bending deformation of the screen edge area may cause the touch point detection result to be offset inward compared to the actual touch point, affecting the touch accuracy of the touch screen. Summary of the Invention
[0003] The main technical problem addressed by this application is to provide a coordinate calibration method, apparatus, device, storage medium, and product for a touch screen, which solves the technical problem that the electrical signals generated by touch sensors often have nonlinear distortion, causing the detected touch points to shift inward.
[0004] To solve the above-mentioned technical problems, this application adopts a coordinate calibration method for a touch screen, which includes the following steps: Obtain a pre-constructed triangular mesh for the touchscreen, wherein the triangular mesh is composed of multiple triangles, each triangle's vertex is the touch point coordinate, and each vertex corresponds to a reference marker point coordinate; For each triangle in the triangular mesh, an affine transformation matrix is calculated based on the touch point coordinates and reference marker coordinates corresponding to the three vertices of each triangle. Each affine transformation matrix corresponds to a triangular region. For the display coordinates to be calibrated, the triangle to which it belongs is determined, and matrix operations are performed on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
[0005] Furthermore, prior to the step of obtaining the triangular mesh pre-constructed for the touchscreen, the procedure includes: The coordinates of at least three non-collinear reference marker points are displayed sequentially on the display unit of the touch screen, and at the same time, the touch unit of the touch screen collects a set of point pairs generated by the user performing a touch operation on each of the reference marker point coordinates, which consists of at least three reference marker point coordinates and at least three corresponding touch point coordinates. A triangular mesh is constructed based on the coordinates of at least three touch points in the set of point pairs.
[0006] Furthermore, the step of acquiring a set of point pairs generated by the user performing a touch operation on each of the reference marker points through the touch unit of the touch screen, consisting of the coordinates of at least three reference marker points and the coordinates of at least three corresponding touch points, includes: While the coordinates of each reference marker point are sequentially displayed on the display unit of the touch screen, the touch events of the touch unit are monitored in real time. Extract the original touch point corresponding to the current reference marker point when the finger was pressed from the message body of the touch event; After completing the touch operation on all reference marker points, the coordinates of the reference marker point and the original touch point corresponding to each reference marker point are summarized; Each reference marker coordinate and its corresponding original touch point are stored in a preset data linked list in key-value pair form, resulting in a set of point pairs consisting of at least three reference marker coordinates and at least three corresponding touch point coordinates.
[0007] Furthermore, constructing a triangular mesh based on the coordinates of at least three touch points in the set of point pairs includes: Extract all touch point coordinates from the set of point pairs to obtain touch point cloud data consisting of at least three touch point coordinates; The touch point cloud data is subjected to Delaunay triangulation to generate an initial triangular mesh that covers the touch area and where each triangle does not overlap. Traverse each grid edge in the initial triangular mesh and calculate the current length of each grid edge; Based on a preset maximum side length threshold, each grid edge is filtered to remove triangles whose side length exceeds the maximum side length threshold from the initial triangle grid, thus obtaining a triangle grid.
[0008] Furthermore, the step of performing Delaunay triangulation on the touch point cloud data to generate an initial triangular mesh covering the touch area and where each triangle does not overlap includes: The coordinates of every three touch points in the touch point cloud data are combined and traversed to obtain a set of candidate triangles; wherein, the set of candidate triangles includes all possible triangles formed by connecting each pair of touch point coordinates; For each candidate triangle, the center and radius of its circumcircle are calculated at the three vertices to obtain a candidate circumcircle parameter table; wherein, the candidate circumcircle parameter table includes the coordinates of the circumcircle center and the circumcircle radius value corresponding to each candidate triangle; Based on the candidate circumcircle parameter table, the coordinates of the remaining touch points in the touch point cloud data, excluding the current candidate triangle vertex, are subjected to circle inclusion detection to obtain a set of valid triangles that satisfy the empty circle condition; wherein, the empty circle condition is that the circumcircle of the candidate triangle does not contain any other touch point coordinates. Each triangle in the set of valid triangles is indexed and its edge connection is recorded to obtain an initial triangle mesh that covers the touch area and where the triangles do not overlap. The initial triangle mesh includes a list of vertex numbers for each valid triangle and the common edge index of adjacent triangles.
[0009] Furthermore, the step of calculating the affine transformation matrix corresponding to each triangle based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle includes: Traverse each triangle in the triangle grid, and for the target triangle being traversed, extract the touch point coordinates corresponding to the three vertices of the triangle and the coordinates of the reference marker point that is paired with them from the point pair set to obtain three sets of vertex coordinate pairs; Based on the three sets of vertex coordinate pairs, a system of linear equations consisting of six affine parameters is constructed to describe the mapping relationship between the touch point coordinates and the reference mark point coordinates. Solving the system of linear equations yields the six affine parameters corresponding to the target triangle; The six affine parameters are filled into a 3×3 matrix according to a preset matrix arrangement order to generate the affine transformation matrix corresponding to the target triangle.
[0010] The present invention also provides a coordinate calibration device for a touch screen, comprising: The acquisition module is used to acquire a triangular mesh pre-constructed for the touch screen, wherein the triangular mesh is composed of multiple triangles, the vertex of each triangle is the coordinate of the touch point, and each vertex corresponds to the coordinate of a reference marker point; The calculation module is used to calculate the affine transformation matrix corresponding to each triangle in the triangular mesh, based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle, with each affine transformation matrix corresponding to a triangular region. The calculation module is used to determine the triangle to which the display coordinates to be calibrated belong, and to perform matrix operations on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
[0011] The present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above methods.
[0012] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the above methods.
[0013] The present invention also provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of any of the above methods.
[0014] The above scheme obtains a pre-constructed triangular mesh for the touchscreen, wherein the triangular mesh is composed of multiple triangles, each triangle's vertex represents the touch point coordinates, and each vertex corresponds to a reference marker point coordinate. For each triangle in the triangular mesh, based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle, an affine transformation matrix is calculated for that triangle, with each affine transformation matrix corresponding to a triangular region. For the display coordinates to be calibrated, the triangle to which it belongs is determined, and matrix operations are performed on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation. This solves the technical problem that the electrical signals generated by touch sensors often have nonlinear distortion, causing the detected touch points to shift inward. Due to the influence of physical manufacturing processes, material properties, and edge electric field distortion, the original detected touch point coordinates generally exhibit nonlinear distortion with inward shift in the screen edge area, resulting in a discrepancy between the user's actual touch position and the system's recognized position, leading to false icon triggering or operation lag. This solution pre-constructs a triangular mesh with the measured touch point coordinates as vertices and calculates a dedicated affine transformation matrix based on the mapping relationship between the touch point coordinates within each triangle and the corresponding reference marker coordinates. This allows the calibration model to directly reflect the actual deviation distribution at the hardware level. When the system receives the display coordinates to be calibrated, it first determines the specific region it falls into within the triangular mesh, then calls the affine transformation matrix corresponding to that region to perform a local coordinate transformation, and outputs the geometrically corrected touch coordinates. This approach avoids the problem of insufficient fitting of local nonlinear distortion by a single global calibration model, especially in the corner areas of curved screens or large-size panels, effectively reducing coordinate shrinkage caused by electric field curvature. After calibration, the system spatially matches the real-time detected physical touch points with the calibrated touch coordinates, confirming a valid operation only when the two coincide within the tolerance range, thus ensuring that the user's icon click behavior is accurately recognized. In this embodiment, the above scheme, through a combination of regional local modeling and dynamic matrix correction, significantly suppresses the inward shift of touch points caused by nonlinear distortion, improves the positioning accuracy of the entire screen, especially the edge areas, achieves spatial consistency between touch response and visual feedback, and enhances the accuracy and reliability of human-computer interaction. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a coordinate calibration method for a touchscreen according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a point pair set consisting of at least three reference marker coordinates and at least three corresponding touch point coordinates in one embodiment of the present invention. Figure 3 This is the present invention. Figure 1 A schematic diagram of the implementation process of S1 in the middle; Figure 4 This is the present invention. Figure 1 A schematic diagram of the implementation process of S2 in the middle; Figure 5 This is a structural block diagram of a coordinate calibration device for a touch screen according to an embodiment of the present invention; Figure 6 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.
[0017] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0019] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. It should also be understood that, as used in this specification and the appended claims, the term "and / or" refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0020] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0021] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0022] Specifically, such as Figure 1 As shown, Figure 1 This invention provides a coordinate calibration method for a touchscreen, comprising the following steps: Step S1: Obtain a triangular mesh pre-constructed for the touchscreen, wherein the triangular mesh is composed of multiple triangles, each triangle's vertex is the touch point coordinate, and each vertex corresponds to a reference marker point coordinate.
[0023] Specifically, a pre-constructed triangular mesh is obtained, which is composed of multiple triangles. The vertices of each triangle are the coordinates of the touch point determined during the calibration process. Each vertex is associated with a known reference marker coordinate to establish the mapping relationship between the touch system and the display system. The energy region data corresponding to each candidate touch point is extracted and its energy distribution characteristics are represented in matrix form. Then, the similarity between this energy distribution and the pre-stored standard ghost point energy templates in the ghost point feature library is calculated one by one. The matching score is obtained by normalized cross-correlation method. For example, when a suspected ghost point appears in the edge area of a 5-inch capacitive screen, if its energy distribution matches the typical water stain interference template in the library with a score higher than 0.85, it is determined to have high similarity. In this embodiment, the above scheme effectively identifies non-real touch signals, suppresses false alarms, and improves coordinate accuracy through the template matching mechanism.
[0024] Step S2: For each triangle in the triangular mesh, calculate the affine transformation matrix corresponding to the triangle based on the touch point coordinates and reference marker coordinates corresponding to the three vertices of each triangle. Each affine transformation matrix corresponds to a triangular region.
[0025] Specifically, for each triangle in the triangular mesh, two sets of six linear equations are constructed using the touch point coordinates and reference marker coordinates corresponding to its three vertices. The affine transformation parameters within the local area are solved using the least squares method, thereby determining a unique affine transformation matrix. This matrix is specifically used to correct coordinate distortion within the corresponding triangular area. Simultaneously, the energy region data collected around each candidate touch point is represented in grayscale matrix form and compared item by item with the preset standard ghost point energy distribution template in the ghost point feature library. A weighted Euclidean distance is used to calculate the matching degree score. For example, if an energy distribution detected in the upper right corner of the screen has a similarity exceeding the threshold of 0.82 with the wet hand interference template in the library, it is determined to be a suspected ghost point. In this embodiment, the above scheme can achieve accurate compensation for local nonlinear distortion, while effectively identifying and suppressing false touch signals caused by environmental interference, thus improving the overall positioning accuracy and stability of the system.
[0026] Step S3: For the display coordinates to be calibrated, determine the triangle to which it belongs, and perform matrix operations on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
[0027] Specifically, when the display coordinates generated by a touch event are received, the system first determines which triangle region in the triangular mesh the coordinates fall into using a point-polygon position determination algorithm. Once the triangle is located, the system calls the pre-calculated affine transformation matrix corresponding to that triangle to perform a matrix left multiplication operation on the original display coordinates, outputting the geometrically corrected touch coordinates. Subsequently, the driver layer spatially matches the detected physical touch point coordinates with these calibrated touch coordinates. If the two coincide within a preset tolerance range, a valid touch is confirmed, triggering the corresponding icon's functional response. Simultaneously, the energy region associated with each candidate touch point is extracted and compared one by one with the standard templates in the ghost point feature library. A matching score is obtained based on the correlation coefficient. For example, when the device is in a humid environment, if the energy distribution of a certain touch scores 0.88 with the water droplet interference template in the library, the system reduces the validity weight of that point accordingly. In this embodiment, the above scheme achieves high-precision coordinate mapping under nonlinear distortion, and at the same time, combines energy feature analysis to suppress false triggering, improving the accuracy and reliability of touch response.
[0028] In a specific embodiment, such as Figure 2 As shown, prior to the step of obtaining the triangular mesh pre-constructed for the touchscreen, the following steps are included: S11, sequentially display the coordinates of at least three non-collinear reference marker points on the display unit of the touch screen, and simultaneously collect the set of point pairs generated by the user performing a touch operation on each of the reference marker point coordinates through the touch unit of the touch screen, which consists of at least three reference marker point coordinates and at least three corresponding touch point coordinates; S12, construct a triangular mesh based on the coordinates of the at least three touch points in the set of point pairs.
[0029] Specifically, before acquiring the pre-constructed triangular mesh for the touchscreen, the system must first complete an initial calibration process. This process begins with the controller instructing the display unit to sequentially activate and present the coordinates of at least three non-collinear reference marker points. These coordinates are typically selected at specific locations within the effective visible area of the screen, such as the upper left corner, lower right corner, and top center, to ensure the non-degenerate geometric distribution. When a reference marker point is illuminated on the display, the user is prompted to perform a specific touch operation at that location using a designated input tool (such as a finger or stylus). During this process, the touch unit acquires the raw signals captured by the sensor array in real time and resolves the physical touch point coordinates corresponding to this touch using a centroid algorithm or peak detection method. Each such interaction forms a point-pair data item containing a reference marker point coordinate and its corresponding actually detected touch point coordinate; all such point pairs together constitute a point-pair set.
[0030] Considering the influence of manufacturing tolerances and electric field distortion at the panel edges, the collected touch point coordinates often deviate from the ideal reference marker coordinates, especially in the side areas of curved screens. Subsequently, based on all touch point coordinates extracted from this set of point pairs, a planar meshing process is performed using the Delaunay triangulation algorithm. The constraint is that the generated triangles should be as close to equilateral as possible and avoid elongated triangles, thus constructing a triangular mesh covering the entire effective touch area. Each triangle in this mesh is formed by connecting three touch point coordinates as vertices, and each vertex is strictly associated with its corresponding reference marker coordinate in the set of point pairs, thus establishing the basis for local spatial mapping.
[0031] Meanwhile, during normal operation, whenever a new candidate touch point is detected, the signal intensity distribution within a certain neighborhood around it is extracted as an energy region matrix. This matrix is then matched with various standard ghost point energy distribution templates pre-stored in the ghost point feature library—such as lateral strip-shaped energy regions formed by simulated water droplet bridging or isolated high-energy patches caused by electrostatic accumulation—through two-dimensional cross-correlation operations, outputting a matching score between 0 and 1 to quantify its similarity to known interference patterns. In this embodiment, the above scheme establishes a calibration base grid that accurately reflects physical characteristics through actual sampled data-driven methods, improving the local fitting accuracy of subsequent affine transformations. Simultaneously, combined with pre-processed multi-point calibration and real-time energy feature screening, it synergistically enhances the system's ability to recognize genuine touch intentions and its robustness against environmental interference.
[0032] In a specific embodiment, the step of collecting a set of point pairs generated by the user performing a touch operation on each of the reference marker points through the touch unit of the touch screen, consisting of the coordinates of at least three reference marker points and the coordinates of at least three corresponding touch points, includes: While the coordinates of each reference marker point are sequentially displayed on the display unit of the touch screen, the touch events of the touch unit are monitored in real time. Extract the original touch point corresponding to the current reference marker point when the finger was pressed from the message body of the touch event; After completing the touch operation on all reference marker points, the coordinates of the reference marker point and the original touch point corresponding to each reference marker point are summarized; Each reference marker coordinate and its corresponding original touch point are stored in a preset data linked list in key-value pair form, resulting in a set of point pairs consisting of at least three reference marker coordinates and at least three corresponding touch point coordinates.
[0033] Specifically, as the touchscreen display unit sequentially presents the coordinates of each reference marker point, the system's underlying driver listens in real-time to the touch event stream reported by the touch unit via interrupts. Whenever a reference marker point is activated, the operator needs to tap that location with their finger or stylus. At this time, the touch sensor detects the capacitance change and generates a raw signal frame. After analog-to-digital conversion and filtering, a touch event containing the touch state, coordinates, and timestamp is formed.
[0034] The system only captures the first valid event message body generated at the moment of "touch down" to eliminate the interference of redundant data introduced by swiping or long pressing on the calibration accuracy. The original touch point parsed from this message body is the actual physical coordinate value detected by the touch unit in this interaction. This value and the coordinates of the reference marker point being touched on the current screen form the basis for a pairing.
[0035] The entire calibration process requires the user to click on all the preset reference markers one by one. For example, first click the top-left crosshair icon at (50, 50) pixels, then click the bottom-right dot at (1920, 1080) pixels, and finally click the triangle symbol at (980, 200) pixels slightly above the center. Each click records the corresponding original touch point. After all reference markers have been touched, the controller summarizes all the collected data and organizes it into an ordered set of correspondences.
[0036] Subsequently, the system organizes this data in key-value pairs, where the key is the coordinates of the reference marker point on the display unit, and the value is the original touch point obtained by the touch unit under the same interaction action; the two are encapsulated in pairs. These key-value pairs are written one by one into a pre-allocated linear data linked list according to the calibration order or spatial index. This linked list structure supports dynamic expansion and fast traversal, ultimately forming a complete set of point pairs with no fewer than three elements, and the coordinates of each reference marker point are geometrically non-collinear to satisfy the rigid constraints of subsequent triangulation.
[0037] This set of point pairs serves as direct input for constructing the triangular mesh, ensuring that the calibration model originates from real human-computer interaction sampling. Simultaneously, during normal device operation, for each newly emerging candidate touch point, the energy values of its neighboring sensor nodes are extracted and constructed into a two-dimensional energy region matrix. This matrix is then subjected to normalized cross-correlation with pre-stored standard templates in the ghost point feature library—such as diffuse high-energy regions simulating sweat or peak-shaped energy distributions induced by external electromagnetic pulses—to obtain a quantitative similarity matching score, used for subsequent ghost point identification.
[0038] In this embodiment, the above scheme ensures the integrity and timing consistency of calibration data by accurately capturing the original data at the start of touch and using structured storage. Combined with the message extraction mechanism based on hardware events, it effectively reduces the risk of coordinate drift caused by software latency. At the same time, the pre-set key-value pair linked list management method improves data access efficiency and provides a reliable data foundation for high-precision nonlinear calibration.
[0039] In a specific embodiment, constructing a triangular mesh based on the coordinates of at least three touch points in the set of point pairs includes: Extract all touch point coordinates from the set of point pairs to obtain touch point cloud data consisting of at least three touch point coordinates; The touch point cloud data is subjected to Delaunay triangulation to generate an initial triangular mesh that covers the touch area and where each triangle does not overlap. Traverse each grid edge in the initial triangular mesh and calculate the current length of each grid edge; Based on a preset maximum side length threshold, each grid edge is filtered to remove triangles whose side length exceeds the maximum side length threshold from the initial triangle grid, thus obtaining a triangle grid.
[0040] Specifically, as the touchscreen display unit sequentially presents the coordinates of each reference marker point, the system's underlying driver listens in real-time to the touch event stream reported by the touch unit via interrupts. Whenever a reference marker point is activated, the operator needs to tap that location with their finger or stylus. At this time, the touch sensor detects the capacitance change and generates a raw signal frame. After analog-to-digital conversion and filtering, a touch event containing the touch state, coordinates, and timestamp is formed.
[0041] The system only captures the first valid event message body generated at the moment of "touch down" to eliminate the interference of redundant data introduced by swiping or long pressing on the calibration accuracy. The original touch point parsed from this message body is the actual physical coordinate value detected by the touch unit in this interaction. This value and the coordinates of the reference marker point being touched on the current screen form the basis for a pairing.
[0042] The entire calibration process requires the user to click on all the preset reference markers one by one. For example, first click the top-left crosshair icon at (50, 50) pixels, then click the bottom-right dot at (1920, 1080) pixels, and finally click the triangle symbol at (980, 200) pixels slightly above the center. Each click records the corresponding original touch point. After all reference markers have been touched, the controller summarizes all the collected data and organizes it into an ordered set of correspondences.
[0043] Subsequently, the system organizes this data in key-value pairs, where the key is the coordinates of the reference marker point on the display unit, and the value is the original touch point obtained by the touch unit under the same interaction action; the two are encapsulated in pairs. These key-value pairs are written one by one into a pre-allocated linear data linked list according to the calibration order or spatial index. This linked list structure supports dynamic expansion and fast traversal, ultimately forming a complete set of point pairs with no fewer than three elements, and the coordinates of each reference marker point are geometrically non-collinear to satisfy the rigid constraints of subsequent triangulation.
[0044] This set of point pairs serves as direct input for constructing the triangular mesh, ensuring that the calibration model originates from real human-computer interaction sampling. Simultaneously, during normal device operation, for each newly emerging candidate touch point, the energy values of its neighboring sensor nodes are extracted and constructed into a two-dimensional energy region matrix. This matrix is then subjected to normalized cross-correlation with pre-stored standard templates in the ghost point feature library—such as diffuse high-energy regions simulating sweat or peak-shaped energy distributions induced by external electromagnetic pulses—to obtain a quantitative similarity matching score, used for subsequent ghost point identification.
[0045] In this embodiment, the above scheme ensures the integrity and timing consistency of calibration data by accurately capturing the original data at the start of touch and using structured storage. Combined with the message extraction mechanism based on hardware events, it effectively reduces the risk of coordinate drift caused by software latency. At the same time, the pre-set key-value pair linked list management method improves data access efficiency and provides a reliable data foundation for high-precision nonlinear calibration.
[0046] In a specific embodiment, the step of performing Delaunay triangulation on the touch point cloud data to generate an initial triangular mesh covering the touch area and where each triangle does not overlap includes: The coordinates of every three touch points in the touch point cloud data are combined and traversed to obtain a set of candidate triangles; wherein, the set of candidate triangles includes all possible triangles formed by connecting each pair of touch point coordinates; For each candidate triangle, the center and radius of its circumcircle are calculated at the three vertices to obtain a candidate circumcircle parameter table; wherein, the candidate circumcircle parameter table includes the coordinates of the circumcircle center and the circumcircle radius value corresponding to each candidate triangle; Based on the candidate circumcircle parameter table, the coordinates of the remaining touch points in the touch point cloud data, excluding the current candidate triangle vertex, are subjected to circle inclusion detection to obtain a set of valid triangles that satisfy the empty circle condition; wherein, the empty circle condition is that the circumcircle of the candidate triangle does not contain any other touch point coordinates. Each triangle in the set of valid triangles is indexed and its edge connection is recorded to obtain an initial triangle mesh that covers the touch area and where the triangles do not overlap. The initial triangle mesh includes a list of vertex numbers for each valid triangle and the common edge index of adjacent triangles.
[0047] Specifically, the coordinates of all stored original touch points are extracted from the set of point pairs to form a set of discretely distributed two-dimensional coordinate data, i.e., touch point cloud data. This dataset contains at least three non-collinear points, and their spatial distribution corresponds to the actual touch positions during the calibration process. Due to manufacturing deviations and edge electric field distortion, these touch points often deviate from the ideal reference marker positions, especially in the side areas of curved displays larger than 5 inches, where the offset can reach tens of pixels. To construct a geometrically stable mesh, the Delaunay triangulation algorithm is applied to the touch point cloud data. This algorithm, based on the empty circle criterion, ensures that the circumcircle of any triangle does not contain other data points, thereby generating an initial triangular mesh composed of non-overlapping triangles that seamlessly cover the effective touch area.
[0048] This process is implemented using a computational geometry library, for example, employing the Bowyer-Watson algorithm for incremental insertion modeling, ultimately outputting a set of topologically connected triangular units. Next, the system traverses each edge of this initial triangular mesh, calculating its current length using the Euclidean distance formula. For example, an edge connecting the top left corner to the touch point in the center region has a calculated length of 420.3 pixels. Based on a preset maximum edge length threshold, such as 400 pixels, all mesh edges are filtered. If any side length of a triangle exceeds this threshold, it is determined to have crossed areas of severe signal distortion or abnormal sensor response, belonging to unreliable calibration areas, and must be removed from the initial triangular mesh. This edge length filtering mechanism effectively eliminates large-scale triangles caused by sparse calibration points or local nonlinear abrupt changes, preventing them from introducing excessive interpolation errors during the calibration stage. The retained triangles after filtering constitute the final triangular mesh, used for subsequent local fitting of the affine transformation matrix.
[0049] Meanwhile, when a candidate touch point is detected during runtime, the energy values of the surrounding sensor nodes are extracted into an energy region matrix. This matrix is then matched with a normalized cross-correlation model of a pre-stored standard template in the ghost point feature library—such as a horizontal stripe energy distribution formed by simulated water droplet bridging or an isolated high-energy patch caused by electrostatic accumulation. A matching score between 0 and 1 is output to identify false touches. In this embodiment, the above scheme constructs a local calibration mesh adapted to actual physical characteristics through a dual processing of Delaunay partitioning and side length constraints. This improves the accuracy and robustness of nonlinear distortion compensation. At the same time, the pre-emptive geometric filtering mechanism avoids the interference of abnormal regions on the overall model, enhancing the system's stable response capability in complex environments.
[0050] In a specific embodiment, such as Figure 4 As shown, the step of calculating the affine transformation matrix corresponding to each triangle based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle includes: S21, traverse each triangle in the triangle grid, and for the target triangle being traversed, extract the touch point coordinates corresponding to the three vertices of the triangle and the coordinates of the reference marker points that are paired with them from the point pair set to obtain three sets of vertex coordinate pairs; S22, Based on the three sets of vertex coordinate pairs, construct a system of linear equations consisting of six affine parameters that describe the mapping relationship between the touch point coordinates and the reference mark point coordinates; S23, Solve the system of linear equations to obtain the six affine parameters corresponding to the target triangle; S24, fill the six affine parameters into a 3×3 matrix according to a preset matrix arrangement order to generate the affine transformation matrix corresponding to the target triangle.
[0051] Specifically, in the above technical solution, the letter symbols involved are used to characterize the key parameters in the affine transformation model. Their definitions and physical meanings are as follows: Letters a and b describe the linear transformation coefficients in the X-axis direction within the local region of the target triangle. a mainly reflects the scaling and rotation coupling components along the horizontal direction, while b characterizes the cross-effect of the Y-coordinate on the X-mapping caused by shear deformation. c and d correspond to the transformation parameters in the Y-axis direction. c reflects the tilt contribution of the X-coordinate to the Y-mapping, while d dominates the scaling and rotation effects in the vertical direction. These four parameters together constitute the linear part of the transformation matrix, determining the rotation, scaling, and deformation characteristics within the region. Parameter tx represents the translation offset in the X-direction, used to compensate for the horizontal origin deviation between the touch coordinate system and the display coordinate system; ty is the translation in the Y-direction, correcting the vertical positional offset. The above six parameters (a, b, c, d, tx, ty) are obtained by solving a system of linear equations constructed from three sets of vertex coordinate pairs. Each coordinate pair provides two equation constraints, forming a system of six linear equations to ensure the uniqueness of the solution. Finally, these parameters are filled into a 3×3 matrix in standard homogeneous coordinate form, with the first row containing a, b, tx, the second row containing c, d, ty, and the third row containing 0, 0, 1, forming a complete affine transformation matrix specifically used for coordinate correction calculations within the triangular coverage area. In this embodiment, the above scheme, by clarifying the geometric meaning of each parameter and accurately solving it based on measured data, achieves effective modeling and compensation for local nonlinear distortions of the screen, improving the spatial accuracy of touch response.
[0052] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention. It should be noted that the information interaction, execution process, etc. between the above devices / units are based on the same concept as the method embodiments of this application. Their specific functions and technical effects can be found in the embodiment section of the control device, and will not be repeated here.
[0053] Please see Figure 5 , Figure 5 This is a schematic diagram of the framework of an embodiment of the coordinate calibration device for the touchscreen of this application. Figure 5 As shown, the coordinate calibration device for the touch screen includes an acquisition module 1, which is used to acquire a triangular mesh pre-constructed for the touch screen, wherein the triangular mesh is composed of multiple triangles, the vertex of each triangle is the coordinate of the touch point, and each vertex corresponds to the coordinate of a reference marker point; Calculation module 2 is used to calculate the affine transformation matrix corresponding to each triangle in the triangular mesh, based on the touch point coordinates and reference mark point coordinates corresponding to the three vertices of each triangle, with each affine transformation matrix corresponding to a triangular region. The calculation module 3 is used to determine the triangle to which the display coordinates to be calibrated belong, and to perform matrix operations on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
[0054] The above module is used to perform the steps of the coordinate calibration method for the touch screen.
[0055] Reference Figure 6 This invention also provides a computer device whose internal structure can be as follows: Figure 6 As shown, the computer device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.
[0056] Those skilled in the art will understand that Figure 6 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.
[0057] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0058] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the functions of the various structures of the control device described above, or to implement the steps in the various method embodiments described above.
[0059] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.
[0060] In some embodiments, the functions or modules of the apparatus provided in this disclosure can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0061] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0062] In the several embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. For example, the apparatus implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.
[0063] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0064] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0065] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0066] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
Claims
1. A coordinate calibration method for a touchscreen, characterized in that, Includes the following steps: Obtain a pre-constructed triangular mesh for the touchscreen, wherein the triangular mesh is composed of multiple triangles, each triangle's vertex is the touch point coordinate, and each vertex corresponds to a reference marker point coordinate; For each triangle in the triangular mesh, an affine transformation matrix is calculated based on the touch point coordinates and reference marker coordinates corresponding to the three vertices of each triangle. Each affine transformation matrix corresponds to a triangular region. For the display coordinates to be calibrated, the triangle to which it belongs is determined, and matrix operations are performed on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
2. The coordinate calibration method for a touchscreen according to claim 1, characterized in that, Prior to the step of obtaining the triangular mesh pre-constructed for the touchscreen, the following steps are included: The coordinates of at least three non-collinear reference marker points are displayed sequentially on the display unit of the touch screen, and at the same time, the touch unit of the touch screen collects a set of point pairs generated by the user performing a touch operation on each of the reference marker point coordinates, which consists of at least three reference marker point coordinates and at least three corresponding touch point coordinates. A triangular mesh is constructed based on the coordinates of at least three touch points in the set of point pairs.
3. The coordinate calibration method for a touchscreen according to claim 2, characterized in that, The set of point pairs generated by the user performing a touch operation on each of the reference marker points, collected by the touch unit of the touch screen, consists of the coordinates of at least three reference marker points and the coordinates of at least three corresponding touch points, including: While the coordinates of each reference marker point are sequentially displayed on the display unit of the touch screen, the touch events of the touch unit are monitored in real time. Extract the original touch point corresponding to the current reference marker point when the finger was pressed from the message body of the touch event; After completing the touch operation on all reference marker points, the coordinates of the reference marker point and the original touch point corresponding to each reference marker point are summarized; Each reference marker coordinate and its corresponding original touch point are stored in a preset data linked list in key-value pair form, resulting in a set of point pairs consisting of at least three reference marker coordinates and at least three corresponding touch point coordinates.
4. The coordinate calibration method for a touchscreen according to claim 2, characterized in that, The construction of a triangular mesh based on the coordinates of at least three touch points in the set of point pairs includes: Extract all touch point coordinates from the set of point pairs to obtain touch point cloud data consisting of at least three touch point coordinates; The touch point cloud data is subjected to Delaunay triangulation to generate an initial triangular mesh that covers the touch area and where each triangle does not overlap. Traverse each grid edge in the initial triangular mesh and calculate the current length of each grid edge; Based on a preset maximum side length threshold, each grid edge is filtered to remove triangles whose side length exceeds the maximum side length threshold from the initial triangle grid, thus obtaining a triangle grid.
5. The coordinate calibration method for a touchscreen according to claim 4, characterized in that, The step of performing Delaunay triangulation on the touch point cloud data to generate an initial triangular mesh covering the touch area and where each triangle does not overlap includes: The coordinates of every three touch points in the touch point cloud data are combined and traversed to obtain a set of candidate triangles; wherein, the set of candidate triangles includes all possible triangles formed by connecting each pair of touch point coordinates; For each candidate triangle, the center and radius of its circumcircle are calculated at the three vertices to obtain a candidate circumcircle parameter table; wherein, the candidate circumcircle parameter table includes the coordinates of the circumcircle center and the circumcircle radius value corresponding to each candidate triangle; Based on the candidate circumcircle parameter table, the coordinates of the remaining touch points in the touch point cloud data, excluding the current candidate triangle vertex, are subjected to circle inclusion detection to obtain a set of valid triangles that satisfy the empty circle condition; wherein, the empty circle condition is that the circumcircle of the candidate triangle does not contain any other touch point coordinates. Each triangle in the set of valid triangles is indexed and its edge connection is recorded to obtain an initial triangle mesh that covers the touch area and where the triangles do not overlap. The initial triangle mesh includes a list of vertex numbers for each valid triangle and the common edge index of adjacent triangles.
6. The coordinate calibration method for a touchscreen according to any one of claims 1-4, characterized in that, The step of calculating the affine transformation matrix corresponding to each triangle based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle includes: Traverse each triangle in the triangle grid, and for the target triangle being traversed, extract the touch point coordinates corresponding to the three vertices of the triangle and the coordinates of the corresponding reference marker points from the set of point pairs to obtain three sets of vertex coordinate pairs; Based on the three sets of vertex coordinate pairs, a system of linear equations consisting of six affine parameters is constructed to describe the mapping relationship between the touch point coordinates and the reference mark point coordinates. Solving the system of linear equations yields the six affine parameters corresponding to the target triangle; The six affine parameters are filled into a 3×3 matrix according to a preset matrix arrangement order to generate the affine transformation matrix corresponding to the target triangle.
7. A coordinate calibration device for a touch screen, characterized in that, The coordinate calibration method for performing the touchscreen according to any one of claims 1 to 6 includes: The acquisition module is used to acquire a triangular mesh pre-constructed for the touch screen, wherein the triangular mesh is composed of multiple triangles, the vertex of each triangle is the coordinate of the touch point, and each vertex corresponds to the coordinate of a reference marker point; The calculation module is used to calculate the affine transformation matrix corresponding to each triangle in the triangular mesh, based on the touch point coordinates and reference marker point coordinates corresponding to the three vertices of each triangle, with each affine transformation matrix corresponding to a triangular region. The calculation module is used to determine the triangle to which the display coordinates to be calibrated belong, and to perform matrix operations on the display coordinates using the affine transformation matrix corresponding to the triangle to obtain the calibrated touch coordinates. The calibrated touch coordinates are used to match the touch point coordinates with the calibrated touch coordinates when a touch operation is detected on the touch screen. If a match is found, a response operation to the corresponding icon is triggered based on the touch operation.
8. A computer device, characterized in that, The device includes a memory and a processor coupled to each other, the memory storing program instructions, and the processor executing the program instructions to implement the coordinate calibration method for a touchscreen according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The device stores program instructions that can be executed by a processor, the program instructions being used to implement the coordinate calibration method for the touchscreen according to any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, enables the implementation of the coordinate calibration method for the touchscreen as described in any one of claims 1 to 6.