Electronic handwriting processing method, display device, storage medium and program product
By using the size and writing speed of touch points to generate chalk handwriting effects, the problem of poor chalk handwriting effect in the prior art is solved, and a more natural and flexible handwriting display is achieved, while saving storage resources.
Patent Information
- Application Number
- CN202311132710.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-04
- Publication Date
- 2025-03-04
AI Technical Summary
The existing electronic handwriting processing technology is in enlargement or shrinking, and the chalk handwriting effect is poor, and multi-resolution pictures occupy a large amount of storage resources, making the display effect stiff and lack flexibility.
By utilizing the size and writing speed of the touch points to achieve the chalk handwriting effect of the handwriting, avoiding the disadvantages of picture filling. The specific implementation method includes enlarging the touch point into a touch circle corresponding to the handwriting speed, connecting these circles to form a thickness frame of the handwriting, and finally discrete the lines and dotted lines to obtain the chalk handwriting effect.
It achieves the flexibility of handwriting and the authenticity of simulation, avoids the problem of pixel impact and excessive storage resource utilization, and the display effect is more natural and vivid.
Smart Images

Figure CN119556835A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to electronic handwriting processing technology, and more specifically, to an electronic handwriting processing method, display device, storage medium and program product. Background Art
[0002] When a user utilizes a writing medium to touch a display device such as an electronic whiteboard to generate a trajectory composed of multiple touch points, and displays handwriting on the electronic whiteboard according to the trajectory, there will be certain requirements for the way the handwriting is displayed. For example, for specific users such as teachers, when they want the handwriting to be displayed with the effect of chalk handwriting, they can define the shape of the touch points that make up the trajectory as chalk pictures before displaying the handwriting, and then when displaying the handwriting, they can superimpose multiple chalk pictures according to the trajectory to create the effect of chalk handwriting. Summary of the invention
[0003] However, as described in the above background technology, if a chalk picture with a lower resolution is used, when the displayed chalk handwriting is enlarged, due to the limitation that the resolution of the chalk picture itself is fixed, the resolution of the chalk picture composed of the chalk handwriting after enlargement is too small, resulting in blurred handwriting after enlargement, which is not conducive to recognition. If a chalk picture with a higher resolution is used, when the displayed chalk handwriting is reduced, due to the limitation that the resolution of the chalk picture itself is fixed, the resolution of the chalk picture composed of the chalk handwriting after reduction is too large, resulting in clear handwriting after reduction, and no chalk effect can be reflected. If chalk images with multiple resolutions are used, the corresponding resolution can be selected according to the magnification of enlargement or reduction, so as to solve the problem of poor chalk effect display after enlargement and reduction. However, when there are many levels of resolution settings, or the texture image filled is not a chalk image, for example, 5 levels of texture images with resolution and 10 texture images containing chalk texture are preset, the total number of replaceable images is as high as 50, which takes up a lot of storage resources, and due to the limitation of fixed image style, the final display effect is stiff and lacks flexibility. The present application is to use the size of the touch point itself and the writing speed to achieve the chalk handwriting effect of the handwriting, thereby avoiding the disadvantages of image filling.
[0004] The display device provided in the first embodiment of the present application comprises: a touch device, which is used to collect the coordinates and time of the touch point and send them to a processor; a display screen, which is used to display the trajectory of the touch point processed by the processor; and a processor connected to the touch device and the display screen respectively, which is used to process the touch point coordinates and time collected by the touch device and send them to the display screen, so that the display screen displays a chalk handwriting effect.
[0005] The processor in the display device provided in the first embodiment of the present application has the following functions: after continuously receiving two or more touch point coordinates and times sent by the touch device, determine a touch circle for locating the direction of handwriting movement and a touch trajectory for locating the outline of the handwriting based on the touch point coordinates and time; wherein the touch trajectory is used to connect adjacent touch circles; discretize the touch circle or touch trajectory and process it as a dotted line, and send the processed data to the display screen so that the display screen displays the chalk handwriting effect. Since the data format is processed and sent, the pixel influence of the filling method is avoided.
[0006] The processor in the display device provided in the second embodiment of the present application has the following functions: determining the distance between touch points based on the coordinates of two adjacent touch points, determining the time difference between the touch points based on the time of the two adjacent touch points, and then determining the speed of the touch points according to the distance and time difference between the touch points; determining the width of the touch circle according to the speed of the touch points; wherein the speed of the touch points is negatively correlated with the width of the touch circle; and determining the touch circle for locating the direction of handwriting movement according to the coordinates of the touch points and the width of the touch circle.
[0007] In the display device in the second embodiment of the present application, since the faster the writing speed, the thinner the corresponding writing handwriting, after the touch point is enlarged into a touch circle, the size of the touch circle can be limited by the speed of the touch point, and the greater the speed of the touch point, the smaller the corresponding touch circle size, and the touch circle can be characterized by the center and radius / diameter, and the center corresponds to the coordinates of the touch point, and the radius / diameter corresponds to the width of the touch circle. Therefore, by limiting the width of the touch circle by the speed of the touch point, the touch point can be converted into a touch circle related to speed.
[0008] The processor in the display device provided in the third embodiment of the present application has: if the speed of the touch point reaches the preset speed upper limit value, it means that when the speed of the touch point is at the preset speed upper limit value or exceeds the preset speed upper limit value, in order to ensure that the touch circle is connected and will not be unable to be displayed due to the line being too narrow, the width of the touch circle no longer changes with the change of speed, that is, the width of the touch circle is a fixed value at this time, and it is defined as a static width; wherein, since the writing width is usually customized according to user needs or predefined as a preset width threshold according to conventional use needs, the static width is defined as a first ratio of the preset width threshold; if the speed of the touch point does not reach the preset speed upper limit value, the width of the touch circle is determined to be a dynamic width, and the width of the touch circle can change within a certain range at this time, so that the thickness of the line connecting the touch circle changes with the speed; wherein, the dynamic width is defined as the sum of the first ratio of the preset width threshold and the second ratio of the preset width threshold, and the second ratio is linearly related to the ratio of the speed of the touch point to the preset speed upper limit value.
[0009] In the display device in the third embodiment of the present application, since the handwriting needs to be captured by the human eye on the display screen, it is necessary to set a lower limit value of the touch point, that is, no matter how fast the writing speed is, the width of the touch circle cannot be less than the lower limit value, and when the writing speed is very slow, the width of the touch circle cannot be too large, resulting in the font being too compact and unable to be clearly identified on the display screen. Therefore, it is necessary to set an upper limit value of the touch circle width, that is, a preset width threshold. Regardless of whether the writing speed is fast or slow, it will not exceed the preset width threshold. Therefore, a functional relationship between the touch point speed and the touch point width is constructed so that the touch point width changes with the touch point speed when it is between the maximum and minimum values.
[0010] The processor in the display device provided in the fourth embodiment of the present application has the following functions: after determining the touch circle, determining the outer common tangent of the two touch circles based on two adjacent touch circles to obtain the upper and lower line segments of the touch trajectory, and using the upper and lower line segments as the touch trajectory; or connecting the corresponding endpoints of the upper and lower line segments to obtain a touch quadrilateral as the touch trajectory.
[0011] In the display device in the fourth embodiment of the present application, since the outer common tangents of two non-adjacent touch circles can contain both touch circles within the range of the lines, the two touch circles can smoothly transition in width along the trajectory formed by the two outer common tangents to form a touch trajectory, or, the endpoints of the two outer common tangents are connected to form a quadrilateral structure to increase the lines of the blank part within the touch circle, and then increase some horizontal lines inside the handwriting, so as to enhance the dot-segment texture of the chalk handwriting and improve the display effect on the display screen.
[0012] The processor in the display device provided in the fifth embodiment of the present application has the following features: when blurring the touch circle or the touch track, the touch circle or the touch track is discretized to obtain discrete circles or discrete tracks; a dotted line track is obtained according to the discrete circles, discrete tracks and a preset spacing; wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete circles or discrete tracks.
[0013] In the display device in the fifth embodiment of the present application, since the lines of the touch track or the touch circle are very neat and cannot reflect the powdery effect of chalk, the lines are first discretized into irregular lines, and then some lines are intermittently hidden at a preset interval to achieve a blurring effect.
[0014] The processor in the display device provided in the sixth embodiment of the present application has the following functions: when discretizing the touch trajectory, determining the line length, unit vector and normal vector of the touch trajectory according to the endpoint coordinates of the touch trajectory; determining the third ratio of the unit vector according to the line length of the touch trajectory, a first preset discrete point deviation upper limit value and a first preset discrete point projection distance; wherein the first preset discrete point deviation upper limit value is used to define the upper limit value of the distance of the discrete point deviation from the touch trajectory, and the first preset discrete point projection distance is used to define the distance between the front and rear discrete points on the touch trajectory projected on the touch trajectory; determining the fourth ratio of the normal vector according to the sine value of the random angle and the first preset discrete point deviation upper limit value; determining the discrete point coordinates of the touch trajectory according to the endpoint coordinates of the touch trajectory, the unit vector of the third ratio and the normal vector of the fourth ratio, so as to obtain a discrete trajectory according to the discrete point coordinates.
[0015] In the display device in the sixth embodiment of the present application, since the constituent lines of the touch track are all straight lines and each straight line has a certain direction, it is necessary to consider both the unit vector and the normal vector during discretization, and perform randomization on both the unit vector and the normal vector within a certain range to achieve uniform discretization, while avoiding the situation where the discretized graphics cannot form the overall shape to be expressed by the original lines due to the discretization distance being too far.
[0016] The processor in the display device provided in the seventh embodiment of the present application has the following features: when discretizing the touch circle, determining the fifth ratio of the radius according to the radius of the touch circle, the second preset discrete point deviation upper limit value and the second preset discrete point projection distance; determining the sixth ratio according to the sine value of the random angle, the radius of the touch circle, the second preset discrete point deviation upper limit value and the second preset discrete point projection distance; wherein the second preset discrete point deviation upper limit value is used to define the upper limit value of the distance that the discrete point deviates from the touch circle, and the second preset discrete point projection distance is used to define the distance between the front and rear discrete points on the touch circle projected on the touch circle; determining the discrete point coordinates of the touch circle according to the coordinates of the center of the circle, the radius of the fifth ratio and the sixth ratio, so as to obtain a discrete circle according to the discrete point coordinates.
[0017] In the display device in the seventh embodiment of the present application, since the constituent lines of the touch circle are arcs, it is only necessary to randomize the center and radius of the arcs to obtain an irregular ring structure.
[0018] In the display device in the first embodiment of the present application, it is possible to construct handwriting lines based on the collected touch point information, and by discretizing the handwriting lines and processing them as dotted lines, it is possible to directly process the data to obtain a data-based pattern, thereby avoiding the influence of pixels in the filling method.
[0019] In the display device in the second embodiment of the present application, the touch point can be converted into a touch circle related to speed, so as to realize the function of controlling the thickness of the handwriting according to the writing speed, which is more in line with the actual handwriting effect.
[0020] In the display device in the third embodiment of the present application, the touch point width is changed as the touch point speed changes when it is between the maximum value and the minimum value, thereby improving the flexibility of the handwriting and the simulation authenticity.
[0021] In the display device in the fourth embodiment of the present application, while the adjacent touch circles are smoothly connected by the touch quadrilateral, the lines of the touch quadrilateral within the touch circle are used to enhance the dot-segment texture of the chalk handwriting, thereby improving the display effect on the display screen.
[0022] In the display device in the fifth embodiment of the present application, the harsh lines are transformed into a powdery texture effect by first discretizing and then hiding.
[0023] In the display device in the sixth embodiment of the present application, uniform discretization is performed according to the shape of the touch quadrilateral to improve the roughness of the line, thereby improving the authenticity of the handwriting simulation.
[0024] In the display device in the seventh embodiment of the present application, uniform discretization is performed according to the shape of the touch circle to improve the roughness of the line, thereby improving the authenticity of the handwriting simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0026] Figure 1 A schematic diagram of a chalk pattern replacement state in an existing electronic handwriting processing solution;
[0027] Figure 2 A schematic diagram of an operation scenario between a display device and a control device according to an embodiment;
[0028] Figure 3 This is a schematic diagram showing the structure of the display device in the embodiment of the present application;
[0029] Figure 4 A schematic diagram of a process for processing electronic handwriting provided in this application Figure 1 ;
[0030] Figure 5 A schematic diagram of a process for processing electronic handwriting provided in this application Figure 2 ;
[0031] Figure 6 A set of touch points and corresponding touch circle diagrams provided for the application;
[0032] Figure 7 Schematic diagram of two touch circles and their corresponding common tangent lines provided for the application;
[0033] Figure 8 A schematic diagram of a set of touch circles and their corresponding touch quadrilaterals provided for the application;
[0034] Fig. 9 A schematic diagram of a set of touch circles and corresponding touch quadrilaterals discretized for the application;
[0035] Fig.10 A schematic diagram of a set of touch circles and corresponding touch quadrilaterals processed by dotted lines provided in the application;
[0036] Fig.11 A schematic diagram of the effect of simulating chalk marks provided for the application;
[0037] Fig.12 A schematic diagram of the structure of an electronic handwriting processing device provided in this application. DETAILED DESCRIPTION
[0038] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0039] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0040] In addition, the terms "including" and "having" and any variations thereof are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to those components expressly listed but may include other components not expressly listed or inherent to such products or devices.
[0041] Display devices with touch functions, such as electronic whiteboards, usually include a touch device for collecting trajectories, a display screen for displaying the trajectories, and a processor for processing the trajectories collected by the touch device and sending them to the display screen for display. The collection of trajectories can be recorded by changes in pressure or level sensed by the touch device, the size of the touch device can be set in proportion or unequally to the size of the display screen, and the touch device can be set integrally with the display screen or not. Since the collected trajectory is a linear trajectory composed of multiple touch points, in order to improve the display effect of handwriting on the display screen, existing solutions usually perform pattern replacement or bolding on the collected touch points to enlarge the trajectory composed of touch points for easy recognition by the human eye.
[0042] Figure 1 Schematic diagram of the chalk pattern replacement state in the existing electronic handwriting processing solution. For users who need chalk handwriting after writing, the existing method of converting the displayed track into chalk handwriting is mainly through pattern replacement. Figure 1 As shown, a chalk handwriting texture image 101 is preset, and then the chalk handwriting texture image 101 is inserted into a touch point 102 in the track, and the chalk handwriting effect image 103 is displayed by overlaying the images.
[0043] However, the above pattern replacement method can only form handwriting of fixed width, which lacks flexibility compared with actual chalk handwriting. When the handwriting is enlarged, the chalk handwriting will be blurred due to the fixed pixels of the chalk handwriting texture image itself. A feasible way to solve the blurred chalk handwriting is to increase the texture images of chalk handwriting with different resolutions. For example, 5 images of different resolutions are set for the chalk handwriting, and each resolution corresponds to a certain range of zoom sizes. After the chalk handwriting is enlarged to a certain size, it searches for the chalk handwriting texture image of the corresponding resolution, and then replaces the found image with the touch point, thereby solving the problem of blurring after enlargement. However, the introduction of multiple images of different resolutions will occupy a large memory space, especially when the texture image is not only the chalk handwriting texture, the storage resources occupied by the texture image will be very large. Obviously, this solution will increase new memory problems, and this solution does not get rid of the problem of lack of flexibility in image replacement.
[0044] The technical concept of the present application is: according to the speed of the handwriting reaching the touch point, the collected touch point is enlarged into a circle of a size corresponding to the handwriting speed, and then the circles are connected to form a thickness framework of the handwriting, and finally the lines that make up the thickness framework are directly discretized and converted into dotted lines to obtain handwriting with a chalk handwriting effect, so as to send it to the display screen for display, avoiding the insertion of texture images, aiming to solve the above technical problems in the prior art.
[0045] The display device provided in the embodiments of the present application may have various implementation forms, for example, it may be a television, a smart television, a laser projection device, a monitor, an electronic bulletin board, an electronic table, etc. The following is a specific implementation of the display device of the present application.
[0046] Figure 2 FIG. 1 is a schematic diagram of an operation scenario between a display device and a control device according to an embodiment. Figure 2 As shown, the user can operate the display device 300 through the control device 200 or the smart device 400 or the server 500.
[0047] In some embodiments, the control device 200 may be a stylus pen, which can directly touch the display device 300 to implement written content operations, or communicate with the display device 300 to remotely control the written content, and the communication includes infrared protocol communication or Bluetooth protocol communication, and other short-range communication methods, and the display device 300 is controlled wirelessly or wired. The user can input user commands through buttons on the stylus pen, voice input, control panel input, etc. to control the functions of the display device 300, and display the content written by the stylus pen through direct contact with the display device or spatial trajectory recognition.
[0048] In some embodiments, a smart device 400 (such as a mobile terminal, tablet computer, computer, laptop computer, etc.) can also be used to control the display device 300. For example, the functions of the display device 300 and the content written on the smart device 400 can be controlled using an application running on the smart device.
[0049] In some embodiments, the display device 300 may not use the above-mentioned smart device 400 or the control device 200 to receive instructions, but may directly receive control instructions such as touch or gestures from the user.
[0050] In some embodiments, the display device 300 can also be controlled in a manner other than the control device 200 and the smart device 400. For example, the user's voice command control can be directly received through a module for obtaining voice commands configured inside the display device 300, or the user's voice command control can be received through a voice control device set outside the display device 300.
[0051] In some embodiments, the display device 300 also communicates data with the server 500. The display device 300 may be allowed to communicate via a local area network (LAN), a wireless local area network (WLAN) and other networks to achieve remote control writing. The server 500 may be a cluster or multiple clusters, and may include one or more types of servers.
[0052] Figure 3 This is a schematic diagram showing the structure of the display device in the embodiment of the present application. Figure 3 The display device 300 includes a touch device 301 , a display screen 302 and a processor 303 .
[0053] The display screen 302 includes a display screen component for presenting handwriting, and a driving component for driving the handwriting display, which is used to receive the handwriting signal output from the processor to display the handwriting content, and may also include components of the menu control interface and / or the user control UI interface.
[0054] The display screen 302 may be an electronic whiteboard, a liquid crystal display screen, an OLED display screen, or a projection display screen.
[0055] The processor 303, on the one hand, processes the coordinates and time of the touch point collected by the touch device 301 to obtain the handwriting signal to be displayed, and sends the handwriting signal to the display screen 302 to display the corresponding handwriting content; on the other hand, it can also control the operation of the display device 300 and respond to the user's operation through various software control programs stored in the memory. The processor 303 controls the overall operation of the display device 300. For example: in response to receiving a user command for selecting a UI object to be displayed on the display screen 302, the processor 303 can perform operations related to the object selected by the user command.
[0056] In some embodiments, the processor includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), a RAM Random Access Memory (RAM), a ROM (Read-Only Memory, ROM), a first interface to an nth interface for input / output, a communication bus (Bus), etc.
[0057] The user may input a user command in a graphical user interface (GUI) displayed on the display screen 302, and the user input interface receives the user input command through the graphical user interface (GUI). Alternatively, the user may input a user command by inputting a specific sound or gesture, and the user input interface recognizes the sound or gesture through a sensor to receive the user input command.
[0058] "User interface" is the medium interface for interaction and information exchange between application programs or operating systems and users. It realizes the conversion between the internal form of information and the form acceptable to users. The commonly used form of user interface is the Graphical User Interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0059] The following uses the processor of the display device as an example to illustrate how the display device implements the processing of electronic handwriting.
[0060] The technical solution of the present application is described in detail below in conjunction with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0061] Figure 4 A schematic diagram of a process for processing electronic handwriting provided in this application Figure 1 .like Figure 4 As shown, the method comprises the following steps:
[0062] S401: Receive touch point coordinates and time sent by a touch device.
[0063] Specifically, since the writing trajectory is composed of lines, according to the principle of points, lines and surfaces, multiple continuous touch points can be selected on the writing trajectory to realize the function of obtaining the writing trajectory by connecting the touch points. In order to make the writing trajectory on the touch device consistent with the display trajectory of the display screen, by limiting the positional relationship of the touch points, the touch points on the touch device and the display screen can be made to correspond one to one. The positional relationship can be represented by two-dimensional coordinates, so the touch device needs to collect the coordinates of the touch points.
[0064] Since the thickness of the handwriting needs to be determined according to the speed of the touch point, under the premise of knowing the coordinates of the touch point, it is only necessary to obtain the time of the touch point, and then the speed of the touch point can be obtained according to the ratio of the distance and the time difference.
[0065] S402: after continuously receiving two or more touch point coordinates and times sent by the touch device, determine a touch circle for locating a handwriting running direction based on the touch point coordinates and times.
[0066] Specifically, since the touch point itself is small, in order to be sent to the display screen for easy recognition by the human eye, it needs to be bolded. One way is to enlarge it into a touch circle. The center coordinates of the touch circle are the coordinates of the touch point, and the radius of the touch circle is related to the magnification.
[0067] The written font is formed by connecting the touch circles, and the font can be a font with the same stroke thickness, or a flexible font with thick and thin strokes similar to the actual handwriting process. For fonts with the same stroke thickness, it is only necessary to set the radius of the touch circle to the same, and then connect the touch circles to get fonts with the same thickness. For fonts with different stroke thicknesses, it is necessary to obtain the moving speed of the touch point, so that the touch circle radius corresponding to the fast-moving touch point is small, and the touch circle radius corresponding to the slow-moving touch point is large. The speed of the touch point is obtained based on the ratio of distance and time difference.
[0068] One feasible way to obtain the velocity is to use a limit algorithm to calculate the velocity of each touch point.
[0069] Another feasible way to obtain the speed is to simply calculate the average speed through the coordinates and time of two adjacent touch points, that is, the distance is obtained by the coordinates of the touch point whose speed is to be calculated and the coordinates of the previous touch point, and then the time of the touch point and the time of the previous touch point are calculated to obtain the time difference. Finally, based on the ratio of the distance and the time difference, the average speed obtained is defined as the speed of the touch point.
[0070] S403: Determine a touch track according to the coordinates of the touch circle.
[0071] Specifically, the touch track is formed by connecting the touch circles with straight lines.
[0072] Among them, a feasible connection method is to move the connection line between the touch points up and down respectively, so that the two end points of the connection line are respectively connected to the edge lines of the touch circles on both sides. Since the diameters of the touch circles on both sides are not necessarily the same, when the diameters are different, the translation can only satisfy the connection of one end point with the edge line of the touch circle, while the other end point is not connected. Since the chalk handwriting itself is discontinuous, the non-connection does not have a significant impact on the overall shape of the touch track, so the formation of the touch track can be achieved in this way.
[0073] Another feasible connection method is to use the common tangent of two adjacent touch circles as the connecting line, so that the touch circles are completely contained in the touch track to form a touch track. Because the common tangent makes the width between the touch circles change evenly, it is more in line with the handwriting rules when writing, and improves the flexibility of the displayed font after writing. And this method is applicable to both the same and different stroke thicknesses.
[0074] S404: discretize the touch circle or the touch track and process it into a dotted line, and send the processed data to the display screen, so that the display screen displays a chalk handwriting effect.
[0075] Specifically, since chalk handwriting is composed of many dotted particles, and the acquired touch circles or touch tracks are regular line shapes, it is necessary to discretize the regular lines to increase the roughness of the lines, and then perform dotted line processing on the discretized line segments, so that the discrete line segments present a powdery effect, and finally send these discrete line segments with powdery effect to the display screen for display; since the discrete line segments with powdery effect are obtained through data conversion and are not affected by pixels, there will be no blurring due to pixel problems when scaling the image on the display screen; and since discrete line segment data is sent, the data occupies less memory than texture images, thereby reducing data transmission traffic, and since there is no need to pre-store texture images, basic memory usage is saved.
[0076] Figure 5 A schematic diagram of a process for processing electronic handwriting provided in this application Figure 2 .like Figure 5 As shown, the method comprises the following steps:
[0077] S501: Receive touch point coordinates and time sent by the touch device.
[0078] Specifically, the coordinates of the i-th touch point are (x i ,y i , t i ) means, where x i is the horizontal axis, y i is the vertical axis, t i For time.
[0079] S502: After continuously receiving two or more touch point coordinates and times sent by the touch device, determine the speed of the touch point based on the touch point coordinates and time.
[0080] Specifically, the velocity of the initial touch point is defined as 0, and the velocity of the i-th touch point is expressed as a horizontal velocity v in a two-dimensional plane vector. i|x and vertical velocity v i|y , the formula is as follows:
[0081]
[0082]
[0083] Among them, v 0|x =0, v 0|y =0.
[0084] Then the velocity v of the touch pointi and size|v i | respectively satisfy the following formulas:
[0085] v i =v i|x +v i|y ;
[0086]
[0087] S503: If the speed of the touch point reaches a preset speed upper limit, determine that the width of the touch circle is a static width.
[0088] The static width is defined as a first ratio of a preset width threshold.
[0089] Specifically, the static width of the touch point is the product of the first ratio and the preset width threshold. For example, when the first ratio is set to 1 / 3 and the preset width threshold is W, the width of the touch circle is determined to be a static width of 1 / 3W.
[0090] S504: If the speed of the touch point does not reach the preset speed upper limit, determine that the width of the touch circle is a dynamic width.
[0091] The dynamic width is defined as the sum of a first ratio of a preset width threshold and a second ratio of a preset width threshold, and the second ratio is linearly related to a ratio of a speed of the touch point to a preset speed upper limit.
[0092] Specifically, the preset speed upper limit is defined as V max , the preset width threshold is W, and the dynamic width of the touch point is w i Satisfies the following formula:
[0093]
[0094] S505: Determine the touch circle according to the coordinates of the touch point and the width of the touch circle.
[0095] Specifically, Figure 6 A set of touch points and corresponding touch circle diagrams provided for the application. Figure 6 As shown, the touch point coordinate 601 is taken as the center of the circle and half of the width of the touch circle is taken as the radius to determine the touch circle 602 corresponding to the touch point. It should be noted that the touch point coordinate 601 is shown in the figure to facilitate the representation of the positional relationship. The actual electronic handwriting processing does not display the touch point coordinate 601.
[0096] S506 : After the touch circle is determined, determine the outer common tangent of the two touch circles according to two adjacent touch circles to obtain the upper and lower line segments of the touch track.
[0097] Specifically, Figure 7 A schematic diagram of two touch circles and their corresponding tangent lines provided for the application. Figure 7 As shown, the line segment between the two touch circles in the external common tangent line 603 is taken as the upper and lower line segments of the touch track.
[0098] S507 , connecting the corresponding endpoints of the upper and lower line segments of the touch track to obtain a touch quadrilateral.
[0099] Specifically, Figure 8 A set of touch circles and their corresponding touch quadrilateral diagrams provided for the application. Figure 8 As shown, any two adjacent touch circles correspond to a touch quadrilateral. As the trajectory direction changes, the two adjacent touch quadrilaterals will display two intersecting diameters within the same touch circle, thereby increasing the line density contrast within and between the touch circles, preparing for the overall discontinuous chalk handwriting.
[0100] S508 . When discretizing the touch quadrilateral, determine the line length, unit vector, and normal vector of the touch quadrilateral according to the coordinates of the endpoints of the touch quadrilateral.
[0101] Specifically, define the endpoint coordinates of the quadrilateral as P ei (x ei ,y ei ) and P e(i+1) (x e(i+1) ,y e(i+1) ),then the line length L i , unit vector (d x|i , d y|i ) and the normal vector (n x|i , n y|i ) satisfies the following formula:
[0102]
[0103]
[0104]
[0105] S509 , determining a third ratio of the unit vector according to the line length of the touch quadrilateral, the deviation upper limit of the first preset discrete point, and the projection distance of the first preset discrete point.
[0106] The first preset discrete point deviation upper limit value is used to define the upper limit value of the distance that the discrete point deviates from the touch quadrilateral, and the first preset discrete point projection distance is used to define the distance between the projections of the front and rear discrete points on the touch quadrilateral.
[0107] Specifically, the first preset discrete point deviation upper limit is defined as S 1, the first preset discrete point projection distance is D 1 When , the third ratio a of the unit vector satisfies the following formula:
[0108] a=l 1 *S 1 ;
[0109] In the formula, l 1 is a natural number, and
[0110] S510: Determine a fourth ratio of the normal vector according to the sine value of the random angle and the deviation upper limit of the first preset discrete point. Specifically, when the random angle is defined as (2π*rand(0,1)-π), the fourth ratio b of the normal vector satisfies the following formula:
[0111] b=sin(2π*rand(0,1)-π)D 1 ;
[0112] In the formula, rand(0,1) means that the generated random number is in the closed interval between 0 and 1.
[0113] S511 . Determine the coordinates of discrete points of the touch quadrilateral according to the coordinates of the endpoints of the touch quadrilateral, the unit vector of the third ratio, and the normal vector of the fourth ratio, so as to obtain a discrete quadrilateral according to the coordinates of the discrete points.
[0114] Specifically, the coordinates of the discrete points (x i ,y i ) satisfies the following formula:
[0115]
[0116]
[0117] S512 . When discretizing the touch circle, determine a fifth ratio of the radius according to the radius of the touch circle, the deviation upper limit of the second preset discrete point, and the projection distance of the second preset discrete point.
[0118] Specifically, define the radius r of the touch circle ci , the second preset discrete point deviates from the upper limit value S 2 and the second preset discrete point projection distance D 2 , then the fifth ratio f of the radius satisfies the following formula:
[0119]
[0120] In the formula, l 2 is a natural number, and
[0121] S513: Determine a sixth ratio according to the sine value of the random angle, the radius of the touch circle, the deviation upper limit of the second preset discrete point, and the projection distance of the second preset discrete point.
[0122] The second preset discrete point deviation upper limit value is used to define the upper limit value of the distance that the discrete point deviates from the touch circle, and the second preset discrete point projection distance is used to define the distance between the projections of the front and rear discrete points on the touch circle on the touch circle.
[0123] Specifically, when the random angle is defined as (2π*rand(0,1)-π), the sixth ratio g satisfies the following formula:
[0124] g=sin(2π*rand(0,1)-π)D 2 ;
[0125] In the formula, rand(0,1) means that the generated random number is in the closed interval between 0 and 1.
[0126] S514 . Determine the coordinates of discrete points of the touch circle according to the coordinates of the circle center, the radius of the fifth ratio, and the sixth ratio, so as to obtain a discrete circle according to the coordinates of the discrete points.
[0127] Specifically, the coordinates of the touch circle are defined as (x ci ,y ci ,r ci ), then the coordinates of the discrete point (x i ,y i ) satisfies the following formula:
[0128]
[0129]
[0130] Fig. 9 A schematic diagram of a set of touch circles and corresponding touch quadrilaterals discretized for the application. Fig. 9 As shown, the edge of a discrete line graph constructed according to the discrete point coordinates of the touch circle and the touch quadrilateral has become relatively rough.
[0131] S515, obtaining a dotted line processing trajectory according to the discrete circle, the discrete quadrilateral and the preset spacing.
[0132] The preset spacing is used to define the display spacing of the dashed line segments constituting the discrete circles and discrete quadrilaterals.
[0133] Specifically, since chalk handwriting is composed of many dotted particles, and after discretization processing, it is still a line segment structure, the discretized line segments are processed as dashed lines, so that the discretized line segments appear powdery. A feasible way to process dashed lines is to divide the discrete polyline segments into arrays of equal length according to a preset spacing, and then display the line segments in the array at intervals to obtain the corresponding dashed lines.
[0134] Fig.10 A schematic diagram of a set of touch circles and corresponding touch quadrilaterals processed by dotted lines provided in the application. Fig.10 As shown, the discrete broken line segments are displayed at intervals, and the overall effect is powdery.
[0135] S516: Send the dotted line processed trajectory to the display screen, so that the display screen displays a chalk handwriting effect.
[0136] Fig.11 A schematic diagram of the effect of simulating chalk handwriting provided for the application. Fig.11 As shown, since the thickness of the handwriting changes with the writing speed, some strokes change from thick to thin, which makes the handwriting as a whole more in line with the actual writing state and improves the flexibility of electronic writing. At the same time, due to the existence of the touch circle and the touch quadrilateral, the points inside the handwriting are distributed discontinuously, which is more in line with the actual chalk writing effect. At the same time, since the discrete line segments of the powder effect are obtained through data conversion and are not affected by pixels, there will be no blurring due to pixel problems when scaling the image on the display screen. Since discrete line segment data is sent, the data occupies less memory than texture images, thereby reducing data transmission traffic, and since there is no need to pre-store texture images, basic memory usage is saved.
[0137] Fig.12 This is a schematic diagram of the structure of an electronic handwriting processing device provided in this application. Fig.12 As shown, the device comprises:
[0138] The receiving module 701 is used to receive the touch point coordinates and time sent by the touch device.
[0139] Processing module 702 is used to determine a touch circle for locating the direction of handwriting and a touch track for locating the outline of handwriting based on the touch point coordinates and time after continuously receiving two or more touch point coordinates and time sent by the touch device; wherein the touch track is used to connect adjacent touch circles.
[0140] The processing module 702 is further used to discretize the touch circle or the touch track and process it into a dotted line.
[0141] The sending module 703 is used to send the processed data to the display screen so that the display screen can display the chalk handwriting effect.
[0142] Based on the above embodiment, the processing module 702 is also used to determine the speed of the touch point based on the touch point coordinates and time; determine the width of the touch circle according to the speed of the touch point; wherein the speed of the touch point is negatively correlated with the width of the touch circle; and determine the touch circle used to locate the direction of handwriting movement according to the coordinates of the touch point and the width of the touch circle.
[0143] On the basis of the above embodiment, the processing module 702 is also used to determine that the width of the touch circle is a static width if the speed of the touch point reaches a preset speed upper limit; wherein the static width is defined as a first ratio of a preset width threshold; if the speed of the touch point does not reach the preset speed upper limit, the width of the touch circle is determined to be a dynamic width; wherein the dynamic width is defined as the sum of a first ratio of the preset width threshold and a second ratio of the preset width threshold, and the second ratio is linearly related to the ratio of the speed of the touch point to the preset speed upper limit.
[0144] Based on the above embodiment, the processing module 702 is further used to determine the outer common tangent of the two touch circles according to two adjacent touch circles determined based on the touch point coordinates and time, and use the outer common tangent of the two touch circles as the touch trajectory.
[0145] Based on the above embodiment, the processing module 702 is also used to determine the outer common tangents of two touch circles according to two adjacent touch circles determined based on the touch point coordinates and time; the outer common tangents of the two touch circles are connected with the intersection points of the touch circles to obtain a touch quadrilateral, and the touch quadrilateral is used as the touch trajectory.
[0146] On the basis of the above-mentioned embodiment, the processing module 702 is further used to discretize the touch circle or the touch trajectory to obtain discrete circles or discrete trajectories when blurring the touch circle or the touch trajectory; obtain a dotted line trajectory according to the discrete circle, the discrete trajectory and the preset spacing; wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete circle or the discrete trajectory.
[0147] On the basis of the above embodiment, the processing module 702 is further used to determine the line length, unit vector and normal vector of the touch trajectory according to the endpoint coordinates of the touch trajectory when discretizing the touch trajectory; determine the third ratio of the unit vector according to the line length of the touch trajectory, the first preset discrete point deviation upper limit value and the first preset discrete point projection distance; wherein the first preset discrete point deviation upper limit value is used to define the upper limit value of the distance of the discrete point deviation from the touch trajectory, and the first preset discrete point projection distance is used to define the distance between the front and rear discrete points on the touch trajectory projected on the touch trajectory; determine the fourth ratio of the normal vector according to the sine value of the random angle and the first preset discrete point deviation upper limit value; determine the discrete point coordinates of the touch trajectory according to the endpoint coordinates of the touch trajectory, the unit vector of the third ratio and the normal vector of the fourth ratio, so as to obtain a discrete trajectory according to the discrete point coordinates; obtain a dotted line processed trajectory according to the discrete trajectory and the preset spacing; wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete trajectory.
[0148] On the basis of the above-mentioned embodiment, the processing module 702 is also used to determine the fifth ratio of the radius according to the radius of the touch circle, the second preset discrete point deviation upper limit value and the second preset discrete point projection distance when discretizing the touch circle; determine the sixth ratio according to the sine value of the random angle, the radius of the touch circle, the second preset discrete point deviation upper limit value and the second preset discrete point projection distance; wherein the second preset discrete point deviation upper limit value is used to define the upper limit value of the distance of the discrete point deviation from the touch circle, and the second preset discrete point projection distance is used to define the distance between the front and rear discrete points on the touch circle projected on the touch circle; determine the discrete point coordinates of the touch circle according to the coordinates of the center of the circle, the radius of the fifth ratio and the sixth ratio, so as to obtain a discrete circle according to the discrete point coordinates; obtain the trajectory of the dotted line processing according to the discrete circle and the preset spacing; wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete circle.
[0149] The electronic handwriting processing device provided in the embodiment of the present application can execute the electronic handwriting processing method in the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here. Fig.12 The division of the modules shown is only a schematic representation, and the present application does not limit the division of the modules and the naming of the modules.
[0150] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions, which are program instructions. When executed by a processor, they are used in the electronic handwriting processing method in the above embodiment.
[0151] The present application also provides a computer program product, which includes a computer program, the computer program is executed by a processor, and the execution instruction is stored in a readable storage medium. At least one control module of the display device can read the execution instruction from the readable storage medium, and at least one control module executes the execution instruction so that the display device implements the electronic handwriting processing method provided by the various embodiments described above.
[0152] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0153] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A display device, characterized in that: The display device comprises: A touch device is used to collect the coordinates and time of the touch point and send them to the processor; A display screen, used to display the trajectory of the touch points processed by the processor; and a processor connected to the touch device and the display screen respectively, wherein the processor is configured to: After continuously receiving two or more touch point coordinates and times sent by the touch device, determine a touch circle for locating the running direction of the handwriting and a touch track for locating the outline of the handwriting based on the touch point coordinates and times; wherein the touch track is used to connect adjacent touch circles; The touch circle or the touch track is discretized and dotted, and the processed data is sent to the display screen, so that the display screen shows the chalk handwriting effect.
2. The display device according to claim 1, characterized in that The step of determining a touch circle for locating a handwriting running direction based on the touch point coordinates and time includes: Determining a velocity of the touch point based on the touch point coordinates and the time; Determining the width of the touch circle according to the speed of the touch point; wherein the speed of the touch point is negatively correlated with the width of the touch circle; The touch circle used to locate the running direction of the handwriting is determined according to the touch point coordinates and the width of the touch circle.
3. The display device according to claim 2, characterized in that The step of determining the width of the touch circle according to the speed of the touch point includes: If the speed of the touch point reaches a preset speed upper limit, the width of the touch circle is determined to be a static width; wherein the static width is defined as a first ratio of a preset width threshold; If the speed of the touch point does not reach the preset speed upper limit, the width of the touch circle is determined to be a dynamic width; wherein the dynamic width is defined as the sum of a first ratio of a preset width threshold and a second ratio of a preset width threshold, and the second ratio is linearly related to the ratio of the speed of the touch point to the preset speed upper limit.
4. The display device according to claim 1, characterized in that The step of determining a touch circle for locating a handwriting running direction and a touch track for locating a handwriting contour based on the touch point coordinates and time includes: Determine the outer common tangent of the two touch circles according to two adjacent touch circles determined based on the touch point coordinates and time; The outer common tangent of the two touch circles is used as the touch track.
5. The display device according to claim 1, characterized in that The step of determining a touch circle for locating a handwriting running direction and a touch track for locating a handwriting contour based on the touch point coordinates and time includes: Determine the outer common tangent of the two touch circles according to two adjacent touch circles determined based on the touch point coordinates and time; The outer common tangents of the two touch circles are correspondingly connected to the intersection points of the touch circles to obtain a touch quadrilateral, and the touch quadrilateral is used as the touch track.
6. The display device according to claim 1, characterized in that The step of discretizing the touch track and processing it as a dotted line includes: Determine the line length, unit vector and normal vector of the touch track according to the endpoint coordinates of the touch track; Determine a third ratio of the unit vector according to the line length of the touch track, the first preset discrete point deviation upper limit value and the first preset discrete point projection distance; wherein the first preset discrete point deviation upper limit value is used to define the upper limit value of the distance that the discrete point deviates from the touch track, and the first preset discrete point projection distance is used to define the distance between the projections of the two front and rear discrete points on the touch track on the touch track; Determining a fourth ratio of the normal vector according to the sine value of the random angle and the deviation of the first preset discrete point from an upper limit value; Determining the coordinates of discrete points of the touch track according to the coordinates of the endpoints of the touch track, the unit vector of the third ratio, and the normal vector of the fourth ratio, so as to obtain a discrete track according to the coordinates of the discrete points; A dotted line track is obtained according to the discrete track and the preset spacing, wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete track.
7. The display device according to claim 1, characterized in that The discretizing the touch circle and processing the dotted line includes: determining a fifth ratio of the radius according to the radius of the touch circle, the deviation upper limit of the second preset discrete point, and the projection distance of the second preset discrete point; Determine a sixth ratio according to the sine value of the random angle, the radius of the touch circle, the second preset discrete point deviation upper limit value and the second preset discrete point projection distance; wherein the second preset discrete point deviation upper limit value is used to define the upper limit value of the distance of the discrete point deviation from the touch circle, and the second preset discrete point projection distance is used to define the distance between the front and rear discrete points on the touch circle projected on the touch circle; Determine the coordinates of the discrete points of the touch circle according to the coordinates of the center of the circle, the radius of the fifth ratio, and the sixth ratio, so as to obtain a discrete circle according to the coordinates of the discrete points; According to the discrete circle and the preset spacing, a dotted line processing trajectory is obtained; wherein the preset spacing is used to define the display spacing of the dotted line segments constituting the discrete circle.
8. A method for processing electronic handwriting, characterized in that: The method comprises: After continuously receiving two or more touch point coordinates and times sent by the touch device, determine a touch circle for locating the running direction of the handwriting and a touch track for locating the outline of the handwriting based on the touch point coordinates and time; wherein the touch track is used to connect adjacent touch circles; The touch circle or the touch track is discretized and dotted, and the processed data is sent to the display screen, so that the display screen shows the chalk handwriting effect.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the method of claim 8 is implemented.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method of claim 8 when being executed by a processor.