Electronic handwriting correction method, device, equipment, storage medium and program product
By obtaining the posture information and pen tip pressure value of the writing pen, calculating the offset and performing adaptive correction, the problems of low efficiency and precision of electronic handwriting correction are solved, and the accuracy and aesthetics of the writing trajectory are improved.
Patent Information
- Application Number
- CN202511014285.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-23
AI Technical Summary
Existing electronic handwriting correction technology has low correction efficiency and low correction accuracy, resulting in writing trajectory deviation and reduced aesthetics.
By obtaining the posture information and pen tip pressure value of the writing pen, calculating the offset, and correcting the current writing point coordinates of the pen tip, the correction efficiency and accuracy are improved.
Adaptive correction of electronic handwriting is achieved, which improves the correction efficiency and accuracy and ensures that the handwriting is consistent with the user's intention.
Smart Images

Figure CN120523359B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of intelligent writing devices, and in particular to an electronic handwriting correction method, apparatus, device, storage medium, and program product. Background Art
[0002] Smart writing devices are becoming increasingly popular in a variety of applications, including electronic note-taking, digital signatures, and artistic drawing. However, due to differences in pen grip and writing angles, writing paths can easily become skewed, uneven, and impact the accuracy and aesthetics of handwriting. This deviation is particularly pronounced when writing at high speeds, with large pen tip tilts, or with frequent changes in contact pressure, severely impacting the user's writing experience.
[0003] Currently, the correction efficiency and accuracy of electronic handwriting correction are low. Summary of the Invention
[0004] The present disclosure provides an electronic handwriting correction method, apparatus, device, storage medium and program product to at least solve the problems of low correction efficiency and low correction accuracy of existing electronic handwriting correction.
[0005] The technical solutions disclosed in this disclosure are as follows:
[0006] The present disclosure also provides a method for correcting electronic handwriting, including:
[0007] Acquiring posture information of the writing pen body and a pressure value of the writing pen tip;
[0008] determining a current writing state of the writing pen according to the pressure value;
[0009] When the writing state is a valid writing state, calculating an offset according to the posture information and the pressure value;
[0010] Correcting the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates;
[0011] The calculating the offset according to the posture information and the pressure value includes:
[0012] Calculating the tilt angle of the writing pen according to the posture information;
[0013] Calculating an offset according to the tilt angle, the pressure value, and the pen tip length;
[0014] The tilt angle includes a pitch angle and a roll angle, and the offset includes a lateral offset and a longitudinal offset. Calculating the offset based on the tilt angle, the pressure value, and the pen tip length includes:
[0015] Calculating a lateral offset direction according to the roll angle;
[0016] Calculating a longitudinal offset direction according to the pitch angle;
[0017] Calculating a weighted degree of pen pressure influence according to the pressure value and a reference pressure;
[0018] Calculating the lateral offset according to the lateral offset direction, the weighted pen pressure influence, and the pen tip length;
[0019] Calculating the longitudinal offset according to the longitudinal offset direction, the weighted pen pressure influence, and the pen tip length;
[0020] The pitch angle pitch is calculated as follows: pitch=arcsin(2·(W·YZ·X));
[0021] The calculation formula of the roll angle roll is: roll=arctan2(2·(W·X+Y·Z), 1-2·( + )); wherein the quaternion representation of the posture information is q(t)=[X,Y,Z,W];
[0022] The calculation formula of the lateral offset is:
[0023] ;
[0024] The calculation formula of the longitudinal offset is:
[0025] ;
[0026] Where L is the length of the pen tip, which is a constant, i.e. the length of the exposed part of the pen core; p(t) is the pressure value; is the lateral offset; △y(t) is the longitudinal offset; tan(θ) represents the theoretical offset direction caused by tilt. Indicates the weighted influence of pen pressure. This is the reference pressure when the writing pen is in normal use.
[0027] Optionally, obtaining the posture information of the writing pen body and the pressure value of the writing pen tip includes:
[0028] Using a rotation vector sensor provided on the pen body, collecting posture information of the pen body of the writing pen;
[0029] The pressure value of the pen tip of the writing pen is collected by using a pressure sensor provided on the pen tip.
[0030] Optionally, determining the current writing state of the writing pen according to the pressure value includes:
[0031] When the pressure value is greater than or equal to the pressure threshold, determining that the current writing state of the writing pen is a valid writing state;
[0032] When the pressure value is less than the pressure threshold, it is determined that the current writing state of the writing pen is an invalid writing state.
[0033] Optionally, the offset includes: a horizontal offset and a vertical offset; and correcting the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates includes:
[0034] Correcting the horizontal coordinate of the current writing point coordinate of the pen tip according to the horizontal offset to obtain the corrected horizontal coordinate of the writing point coordinate;
[0035] Correcting the vertical coordinate of the current writing point coordinate of the pen tip according to the vertical offset to obtain the corrected vertical coordinate of the writing point coordinate;
[0036] The corrected writing point coordinates are determined according to the corrected abscissa of the writing point coordinates and the corrected ordinate of the writing point coordinates.
[0037] The present disclosure also provides an electronic handwriting correction device, comprising:
[0038] An acquisition module, configured to acquire posture information of the writing pen body and a pressure value of the writing pen tip;
[0039] a determination module, configured to determine a current writing state of the writing pen according to the pressure value;
[0040] A calculation module is configured to calculate an offset according to the posture information and the pressure value when the writing state is a valid writing state; the calculation of the offset according to the posture information and the pressure value includes:
[0041] Calculating the tilt angle of the writing pen according to the posture information;
[0042] Calculating an offset according to the tilt angle, the pressure value, and the pen tip length;
[0043] The tilt angle includes a pitch angle and a roll angle, and the offset includes a lateral offset and a longitudinal offset. Calculating the offset based on the tilt angle, the pressure value, and the pen tip length includes:
[0044] Calculating a lateral offset direction according to the roll angle;
[0045] Calculating a longitudinal offset direction according to the pitch angle;
[0046] Calculating a weighted degree of pen pressure influence according to the pressure value and a reference pressure;
[0047] Calculating the lateral offset according to the lateral offset direction, the weighted pen pressure influence, and the pen tip length;
[0048] Calculating the longitudinal offset according to the longitudinal offset direction, the weighted pen pressure influence, and the pen tip length;
[0049] The pitch angle pitch is calculated as follows: pitch=arcsin(2·(W·YZ·X));
[0050] The calculation formula of the roll angle roll is: roll=arctan2(2·(W·X+Y·Z), 1-2·( + )); wherein the quaternion representation of the posture information is q(t)=[X,Y,Z,W];
[0051] The calculation formula of the lateral offset is:
[0052] ;
[0053] The calculation formula of the longitudinal offset is:
[0054] ;
[0055] Where L is the length of the pen tip, which is a constant, i.e. the length of the exposed part of the pen core; p(t) is the pressure value; is the lateral offset; △y(t) is the longitudinal offset; tan(θ) represents the theoretical offset direction caused by tilt. Indicates the weighted influence of pen pressure. It is the reference pressure when the writing pen is in normal use;
[0056] The correction module is used to correct the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates.
[0057] The present disclosure also provides an electronic device, including:
[0058] processor;
[0059] a memory for storing processor-executable instructions;
[0060] The processor is configured to execute instructions to implement each step in the above method.
[0061] The embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step in the above method is implemented.
[0062] The embodiments of the present disclosure further provide a computer program product, including a computer program / instruction, which implements the steps in the above method when executed by a processor.
[0063] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0064] In some embodiments of the present disclosure, the posture information of the pen body and the pressure value of the pen tip are automatically obtained; based on the pressure value, the current writing state of the writing pen is intelligently judged; when the writing state is a valid writing state, the offset is calculated in combination with the posture information and the pressure value; based on the offset, the current writing point coordinates of the pen tip are adaptively corrected to obtain the corrected writing point coordinates; the correction efficiency of electronic handwriting correction is improved, and the correction accuracy is improved.
[0065] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0067] Figure 1 A flowchart of an electronic handwriting correction method provided by an exemplary embodiment of the present disclosure;
[0068] Figure 2 A schematic structural diagram of an electronic handwriting correction device provided by an exemplary embodiment of the present disclosure;
[0069] Figure 3 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0070] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0071] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure.
[0072] It should be noted that the user information involved in this disclosure includes but is not limited to: user device information and user personal information; the collection, storage, use, processing, transmission, provision and disclosure of user information in this disclosure comply with the relevant laws and regulations and do not violate public order and good morals.
[0073] In response to the above technical problems, in some embodiments of the present disclosure, the posture information of the pen body and the pressure value of the pen tip are automatically obtained; based on the pressure value, the current writing state of the writing pen is intelligently judged; when the writing state is a valid writing state, the offset is calculated in combination with the posture information and the pressure value; based on the offset, the current writing point coordinates of the pen tip are adaptively corrected to obtain the corrected writing point coordinates; the correction efficiency of electronic handwriting correction is improved, and the correction accuracy is improved.
[0074] The technical solutions provided by various embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0075] Figure 1 The flowchart of an electronic handwriting correction method provided by the exemplary embodiment of the present disclosure is as follows. Figure 1 As shown, the method includes:
[0076] S101: Acquire posture information of the writing pen body and pressure value of the writing pen tip;
[0077] S102: Determine the current writing state of the writing pen according to the pressure value;
[0078] S103: When the writing state is a valid writing state, calculating an offset according to the posture information and the pressure value;
[0079] S104: Correcting the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates.
[0080] In this embodiment, the execution subject of the above method is a terminal device or a server.
[0081] The terminal device includes, but is not limited to, a mobile station (MS), a mobile terminal, a mobile telephone, a handset, a portable equipment, and the like. The terminal device can communicate with one or more core networks through a radio access network (RAN). For example, the terminal device can be a mobile phone (also referred to as a "cellular" phone), a computer with wireless communication functions, and the like. The terminal device can also be a computer with wireless transceiver functions, a virtual reality (VR) terminal device, an AR terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical treatment, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, and the like. An operating system installed on the terminal device includes, but is not limited to, an IOS, an Android, a windows, a linux, a Mac OS, and the like. In different networks, the terminal device can be referred to by different names, such as a user equipment, a mobile station, a user unit, a station, a cellular phone, a personal digital assistant, a wireless modem, a wireless communication device, a handheld device, a laptop computer, a cordless phone, a wireless local loop station, a television, and the like. For the convenience of description, the terminal device is referred to as a terminal device in this embodiment.
[0082] In this embodiment, the implementation form of the server is not limited. For example, the server can be a conventional server, a cloud server, a cloud host, a virtual center, and the like. The server mainly includes a processor, a hard disk, a memory, a system bus, and the like, and has a general computer architecture type.
[0083] In some embodiments of the present disclosure, the posture information of the pen body of the writing pen is acquired. One implementable manner is to use a rotation vector sensor arranged on the pen body to collect the posture information of the pen body of the writing pen. The rotation vector sensor is used to detect the angle change of the pen body in space in real time, that is, the rotation of the pen body around each axis. Such a sensor can provide the posture information of the current pen body, which is expressed as a direction vector or a quaternion.
[0084] In some embodiments of the present disclosure, the current writing point coordinates are collected by a touch module or a displacement sampling module.
[0085] In some embodiments of the present disclosure, the pressure value of the pen tip of the writing pen is obtained. One achievable method is to use a pressure sensor provided on the pen tip to collect the pressure value of the pen tip of the writing pen. The pressure sensor is arranged in the contact area of the pen tip, and is used to measure the pressure exerted by the pen tip on the surface when writing. This data can be used to determine whether it is currently in a valid writing state, and to participate in the weight calculation of the subsequent correction degree. The present disclosure collects the above two types of data at the same time by setting a fixed sampling frequency, for example, once every 10 milliseconds, and combines the current writing point coordinates recorded by devices such as tablets. After the system is started, the rotation vector and pressure sensor are initialized, and a unified data sampling period is set (such as once every 10ms). In each sampling period, the device will simultaneously obtain the following data: the current rotation vector value of the pen body, the current pen tip contact pressure value and the current writing point coordinates.
[0086] In some embodiments of the present disclosure, the current writing state of the writing pen is determined based on the pressure value. One achievable way is to determine that the current writing state of the writing pen is a valid writing state when the pressure value is greater than or equal to the pressure threshold; and to determine that the current writing state of the writing pen is an invalid writing state when the pressure value is less than the pressure threshold. For example, the pressure threshold is set to 5g to determine whether it is in a valid writing state. When the pressure value is greater than or equal to the pressure threshold, it means that the pen tip is indeed in contact with the writing surface and is in a valid writing state; when the pressure value is less than the pressure threshold, it means that the pen tip is not in contact with the writing surface and is in an invalid writing state, and the current data is ignored to prevent erroneous correction. The present disclosure sets a pressure threshold, and then performs a trajectory correction process when the writing pen is in a valid writing state, thereby reducing error interference.
[0087] In some embodiments of the present disclosure, the offset is calculated based on the posture information and the pressure value. One feasible way is to calculate the inclination angle of the writing pen based on the posture information; and calculate the offset based on the inclination angle, the pressure value and the length of the pen tip. For example, when the pen is tilted to the left, a certain lateral offset will occur; when it is tilted forward, the actual contact point of the pen tip will deviate to the longitudinal direction. The system determines the direction and magnitude of the trajectory that needs to be corrected based on these angle changes. If the pen is tilted forward, it means that the contact point may be in front of the user's expected position; if the pen is tilted to the left, the contact point may be deviated to the left.
[0088] It should be noted that the tilt angle disclosed herein includes the pitch angle and the roll angle. The offset includes the lateral offset and the longitudinal offset.
[0089] In the above embodiment, the stylus's tilt angle is calculated based on the posture information. The posture information obtained from the rotation vector sensor is used to derive the stylus's pitch and roll angles through an embedded posture calculation function. The pitch angle represents the stylus's forward and backward tilt, while the roll angle represents its left and right tilt.
[0090] For example, the posture information is in the form of quaternions, such as q(t) = [X, Y, Z, W], which represents the current posture of the pen tip. The quaternion posture information needs to be converted into a more intuitive Euler angle form. The pitch angle is calculated as follows:
[0091] pitch=arcsin(2·(W·YZ·X));
[0092] The roll angle is calculated as follows:
[0093] roll=arctan2(2·(W·X+Y·Z),1-2·( + )).
[0094] Among them, the converted angle value and The unit is radian, which represents the tilt angle of the writing pen around the X-axis and Y-axis in space.
[0095] In this embodiment, when the pen is tilted, the extension of the refill deviates from the vertical, resulting in a certain physical offset between the actual contact point and the user's desired trajectory. This disclosure treats the refill as a straight rod of fixed length and, by combining the posture angle and pressure value, estimates the horizontal displacement caused by tilt. The direction of this displacement depends on the tilt direction, while the magnitude is related to the angle and the pressure level. Simply put, the more tilted the pen is and the harder the pressure is applied, the further the actual contact point of the pen tip deviates from the desired trajectory. This offset is not random but rather calculated based on geometric relationships. Based on the pen's structural characteristics (such as refill length) and the current posture angle information, the system uses geometric mapping to estimate the spatial offset of the pen tip caused by tilt. The greater the tilt angle, the greater the offset at the end of the refill; the greater the writing pressure, the slightly greater this offset. The system uses built-in logic to combine the angle and pressure values into an offset factor. For example, different correction weights can be assigned to different angle ranges, and pressure can be used as an amplification factor to dynamically adjust the offset correction.
[0096] In some embodiments of the present disclosure, the offset is calculated based on the tilt angle, pressure value, and pen tip length. One possible implementation is to calculate the lateral offset direction based on the roll angle; calculate the longitudinal offset direction based on the pitch angle; calculate the weighted pen pressure influence based on the pressure value and a reference pressure; calculate the lateral offset based on the lateral offset direction, the weighted pen pressure influence, and the pen tip length; and calculate the longitudinal offset based on the longitudinal offset direction, the weighted pen pressure influence, and the pen tip length.
[0097] Among them, the lateral offset The calculation formula is as follows:
[0098] ;
[0099] Where L is the length of the pen tip, which is a constant, i.e. the length of the exposed part of the pen core, for example, 5 mm; p(t) is the pressure value; is the lateral offset; tan(θ) represents the theoretical offset direction caused by tilt, Indicates the weighted influence of pen pressure. This is the reference pressure when the writing pen is in normal use, for example, 50g.
[0100] The calculation formula of the longitudinal offset △y(t) is as follows:
[0101] .
[0102] In some embodiments of the present disclosure, the current writing point coordinates of the pen tip are corrected according to the offset to obtain the corrected writing point coordinates. One achievable method is to correct the horizontal coordinates of the current writing point coordinates of the pen tip according to the horizontal offset to obtain the horizontal coordinates of the corrected writing point coordinates; correct the vertical coordinates of the current writing point coordinates of the pen tip according to the vertical offset to obtain the vertical coordinates of the corrected writing point coordinates; and determine the corrected writing point coordinates according to the horizontal coordinates of the corrected writing point coordinates and the vertical coordinates of the corrected writing point coordinates. Among them, the current writing coordinates (x0, y0) are obtained, and the calculation formula of the horizontal coordinates of the corrected writing point coordinates is: x(t)=x0(t)+∆x(t); the vertical coordinates of the corrected writing point coordinates are: y(t)=y0(t)+∆y(t). In the user's writing display or drawing record, the original trajectory is replaced by the corrected coordinates, thereby achieving real-time dynamic compensation to ensure that the handwriting is consistent with the expected writing.
[0103] After the offset is estimated, the offset is added to the current writing point coordinate currently collected to generate a new corrected handwriting point. The purpose of this is to compensate the trajectory error caused by the holding posture in real time to the correct position. This correction process is performed every 10 milliseconds, ensuring that the whole handwriting curve is always smooth, coherent, and maximally close to the original intention of the user. When the system identifies the trajectory offset, the current writing point coordinate is adjusted in real time. The correction logic is as follows: if the pen is tilted to the right, the system compensates to the left in the horizontal coordinate; if the pen is tilted forward, the system compensates backward in the vertical coordinate; if the pressure is larger, the compensation amplitude can be appropriately increased.
[0104] In some embodiments of the present disclosure, considering that the holding posture, force application manner, and offset degree of each user are different, the system supports the following lightweight adaptive scheme to perform parameter adaptive adjustment. Initial calibration: when the user uses for the first time, the user can complete writing calibration of a standard holding posture through system guidance, to establish personalized parameter reference values; dynamic adjustment: the system records the commonly used angle range and pressure distribution of the user during use, and fine-tunes the correction intensity coefficient, to achieve an effect that is more suitable for the user's habits; local saving: all personalized parameters are saved in the local device, without the need for data uploading, and without involving neural network training, to ensure privacy and low-power operation.
[0105] In some embodiments of the present disclosure, in order to adapt to the holding posture and force application manner of different users, the system provides a lightweight adaptive strategy. Initial calibration: the user can be guided to write a trajectory under a standard holding posture for the first time, and the system records the angle and pressure characteristics thereof, for subsequent comparison; rolling adjustment: during multiple uses, the system automatically updates and fine-tunes the commonly used angle range of the user, to dynamically adjust the correction sensitivity; parameter local caching: the personalized parameters of the user are saved in a local configuration file, to avoid repeated initialization and improve adaptive efficiency.
[0106] In some embodiments of the present disclosure, the present disclosure can be integrated into a smart pen control system or a mobile device application through the following module interfaces: attitude solving interface: after obtaining data from the rotation vector sensor, the existing operating system (such as Android) attitude conversion API is called to obtain the pitch angle and roll angle; pressure reading interface: the real-time pressure value of the pen tip is obtained through a hardware interface; coordinate correction module: the offset is calculated according to the obtained pitch angle, roll angle, and pressure information, and the touch coordinates are corrected in real time; display interface: the corrected coordinate points are displayed on the screen or stored in a handwriting trajectory array for subsequent calling.
[0107] Figure 2 A structural schematic diagram of an electronic handwriting correction device 20 is provided for an exemplary embodiment of the present disclosure. As shown in FIG. 2, the device 20 includes a pen 21, a pen tip 22, a pen body 23, a pen tip pressure sensor 24, a rotation vector sensor 25, a display screen 26, and a handwriting correction module 27. Figure 2As shown, the electronic handwriting correction device 20 includes: an acquisition module 21 , a determination module 22 , a calculation module 23 and a correction module 24 .
[0108] The acquisition module 21 is used to acquire the posture information of the writing pen body and the pressure value of the writing pen tip;
[0109] A determination module 22, configured to determine the current writing state of the writing pen according to the pressure value;
[0110] A calculation module 23, configured to calculate an offset according to the posture information and the pressure value when the writing state is a valid writing state;
[0111] The correction module 24 is used to correct the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates.
[0112] Optionally, when acquiring the posture information of the writing pen body and the pressure value of the writing pen tip, the acquiring module 21 is configured to:
[0113] Using the rotation vector sensor provided on the pen body, the posture information of the pen body of the writing pen is collected;
[0114] The pressure sensor provided on the pen tip is used to collect the pressure value of the pen tip of the writing pen.
[0115] Optionally, when determining the current writing state of the writing pen according to the pressure value, the determination module 22 is configured to:
[0116] When the pressure value is greater than or equal to the pressure threshold, determining that the current writing state of the writing pen is a valid writing state;
[0117] When the pressure value is less than the pressure threshold, it is determined that the current writing state of the writing pen is an invalid writing state.
[0118] Optionally, when calculating the offset according to the posture information and the pressure value, the calculation module 23 is configured to:
[0119] Calculate the tilt angle of the writing pen based on the posture information;
[0120] Calculates the offset based on the tilt angle, pressure value, and pen tip length.
[0121] Optionally, the tilt angle includes a pitch angle and a roll angle, and the offset includes a lateral offset and a longitudinal offset; when calculating the offset based on the tilt angle, the pressure value, and the pen tip length, the calculation module 23 is used to:
[0122] According to the roll angle, calculate the lateral offset direction;
[0123] Calculate the longitudinal offset direction according to the pitch angle;
[0124] Calculate the weighted impact of pen pressure based on the pressure value and reference pressure;
[0125] Calculate the lateral offset according to the lateral offset direction, the weighted influence of pen pressure and the pen tip length;
[0126] The longitudinal offset is calculated based on the longitudinal offset direction, the weighted influence of pen pressure, and the pen tip length.
[0127] Optionally, the offset includes: a horizontal offset and a vertical offset; when the correction module 24 corrects the current writing point coordinates of the pen tip according to the offset to obtain the corrected writing point coordinates, it is used to:
[0128] Correcting the horizontal coordinate of the current writing point coordinate of the pen tip according to the horizontal offset to obtain the corrected horizontal coordinate of the writing point coordinate;
[0129] Correcting the vertical coordinate of the current writing point coordinate of the pen tip according to the vertical offset to obtain the corrected vertical coordinate of the writing point coordinate;
[0130] The corrected writing point coordinates are determined according to the corrected abscissa of the writing point coordinates and the corrected ordinate of the writing point coordinates.
[0131] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0132] Figure 3 FIG. 1 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. Figure 3 As shown, the electronic device includes: a memory 31 and a processor 32. In addition, the electronic device also includes a power supply component 33 and a communication component 34.
[0133] The memory 31 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device.
[0134] The memory 31 can be implemented by any type of volatile or non-volatile memory device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0135] The communication component 34 is used for data transmission with other devices.
[0136] The processor 32 can execute computer instructions stored in the memory 31 to: obtain the posture information of the pen body and the pressure value of the pen tip of the writing pen; determine the current writing state of the writing pen based on the pressure value; when the writing state is a valid writing state, calculate the offset based on the posture information and the pressure value; based on the offset, correct the current writing point coordinates of the pen tip to obtain the corrected writing point coordinates.
[0137] Accordingly, the embodiment of the present disclosure further provides a computer-readable storage medium storing a computer program. When the computer-readable storage medium stores the computer program and the computer program is executed by one or more processors, the one or more processors are caused to execute Figure 2 Each step in the method embodiment.
[0138] Accordingly, the present disclosure also provides a computer program product, which includes a computer program / instruction, and the computer program / instruction is executed by a processor. Figure 2 Each step in the method embodiment.
[0139] above Figure 3 The communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0140] above Figure 3 The power supply component in a device provides power to various components of the device in which the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply component is located.
[0141] The electronic device also includes a display screen and an audio component.
[0142] The display screen includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors can detect not only the boundaries of a touch or slide action, but also the duration and pressure associated with the touch or slide operation.
[0143] The audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC), which is configured to receive external audio signals when the device where the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signal can be further stored in a memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0144] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0145] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0146] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0147] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0148] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0149] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0150] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0151] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes the element.
[0152] The above are merely specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not limited to these embodiments, but is to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A method for correcting electronic handwriting, characterized in that: include: Acquiring posture information of the writing pen body and a pressure value of the writing pen tip; determining a current writing state of the writing pen according to the pressure value; When the writing state is a valid writing state, calculating an offset according to the posture information and the pressure value; Correcting the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates; The calculating the offset according to the posture information and the pressure value includes: Calculating the tilt angle of the writing pen according to the posture information; Calculating an offset according to the tilt angle, the pressure value, and the pen tip length; The tilt angle includes a pitch angle and a roll angle, and the offset includes a lateral offset and a longitudinal offset. Calculating the offset based on the tilt angle, the pressure value, and the pen tip length includes: Calculating a lateral offset direction according to the roll angle; Calculating a longitudinal offset direction according to the pitch angle; Calculating a weighted degree of pen pressure influence according to the pressure value and a reference pressure; Calculating the lateral offset according to the lateral offset direction, the weighted pen pressure influence, and the pen tip length; Calculating the longitudinal offset according to the longitudinal offset direction, the weighted pen pressure influence, and the pen tip length; The pitch angle pitch is calculated as follows: pitch=arcsin(2·(W·YZ·X)); The calculation formula of the roll angle roll is: roll=arctan2(2·(W·X+Y·Z), 1-2·( + )); wherein the quaternion representation of the posture information is q(t)=[X,Y,Z,W]; The calculation formula of the lateral offset is: ; The calculation formula of the longitudinal offset is: ; Where L is the length of the pen tip, which is a constant, i.e. the length of the exposed part of the pen core; p(t) is the pressure value; is the lateral offset; △y(t) is the longitudinal offset; tan(θ) represents the theoretical offset direction caused by tilt. Indicates the weighted influence of pen pressure. This is the reference pressure when the writing pen is in normal use.
2. The method according to claim 1, characterized in that Obtaining posture information of the writing pen body and a pressure value of the writing pen tip includes: Using a rotation vector sensor provided on the pen body, collecting posture information of the pen body of the writing pen; The pressure value of the pen tip of the writing pen is collected by using a pressure sensor provided on the pen tip.
3. The method according to claim 1, characterized in that Determining the current writing state of the writing pen according to the pressure value includes: When the pressure value is greater than or equal to the pressure threshold, determining that the current writing state of the writing pen is a valid writing state; When the pressure value is less than the pressure threshold, it is determined that the current writing state of the writing pen is an invalid writing state.
4. The method according to claim 1, wherein The offset includes: a horizontal offset and a vertical offset; and the current writing point coordinates of the pen tip are corrected according to the offset to obtain the corrected writing point coordinates, including: Correcting the horizontal coordinate of the current writing point coordinate of the pen tip according to the horizontal offset to obtain the corrected horizontal coordinate of the writing point coordinate; Correcting the vertical coordinate of the current writing point coordinate of the pen tip according to the vertical offset to obtain the corrected vertical coordinate of the writing point coordinate; The corrected writing point coordinates are determined according to the corrected abscissa of the writing point coordinates and the corrected ordinate of the writing point coordinates.
5. An electronic handwriting correction device, characterized in that: include: An acquisition module, configured to acquire posture information of the writing pen body and a pressure value of the writing pen tip; a determination module, configured to determine a current writing state of the writing pen according to the pressure value; A calculation module, configured to calculate an offset according to the posture information and the pressure value when the writing state is a valid writing state; The calculating the offset according to the posture information and the pressure value includes: Calculating the tilt angle of the writing pen according to the posture information; Calculating an offset according to the tilt angle, the pressure value, and the pen tip length; The tilt angle includes a pitch angle and a roll angle, and the offset includes a lateral offset and a longitudinal offset. Calculating the offset based on the tilt angle, the pressure value, and the pen tip length includes: Calculating a lateral offset direction according to the roll angle; Calculating a longitudinal offset direction according to the pitch angle; Calculating a weighted degree of pen pressure influence according to the pressure value and a reference pressure; Calculating the lateral offset according to the lateral offset direction, the weighted pen pressure influence, and the pen tip length; Calculating the longitudinal offset according to the longitudinal offset direction, the weighted pen pressure influence, and the pen tip length; The pitch angle pitch is calculated as follows: pitch=arcsin(2·(W·YZ·X)); The calculation formula of the roll angle roll is: roll=arctan2(2·(W·X+Y·Z), 1-2·( + )); wherein the quaternion representation of the posture information is q(t)=[X,Y,Z,W]; The calculation formula of the lateral offset is: ; The calculation formula of the longitudinal offset is: ; Where L is the length of the pen tip, which is a constant, i.e. the length of the exposed part of the pen core; p(t) is the pressure value; is the lateral offset; △y(t) is the longitudinal offset; tan(θ) represents the theoretical offset direction caused by tilt. Indicates the weighted influence of pen pressure. It is the reference pressure when the writing pen is in normal use; The correction module is used to correct the current writing point coordinates of the pen tip according to the offset to obtain corrected writing point coordinates.
6. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute instructions to implement each step in the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Pen system with internal pressure tilt rotation
CN106716314A
Method and device for adjusting writing track deviation of intelligent handwriting pen
CN113986032A