Method, system and equipment for detecting and repairing electronic handwriting data and medium
By detecting and repairing time and spacing abnormalities in the electronic handwriting data acquisition points, the data inaccuracy and loss caused by the acquisition equipment is solved, and more accurate electronic signature handwriting data acquisition is achieved, supporting subsequent handwriting identification and identification.
Patent Information
- Application Number
- CN202311042938.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the hardware and software limitations of electronic signature handwriting data acquisition equipment lead to inaccurate time of the acquisition point and data loss, which cannot meet the requirements of handwriting identification and judicial appraisal.
By calculating the time and spacing abnormalities of the electronic handwriting data acquisition point, time gradient repair and data compensation are carried out to ensure the time accuracy and data integrity of the acquisition point.
It improves the authenticity and accuracy of electronic signature handwriting data, meets the needs of subsequent handwriting identification, identification and database construction, and provides more reliable electronic handwriting identification results.
Smart Images

Figure CN120335632A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for preprocessing electronic handwriting data in the field of artificial intelligence biometric recognition technology, specifically a method for repairing the time interval of acquisition points and detecting missing points of electronic handwriting data. Background Art
[0002] With the development of electronic information technology, the situation of directly writing on electronic devices is increasing day by day. Online electronic signatures are gradually becoming the most common behavior in e-commerce activities and are widely used in various important fields such as insurance, e-commerce, banking, finance, and entry-exit management. However, correspondingly, disputes caused by electronic signature handwriting in social and economic activities are also showing an increasing trend. Therefore, it is urgently necessary to identify the same writer based on electronic signature handwriting. Compared with traditional handwritten signature handwriting identification, due to the inherent characteristics of electronic signature handwriting, it brings new challenges to the identification practice. Systematically and deeply studying electronic signature handwriting has important practical significance and is also a new challenge brought by the current development of electronic information technology to document appraisers.
[0003] With the wide application of electronic contracts and electronic document signing, electronic data is easily copied and modified, resulting in frequent occurrences of handwriting identification of electronic signatures after signing. The selection and extraction of handwriting features are key steps in computer automatic handwriting identification. After preprocessing the image, it is necessary to correctly identify and select the key features of the handwriting image from the large amount of data obtained and extract them. Currently, the methods for offline automatic handwriting identification can be roughly divided into statistical feature methods and structural feature methods. The statistical feature method takes the collected handwriting image as a whole and selects the features of the image. The structural feature method divides the handwriting image into a combination of several strokes and selects the features of each stroke. No matter which method is used, it is necessary to obtain the electronic signature handwriting feature data collected by the writing device for comparative identification. Therefore, it is very important to be able to provide the electronic handwriting data required for identification. In addition, collecting accurate electronic handwriting data is very important for electronic signature recognition, the construction of electronic signature databases, etc.
[0004] Publication No. CN107391016A, titled "Handwritten Input Handwriting Calibration Method and System", obtains the writing trajectory of the writing device, determines the trajectory coordinates of the writing device at each moment, and forms the trajectory data at each moment; stores the acquisition time of each trajectory data as the time tag of the trajectory data; determines the writing habit data of the user according to the user's writing history record; determines whether the difference between the first trajectory coordinate and the second trajectory coordinate between two adjacent time tags is abnormal according to the user's writing habit data and the trajectory data. The present invention can accurately proofread whether the trajectories of the displayed handwriting and the written handwriting are the same, so that corrections can be made according to the proofreading result to ensure the consistency of the displayed handwriting and the written handwriting.
[0005] Publication number: CN107798717A, Title: "Electronic Brush Writing Method, Device, Computer Equipment and Storage Medium". The electronic brush writing method includes: obtaining contact data of the writing stroke, where the contact data includes contact coordinates, contact size, and generation time; the writing stroke includes the current contact and historical contacts, and the historical contacts and the current contact are arranged according to the generation time; adjusting the contact size of the current contact according to the difference between the generation time of the current contact and the generation time of the adjacent historical contact, or the contact sizes of a preset number of historical contacts; generating a writing outline of the current contact according to the contact coordinates of the current contact and the adjusted contact size, and rendering the area enclosed by the writing outline. This method can make the simulated brush stroke have a better reduction degree compared with the actual writing stroke.
[0006] The above-mentioned prior art document makes the brush writing echo method reach the pen movement process by proofreading whether the trajectories of the displayed stroke and the writing stroke are the same. The purpose is to make the displayed stroke data visually as consistent as possible with the writer's stroke image, and the stroke is smooth. However, it does not pursue the authenticity of the collected stroke data and the accurate consistency with the original writing stroke data, and the obtained data cannot meet the requirements of writing stroke authentication and forensic identification. Summary of the Invention
[0007] In view of this, in response to the above problems existing in the prior art, the present application proposes a method for detecting and repairing electronic stroke data. As a preprocessing link for stroke authentication, it pursues the authenticity of the collected stroke data and restores the true value of the writing stroke as much as possible through the electronic stroke data collected by the writing device.
[0008] Based on one aspect of the present application, a method for detecting and repairing electronic stroke data is proposed. Calculate time-abnormal acquisition points and / or distance-abnormal acquisition points according to the acquisition points of the obtained electronic stroke data, and perform time gradient repair on the time-abnormal acquisition points and their front and rear acquisition points; when a distance-abnormal acquisition point is detected, prompt acquisition abnormal information.
[0009] Further preferably, calculate the stroke data acquisition points with too late or too early acquisition time according to all the coordinate values and the acquisition time difference sequence of the acquisition points of the collected electronic stroke data, add them to the abnormal speed point set, and perform repair by compensating a quantitative time gradient on the acquisition points in the abnormal speed point set and their front and rear acquisition points; determine the maximum tolerable distance between the acquisition points of the stroke data in each stroke according to the average writing speed of each stroke of the electronic stroke, calculate the distance between adjacent stroke data acquisition points, detect the stroke data acquisition points with a distance greater than the maximum tolerable distance, add them to the abnormal missing point set, and prompt acquisition abnormal information.
[0010] Further preferably, the handwriting data acquisition points with too late or too early calculated acquisition time further include: calculating the overall average writing speed and speed difference of the electronic handwriting according to the coordinate values and acquisition time differences of all acquisition points of the electronic handwriting data, and calculating the speeds V x ,V y in the horizontal and vertical directions of all acquisition points according to the coordinate values and time differences of adjacent acquisition points of the electronic handwriting data, so as to obtain the speed differences dV x ,dV y in the horizontal and vertical directions of all handwriting acquisition points. Then, according to the speed differences of the handwriting data sampling points and the overall average writing speed of the handwriting the acquisition points with too large speed differences are detected as the acquisition points with too late acquisition time, and the acquisition points with too small speed differences are detected as the acquisition points with too early acquisition time.
[0011] Further preferably, the compensation of a fixed time gradient for the acquisition points in the abnormal speed point set and their previous and subsequent acquisition points for repair further includes: increasing the acquisition time interval of the acquisition points with too late acquisition time by a fixed time gradient, and reducing the time interval of its previous acquisition point by the same time gradient; increasing the acquisition time interval of the acquisition points with too early acquisition time by a fixed time gradient, and reducing the time interval of its subsequent acquisition point by the same time gradient.
[0012] Further preferably, detecting the handwriting data acquisition points with a spacing greater than the maximum tolerable spacing further includes: determining the maximum tolerable interval duration t max , obtaining the maximum tolerable spacing by multiplying the maximum tolerable interval duration by the maximum normal writing speed of the stroke segment, and adding the acquisition points with a spacing greater than the maximum tolerable spacing between adjacent data acquisition points to the abnormal missing point set G; wherein, according to the writing time t i,j of the stroke segment and the predetermined duration T mean for writing the stroke segment, according to the formula:
[0013]
[0014] the weight w of the i-th stroke is determined i , and the formula: is called to calculate the maximum writing speed of the i-th stroke
[0015] Further preferably, the writing speed ratio parameter α is calculated through all the writing speed differences recorded by the data acquisition device and the average writing speed, and the speed difference threshold is determined According to the speed differences of the handwriting data acquisition points and the threshold the formula:
[0016]
[0017] Detect the set I of acquisition points with an excessive speed difference, and perform time compensation through the acquisition points before this acquisition point; call the formula:
[0018]
[0019] Detect the set I' of sampling points where the acquisition time of the previous acquisition point is too early, and time compensation needs to be performed through the acquisition points after this acquisition point.
[0020] Further preferably, determine the predetermined duration parameter T according to the duration of short strokes in the regular writing of normal people statistically by the acquisition device mean , and set the maximum tolerable interval duration as: t max = 0.6T mean , and set the fixed time gradient dt as 10 - 50 milliseconds.
[0021] Further preferably, according to the coordinate position of each handwriting data acquisition point and the time difference t between adjacent acquisition points i , according to the formula:
[0022]
[0023] Calculate the overall average writing speed of the electronic signature handwriting According to the coordinate values of all handwriting data acquisition points of each stroke segment and the time difference between adjacent acquisition points, call the formula:
[0024]
[0025]
[0026] Calculate the average writing speed of the stroke segment and the average writing speed of all electronic handwriting data Among them, n represents the number of digits of the electronic handwriting data acquisition points, x i is the abscissa of the i-th acquisition point, y i is the ordinate of the i-th acquisition point, n i represents the number of points of the i-th stroke of the electronic handwriting, x ij , y ij are respectively the abscissa and ordinate of the j-th acquisition point of the i-th stroke, t ij is the time interval between the acquisition point (x ij , y ij ) and the previous acquisition point.
[0027] According to another aspect of the present application, a detection and repair system for electronic handwriting data is proposed. The acquisition device acquires electronic handwriting data; the calculation unit calculates time-abnormal acquisition points and / or distance-abnormal acquisition points based on the acquired acquisition points of the electronic handwriting data, and the handwriting repair unit performs time gradient repair on the time-abnormal acquisition points and their adjacent acquisition points before and after; when a distance-abnormal acquisition point is detected, acquisition abnormal information is prompted.
[0028] Further preferably, the acquisition device acquires electronic handwriting data; the calculation unit calculates the handwriting data acquisition points with too late or too early acquisition time according to all the coordinate values and the acquisition time difference sequence of the acquisition points of the acquired electronic handwriting data, adds them to the abnormal speed point set, calculates the average writing speed of each stroke of the electronic handwriting, determines the maximum tolerable distance between the acquisition points of each stroke, calculates the distance between adjacent handwriting data acquisition points, and detects the handwriting data acquisition points with a distance greater than the maximum tolerable distance, and adds them to the abnormal missing point set; the handwriting repair unit repairs the acquisition points in the abnormal speed point set and their adjacent acquisition points before and after by compensating a quantitative time gradient, and for the electronic handwriting data with abnormal missing points, acquisition data abnormal information is prompted.
[0029] Further preferably, the repairing by compensating a quantitative time gradient for the acquisition points in the abnormal speed point set and their adjacent acquisition points before and after further includes: increasing the acquisition time interval of the acquisition points with too late acquisition time by a fixed time gradient, and reducing the time interval of its previous acquisition point by the same time gradient; increasing the acquisition time interval of the acquisition points with too early acquisition time by a fixed time gradient, and reducing the time interval of its subsequent acquisition point by the same time gradient. Detecting the handwriting data acquisition points with a distance greater than the maximum tolerable distance further includes: determining the maximum tolerable interval duration t max , obtaining the maximum tolerable distance by multiplying the maximum tolerable interval duration and the maximum normal writing speed of the stroke segment, and adding the acquisition points with a distance between adjacent data acquisition points greater than the maximum tolerable distance to the abnormal missing point set G; wherein, according to the writing time t i,j of the stroke segment and the predetermined duration T mean for writing the stroke segment, according to the formula:
[0030]
[0031] determine the weight w i of the i-th stroke segment, and call the formula: to calculate the maximum writing speed
[0032] According to another aspect of the present application, an electronic device is provided, including: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to execute the method for detecting and repairing electronic handwriting data as described above.
[0033] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, and the computer instructions are used to cause the computer to execute the method for detecting and repairing electronic handwriting data as described above.
[0034] Based on the regular writing rules of the normal human body, the present application calculates the overall writing speed, direction angular velocity, average quick writing speed, stroke segment writing speed, etc. of the electronic handwriting according to the coordinates of the electronic handwriting data acquisition points, time differences, etc., detects whether the sampling time of the handwriting data is accurate, and whether there are missing handwriting coordinate points between the acquisition points afterwards. According to the detection results, the handwriting data collected by the acquisition device is repaired, and the electronic handwriting acquisition point sequence can be simply and efficiently repaired. It solves the problem that the original data of the electronic handwriting features directly sampled from the acquisition device cannot meet the requirements of subsequent handwriting recognition and identification due to the limitations of the hardware and software of the electronic handwriting data acquisition device, and can provide accurate electronic handwriting data samples for subsequent electronic handwriting identification, electronic handwriting recognition, construction of an electronic handwriting database, and training of an electronic handwriting recognition model. Description of the Drawings
[0035] Figure 1 Schematic diagram of the repair process of the electronic handwriting data acquisition time interval in an exemplary embodiment of the present application;
[0036] Figure 2 Schematic diagram of the process for detecting missing acquisition points of handwriting data in an exemplary embodiment of the present application;
[0037] Figure 3 Comparison diagram of the electronic signature handwriting data acquisition point sequences before and after the time interval repair;
[0038] Figure 4 Shown is a block diagram of an exemplary electronic device that can be used to implement the embodiments of the present application. Detailed Embodiments
[0039] Embodiments of the present application will be described in more detail below with reference to the drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Instead, these embodiments are provided to more thoroughly and completely understand the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not used to limit the protection scope of the present application.
[0040] It should be understood that the various steps described in the method embodiments of the present application can be executed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this regard.
[0041] An electronic signature handwriting is an electronic signature handwriting formed by people directly writing on an electronic writing device with a stylus according to the writing movement specifications of text symbols, with the name as the content of the text symbols, and it is an electronic dynamic trace. The electronic signature handwriting can be directly obtained on electronic devices such as tablet computers and smart phones, and the operation is very convenient. It can also be integrated with electronic documents to solve the problem of electronic conversion of ordinary signature handwritings. However, the widespread use of electronic signatures has also brought the problem of the authenticity of electronic signature handwritings. After all, electronic signature handwritings are different from ordinary signature handwritings. They not only contain electronic images presenting the outline of the signature handwriting, but also have electronic data reflecting the dynamic information of the handwriting.
[0042] When writing a signature on an electronic device, the writer not only presents the trajectory of the writing movement in the form of an electronic image, but also records the electronic data related to the writing movement. These two aspects constitute the handwriting information of the electronic signature handwriting. The electronic signature handwriting has a static image signature, and more importantly, it also contains the dynamic data during writing.
[0043] The electronic data of the electronic signature handwriting refers to the data information related to the entire writing process recorded by the electronic device, usually consisting of a series of data pairs. Generally, the electronic device is equipped with a dedicated software application program that can provide a secure format to obtain the signature data. These data are original and unprocessed, and the handwriting information contained therein can be obtained only through software analysis. The software equipped with different electronic devices is different. For example, the two software SigAnalyzeTM and SigCompareTM provided by Topaz Company for the inspection of electronic signature handwritings; the SigNotec SignPad Omega tablet has SignoSign / 2 and Signotec RSAVeri fi er software; the Wacom digital panel has MovAlyzeR software. However, their functions are similar. The electronic data records the entire dynamic process of writing. Once these data are obtained, the writing dynamic information of the writer can be analyzed.
[0044] In the authentication of electronic signature handwriting, the accuracy of data in the time dimension is particularly important. However, due to the limitations of the hardware and software of electronic handwriting data acquisition devices, the original data of electronic handwriting features directly sampled from the acquisition device often cannot meet the requirements of subsequent handwriting recognition and forensic expertise. Common problems mainly include the following. In one case, during the triggering process of pointer events, hardware resources are occupied, resulting in the reception time of some sampling points being too early or too late, and the accurate moment of the written handwriting data and its accurate corresponding relationship with other information not being acquired. The time interval between adjacent sampling points is too large or too small. In another case, due to system lag of the acquisition device, the time interval between acquisition points is too long, manifested as an excessive interval between two consecutive acquisition points, and multiple acquisition points are significantly missing in the handwriting path. The above two situations are common problems in the process of electronic signature handwriting data acquisition. Due to the limited number of strokes and characters in electronic signature characters, the acquisition point data of the problems caused by the above device reasons lead to defects in the biometric information used in subsequent processes such as handwriting recognition, handwriting expertise, handwriting recognition model training, and handwriting restoration, and there are flaws in the handwriting forensic expertise of electronic contracts, electronic documents, etc., and a credible identification result cannot be obtained.
[0045] Based on the study of the normal human writing law, this application researches handwriting data repair and detection methods, and proposes relevant solutions to common problems in the acquisition of electronic signature handwriting data, including inaccurate time differences between consecutive acquisition points and easy loss of relevant handwriting data points during the acquisition process. Specifically,
[0046] Obtain all coordinate values and time difference sequences of the electronic handwriting data collected by the acquisition device, calculate the average writing speed and speed difference of the electronic handwriting, extract the handwriting data sampling points with too late or too early acquisition time, add them to the abnormal point set, and compensate a quantitative time gradient to adjacent sampling points of the sampling points in the abnormal point set for repair. Obtain the distance between adjacent data acquisition points of the electronic handwriting, determine the maximum tolerable distance of the handwriting data acquisition points in each stroke according to the average writing speed of each stroke of the electronic handwriting, detect the data acquisition points with a distance greater than the maximum tolerable distance, add them to the abnormal point set, prompt that the acquisition data is abnormal, and re-acquire this stroke segment.
[0047] As Figure 1 shown is a schematic diagram of the repair process of the time interval of electronic handwriting data acquisition in an exemplary embodiment of this application.
[0048] 1. Obtain the coordinate values of the electronic signature trajectory data points collected by the acquisition device and the acquisition time, and calculate the average writing speed of all handwritings of the electronic signature;
[0049] 2. Calculate the speeds of all handwriting acquisition points and obtain the speed differences of all handwriting acquisition points based on the coordinate values of each electronic handwriting data acquisition point, the coordinate values of adjacent points, and the acquisition time difference.
[0050] 3. Calculate and compare whether there are any handwriting data acquisition points with speed differences exceeding the threshold based on the average handwriting writing speed and the speed differences of all handwriting acquisition points.
[0051] 4. If there are handwriting data acquisition points with speed differences exceeding the threshold, add them to the abnormal point set, compensate a quantitative time gradient to the adjacent points, and feedback it to the handwriting data acquisition end. Then return to step 2 to further calculate the speeds and speed differences of all handwriting data acquisition points after compensating the quantitative time gradient, and continue the comparison until the speed differences of all handwriting data acquisition points do not exceed the threshold.
[0052] 5. Determine that there are no sampling points with overly large speed differences exceeding the threshold, and the time repair is completed. Obtain the handwriting data acquisition points after time repair.
[0053] The exemplary embodiments of the present application specifically include calculating the speeds V in the horizontal and vertical directions of all acquisition points based on the coordinates and time differences of adjacent data acquisition points of the electronic signature handwriting. x ,V y , and obtaining the speeds of all acquisition points; detecting the acquisition points where the acquisition time of the previous acquisition point is too late or too early according to the set acquisition time threshold; obtaining the acquisition points with inaccurate time differences of consecutive acquisition points and adding them to the abnormal point set. Perform time compensation on the sampling points in the abnormal point set and their front and rear sampling positions. For the set I of points with too early acquisition time in the abnormal point set, perform time compensation by increasing the time gradient, and for the acquisition points in the set I' of points with too late acquisition time, perform time compensation by reducing the time gradient. Obtain the repaired handwriting data through time compensation.
[0054] The specific method adopted in this exemplary embodiment includes obtaining the horizontal and vertical coordinates (x, y) of the electronic signature handwriting data points collected by the electronic signature data acquisition device, and obtaining the coordinate point sequence and the time difference sequence between points of the electronic handwriting data, (X, Y, T), where X and Y respectively represent the horizontal and vertical coordinates of the point sequence, and T represents the time difference sequence of the collected data points.
[0055] X = {x i | i = 1, 2,..., n}
[0056] Y = {y i | i = 1, 2,..., n}
[0057] T = {t i | i = 1, 2,…, n}
[0058] Among them, n represents the number of acquisition points of the electronic handwriting, and x i represents the abscissa of the i-th acquisition point, and y i represents the ordinate of the i-th acquisition point, and t i represents the time interval between the i-th acquisition point and the previous acquisition point.
[0059] According to the coordinate positions of each handwriting data acquisition point and the time difference between two acquisition points, according to the formula:
[0060]
[0061] Calculate the overall average writing speed of the electronic signature handwriting
[0062] According to the coordinates and time difference of two adjacent sampling points, calculate the speeds V x , V y in the horizontal and vertical directions of all acquisition points. Specifically, according to the x and y coordinates (x i , y i )(x i-1 , y i-1 ) of the i-th acquisition point and the adjacent previous acquisition point (i - 1) and the time interval t i , according to the formula:
[0063]
[0064] Calculate the horizontal and vertical direction speeds of the i-th handwriting data sampling point, and thus obtain the horizontal and vertical direction speeds of all handwriting data sampling points: (V x , V y )
[0065]
[0066]
[0067] Among them, respectively represent the horizontal and vertical direction speeds of the i-th sampling point.
[0068] According to the horizontal and vertical direction speeds of the i-th sampling point, call the formula:
[0069]
[0070] Calculate the speed v of the i-th sampling point i , and thus obtain the speeds V of all acquisition points,
[0071] V = {v i | i = 1, 2, …, n}
[0072] Among them, v i represents the velocity value at the i-th sampling point.
[0073] Calculate the velocity differences in the horizontal and vertical directions respectively based on the velocities at adjacent acquisition points in the horizontal and vertical directions. Thus, obtain the velocity differences dV in the horizontal and vertical directions for all electronic writing trace acquisition points x , dV y
[0074]
[0075]
[0076]
[0077]
[0078] respectively represent the velocity differences in the horizontal and vertical directions at the i-th sampling point.
[0079] Calculate the arithmetic square root of the velocity differences in the horizontal and vertical directions at each sampling point as the velocity difference at that sampling point. Specifically:
[0080]
[0081] Thus, according to the formula:
[0082] dV = {dv i | i = 1, 2, …, n}
[0083] Calculate to obtain the writing velocity differences dV for all acquisition points. Among them, dv i represents the writing velocity difference at the i-th sampling point.
[0084] Calculate the writing velocity ratio parameter α through all the writing velocity differences recorded by the data acquisition device and the average writing velocity, and determine the velocity difference threshold According to the velocity differences of the handwriting data acquisition points and the threshold Call the formula:
[0085]
[0086] Detect the set I of acquisition points with excessive velocity differences.
[0087] The acquisition points in the set I of sampling points indicate that the acquisition time of the previous acquisition point is too late, resulting in too small a time interval for this acquisition point, and time compensation needs to be performed through the acquisition points before this acquisition point.
[0088] Similarly, according to the velocity differences of the handwriting data acquisition points and the threshold Call formula:
[0089]
[0090] It is possible to detect the set I' of sampling points where the sampling time of the previous sampling point is too early. The sampling points in the set I' of sampling points indicate that the time interval of the sampling points is too large, and time compensation needs to be performed through the sampling points after the sampling point.
[0091] The specific method adopted in this exemplary embodiment is to perform fixed-time compensation on the sampling points in all abnormal point sets I and set I' through a time gradient. Perform time compensation repair on all sampling points in the abnormal point set until the abnormal point sets I and I' are empty.
[0092] Specifically, for all sampling points in the set I of sampling points, increase the fixed time gradient for the sampling time interval of the sampling point i, and decrease the same time gradient for the time interval of the previous sampling point; for the sampling points in the set I' of sampling points, increase the fixed time gradient for the sampling time interval of the sampling point i, and decrease the same time gradient for the time interval of the subsequent sampling point. Specifically
[0093] For all sampling points in the set I, according to the formula:
[0094] t′ i :=t i +dt
[0095] t′ i-1 :=t i-1 -dt
[0096] Repair the sampling time interval. Similarly, for all sampling points in the set I', according to the formula:
[0097] t′ i' :=t i +dt
[0098] t′ i'+1 :=t i+1 -dt
[0099] Repair the sampling time interval, where t' i 、t' i-1 、t' i' 、t' i+1 are the sampling time intervals of the sampling point i, the previous sampling point i - 1, and the subsequent sampling point i + 1 after the time compensation repair is increased, respectively.
[0100] In theory, the smaller the fixed time gradient dt is, the more accurate it is. If the time gradient dt is set too large, the gap is too big, resulting in a large change in adjacent acquisition points, and the data cannot be restored through repair and compensation, thus unable to generate positive benefits. However, too small dt compensation will increase the number of algorithm iterations, leading to too high algorithm complexity. Therefore, it is necessary to set an appropriate dt value according to the specific usage scenario. In this embodiment, according to the later algorithm and recognition model, to meet the requirements of electronic signature handwriting recognition, handwriting authenticity verification, and handwriting forensic expertise, the algorithm complexity is reasonably reduced, and the time gradient is determined according to the device sampling rate. The higher the sampling rate, the higher the possible time gradient dt. The sampling rate is set to 20 milliseconds, with each iteration being 0.25 milliseconds, and the maximum compensation time is within a certain fluctuation range. Generally, the fixed time gradient dt can be set to 10 - 50 milliseconds. Through the analysis and research of the data collected by a large number of acquisition devices, based on optimizing the computational complexity of common AI models and the accuracy requirements of handwriting identification, the time gradient can be set to 16 milliseconds in this embodiment.
[0101] Through time compensation and repair, the time difference T' of the repaired electronic handwriting point position sequence is obtained.
[0102] T′={t′ i |i=1,2,…,n|
[0103] If the maximum number of iterations is exceeded, usually due to consecutive anomalies in multiple consecutive points. It indicates that the acquisition time problem of this electronic handwriting data is too serious to be repaired through time compensation, prompts the acquisition anomaly information, and re - collects the handwriting data. According to the position of the anomaly point and the stroke segments where the pen - lift and pen - down states occur, it prompts to re - collect the handwriting data of the stroke segment from the pen - down point to the pen - lift point. Until there are no acquisition points with too early or too late acquisition time in all handwriting data.
[0104] The repaired time - difference information is more accurate, more in line with human writing kinematics, can more accurately restore the trajectory data written by the signer, and can make the subsequent handwriting discrimination algorithm more precise and robust when used as the data input. When pre - processing the signature recognition and identification algorithm, using the repaired time to calculate more accurate dynamic characteristics such as speed and acceleration can obtain more real and accurate handwriting data.
[0105] Regarding the problem that the distance between two acquisition points of the handwriting data is too large and there are obvious missing points in between, the following method is used for detection in this embodiment.
[0106] Such as Figure 2The following is a schematic diagram of the process for detecting the loss of handwriting data collection points in an exemplary embodiment of the present application. Obtain all electronic handwriting data collection point data, calculate the distance between each handwriting data collection point and the previous collection point; calculate the average writing speed of all electronic handwriting; calculate the writing speed of each stroke in the electronic handwriting; estimate the maximum normal writing speed of the stroke based on the writing speed of each stroke and the average writing speed of all signed handwriting; calculate whether the sampling point distance is greater than the maximum normal writing distance based on the estimated maximum normal writing speed of the stroke and the distance between sampling points. If it is greater, it is determined that there are handwriting data loss points between the handwriting data collection points, otherwise the collected data is normal.
[0107] The exemplary embodiment of the present application can specifically adopt the following method. According to the pen-down and pen-up states of the electronic signature handwriting, the entire handwriting from the pen-down state to the pen-up state is divided into a stroke, determine the strokes and the number of strokes m of the electronic handwriting, and calculate the number of handwriting data collection points for each stroke, as well as its coordinates and time intervals.
[0108] Obtain the entire electronic handwriting data coordinate and time difference sequence (X, Y, T) collected by the collection device.
[0109] X = {x ij | i = 1, 2,..., m; j = 1, 2…, n i}
[0110] Y = {y ij | i = 1, 2,..., m; j = 1, 2…, n i}
[0111] T = {t ij | i = 1, 2,…, m; j = 1, 2…, n i}
[0112] Among them, X and Y respectively represent the horizontal and vertical coordinates of the handwriting data collection point position sequence, and T represents the time difference sequence between the handwriting data collection point positions. n i represents the number of points of the i-th stroke of the collected electronic handwriting. x ij , y ij are respectively the horizontal and vertical coordinates of the j-th collection point of the i-th stroke, and t ij is the time interval between this collection point and the previous collection point. According to the coordinate values of all handwriting data collection points of each stroke and the time difference between adjacent collection points, call the formula:
[0113]
[0114] Calculate the average writing speed of the electronic handwriting (x i,j-1 , y i,j-1) are the x and y coordinate values of j - 1 acquisition points in stroke i.
[0115] Call the formula:
[0116]
[0117] Calculate the average writing speed of the i-th stroke Thus, the writing speeds of all stroke segments of the electronic handwriting are obtained.
[0118] Determine the weight of each stroke according to factors such as stroke writing time, acquisition point time difference, and stroke length. The longer the writing duration of the stroke, the greater the weight of the average stroke speed, and the smaller the average speed of the overall handwriting. When the writing duration reaches the set preset duration parameter T mean , according to the formula:
[0119]
[0120] Calculate the weight w of the i-th stroke i . Other types of functions can also be used to control and the weight size between. For example, according to a large number of experimental experiences, as well as the performance of the acquisition device and the requirements and tolerances of the later handwriting recognition model for the handwriting acquisition data, the preset duration parameter 500ms can be set, and the weight is 0.5.
[0121] This exemplary embodiment determines the preset duration parameter T mean Specifically, it is determined by counting the normal writing short stroke duration of the acquisition device. From the pen-down state to the pen-up state of the writing state is a short stroke. For the long connected strokes, they are decomposed into multiple short strokes according to the speed peaks and valleys.
[0122] According to the writing speed of the i-th stroke of the electronic handwriting and the average writing speed of all electronic handwritings Call the formula:
[0123]
[0124] Calculate the maximum writing speed when writing the i-th stroke normally
[0125] Among them, β is the stroke segment speed ratio parameter, which represents the ratio between the maximum writing speed and the average speed in a stroke segment, and can be determined according to the acquisition points of the handwriting data counted by the acquisition device, or the handwriting data of the signer in the handwriting sample database, according to the ratio of the maximum writing speed and the average writing speed of the stroke segment.
[0126] Calculate the distance dL between all adjacent acquisition points of the electronic handwriting data. The arithmetic mean difference between two adjacent handwriting data acquisition points can be used, or other methods such as the Euclidean distance can be used to obtain the distance dL between all electronic handwriting data acquisition points.
[0127] dL = {dl ij | i = 1, 2,..., m; j = 1, 2…, n i}
[0128]
[0129] where dl ij represents the distance between the jth handwriting data acquisition point of the ith stroke and the previous acquisition point (point j - 1).
[0130] Determine the maximum tolerable interval duration t max . According to the device acquisition frequency (generally 58 - 62.5 Hz), the accuracy requirements of the handwriting recognition model, algorithm module, and training model for the handwriting data acquisition points in the subsequent processing process, generally, the maximum tolerable interval duration t max ranges from 150 - 300 milliseconds. Usually, the maximum tolerable interval duration is set to: t max = 0.6T mean .
[0131] Multiply the maximum tolerable interval duration by the maximum normal writing speed of the ith stroke to calculate the maximum tolerable distance. Add the acquisition points with a distance between adjacent data acquisition points greater than the maximum tolerable distance to the set, detect the sampling points with too large a distance, and obtain the abnormal missing point set G.
[0132]
[0133] In this embodiment, by weighing and evaluating the downstream handwriting recognition task and algorithm complexity, and referring to the acquisition frequency of conventional electronic devices, t max is set. For the acquisition points that are much lower than the device acquisition frequency, discard the handwriting data acquisition points of this stroke segment, prompt the loss of acquisition information, and re - acquire the electronic handwriting data.
[0134] As Figure 3 shown in, it is a comparison diagram of the electronic signature handwriting data acquisition point sequences before and after the time interval repair, which are the electronic signature handwriting acquisition point sequences before and after the repair of the time interval respectively. Figure a is a schematic diagram of the electronic signature handwriting data acquisition points before repair, and Figure b is a schematic diagram of the electronic signature handwriting data acquisition points after repair. Among them, represents the pen - lifting point in the acquired electronic signature handwriting acquisition points, The starting point in the collected electronic signature handwriting collection points is represented by □, and the jump point or missing point in the collected electronic signature handwriting collection points is represented by ◇.
[0135] The data marked on the handwriting in the figure is the time interval (milliseconds) of consecutive collection points. The stroke movement direction can be obtained from the starting point to the ending point of the pen. The left figure shows the time interval before repair, and the right figure shows the time interval after repair. The data without time identification indicates that the data is normal and does not need to be repaired. The time difference between the points before and after repair and the previous point has changed, but the coordinates of the points themselves have not changed at all, nor are there any newly added or deleted points.
[0136] The detected missing points are shown in Figure c, and the displayed numbers are the time intervals (milliseconds) between sampling points. Obviously, the distance between the detected collection points and the adjacent previous point is too large.
[0137] For example, the collection interval of the vertical stroke in the right ear radical of Zheng is too large, there are missing points, and the point interval below is short. It cannot meet the requirements of the handwriting identification algorithm, and information loss is detected, prompting the signer to sign again.
[0138] Now, the structural block diagram of the electronic device 300 that can be used as the server or client of the present application will be described. It is an example of a hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent various forms of digital electronic computer devices, such as desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described herein and / or claimed.
[0139] Such as Figure 4As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to computer programs stored in a read-only memory (ROM) 302 or computer programs loaded from a storage unit 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304. Multiple components in the electronic device 300 are connected to the I / O interface 305, including: an input unit 306, an output unit 307, a storage unit 308, and a communication unit 309. The input unit 306 can be any type of device capable of inputting information into the electronic device 300. The input unit 306 can receive input digital or character information, and generate key signal inputs related to user settings and / or function controls of the electronic device. The output unit 307 can be any type of device capable of presenting information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 308 can include but is not limited to a magnetic disk, an optical disk. The communication unit 309 allows the electronic device 300 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0140] The computing unit 301 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 301 executes the various methods and processes described above. For example, in some embodiments, the reconstruction and decomposition of the muscle movement trajectory redrawn from the original trajectory of the signature stroke, and the decomposition of its logarithmic velocity curve, etc. can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 300 via the ROM 302 and / or the communication unit 309. In some embodiments, the computing unit 301 can be configured to execute the signature handwriting dynamic acquisition implementation method by any other appropriate means (e.g., by means of firmware).
[0141] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. These program codes can be provided to the processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program codes can be executed entirely on the machine, partially on the machine, executed partially on the machine as an independent software package and partially on a remote machine, or entirely on a remote machine or server.
[0142] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0143] As used in the present application, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, apparatus, and / or device (e.g., a disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term “machine-readable signal” refers to any signal for providing machine instructions and / or data to a programmable processor.
[0144] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, speech input, or tactile input).
[0145] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), and the Internet.
[0146] A computer system can include clients and servers. Clients and servers are generally far apart from each other and typically interact through a communication network. The client - server relationship is created by computer programs that run on respective computers and have a client - server relationship with each other.
Claims
1. A method for detecting and repairing electronic handwriting data, characterized in that, Calculate time-abnormal acquisition points and / or distance-abnormal acquisition points based on the acquired electronic handwriting data acquisition points, and perform time gradient repair on the time-abnormal acquisition points and their adjacent acquisition points before and after; when detecting distance-abnormal acquisition points, prompt acquisition abnormal information.
2. The method according to claim 1, characterized in that, The calculation of time-abnormal acquisition points further includes: calculating handwriting data acquisition points with too late or too early acquisition time according to all coordinate values of the acquired electronic handwriting data acquisition points and the acquisition time difference sequence, and adding them to the abnormal speed point set; the calculation of distance-abnormal acquisition points includes: determining the maximum tolerable distance between handwriting data acquisition points in each stroke according to the average writing speed of each stroke of the electronic handwriting, calculating the distance between adjacent handwriting data acquisition points, detecting the handwriting data acquisition points with a distance greater than the maximum tolerable distance, and adding them to the abnormal missing point set.
3. The method according to claim 2, wherein The handwriting data acquisition points for calculating that the acquisition time is too late or too early further include: calculating the overall average writing speed and speed difference of the electronic handwriting according to the coordinate values and acquisition time differences of all the acquisition points of the electronic handwriting data, and calculating the speeds V of all the acquisition points in the horizontal and vertical directions according to the coordinate values and time differences of adjacent acquisition points of the electronic handwriting data x ,V y , and obtaining the speed differences dV of all the handwriting acquisition points in the horizontal and vertical directions x ,dV y , and detecting, according to the speed differences of the sampling points of the handwriting data and the overall average writing speed of the handwriting that the acquisition points with too large speed differences are the acquisition points with too late acquisition time, and the acquisition points with too small speed differences are the acquisition points with too early acquisition time 4. The method according to any one of claims 1 to 3, characterized in that, The time gradient repair includes: increasing the acquisition time interval of the acquisition points with too late acquisition time by a fixed time gradient, and reducing the time interval of its previous acquisition point by the same time gradient; increasing the acquisition time interval of the acquisition points with too early acquisition time by a fixed time gradient, and reducing the time interval of the subsequent acquisition point by the same time gradient.
5. The method according to claim 2 or 3, characterized in that The addition of the abnormal loss point set further includes: determining the maximum tolerable interval duration t max , obtaining the maximum tolerable distance by multiplying the maximum tolerable interval duration by the maximum normal writing speed of the stroke segment, and adding the acquisition points with the distance between adjacent data acquisition points greater than the maximum tolerable distance to the abnormal loss point set G; wherein, according to the writing time t i,j of the stroke segment mean , according to the formula: Determine the weight w of the i-th stroke i , call the formula: Calculate the maximum writing speed of the i-th stroke 6. The method according to claim 2 or 3, characterized in that, Calculate the writing speed ratio parameter α based on all the writing speed differences recorded by the data acquisition device and the average writing speed, and determine the speed difference threshold According to the speed difference of the handwriting data acquisition points and the threshold Call the formula: Detect the set I of acquisition points with too large speed difference, and perform time compensation through the acquisition points before this acquisition point; call the formula: Detect the set I' of sampling points with too early acquisition time of the previous acquisition point, and time compensation needs to be performed through the acquisition points after this acquisition point.
7. The method according to claim 4, characterized in that Determine the preset duration parameter T based on the normal person's regular writing short stroke duration statistics collected by the acquisition device mean , and set the maximum tolerable interval duration to: t max = 0.6T mean , and set the fixed time gradient dt to 10 - 50 milliseconds.
8. The method according to any one of claims 2-7, characterized in that According to the coordinate positions of each handwriting data acquisition point and the time difference t between adjacent acquisition points i , according to the formula: Calculate the overall average writing speed of the electronic signature handwriting Based on the coordinate values of all handwriting data collection points for each stroke segment and the time difference between adjacent collection points, call the formula: Calculate the average writing speed of stroke segments and the average writing speed of all electronic handwriting data Based on the speeds in the horizontal and vertical directions of adjacent acquisition points, according to the formula: Calculate the velocity differences in the horizontal and vertical directions respectively According to the formula: Calculate the speed difference at this sampling point to obtain the writing speed differences at all the collected points. Here, n represents the number of digits of the electronic handwriting data collection points, x i is the abscissa of the i-th collection point, y i is the ordinate of the i-th collection point, n i represents the number of points in the i-th stroke of the electronic handwriting, x ij , y ij are respectively the abscissa and ordinate of the j-th collection point in the i-th stroke, t ij is the time interval between the collection point (x ij , y ij ) and the previous collection point.
9. An electronic handwriting data detection and repair system, characterized in that, The acquisition device acquires electronic handwriting data; the calculation unit calculates time-abnormal acquisition points and / or distance-abnormal acquisition points according to the acquired electronic handwriting data acquisition points, and the handwriting repair unit performs time gradient repair on the time-abnormal acquisition points and their adjacent acquisition points before and after; when detecting distance-abnormal acquisition points, prompt acquisition abnormal information.
10. The system according to claim 9, wherein The calculation of time-abnormal acquisition points further includes: calculating handwriting data acquisition points with too late or too early acquisition time according to all coordinate values of the acquired electronic handwriting data acquisition points and the acquisition time difference sequence, and adding them to the abnormal speed point set; the calculation of distance-abnormal acquisition points includes: determining the maximum tolerable distance between handwriting data acquisition points in each stroke according to the average writing speed of each stroke of the electronic handwriting, calculating the distance between adjacent handwriting data acquisition points, detecting the handwriting data acquisition points with a distance greater than the maximum tolerable distance, and adding them to the abnormal missing point set.
11. The system according to claim 9 or 10, characterized in that, The repair of the acquisition points in the abnormal speed point set and the compensation of the quantitative time gradient of the acquisition points before and after them further includes: for the acquisition points with too late acquisition time, the acquisition time interval is increased by a fixed time gradient, and the time interval of the previous acquisition point is decreased by the same time gradient; for the acquisition points with too early acquisition time, the acquisition time interval is increased by a fixed time gradient, and the time interval of the next acquisition point is decreased by the same time gradient. Detecting the handwriting data acquisition points with a spacing greater than the maximum tolerable spacing further includes: determining the maximum tolerable interval duration t max , obtaining the maximum tolerable spacing by multiplying the maximum tolerable interval duration by the maximum normal writing speed of the stroke segment, and adding the acquisition points with a spacing greater than the maximum tolerable spacing between adjacent data acquisition points to the abnormal missing point set G; wherein, according to the writing time t of the stroke segment i,j , the predetermined duration T for writing the stroke segment mean , according to the formula: Determine the weight w of the i-th stroke segment i , call the formula: Calculate the maximum writing speed of the i-th stroke segment 12. An electronic device, characterized in that, Including: A processor; And a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to execute the method for detecting and repairing electronic handwriting data according to any one of claims 1-8.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the method for detecting and repairing electronic handwriting data according to any one of claims 1-8.
Citation Information
Patent Citations
Method and system for collating handwriting input trajectory
CN107391016A
Electronic brush pen writing method and device, computer equipment and storage medium
CN107798717A