Handwriting generation method and device, computer equipment and storage medium
By obtaining the initial coordinates and relative angles, combined with UWB, geomagnetmeter and IMU technology, the accurate generation of remote writing handwriting is achieved, solving the problem that traditional technology cannot accurately generate writing handwriting in remote scenarios.
Patent Information
- Application Number
- CN202310840715.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2025-01-10
AI Technical Summary
In remote scenarios, traditional intelligent writing pen technology cannot achieve accurate writing handwriting generation, and cannot accurately simulate the scene and sliding trajectory of the human body using laser pens at a long distance.
By obtaining the initial coordinates and relative angle relationships, determining the coordinates of the writing starting point, and obtaining acceleration and angular velocity in response to the writing operation, updating the coordinates and angular relationships, generating real-time writing coordinates, and achieving accurate generation of remote writing handwriting. Specific methods include using UWB positioning method, geomagnet calibration and six-axis IMU solution, combined with Bluetooth module transmission, to ensure that the display device can accurately display the writing handwriting.
It realizes accurate acquisition of writing starting point and real-time writing coordinates in remote scenarios, ensuring that the display device can accurately generate writing handwriting, and solving the accuracy of remote writing handwriting generation.
Smart Images

Figure CN119292502A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, device, computer equipment, storage medium and computer program product for generating handwriting. Background Art
[0002] With the development of various technologies in the field of artificial intelligence, the technology of using smart writing pens to generate handwriting has emerged, which has brought great convenience to daily life. For example, when a teacher needs to mark, indicate, write, etc. in class, he can do so by interacting with the screen of the smart blackboard through the smart writing pen, without using chalk to mark, indicate, and write, which can avoid inhaling dust or being unable to operate due to lack of chalk.
[0003] In traditional technology, a smart writing pen is usually used instead of chalk, and the pen is brought close to the screen to perform operations such as drawing and writing on the screen to achieve human-computer interaction. In addition, the position and direction of the pen can be calculated by using a camera for video fitting to simulate the scene of a human body using a laser pen, and then the sliding trajectory of the pen can be calculated through the six-axis IMU to complete a series of operations such as writing, indicating, and marking. However, these two methods cannot achieve accurate handwriting generation in remote scenarios. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for accurately generating handwriting in a remote scenario in response to the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a method for generating handwriting. The method comprises:
[0006] Obtaining the initial coordinates and the initial relative angle relationship with the display device;
[0007] Determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0008] In response to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation;
[0009] According to the acceleration and the angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain real-time coordinates and real-time relative angle relationship respectively;
[0010] Generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0011] The real-time writing coordinates are sent to the display device, and the display device generates writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
[0012] In one embodiment, the obtaining of the initial coordinates and the initial relative angle relationship between the initial coordinates and the display device comprises:
[0013] The initial coordinates are obtained by using UWB (Ultra-Wideband, ultra-wideband wireless communication technology) positioning method;
[0014] Acquire an initial relative azimuth angle with the display device and an initial relative pitch angle with the display device;
[0015] According to the initial azimuth angle with the display device and the initial elevation angle with the display device, an initial relative angle relationship with the display device is obtained.
[0016] In one embodiment, acquiring an initial relative azimuth angle with the display device and an initial relative pitch angle with the display device comprises:
[0017] Acquire a first initial azimuth angle and a first initial pitch angle, and acquire a second initial azimuth angle and a second initial pitch angle of the display device;
[0018] Acquire an initial relative azimuth angle with respect to a display device according to the first initial azimuth angle and the second initial azimuth angle;
[0019] An initial relative pitch angle with respect to a display device is acquired according to the first initial pitch angle and the second initial pitch angle.
[0020] In one embodiment, the obtaining of the first initial azimuth angle and the first initial pitch angle, and the obtaining of the second initial azimuth angle and the second initial pitch angle of the display device comprises:
[0021] Obtaining a magnetometer calibration parameter corresponding to the built-in magnetometer, and obtaining a first initial azimuth angle and a first initial pitch angle according to the calibrated magnetometer detection parameters;
[0022] Generate and send a calibration request to the display device according to the magnetometer calibration parameters, wherein the calibration request is used to control the display device to calibrate the built-in magnetometer of the display device according to the magnetometer calibration parameters, and generate a second initial azimuth angle and a second initial pitch angle of the display device according to the magnetometer detection parameters of the calibrated display device;
[0023] A second initial azimuth angle and a second initial pitch angle of the display device fed back by the display device are obtained.
[0024] In one embodiment, determining the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device comprises:
[0025] According to the relative angle relationship with the display device, an initial azimuth angle with the display device and an initial pitch angle with the display device are acquired;
[0026] According to the initial azimuth angle between the display device and the initial coordinates, the coordinates in the direction of the first axis corresponding to the initial coordinates are acquired using trigonometric function theorem;
[0027] According to the initial pitch angle with the display device and the initial coordinates, the coordinates in the direction of the second axis corresponding to the initial coordinates are obtained using trigonometric function theorem, wherein the first axis and the second axis are axes corresponding to the two-dimensional plane coordinate system;
[0028] The coordinates of the writing starting point are determined according to the coordinates in the direction of the first axis and the coordinates in the direction of the second axis.
[0029] In one embodiment, updating the initial coordinates and updating the initial relative angle relationship according to the acceleration and the angular velocity includes:
[0030] updating the initial coordinates according to the acceleration and the angular velocity;
[0031] According to the updated initial coordinates, obtain the real-time relative azimuth angle and the real-time relative elevation angle with the display device;
[0032] The initial relative angle relationship is updated according to the real-time relative azimuth angle with the display device and the real-time relative pitch angle with the display device.
[0033] In a second aspect, the present application also provides a writing handwriting generation device. The device comprises:
[0034] An initial data acquisition module, used to acquire initial coordinates and initial relative angle relationship with a display device;
[0035] A starting point coordinate determination module, used to determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0036] A writing data acquisition module, used to respond to a writing operation and acquire the acceleration and angular velocity corresponding to the writing operation;
[0037] A writing data processing module, used for updating the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity, and obtaining real-time coordinates and real-time relative angle relationship respectively;
[0038] A real-time coordinate determination module, used to generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0039] The writing handwriting generation module is used to send the real-time writing coordinates to the display device, and the display device generates the writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
[0040] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0041] Obtaining the initial coordinates and the initial relative angle relationship with the display device;
[0042] Determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0043] In response to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation;
[0044] According to the acceleration and the angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain real-time coordinates and real-time relative angle relationship respectively;
[0045] Generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0046] The real-time writing coordinates are sent to the display device, and the display device generates writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
[0047] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0048] Obtaining the initial coordinates and the initial relative angle relationship with the display device;
[0049] Determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0050] In response to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation;
[0051] According to the acceleration and the angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain real-time coordinates and real-time relative angle relationship respectively;
[0052] Generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0053] The real-time writing coordinates are sent to the display device, and the display device generates writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
[0054] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0055] Obtaining the initial coordinates and the initial relative angle relationship with the display device;
[0056] Determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0057] In response to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation;
[0058] According to the acceleration and the angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain real-time coordinates and real-time relative angle relationship respectively;
[0059] Generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0060] The real-time writing coordinates are sent to the display device, and the display device generates writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
[0061] The above-mentioned human-computer interaction method, device, computer equipment, storage medium and computer program product obtain the initial coordinates and the initial relative angle relationship with the display device; determine the coordinates of the writing starting point based on the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device; respond to the writing operation and obtain the acceleration and angular velocity corresponding to the writing operation; update the initial coordinates and the initial relative angle relationship based on the acceleration and angular velocity, and obtain the real-time coordinates and the real-time relative angle relationship respectively; generate real-time writing coordinates based on the real-time coordinates and the real-time relative angle relationship; send the real-time writing coordinates to the display device, and the display device generates the writing handwriting based on the writing starting point coordinates and the real-time writing coordinates. During the whole process, by acquiring the initial coordinates and the initial relative angle relationship with the display device, it is possible to accurately acquire the writing starting point coordinates corresponding to the initial coordinates even in a remote scene. Furthermore, by acquiring the acceleration and angular velocity corresponding to the writing operation, the real-time coordinates and the real-time relative angle relationship in response to the writing operation are obtained, and the real-time writing coordinates can be accurately generated. After the writing starting point coordinates and the real-time writing coordinates are sent to the display device, the display device can accurately generate the writing handwriting in the remote scene based on the writing starting point coordinates and the real-time writing coordinates. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A diagram showing an application environment of a handwriting generation method in an embodiment;
[0063] Figure 2 A schematic diagram of a flow chart of a method for generating handwriting in one embodiment;
[0064] Figure 3 A schematic diagram of the positional relationship between a writing pen and a display device in a specific application example;
[0065] Figure 4 A schematic diagram of a flow chart of a method for generating handwriting in another embodiment;
[0066] Figure 5 A schematic diagram of the azimuth angle relationship between a writing pen and a display device in a specific application example;
[0067] Figure 6 A schematic diagram of a flow chart of a method for generating handwriting in another embodiment;
[0068] Figure 7 It is a diagram of the internal structure of a writing pen and a display device in a specific application example;
[0069] Figure 8 The figure is a flow chart of obtaining the azimuth angle and the elevation angle by using a geomagnetic meter in a specific application example;
[0070] Fig. 9 is a structural block diagram of a writing handwriting generating device in one embodiment;
[0071] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0073] The handwriting generation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the writing pen 102 communicates with the display device 104. The user holds the writing pen 102, and when the writing pen 102 is started, the writing pen 102 obtains the initial coordinates and the initial relative angle relationship with the display device 104; and the writing pen 102 determines the coordinates of the writing starting point on the display device 104 according to the initial coordinates and the relative angle relationship with the display device 104, and sends the coordinates of the writing starting point to the display device 104; the writing pen 102 responds to the user's writing operation, obtains the acceleration and angular velocity corresponding to the writing operation; according to the acceleration and angular velocity, updates the initial coordinates, and updates the initial relative angle relationship, respectively obtaining the real-time coordinates and the real-time relative angle relationship; according to the real-time coordinates and the real-time relative angle relationship, generates the real-time writing coordinates; sends the real-time writing coordinates to the display device 104, and the display device 104 generates the writing handwriting according to the coordinates of the writing starting point and the real-time writing coordinates. Further, the display device 104 displays (displays) the writing handwriting to the user.
[0074] In one embodiment, Figure 2 As shown, a method for generating handwriting is provided, and the method is applied to Figure 1 Taking the writing pen 102 in the embodiment as an example, the method includes the following steps:
[0075] S100, obtaining initial coordinates and an initial relative angle relationship with a display device.
[0076] Among them, the writing pen includes a switch and an MCU control terminal. When the user presses the switch, the MCU control terminal of the pen is quickly awakened to realize data collection and data transmission of the writing pen based on the MCU control terminal.
[0077] like Figure 3As shown, the application scenario of remote writing includes a writing pen and a display device. When the writing pen writes, the writing of the writing pen will be displayed on the display device. The display device is generally rectangular. A three-dimensional rectangular coordinate system is established with the center point of the top edge of the display device as the origin of the coordinate system, and the length direction of the display device is the x-axis, the width direction of the display device is the y-axis, and the thickness direction of the display device is the z-axis. As an example, since the writing is displayed on the display device, the z-axis coordinate corresponding to the writing on the display device is 0 in subsequent calculations. At this time, the writing on the display device can be considered as a two-dimensional coordinate in the three-dimensional rectangular coordinate system, and the coordinates of the writing on the display device are (x, y, 0) or (x, y).
[0078] Specifically, the user holds the writing pen, and when the user presses the switch of the writing pen, the MCU control end in the writing pen is awakened. The MCU control end controls the writing pen to obtain the initial coordinates (x0, y0, z0) of the writing pen in the three-dimensional rectangular coordinate system, and the initial relative angle relationship between the writing pen and the display device.
[0079] Furthermore, the writing pen is an intelligent interactive device, and the display device may include a display screen, an interactive tablet and other devices that can display handwriting.
[0080] S200, determining the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and sending the coordinates of the writing starting point to the display device.
[0081] Specifically, when the switch of the writing pen is pressed and the writing pen is turned on, the initial coordinates of the writing pen when it is turned on in the remote scene are used as the starting point of the writing of the writing pen, and the initial coordinates are the starting coordinates of the writing pen in the three-dimensional rectangular coordinate system, and the relative angle relationship between the writing pen and the display device is the relative angle relationship between the writing pen and the display device, so the coordinates of the writing starting point displayed on the display device corresponding to the initial coordinates can be calculated based on the initial coordinates and the relative angle relationship between the writing pen and the display device. That is, the writing starting point coordinates in the above determination of the writing starting point coordinates are the writing starting point coordinates displayed on the display device.
[0082] Furthermore, the coordinates of the writing starting point displayed on the display device are sent to the display device for the display device to display the coordinates. The writing starting point coordinates may be sent by transmission via a Bluetooth module. Both the writing pen and the display device have built-in Bluetooth modules. When the coordinates of the writing starting point are determined, the Bluetooth modules of both parties are controlled to be turned on, and the coordinates of the writing starting point are sent from the Bluetooth module of the writing pen to the Bluetooth module of the display device.
[0083] S300, responding to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation.
[0084] Specifically, the user holds the writing pen to perform writing operations, and the posture of the hand changes when the user writes. The writing pen moves in response to the user's writing operations, thereby analyzing the movement process of the writing pen, identifying the motion trajectory of the writing pen when the user performs the writing operation, and calculating the acceleration and angular velocity of the writing pen when the user performs the writing operation.
[0085] Furthermore, an IMU (inertial measurement unit) unit is built into the writing pen, wherein the IMU is used to directly measure acceleration and angular velocity. The movement of the writing pen drives the movement of the built-in IMU unit. According to the IMU unit, the movement trajectory of the writing pen during the writing process is captured, and the acceleration and angular velocity values of the writing pen are calculated to obtain the acceleration and angular velocity corresponding to the writing operation. Among them, the IMU unit can be a six-axis IMU unit, which is composed of a three-axis accelerometer and a three-axis gyroscope.
[0086] S400, updating the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity, and obtaining the real-time coordinates and the real-time relative angle relationship respectively.
[0087] Specifically, at this time, the initial coordinates of the writing pen are known, and the acceleration and angular velocity of the writing pen when performing the writing operation are known. According to the kinematic theorem, the real-time coordinates of the writing pen in the three-dimensional rectangular coordinate system can be obtained when the writing pen moves, and the initial coordinates are updated according to the real-time coordinates of the writing pen to obtain the real-time coordinates until the writing operation is paused or terminated, and the acceleration and angular velocity of the writing pen are zero. Furthermore, when the writing pen reaches the new real-time coordinates, the relative angle relationship between the writing pen and the display device at the real-time coordinates can also be obtained to update the initial relative angle relationship between the writing pen and the display device to obtain the real-time relative angle relationship.
[0088] S500, generating real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship.
[0089] Specifically, the real-time coordinates are the real-time coordinates of the writing pen in the three-dimensional rectangular coordinate system, and the real-time relative angle relationship is the real-time relative angle relationship between the writing pen and the display device. Based on the real-time coordinates and the real-time relative angle relationship, the real-time writing coordinates displayed on the display device corresponding to the real-time coordinates can be generated.
[0090] S600, sending the real-time writing coordinates to the display device, and the display device generates the writing handwriting according to the coordinates of the writing starting point and the real-time writing coordinates.
[0091] Specifically, the real-time writing coordinates obtained in response to the writing operation are transmitted to the display device via the Bluetooth module. The display device now displays the coordinates of the writing starting point, and takes the coordinates of the writing starting point as the starting point. The writing handwriting on the display device is continuously refreshed according to the real-time writing coordinates to generate the final writing handwriting.
[0092] In the above-mentioned writing handwriting generation method, the initial coordinates and the initial relative angle relationship between the display device are obtained; the coordinates of the writing starting point are determined according to the initial coordinates and the relative angle relationship between the display device, and the coordinates of the writing starting point are sent to the display device; in response to the writing operation, the acceleration and angular velocity corresponding to the writing operation are obtained; according to the acceleration and angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain the real-time coordinates and the real-time relative angle relationship respectively; according to the real-time coordinates and the real-time relative angle relationship, the real-time writing coordinates are generated; the real-time writing coordinates are sent to the display device, and the display device generates the writing handwriting according to the writing starting point coordinates and the real-time writing coordinates. In the whole process, by obtaining the initial coordinates and the initial relative angle relationship between the display device, the writing starting point coordinates corresponding to the initial coordinates can be accurately obtained in the remote scene; further, by obtaining the acceleration and angular velocity corresponding to the writing operation, the real-time coordinates and the real-time relative angle relationship in response to the writing operation can be obtained, and the real-time writing coordinates can be accurately generated, so that after the writing starting point coordinates and the real-time writing coordinates are sent to the display device, the display device can accurately generate the writing handwriting in the remote scene according to the writing starting point coordinates and the real-time writing coordinates.
[0093] In one embodiment, Figure 4 As shown, S100 includes:
[0094] S120, using the UWB positioning method to obtain initial coordinates.
[0095] Among them, UWB positioning is an ultra-wideband wireless communication technology. UWB does not use a carrier, but a short energy pulse sequence, and expands the pulse to a frequency range through orthogonal frequency division modulation or direct sequencing. The UWB positioning method generally uses a UWB base station to communicate with a UWB-tag. The UWB base station receives the signal transmitted by the UWB-tag and obtains the distance difference between the UWB-tag and the UWB base station.
[0096] Specifically, the UWB positioning method can be used to obtain the three-dimensional initial coordinates (x0, y0, z0) of the writing pen based on the rectangular coordinate system of the display device. The writing pen has a built-in UWB-tag, and the display device has a built-in UWB base station. The UWB-tag is paired with the built-in UWB base station in the display device to locate the three-dimensional initial coordinates (x0, y0, z0) of the pen in the rectangular coordinate system of the display device. In practical applications, there are two types of UWB positioning methods, one is the Tof (Time of flight) ranging method, and the other is the Tof+AOA (Angle-of-Arrival) method, and the Tof ranging method requires three anchor points on the display device.
[0097] S140, obtaining an initial relative azimuth angle with the display device and an initial relative elevation angle with the display device.
[0098] The azimuth angle refers to the horizontal angle between the north direction line at a certain point and the target direction line in a clockwise direction, and the angle range is [0, 2π]. That is, the azimuth angle is the horizontal angle between the north direction and the target. The relative azimuth angle in this application refers to the relative azimuth angle between the writing pen and the display device. The pitch angle refers to the angle between an object and a preset horizontal plane. The relative pitch angle in this application refers to the relative pitch angle between the writing pen and the display device.
[0099] Specifically, since the handwriting on the display device is a coordinate with the z axis being zero, the handwriting on the display device can be considered as a two-dimensional coordinate, and it is only necessary to obtain the coordinates of the y axis and the x axis of the handwriting on the display device in the three-dimensional rectangular coordinate system. Therefore, obtaining the initial relative angle relationship with the display device includes obtaining the initial relative azimuth angle with the display device and the initial relative pitch angle with the display device, wherein the initial relative azimuth angle with the display device refers to the angle between the initial orientation of the writing pen and the x-axis direction of the display device, and the initial relative pitch angle with the display device refers to the angle between the initial orientation of the writing pen and the y-axis direction of the display device. And by analyzing the two angles and the initial coordinates of the writing pen, the coordinates of the writing starting point of the handwriting on the display device are determined.
[0100] S160, obtaining an initial relative angle relationship with the display device according to an initial azimuth angle with the display device and an initial elevation angle with the display device.
[0101] Specifically, the initial relative angle relationship with the display device is obtained according to the azimuth angle between the initial orientation of the writing pen and the x-axis direction of the display device, and the pitch angle between the initial orientation of the writing pen and the y-axis direction of the display device. That is, it can be considered that the initial relative angle relationship with the display device includes the initial azimuth angle with the display device and the initial pitch angle with the display device.
[0102] Furthermore, according to the initial relative angle relationship between the writing pen and the display device, and the initial coordinates, it can be determined whether the pen tip is facing the display device. If the pen tip is not facing the display device, even if the writing pen is turned on, the handwriting will not be displayed. At this time, the writing pen pushes a prompt message "not facing the display device" to the user. The push method can be a voice announcement.
[0103] In this embodiment, by adopting the UWB positioning method, the initial coordinates can be accurately obtained; and by obtaining the initial relative azimuth angle between the display device and the initial relative pitch angle between the display device, the initial relative angle relationship between the display device can be efficiently obtained, which paves the way for accurately determining the coordinates of the writing starting point based on the initial coordinates and the relative angle relationship with the display device.
[0104] In one embodiment, obtaining an initial relative azimuth angle with the display device and an initial relative elevation angle with the display device includes:
[0105] Obtain a first initial azimuth angle and a first initial pitch angle, and obtain a second initial azimuth angle and a second initial pitch angle of the display device; obtain an initial relative azimuth angle with the display device based on the first initial azimuth angle and the second initial azimuth angle; obtain an initial relative pitch angle with the display device based on the first initial pitch angle and the second initial pitch angle.
[0106] Specifically, Figure 5 As shown in the figure, the coordinate system is an azimuth coordinate system, N represents north, E represents east, the first initial azimuth angle is the azimuth angle θ1 of the writing pen in the azimuth coordinate system, and the second initial azimuth angle is the azimuth angle θ2 of the display device in the azimuth coordinate system. After obtaining the first initial azimuth angle θ1 of the writing pen and the second initial azimuth angle θ2 of the display device, according to the first initial azimuth angle θ1 and the second initial azimuth angle θ2, and according to the trigonometric relationship that the sum of the internal angles of a triangle is equal to 180°, the initial relative azimuth angle θ=90°+θ1-θ2 between the writing pen and the display device can be obtained. Similarly, obtain the first initial pitch angle of the writing pen And obtain the second initial pitch angle of the display device According to the first initial pitch angle and the second initial pitch angle According to the trigonometric relationship, the sum of the interior angles of the triangle is equal to 180°, and the initial relative pitch angle between the display device and the display device is obtained.
[0107] In this embodiment, the azimuth angle and pitch angle of the display device, and the azimuth angle and pitch angle of the writing pen are obtained respectively, so that the relative angle relationship between the display device and the writing pen can be obtained efficiently and accurately, that is, the initial relative azimuth angle and the initial relative pitch angle between the display device and the writing pen are obtained.
[0108] In one embodiment, obtaining a first initial azimuth angle and a first initial pitch angle, and obtaining a second initial azimuth angle and a second initial pitch angle of the display device includes:
[0109] Obtain the geomagnetometer calibration parameters corresponding to the built-in magnetometer, and obtain a first initial azimuth angle and a first initial pitch angle according to the calibrated geomagnetometer detection parameters; generate and send a calibration request to the display device according to the geomagnetometer calibration parameters, the calibration request is used to control the display device to calibrate the built-in magnetometer of the display device according to the geomagnetometer calibration parameters, and generate a second initial azimuth angle and a second initial pitch angle of the display device according to the calibrated geomagnetometer detection parameters of the display device; obtain the second initial azimuth angle and the second initial pitch angle of the display device fed back by the display device.
[0110] Specifically, a magnetometer method is used to obtain the azimuth angle and pitch angle of the display device and the azimuth angle and pitch angle of the writing pen. The pen tip of the writing pen and the display device are both built with a magnetometer, which is equipped with a three-axis geomagnetic sensor. The geomagnetic sensor is easily disturbed by the surrounding geomagnetic environment. After being disturbed, the original magnetic flux data obtained according to the damping change will be biased. Therefore, it is necessary to calibrate the magnetometer equipped with the geomagnetic sensor and set a bias value for the original magnetic flux data so that the magnetometer can be used normally.
[0111] The process of calibrating the magnetometer includes:
[0112] 1. Initialize the magnetometer of the writing pen tip and the display device;
[0113] 2. Use the "8"-shaped sliding method to calibrate the geomagnetometer at the tip of the writing pen after initialization, obtain the calibration parameters of the geomagnetometer at the tip of the writing pen during calibration, and generate a calibration request based on the calibration parameters, and send the calibration request to the display device. Among them, sending the calibration request can be transmitted through a Bluetooth module, that is, both the writing pen and the display device are built with Bluetooth modules, and the Bluetooth module in the writing pen sends the calibration request to the Bluetooth module of the display device. The "8"-shaped sliding method refers to moving the device carrying the geomagnetometer in the shape of an "8" after power-on.
[0114] 3. The display device extracts the magnetometer calibration parameters carried in the calibration request, and calibrates the magnetometer of the initialized display device according to the magnetometer calibration parameters.
[0115] After the built-in magnetometer at the end of the writing pen and the built-in magnetometer of the display device are calibrated, the first detection parameter of the built-in magnetometer at the end of the writing pen that has been calibrated is obtained, and the first initial azimuth angle and the first initial pitch angle of the writing pen are obtained according to the calibrated first detection parameter. The second detection parameter of the built-in magnetometer of the calibrated display device is obtained, and the second initial azimuth angle and the second initial pitch angle of the display device are obtained according to the calibrated second detection parameter. The detection parameters include the magnetic flux data of the magnetometer. The display device transmits the generated second initial azimuth angle and the second initial pitch angle of the display device to the writing pen through the Bluetooth module for coordinate analysis.
[0116] Furthermore, according to the calibrated detection parameters, the initial azimuth angle and the initial pitch angle are obtained by calculating the angles according to the obtained magnetic flux magnitudes of the three axes xyz.
[0117] In this embodiment, on the one hand, the azimuth angle and pitch angle of the writing pen and the azimuth angle and pitch angle of the magnetometer can be accurately obtained by using a magnetometer, and the process of obtaining the angle by using a magnetometer is more efficient. On the other hand, before using the magnetometer to obtain the angle, the magnetometer will be calibrated to ensure the accuracy of the angle acquisition process of the magnetometer. In the calibration process, the magnetometer calibration parameters of the display device are sent by the writing pen, so as to realize efficient calibration of the magnetometer of the display device.
[0118] In one embodiment, Figure 6 As shown, S200 includes:
[0119] S210: Acquire an initial azimuth angle with the display device and an initial pitch angle with the display device according to a relative angle relationship with the display device.
[0120] Specifically, since the relative angle relationship with the display device is generated based on the initial azimuth angle with the display device and the initial pitch angle with the display device, the initial azimuth angle with the display device θ=90°+θ1-θ2 and the initial pitch angle with the display device can be obtained based on the relative angle relationship with the display device. Among them, the relative angle relationship with the display device refers to the angle between the direction of the writing pen and the display device in the x-axis direction, and the initial pitch angle with the display device refers to the angle between the direction of the writing pen and the display device in the y-axis direction.
[0121] S220, according to the initial azimuth angle with the display device and the initial coordinates, using trigonometric function theorem to obtain the coordinates in the direction of the first axis corresponding to the initial coordinates.
[0122] Specifically, Figure 5 As shown, when the writing pen is facing the screen, the initial coordinates of the writing pen are (x0, y0, z0). According to the trigonometric theorem, the coordinates of the first axis direction corresponding to the writing pen on the display device are x=x0-z0 / tanθ=x0-z0 / tan(90°+θ1-θ2). Among them, the coordinates of the first axis direction are the coordinates of the x-axis of the writing handwriting on the display device.
[0123] S230, according to the initial pitch angle with the display device and the initial coordinates, using trigonometric function theorem to obtain coordinates in the direction of a second axis corresponding to the initial coordinates, wherein the first axis and the second axis are axes corresponding to the two-dimensional plane coordinate system.
[0124] Specifically, similarly, when the writing pen is facing the screen, the initial coordinates of the writing pen are (x0, y0, z0). According to the trigonometric theorem, the coordinates of the writing pen on the display device in the direction of the second axis are: The coordinates in the direction of the first axis are the coordinates of the y axis of the handwriting on the display device. And because the handwriting on the display device can be regarded as a two-dimensional plane coordinate system, the x axis and the y axis are the axes corresponding to the two-dimensional plane coordinate system with the center point of the upper edge of the display device as the origin.
[0125] S240, determining the coordinates of the writing starting point according to the coordinates in the direction of the first axis and the coordinates in the direction of the second axis.
[0126] Specifically, according to the x-axis coordinate and the y-axis coordinate, the coordinates of the writing starting point are determined as That is, the starting coordinates of the writing pen are (x0, y0, z0), and the coordinates of the writing pen will be displayed on the display device. At this time, the coordinates of the starting coordinates calculated by the writing pen on the display device are
[0127] S250, sending the coordinates of the writing starting point to a display device.
[0128] In this embodiment, based on the initial coordinates and the relative angle relationship with the display device, the coordinates of the initial coordinates in the first axis direction of the display device and the coordinates of the initial coordinates in the second axis direction of the display device can be calculated respectively, thereby efficiently and accurately determining the coordinates of the writing starting point.
[0129] In one embodiment, updating the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity includes:
[0130] The acceleration and the angular velocity are respectively integrated over time to obtain the coordinate transformation amount; according to the coordinate transformation amount, the initial coordinates and the initial relative angle relationship are updated.
[0131] Specifically, based on the acceleration and angular velocity, the posture transformation of the writing pen itself can be calculated, that is, the posture change at the current moment relative to the previous moment can be obtained. The angular velocity is integrated once in time to obtain the angle change of the writing pen; the acceleration is integrated twice in time to obtain the updated displacement transformation of the writing pen, and the coordinate transformation is obtained based on the displacement transformation and the angle change, and the initial coordinates are updated. Furthermore, based on the angle change in the coordinate transformation of the writing pen, the relative angle relationship between the writing pen and the display device is obtained, and the initial relative angle relationship between the writing pen and the display device is updated.
[0132] For example, the initial coordinates of the writing pen are (x0, y0, z0), the first initial azimuth angle of the writing pen is θ1, and the first initial pitch angle is The second initial azimuth angle of the display device is θ2, and the second initial pitch angle is The relative angle between the writing pen and the display device is At this time, the writing starting coordinates displayed on the corresponding display device are At the next moment, the initial coordinates of the writing pen are updated according to the angular velocity and acceleration obtained by the IMU unit, and the coordinates at the next moment are (x1, y1, z1), and the relative angle relationship between the writing pen and the display device at the next moment is The writing coordinates displayed on the display device at the next moment are The display position of the handwriting on the display device is continuously refreshed to generate the final written handwriting.
[0133] In this embodiment, the movement process of the writing pen can be analyzed through acceleration and angular velocity, so as to efficiently update the initial coordinates of the writing pen, and on the basis of the update of the initial coordinates of the writing pen, the real-time relative azimuth angle between the writing pen and the display device and the real-time relative pitch angle between the writing pen and the display device are obtained, and the initial relative angle relationship can also be updated in real time, thereby realizing the generation of real-time writing coordinates on the display screen based on the real-time updated coordinate quantity and the corresponding real-time updated relative angle relationship.
[0134] In one embodiment, the writing handwriting generation method is applied to a writing pen, and the internal structure of the writing pen and the display device is as follows: Figure 7As shown, the writing pen has a built-in UWB-tag, a magnetometer, a six-axis IMU unit, a Bluetooth module, a rebound button S1, a writing switch S2, and an MCU control terminal, wherein the rebound button S1 is used in conjunction with the writing switch S2, and the UWB-tag, the magnetometer, the six-axis IMU unit, the Bluetooth module, the rebound button S1, and the writing switch S2 are all controlled by the MUC control terminal; the display device has a built-in Bluetooth module, a UWB base station, a magnetometer, and plug-ins, etc. The specific method for the writing pen and the display device to realize the generation of writing handwriting includes:
[0135] 1. Initial coordinate acquisition stage. A three-dimensional rectangular coordinate system is established with the center point of the top edge of the display device as the origin of the coordinate system, the length direction of the display device as the x-axis, the width direction of the display device as the y-axis, and the thickness direction of the display device as the z-axis. The UWB positioning method is used to obtain the initial coordinates (x0, y0, z0) of the writing pen with a built-in UWB-tag based on the display device with a built-in UWB base station.
[0136] 2. Initial relative angle acquisition stage. Obtain the azimuth coordinate system and the magnetic flux data of the magnetometer, and according to the azimuth coordinate system, use the detection parameters of the built-in magnetometer of the writing pen to obtain the first initial azimuth angle θ1 and the first initial pitch angle of the writing pen. The second initial azimuth angle θ2 and the second initial pitch angle θ2 of the display device are obtained by using the magnetic flux data of the built-in magnetometer of the display device. Among them, when using the geomagnetic timer, the geomagnetometer will be calibrated first. The calibration process includes: initializing the geomagnetometer, and moving the built-in geomagnetometer of the initialized writing pen using the "8" sliding method to obtain the corresponding geomagnetometer calibration parameters, and transmitting the corresponding geomagnetometer calibration parameters to the Bluetooth module of the display device through the Bluetooth module of the writing pen, and the display device calibrates the geomagnetometer of the display device according to the geomagnetometer calibration parameters.
[0137] According to the first initial azimuth angle θ1 and the second initial azimuth angle θ2, the initial relative azimuth angle θ=90°+θ1-θ2 between the display device and the display device is obtained by using the trigonometric function theorem; according to the first initial pitch angle and the second initial pitch angle Use trigonometric theorem to obtain the initial relative pitch angle between the display device and the display device
[0138] 3. Determine the writing starting point on the display device. When the writing pen is facing the screen, based on the initial coordinates (x0, y0, z0) obtained in the initial coordinate acquisition stage and the θ and Determine the coordinates of the writing starting point The writing pen sends the coordinates of the writing starting point on the display device to the display device via the Bluetooth module.
[0139] 4. The stage of determining the real-time writing coordinates on the display device. The user performs the writing operation, so that the movement of the writing pen drives the movement of the built-in IMU unit of the writing pen. The acceleration and angular velocity of the writing pen corresponding to the writing operation are obtained through the IMU unit, and the motion posture of the writing pen during the writing operation period is obtained based on the time integral of the angular velocity and acceleration. Among them, the IMU unit includes an IMU sensor. That is, the acceleration and angular velocity are respectively integrated over time to obtain the coordinate transformation amount; according to the coordinate transformation amount, the initial coordinates are updated, and the initial relative angle relationship is updated; according to the real-time coordinates and the real-time relative angle relationship, the real-time writing coordinates are generated. The writing pen sends the real-time writing coordinates on the display device to the display device through the Bluetooth module.
[0140] 5. The writing handwriting generation stage on the display device: The display device receives the writing starting point coordinates and the real-time writing coordinates, takes the writing starting point coordinates as the starting point, and refreshes the cursor point on the display device according to the continuously received real-time writing coordinates to generate the writing handwriting.
[0141] In this embodiment, the pen tip gesture recognition is completed based on UWB, geomagnetometer, and six-axis IMU unit. Specifically, the initial coordinate position of the pen is obtained by UWB positioning, and the initial relative angle relationship between the pen and the display device is obtained by the geomagnetometer, and then the initial projection cursor position of the pen on the display device can be obtained; when a person writes, marks, clicks, or other operations that require the generation of writing traces, the six-axis IMU unit completes the capture of the pen sliding trajectory, and then converts it into the movement of the display device cursor; the cursor coordinate information is directly transmitted to the display device through Bluetooth transmission to complete the cursor display.
[0142] In one embodiment, Figure 8 As shown, the steps of using a geomagnetic meter to obtain an azimuth angle and a pitch angle include:
[0143] 1. Initialize the built-in magnetometer at the pen tip and the built-in magnetometer of the display device.
[0144] 2. Use the "8"-shaped sliding method to calibrate the magnetometer at the tip of the writing pen after initialization, obtain the calibration parameters of the magnetometer at the tip of the writing pen during calibration, generate a calibration request based on the calibration parameters, and send the calibration request to the display device.
[0145] 3. The display device extracts the geomagnetic calibration parameters carried in the calibration request, and calibrates the geomagnetic calibration parameters of the initialized display device according to the geomagnetic calibration parameters. If the display device does not receive the geomagnetic calibration parameters carried in the calibration request, it returns to the step of receiving the calibration request and re-acquires the calibration parameters.
[0146] 4. The writing pen and the display device respectively obtain calibrated magnetic flux data.
[0147] 5. The writing pen obtains the azimuth angle and pitch angle of the writing pen according to the calibrated magnetic flux data; the display device obtains the azimuth angle and pitch angle of the display device according to the calibrated magnetic flux data.
[0148] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0149] Based on the same inventive concept, the embodiment of the present application also provides a handwriting generation device for implementing the handwriting generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more handwriting generation device embodiments provided below can refer to the limitations of the handwriting generation method above, and will not be repeated here.
[0150] In one embodiment, Fig. 9 As shown, a writing handwriting generation device is provided, comprising: an initial data acquisition module 100, a starting point coordinate determination module 200, a writing data acquisition module 300, a writing data processing module 400, a real-time coordinate determination module 500 and a writing handwriting generation module 600, wherein:
[0151] An initial data acquisition module 100 is used to acquire initial coordinates and an initial relative angle relationship with a display device;
[0152] A starting point coordinate determination module 200 is used to determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device;
[0153] A writing data acquisition module 300 is used to respond to a writing operation and acquire an acceleration and an angular velocity corresponding to the writing operation;
[0154] The writing data processing module 400 is used to update the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity, and obtain the real-time coordinates and the real-time relative angle relationship respectively;
[0155] A real-time coordinate determination module 500, for generating real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship;
[0156] The writing handwriting generation module 600 is used to send the real-time writing coordinates to the display device, and the display device generates the writing handwriting according to the coordinates of the writing starting point and the real-time writing coordinates.
[0157] In one embodiment, the initial data acquisition module 100 is also used to obtain initial coordinates using the UWB positioning method; obtain the initial relative azimuth angle with the display device, and the initial relative pitch angle with the display device; and obtain the initial relative angle relationship with the display device based on the initial azimuth angle with the display device, and the initial pitch angle with the display device.
[0158] In one embodiment, the initial data acquisition module 100 is also used to acquire a first initial azimuth angle and a first initial pitch angle, and to acquire a second initial azimuth angle and a second initial pitch angle of the display device; to acquire an initial relative azimuth angle with the display device based on the first initial azimuth angle and the second initial azimuth angle; and to acquire an initial relative pitch angle with the display device based on the first initial pitch angle and the second initial pitch angle.
[0159] In one embodiment, the initial data acquisition module 100 is also used to obtain the geomagnetometer calibration parameters corresponding to the built-in magnetometer, and obtain a first initial azimuth angle and a first initial pitch angle based on the calibrated geomagnetometer detection parameters; generate and send a calibration request to the display device based on the geomagnetometer calibration parameters, the calibration request is used to control the display device to calibrate the built-in magnetometer of the display device according to the geomagnetometer calibration parameters, and generate a second initial azimuth angle and a second initial pitch angle of the display device based on the calibrated geomagnetometer detection parameters of the display device; obtain the second initial azimuth angle and the second initial pitch angle of the display device fed back by the display device.
[0160] In one embodiment, the starting point coordinate determination module 200 is also used to obtain an initial azimuth angle with the display device and an initial pitch angle with the display device according to a relative angle relationship with the display device; based on the initial azimuth angle with the display device and the initial coordinates, trigonometric function theorem is used to obtain coordinates in the direction of a first axis corresponding to the initial coordinates; based on the initial pitch angle with the display device and the initial coordinates, trigonometric function theorem is used to obtain coordinates in the direction of a second axis corresponding to the initial coordinates, wherein the first axis and the second axis are axes corresponding to a two-dimensional plane coordinate system; based on the coordinates in the direction of the first axis and the coordinates in the direction of the second axis, the coordinates of the writing starting point are determined.
[0161] In one embodiment, the writing data processing module 400 is also used to perform time integration on the acceleration and angular velocity respectively to obtain the coordinate transformation amount; based on the coordinate transformation amount, the initial coordinates are updated, and the initial relative angle relationship is updated.
[0162] Each module in the above-mentioned writing handwriting generation device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module above.
[0163] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as the writing starting point and real-time writing coordinates. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating handwriting is implemented.
[0164] Those skilled in the art will understand that Fig.10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0165] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0166] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0167] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0168] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited thereto.
[0169] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for generating handwriting, characterized in that: The method comprises: Obtaining the initial coordinates and the initial relative angle relationship with the display device; Determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device; In response to a writing operation, obtaining an acceleration and an angular velocity corresponding to the writing operation; According to the acceleration and the angular velocity, the initial coordinates and the initial relative angle relationship are updated to obtain real-time coordinates and real-time relative angle relationship respectively; Generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship; The real-time writing coordinates are sent to the display device, and the display device generates writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
2. The method according to claim 1, characterized in that The obtaining of the initial coordinates and the initial relative angle relationship between the initial coordinates and the display device comprises: Use UWB positioning method to obtain initial coordinates; Acquire an initial relative azimuth angle with the display device and an initial relative pitch angle with the display device; According to the initial azimuth angle with the display device and the initial elevation angle with the display device, an initial relative angle relationship with the display device is obtained.
3. The method according to claim 2, characterized in that The obtaining of the initial relative azimuth angle with the display device and the initial relative pitch angle with the display device comprises: Acquire a first initial azimuth angle and a first initial pitch angle, and acquire a second initial azimuth angle and a second initial pitch angle of the display device; Acquire an initial relative azimuth angle with respect to a display device according to the first initial azimuth angle and the second initial azimuth angle; An initial relative pitch angle with respect to a display device is acquired according to the first initial pitch angle and the second initial pitch angle.
4. The method according to claim 3, characterized in that The obtaining of the first initial azimuth angle and the first initial pitch angle, and obtaining of the second initial azimuth angle and the second initial pitch angle of the display device comprises: Obtaining a magnetometer calibration parameter corresponding to the built-in magnetometer, and obtaining a first initial azimuth angle and a first initial pitch angle according to the calibrated magnetometer detection parameters; Generate and send a calibration request to the display device according to the magnetometer calibration parameters, wherein the calibration request is used to control the display device to calibrate the built-in magnetometer of the display device according to the magnetometer calibration parameters, and generate a second initial azimuth angle and a second initial pitch angle of the display device according to the magnetometer detection parameters of the calibrated display device; A second initial azimuth angle and a second initial pitch angle of the display device fed back by the display device are obtained.
5. The method according to claim 1, characterized in that Determining the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device includes: According to the relative angle relationship with the display device, an initial azimuth angle with the display device and an initial pitch angle with the display device are acquired; According to the initial azimuth angle between the display device and the initial coordinates, the coordinates in the direction of the first axis corresponding to the initial coordinates are acquired using trigonometric function theorem; According to the initial pitch angle with the display device and the initial coordinates, the coordinates in the direction of the second axis corresponding to the initial coordinates are obtained using trigonometric function theorem, wherein the first axis and the second axis are axes corresponding to the two-dimensional plane coordinate system; The coordinates of the writing starting point are determined according to the coordinates in the direction of the first axis and the coordinates in the direction of the second axis.
6. The method according to claim 1, characterized in that The updating of the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity comprises: respectively integrating the acceleration and the angular velocity with respect to time to obtain a coordinate transformation amount; According to the coordinate transformation amount, the initial coordinates are updated, and the initial relative angle relationship is updated.
7. A writing handwriting generating device, characterized in that: The device comprises: An initial data acquisition module, used to acquire initial coordinates and initial relative angle relationship with a display device; A starting point coordinate determination module, used to determine the coordinates of the writing starting point according to the initial coordinates and the relative angle relationship with the display device, and send the coordinates of the writing starting point to the display device; A writing data acquisition module, used to respond to a writing operation and acquire the acceleration and angular velocity corresponding to the writing operation; A writing data processing module, used for updating the initial coordinates and the initial relative angle relationship according to the acceleration and the angular velocity, and obtaining real-time coordinates and real-time relative angle relationship respectively; A real-time coordinate determination module, used to generate real-time writing coordinates according to the real-time coordinates and the real-time relative angle relationship; The writing handwriting generation module is used to send the real-time writing coordinates to the display device, and the display device generates the writing handwriting according to the writing starting point coordinates and the real-time writing coordinates.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. 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 6 are implemented.
10. A computer program product, comprising a computer program, 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 6 are implemented.
Citation Information
Cited By
Handwriting pen handwriting generation method and electronic equipment
CN119739323A