Handwriting reconstruction method and system, electronic equipment and storage medium
By collecting and processing three-dimensional angular velocity timing data, fitting the motion trajectory plane of the writing tool in three-dimensional space and projecting it to the two-dimensional plane, the problem of inaccurate and incomplete handwriting reconstruction in the existing technology is solved, and a higher precision and comprehensive handwriting reconstruction effect is achieved.
Patent Information
- Application Number
- CN202411941826.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-02
AI Technical Summary
The existing handwriting reconstruction method based on two-dimensional images has lost the three-dimensional dynamic information during the writing process, resulting in the handwriting reconstruction inaccurate and comprehensive enough in application scenarios with high requirements for handwriting details and writing style analysis.
By obtaining the installation position information of the three-axis gyroscope on the writing tool, collecting the three-dimensional angular velocity timing data during writing, calculating the movement trajectory timing data of the writing tool in the three-dimensional space, and fitting the movement trajectory plane of the three-dimensional space through the neural network model, and finally projecting it to the two-dimensional plane for handwriting reconstruction.
It realizes the original form of the handwriting more accurately on a two-dimensional plane. Taking into account the multi-dimensional characteristics such as writing speed, angle, and trajectory, the accuracy and comprehensiveness of handwriting reconstruction are guaranteed, and richer writing information and higher reconstruction accuracy are provided.
Smart Images

Figure CN119919538A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a handwriting reconstruction method, system electronic equipment and storage medium. Background Art
[0002] With the rapid development of information technology and the widespread use of digital office and electronic devices, traditional handwriting needs to be processed, stored and analyzed in digital form in many scenarios. For example, in electronic signatures, digitization of handwritten notes, handwriting recognition for identity authentication, etc., it is particularly important to accurately convert handwriting into digital form and effectively reconstruct and analyze it.
[0003] Currently, most commonly used handwriting reconstruction methods are based on two-dimensional image data, which is done by scanning or photographing the handwriting on the writing paper, and then using image processing technology to analyze and reconstruct it. However, this method loses a lot of three-dimensional dynamic information during the writing process, such as the performance of writing speed, strength, angle changes, etc. in three-dimensional space, resulting in inaccurate and incomplete handwriting reconstruction in some application scenarios that require high analysis of handwriting details and writing style. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a handwriting reconstruction method, a system electronic device and a storage medium, which are used to solve the problem that the current handwriting reconstruction based on two-dimensional images is inaccurate and incomplete.
[0005] In a first aspect of an embodiment of the present invention, a handwriting reconstruction method is provided, comprising: Obtaining installation position information of the three-axis gyroscope on the writing tool, and collecting three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; Integrating the three-dimensional angular velocity time series data to obtain angle change time series data, and calculating the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; According to the time series data of the motion trajectory of the writing tool, the motion trajectory plane in three-dimensional space is fitted through a neural network model; The motion trajectory in three-dimensional space is projected onto a two-dimensional plane for handwriting reconstruction.
[0006] In a second aspect of an embodiment of the present invention, a handwriting reconstruction system is provided, comprising: A data acquisition module is used to obtain the installation position information of the three-axis gyroscope on the writing tool, and to collect the three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; A trajectory prediction module is used to integrate the three-dimensional angular velocity time series data to obtain the angle change time series data, and calculate the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; A trajectory fitting module, used to fit the motion trajectory plane in three-dimensional space through a neural network model according to the motion trajectory time series data of the writing tool; The trajectory projection module is used to transform the motion trajectory planar projection of the three-dimensional space into a two-dimensional plane for handwriting reconstruction.
[0007] In a third aspect of an embodiment of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect of the embodiment of the present invention when executing the computer program.
[0008] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method provided in the first aspect of the embodiment of the present invention are implemented.
[0009] In the embodiment of the present invention, the motion trajectory time series data is obtained by collecting the dynamic information of the writing tool in the three-dimensional space, and the motion trajectory plane of the writing tool in the three-dimensional space is fitted by a neural network, and then the three-dimensional motion trajectory is projected onto the two-dimensional plane to achieve note reconstruction. Therefore, not only can the original form of the handwriting be restored more accurately on the two-dimensional plane, but also the multi-dimensional features such as writing speed, angle, trajectory, etc. are taken into consideration, which effectively guarantees the accuracy and comprehensiveness of handwriting reconstruction, and can provide richer writing information and higher reconstruction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 A flowchart of a handwriting reconstruction method provided by an embodiment of the present invention; Figure 2 A schematic diagram of the structure of a handwriting reconstruction system provided by one embodiment of the present invention; Figure 3 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0012] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0013] It should be understood that the term "including" and other similar expressions in the specification or claims of the present invention and the above-mentioned drawings are intended to cover non-exclusive inclusions, such as a process, method, system, or device including a series of steps or units is not limited to the listed steps or units. In addition, "first" and "second" are used to distinguish different objects, not to describe a specific order.
[0014] See also Figure 1 , a flow chart of a handwriting reconstruction method provided by an embodiment of the present invention includes: S101, obtaining installation position information of a three-axis gyroscope on a writing tool, and collecting three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; The three-axis gyroscope is a device that can simultaneously measure the position in six directions, the moving trajectory and the acceleration. Based on the three-axis gyroscope, the dynamic characteristics of the writing tool when writing can be collected. The three-dimensional angular velocity time series data refers to the angular velocity data of the writing tool when writing.
[0015] The first gyroscope is arranged at the tip of the writing tool to collect the writing trajectory during writing, and the second gyroscope is arranged at a preset distance from the tip of the writing tool to collect the trajectory of holding the writing tool during writing; The writing trajectory and the trajectory of the writing tool held are fused through Kalman filtering to obtain the three-dimensional angular velocity time series data during writing.
[0016] The first gyroscope is located closer to the tip of the pen. Because it is closer to the tip of the pen, its angle change is closer to the actual writing trajectory. The second gyroscope is located at a preset distance from the tip of the pen, for example, 10 cm from the tip of the pen. It is greatly affected by the hand grip and wrist movement and can detect the global movement when holding.
[0017] Using a Kalman filter to fuse the data from the two gyroscopes and filter out the noise data can improve the accuracy of motion posture estimation.
[0018] By making a batch of stroke data sets and printing them into a book, the writer traces on the printed strokes and collects the angular velocity time series data at a certain frequency. Each stroke corresponds to a piece of angular velocity time series data, and the angular velocity time series data can be obtained.
[0019] In some embodiments, the filtered data is combined with the angular velocity time series data in the x, y, and z directions in the three-dimensional space to form a feature vector [ ], a stroke constitutes a time series matrix data, forming a feature vector.
[0020] S102, integrating the three-dimensional angular velocity time series data to obtain angle change time series data, and calculating the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; The angle change time series data refers to the cumulative change of the angle within a period of time. Based on the angular velocity time series data and the data acquisition frequency, the angular displacement time series data, i.e., the angle change time series data, is obtained by integral calculation. The motion trajectory data of the writing tool can be updated based on the Euler angle, angle change and other information of the writing tool.
[0021] Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; Specifically, based on the initial position, initial inclination angle and effective radius of the writing tool, a set of coordinate equations for the motion trajectory in three directions of X, Y and Z axes in three-dimensional space is constructed by adding the displacement to the initial position to obtain the trajectory coordinates of the writing tool; based on the real-time angle change timing data, the trajectory coordinates of the writing tool in three-dimensional space are updated to obtain the timing data of the motion trajectory of the writing tool in three-dimensional space.
[0022] The initial inclination angle refers to the inclination angle of the writing tool relative to the coordinate axis when starting to write. The initial inclination angle is obtained by solving the relevant equations by using the kinematic relationship between the Euler angle (i.e., the initial inclination angle) and the angular velocity, knowing the angular velocity at the initial moment and the necessary constraints; The initial position is the coordinate position of the writing tool in the three-dimensional space when the writing tool starts writing. Based on the position of the first gyroscope relative to the pen tip, the initial position of the object can be derived through geometric relationship calculation. The effective radius is the radius that the writing tool pen tip can effectively write, that is, the effective rotation radius corresponding to the rotation of a point on the writing tool around the x, y, and z axes.
[0023] Based on the initial position coordinates of the combined writing tool , the initial tilt angle, effective radius and angular displacement, and construct the coordinate equations of the motion trajectory in the three directions of x, y and z in three-dimensional space by adding the displacement on the basis of the initial coordinates, so as to obtain the trajectory coordinate data. At the same time, in addition to the start sampling time, the position of the previous sampling time can be used as the initial position of the current sampling time.
[0024] The new position coordinates of the writing tool in three-dimensional space at each sampling moment ( ), namely the coordinates of the motion trajectory in three-dimensional space, and each stroke corresponds to a time series coordinate matrix.
[0025] In some embodiments, the motion trajectory coordinate equation in three-dimensional space is expressed as:
[0026] in, is the coordinate position at the current moment, is the coordinate position at the previous moment, is the inclination angle at the current moment.
[0027] R rotation matrix: can be constructed from the Euler angles of the inclination, used to describe the rotation from one coordinate system to another.
[0028] T translation vector: according to the angular displacement and effective radius r to calculate the displacement increment along each axis .
[0029] S103, fitting a motion trajectory plane in three-dimensional space through a neural network model according to the motion trajectory time series data of the writing tool; The neural network model is a model for fitting a motion trajectory plane according to the motion trajectory data of a writing tool, which is trained by a writing tool motion trajectory data set with stroke labels. The motion trajectory plane in the three-dimensional space refers to a plane formed by the motion trajectory of the writing tool in the three-dimensional space.
[0030] Preferably, the neural network model is a neural network model using a multi-layer perceptron, and the neural network model consists of an input layer, a hidden layer and an output layer. The input layer is designed with 3 neurons to receive the coordinate values of the X-axis, Y-axis and Z-axis respectively, 3 hidden layers are set and the number of neurons in each hidden layer is 64, and the output layer is set with 4 neurons to output the four coefficients of the three-dimensional plane equation.
[0031] The plane equation can be established according to the four coefficient vectors [A, B, C, D] of the plane equation. According to the plane equation, the motion trajectory coordinate data of the two-dimensional plane can be obtained through geometric projection, thereby realizing the handwriting reconstruction of the two-dimensional plane.
[0032] Optionally, the three-dimensional space motion trajectory coordinate data set with stroke labels is divided into a training set, a validation set and a test set; the neural network model is trained, validated and tested based on the training set, the validation set and the test set respectively; Among them, the reconstructed handwriting is compared with the stroke label, and the calculated mean square error is used as the loss function. Based on the loss function, the parameter weights and bias parameters of the neural network are updated through back propagation, which can continuously reduce the loss value and make the predicted plane close to the real plane.
[0033] The calculated writing trajectory coordinate data set in three-dimensional space, since each segment of angular velocity time series data corresponds to a stroke label during acquisition, the three-dimensional space motion trajectory coordinate data used for network training also corresponds to a stroke label. Based on the labeled motion trajectory data set, the data set is divided into training set, validation set and test set according to a certain ratio (for example, 7:2:1). The motion trajectory data is preprocessed, and the input trajectory coordinates are normalized. The motion trajectory plane of the writing tool in three-dimensional space can be fitted through the trained neural network model.
[0034] S104, converting the motion trajectory planar projection in the three-dimensional space to a two-dimensional plane for handwriting reconstruction.
[0035] Specifically, obtain the motion trajectory plane fitted by the neural network model, and obtain the projection matrix according to the normal vector and unit matrix of the motion trajectory plane; based on the motion trajectory coordinate points in three-dimensional space and the projection matrix, calculate the trajectory coordinate points projected to the two-dimensional plane; and reconstruct the corresponding handwriting image based on the trajectory coordinate points on the two-dimensional plane.
[0036] Optionally, a dilation operation and an erosion operation are performed on the handwriting image to fill in the breakpoints and remove the noise points.
[0037] After the plane that fits the motion trajectory in three-dimensional space is predicted by the neural network model, the normal vector n=[A, B, C] of the plane is obtained according to the coefficients of the three-dimensional plane equation. Combined with a unit matrix, such as a 3*3 unit matrix, the projection matrix P can be obtained. Combining the coordinate point point1 of the three-dimensional space trajectory with the projection matrix P, the coordinate point projected onto the two-dimensional plane can be obtained. The handwriting image can be reconstructed based on the trajectory coordinate point data set on the two-dimensional plane. The use of dilation and erosion operations can fill some breakpoints or remove some noise points, thereby improving the quality and readability of the notes.
[0038] In this embodiment, the handwriting reconstruction can be achieved by calculating the motion trajectory of the writing tool, fitting the motion trajectory plane in three-dimensional space through a neural network, and projecting it onto a two-dimensional plane, so that the original form of the handwriting can be restored more accurately on the two-dimensional plane, including the thickness changes of the strokes, the performance of the pen tip, etc., so that the reconstructed handwriting is closer to the real writing effect. At the same time, it can provide richer writing information and higher reconstruction accuracy, ensure the accuracy and comprehensiveness of the trajectory, and have broader application prospects in the fields of handwriting identification, calligraphy teaching, psychology research, etc. For example, by analyzing the writing trajectory and dynamic characteristics in three-dimensional space, it can more accurately identify the authenticity of handwriting, evaluate the writer's psychological state and writing skill level, etc.
[0039] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence 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.
[0040] Figure 2 A structural schematic diagram of a handwriting reconstruction system provided by an embodiment of the present invention, the system comprises: The data acquisition module 210 is used to obtain the installation position information of the three-axis gyroscope on the writing tool, and to collect the three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; The first gyroscope is arranged at the tip of the writing tool to collect the writing trajectory during writing, and the second gyroscope is arranged at a preset distance from the tip of the writing tool to collect the trajectory of holding the writing tool during writing; The writing trajectory and the trajectory of the writing tool held are fused through Kalman filtering to obtain the three-dimensional angular velocity time series data during writing.
[0041] The trajectory prediction module 220 is used to integrate the three-dimensional angular velocity time series data to obtain the angle change time series data, and calculate the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; Specifically, based on the initial position, initial tilt angle and effective radius of the writing tool, a set of coordinate equations of the motion trajectory in three directions of X, Y and Z axes in three-dimensional space is constructed by adding a displacement to the initial position to obtain the trajectory coordinates of the writing tool; Based on the real-time angle change time series data, the trajectory coordinates of the writing tool in the three-dimensional space are updated to obtain the motion trajectory time series data of the writing tool in the three-dimensional space.
[0042] A trajectory fitting module 230, for fitting a motion trajectory plane in a three-dimensional space through a neural network model according to the motion trajectory time series data of the writing tool; Among them, the neural network model is a neural network model using a multi-layer perceptron, and the neural network model consists of an input layer, a hidden layer and an output layer. The input layer is designed with 3 neurons to receive the coordinate values of the X-axis, Y-axis and Z-axis respectively, and 3 hidden layers are set, and the number of neurons in each hidden layer is 64. The output layer is set with 4 neurons for outputting the four coefficients of the three-dimensional plane equation.
[0043] Specifically, the three-dimensional space motion trajectory coordinate data set with stroke labels is divided into a training set, a validation set and a test set; the neural network model is trained, validated and tested based on the training set, the validation set and the test set respectively; The reconstructed handwriting is compared with the stroke label, and the calculated mean square error is used as the loss function. The parameter weights and bias parameters of the neural network are updated through back propagation based on the loss function.
[0044] The trajectory projection module 240 is used to transform the motion trajectory in three-dimensional space into a two-dimensional plane for handwriting reconstruction.
[0045] Specifically, the motion trajectory plane fitted by the neural network model is obtained, and a projection matrix is constructed according to the normal vector and unit matrix of the motion trajectory plane; the motion trajectory coordinate points in the three-dimensional space are projected and transformed based on the projection matrix to obtain the trajectory coordinate points projected to the two-dimensional plane; and the corresponding handwriting image is reconstructed based on the trajectory coordinate points on the two-dimensional plane.
[0046] Preferably, the step of reconstructing the corresponding handwriting image based on the trajectory coordinate points on the two-dimensional plane further includes: The handwriting image is subjected to dilation and erosion operations to fill the breakpoints and remove the noise points.
[0047] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0048] Figure 3 FIG. 1 is a schematic diagram of a structure of an electronic device provided by an embodiment of the present invention. The electronic device is used for handwriting reconstruction. Figure 3 As shown, the electronic device 3 of this embodiment includes: a memory 310, a processor 320 and a system bus 330, wherein the memory 310 includes an executable program 3101 stored thereon, and those skilled in the art can understand that Figure 3The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0049] Combine the following Figure 3 A detailed introduction to the various components of electronic equipment: The memory 310 can be used to store software programs and modules. The processor 320 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 310. The memory 310 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device (such as cache data), etc. In addition, the memory 310 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0050] The memory 310 includes an executable program 3101 of the network request method, and the executable program 3101 can be divided into one or more modules / units, which are stored in the memory 310 and executed by the processor 320 to achieve handwriting reconstruction, etc. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 3101 in the electronic device 3. For example, the computer program 3101 can be divided into functional modules such as a data acquisition module, a trajectory prediction module, a trajectory fitting module, and a trajectory projection module.
[0051] The processor 320 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 310, and calling data stored in the memory 310, it performs various functions of the electronic device and processes data, thereby monitoring the overall status of the electronic device. Optionally, the processor 320 may include one or more processing units; preferably, the processor 320 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 320.
[0052] The system bus 330 is used to connect the various functional components inside the computer, and can transmit data information, address information, and control information. Its types can be, for example, PCI bus, ISA bus, CAN bus, etc. The instructions of the processor 320 are transmitted to the memory 310 through the bus, and the memory 310 feeds back data to the processor 320. The system bus 330 is responsible for the data and instruction exchange between the processor 320 and the memory 310. Of course, the system bus 330 can also be connected to other devices, such as network interfaces, display devices, etc.
[0053] In the embodiment of the present invention, the executable program executed by the processor 320 included in the electronic device includes: Obtaining installation position information of the three-axis gyroscope on the writing tool, and collecting three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; Integrating the three-dimensional angular velocity time series data to obtain angle change time series data, and calculating the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; According to the time series data of the motion trajectory of the writing tool, the motion trajectory plane in three-dimensional space is fitted through a neural network model; The motion trajectory in three-dimensional space is projected onto a two-dimensional plane for handwriting reconstruction.
[0054] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0055] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0056] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A handwriting reconstruction method, characterized in that: include: Obtaining installation position information of the three-axis gyroscope on the writing tool, and collecting three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; Integrating the three-dimensional angular velocity time series data to obtain angle change time series data, and calculating the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; According to the time series data of the motion trajectory of the writing tool, the motion trajectory plane in three-dimensional space is fitted through a neural network model; The motion trajectory in three-dimensional space is projected onto a two-dimensional plane for handwriting reconstruction.
2. The method according to claim 1, characterized in that: The step of obtaining the installation position information of the three-axis gyroscope on the writing tool and collecting the three-dimensional angular velocity time series data during writing based on the three-axis gyroscope comprises: The first gyroscope is arranged at the position of the writing tool tip to collect the writing trajectory during writing, and the second gyroscope is arranged at a position at a preset distance from the pen tip to collect the trajectory of holding the writing tool during writing; The writing trajectory and the trajectory of the writing tool held are fused through Kalman filtering to obtain the three-dimensional angular velocity time series data during writing.
3. The method according to claim 1, characterized in that The motion trajectory time series data of the writing tool in three-dimensional space calculated based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool includes: Based on the initial position, initial tilt angle and effective radius of the writing tool, a set of coordinate equations of the motion trajectory in three directions of X, Y and Z axes in three-dimensional space is constructed by adding a displacement to the initial position to obtain the trajectory coordinates of the writing tool; Based on the real-time angle change time series data, the trajectory coordinates of the writing tool in the three-dimensional space are updated to obtain the motion trajectory time series data of the writing tool in the three-dimensional space.
4. The method according to claim 1, characterized in that: The neural network model is a neural network model using a multi-layer perceptron, and the neural network model consists of an input layer, a hidden layer and an output layer. The input layer is designed with 3 neurons to receive the coordinate values of the X-axis, the Y-axis and the Z-axis respectively, 3 hidden layers are set and the number of neurons in each hidden layer is 64, and the output layer is set with 4 neurons to output the four coefficients of the three-dimensional plane equation.
5. The method according to claim 1, characterized in that The step of fitting the motion trajectory plane in three-dimensional space through a neural network model according to the motion trajectory time series data of the writing tool comprises: The three-dimensional space motion trajectory coordinate dataset with stroke labels is divided into a training set, a validation set and a test set; The neural network model is trained, verified and tested based on the training set, validation set and test set respectively; The reconstructed handwriting is compared with the stroke label, and the calculated mean square error is used as the loss function. The parameter weights and bias parameters of the neural network are updated through back propagation based on the loss function.
6. The method according to claim 1, characterized in that The process of converting the motion trajectory plane projection of the three-dimensional space into a two-dimensional plane for handwriting reconstruction comprises: Obtain the motion trajectory plane fitted by the neural network model, and construct a projection matrix based on the normal vector and unit matrix of the motion trajectory plane; Based on the projection matrix, the motion trajectory coordinate points in the three-dimensional space are projected and transformed to obtain the trajectory coordinate points projected to the two-dimensional plane; The corresponding handwriting image is reconstructed based on the trajectory coordinate points on the two-dimensional plane.
7. The method according to claim 6, characterized in that The reconstructing the corresponding handwriting image based on the trajectory coordinate points on the two-dimensional plane also includes: The handwriting image is subjected to dilation and erosion operations respectively to fill the breakpoints in the handwriting and remove the noise points in the handwriting.
8. A handwriting reconstruction system, characterized in that: include: A data acquisition module is used to obtain the installation position information of the three-axis gyroscope on the writing tool, and to collect the three-dimensional angular velocity time series data during writing based on the three-axis gyroscope; A trajectory prediction module is used to integrate the three-dimensional angular velocity time series data to obtain the angle change time series data, and calculate the motion trajectory time series data of the writing tool in the three-dimensional space based on the initial position, initial tilt angle, effective radius and angle change time series data of the writing tool; Wherein, the initial tilt angle is calculated based on the installation position information of the three-axis gyroscope, and the effective radius is the radius at which the writing tool tip can effectively write; A trajectory fitting module, used to fit the motion trajectory plane in three-dimensional space through a neural network model according to the motion trajectory time series data of the writing tool; The trajectory projection module is used to transform the motion trajectory planar projection of the three-dimensional space into a two-dimensional plane for handwriting reconstruction.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of a handwriting reconstruction method as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed, the steps of a handwriting reconstruction method as claimed in any one of claims 1 to 7 are implemented.