CN114168059A - Handwriting generating method and device, storage medium and terminal equipment - Google Patents

Handwriting generating method and device, storage medium and terminal equipment Download PDF

Info

Publication number
CN114168059A
CN114168059A CN202111506512.1A CN202111506512A CN114168059A CN 114168059 A CN114168059 A CN 114168059A CN 202111506512 A CN202111506512 A CN 202111506512A CN 114168059 A CN114168059 A CN 114168059A
Authority
CN
China
Prior art keywords
handwriting
preset
touch
pattern
sampling point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111506512.1A
Other languages
Chinese (zh)
Inventor
戴文波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huasheng Software Technology Co ltd
Original Assignee
Shenzhen Huasheng Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huasheng Software Technology Co ltd filed Critical Shenzhen Huasheng Software Technology Co ltd
Priority to CN202111506512.1A priority Critical patent/CN114168059A/en
Publication of CN114168059A publication Critical patent/CN114168059A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Abstract

The embodiment of the application provides a handwriting generating method, a handwriting generating device, a storage medium and terminal equipment, wherein the method comprises the following steps: determining a sampling point of the initial of the handwriting to be generated according to the initiating position of the touch operation on the display terminal when the touch operation acting on the display terminal is detected; when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation; respectively constructing corresponding preset pen touch patterns based on the initial sampling points and the key sampling points; common tangent lines between adjacent preset pen touch patterns are determined, and a closed area is constructed according to all the common tangent lines; and filling the pattern in the closed area to obtain the writing handwriting. According to the embodiment of the application, the closed area can be constructed according to the common tangent line between the adjacent preset pen touch patterns on the moving track, and the constructed closed area is filled with the patterns to obtain the handwriting with smooth and uninterrupted lines.

Description

Handwriting generating method and device, storage medium and terminal equipment
Technical Field
The present application relates to the field of electronic communications technologies, and in particular, to a method and an apparatus for generating handwriting, a storage medium, and a terminal device.
Background
Along with the rapid development of scientific technology, the human-computer interaction device is developed into an important input device for electronic calligraphy and even electronic safety verification from the support of simple character input. The requirements of users on human-computer interaction equipment are gradually increased, and particularly when characters composed of different strokes are input, if the input characters have the effect of imitating actual handwriting, the users can obtain vivid handwriting input experience on the electronic handwriting input equipment.
The existing computer-aided realization of the effect of simulating actual handwriting is usually realized by adopting hardware equipment such as a touch screen, a touch pen and the like, the moving speed and the pressure value of a touch point are collected from hardware, and then the visual presentation of the numerical values is realized based on software, namely the generation of handwriting is realized by adopting a continuous superposition mode. In the existing continuous superposition mode, in order to obtain a smooth pen moving effect, a high-frequency pen touch pattern must be drawn, but even if a high frequency is used for drawing the pen touch pattern, when a user moves a pen quickly, an incoherent pen touch point is always formed, so that an incoherent gap exists between two adjacent pen touch patterns of a pen stroke.
Disclosure of Invention
The embodiment of the application provides a handwriting generating method, a handwriting generating device, a storage medium and a terminal device, which can construct a closed area according to a common tangent line between adjacent preset pen touch patterns on a moving track, and fill the constructed closed area with patterns to obtain a handwriting with smooth and uninterrupted lines.
An embodiment of the present application provides a handwriting generating method, including:
when touch operation acting on a display terminal is detected, determining a sampling point of the initial of the handwriting to be generated according to the initiating position of the touch operation on the display terminal;
when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation;
respectively constructing corresponding preset pen touch patterns based on the initial sampling points and the key sampling points;
determining common tangent lines between the adjacent preset pen touch patterns, and constructing a closed area according to all the common tangent lines;
and filling the pattern in the closed area to obtain the writing handwriting.
In the handwriting generating method according to the embodiment of the present application, the respectively constructing corresponding preset stroke patterns based on the initial sampling point and the key sampling point includes:
constructing the preset pen-touch pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information;
wherein the preset stroke pattern comprises an ellipse or a circle;
the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
In the handwriting generating method according to the embodiment of the present application, the constructing the preset stroke pattern by using the initial sampling point or the key sampling point as a circle center and combining preset attribute information includes:
constructing an initial stroke pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information;
and rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
In the handwriting generating method according to the embodiment of the present application, the determining a common tangent line between the adjacent preset stroke patterns includes:
and between two adjacent sampling points, a line segment which is parallel to the two adjacent sampling points and is connected with the two adjacent preset pen touch patterns in a tangent mode is used as the common tangent line.
In the handwriting generating method according to the embodiment of the present application, the constructing a closed region according to all the common tangents includes:
respectively determining tangent points on common tangents on two sides of the preset pen touch pattern on the moving track, and connecting all the tangent points on the same side in sequence according to acquisition time to obtain two parallel area boundary lines;
and ending and connecting the two parallel area boundary lines to obtain the closed area.
In the handwriting generating method according to the embodiment of the application, before the closed region is constructed according to all the common tangents, the method includes:
judging whether the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value or not;
and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
In the handwriting generating method according to the embodiment of the present application, after the filling of the pattern into the closed region is performed, before the handwriting is obtained, the method further includes:
when a termination operation acting on the display terminal is detected, determining a sampling point of the termination of the handwriting to be generated according to an initiation position of the termination operation on the display terminal;
and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
Correspondingly, another aspect of the embodiments of the present application further provides a device for generating handwriting, including:
the device comprises a first detection module, a second detection module and a display module, wherein the first detection module is used for determining a sampling point of the initial of the handwriting to be generated according to the initiating position of the touch operation on the display terminal when the touch operation acting on the display terminal is detected;
the second detection module is used for sequentially collecting key sampling points on a moving track corresponding to the moving operation when the moving operation acting on the display terminal is detected;
the pattern construction module is used for respectively constructing corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points;
the area construction module is used for determining common tangents between the adjacent preset pen touch patterns and constructing a closed area according to all the common tangents;
and the pattern filling module is used for filling the pattern into the closed area to obtain the writing handwriting.
Accordingly, another aspect of the embodiments of the present application further provides a storage medium storing a plurality of instructions, which are suitable for being loaded by a processor to execute the handwriting generating method as described above.
Correspondingly, another aspect of the embodiments of the present application further provides a terminal device, including a processor and a memory, where the memory stores a plurality of instructions, and the processor loads the instructions to execute the handwriting generating method as described above.
The embodiment of the application provides a method, a device, a storage medium and terminal equipment for generating handwriting, wherein the method comprises the steps of determining a sampling point of the initial of the handwriting to be generated according to the initiating position of touch operation on a display terminal when the touch operation acting on the display terminal is detected; when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation; respectively constructing corresponding preset pen touch patterns based on the initial sampling points and the key sampling points; determining common tangent lines between the adjacent preset pen touch patterns, and constructing a closed area according to all the common tangent lines; and filling the pattern in the closed area to obtain the writing handwriting. According to the embodiment of the application, the closed area can be constructed according to the common tangent line between the adjacent preset pen touch patterns on the moving track, and the constructed closed area is filled with the patterns to obtain the handwriting with smooth and uninterrupted lines.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly introduced below. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort.
Fig. 1 is a schematic flow chart of a handwriting generating method provided in the embodiment of the present application.
Fig. 2 is a schematic diagram of sampling points of writing initiation in the writing generation method provided in the embodiment of the present application.
Fig. 3 is a schematic diagram of a handwriting writing process in the handwriting generating method according to the embodiment of the present application.
Fig. 4 is a schematic diagram of a handwriting receiving process in the method for generating writing handwriting according to the embodiment of the present application.
FIG. 5 is a schematic view of a user operation interface in the handwriting generating method according to the embodiment of the present application.
Fig. 6 is a schematic diagram illustrating an effect of the handwriting generating method according to the embodiment of the present application.
FIG. 7 is a schematic structural diagram of a writing script generating apparatus according to an embodiment of the present application.
FIG. 8 is a schematic structural diagram of another writing apparatus provided in the embodiments of the present application.
Fig. 9 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without inventive step, are within the scope of the present application.
The embodiment of the application provides a handwriting generating method, which can be applied to terminal equipment. The terminal equipment can be equipment such as a smart phone and a tablet computer.
The existing computer-aided realization of the effect of simulating actual handwriting is usually realized by adopting hardware equipment such as a touch screen, a touch pen and the like, the moving speed and the pressure value of a touch point are collected from hardware, and then the visual presentation of the numerical values is realized based on software, namely the generation of handwriting is realized by adopting a continuous superposition mode. In the existing continuous superposition mode, in order to obtain a smooth pen moving effect, a high-frequency pen touch pattern must be drawn, but even if a high-frequency pen touch pattern is used for drawing, when a user quickly moves a pen, an incoherent pen touch point is always formed, so that an incoherent gap exists between two adjacent pen touch patterns of a pen stroke, and the finally presented writing effect cannot reach an expected value. In order to solve the above technical problem, an embodiment of the present application provides a handwriting generating method. By using the handwriting generating method provided by the embodiment of the application, the closed area can be constructed according to the common tangent line between the adjacent preset pen touch patterns on the moving track, and the obtained closed area is additionally constructed to fill the patterns, so that the handwriting with smooth and uninterrupted lines is obtained.
Referring to fig. 1 to 6, fig. 1 is a schematic flow chart of a handwriting generating method according to an embodiment of the present application. Fig. 2 is a schematic diagram of sampling points of writing initiation in the writing generation method provided in the embodiment of the present application. Fig. 3 is a schematic diagram of a handwriting writing process in the handwriting generating method according to the embodiment of the present application. Fig. 4 is a schematic diagram of a handwriting receiving process in the method for generating writing handwriting according to the embodiment of the present application.
FIG. 5 is a schematic view of a user operation interface in the handwriting generating method according to the embodiment of the present application. Fig. 6 is a schematic diagram illustrating an effect of the handwriting generating method according to the embodiment of the present application. The handwriting generating method is applied to terminal equipment, and can comprise the following steps:
step 101, when a touch operation acting on a display terminal is detected, determining a sampling point of the initial of a handwriting to be generated according to an initiating position of the touch operation on the display terminal.
In this embodiment, the display terminal specifically refers to a display device with a touch input function, and a touch screen is taken as an example here. The trigger condition of the touch operation may be that the user directly presses on the touch screen with a finger to trigger or presses on the touch screen with a touch pen to trigger. When a touch operation initiated by a user is detected, determining a sampling point of the initial of the handwriting to be generated according to the initiation position of the touch operation on the touch screen, as shown in fig. 2.
And 102, when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation.
In the present embodiment, the trigger condition of the moving operation may be that the user directly touches the touch screen with a finger and moves in a specified direction, or that the user touches the touch screen with a utility stylus and moves in a specified direction. And after the initial sampling point of the handwriting is determined, sequentially collecting key sampling points on a moving track corresponding to the moving operation according to the detected moving operation.
For example, when a movement operation of a user on the touch screen is detected, sampling is performed on a movement track generated by the touch screen at a sampling frequency of 30ms each time, so that a plurality of key sampling points on the movement track input by the user on the current touch screen are obtained.
It should be noted that the preset frequency for sampling the moving track may be set based on the performance of different touch screens themselves, and therefore, it should be clear that the preset frequency for sampling the moving track is not limited by the present invention.
And 103, respectively constructing corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points.
In order to construct the writing trace, in this embodiment, a preset stroke pattern is constructed based on the initial sampling point and the key sampling point to construct a model structure of the writing trace, and meanwhile, preparation is made for subsequently determining a common tangent line.
In some embodiments, the process of constructing the predetermined compiled pattern includes: constructing a preset pen-touch pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information; wherein the preset pen touch pattern comprises an ellipse or a circle; the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
It should be noted that the preset attribute information is preset and can be directly called, and once the attribute information is set, the attribute information is not changed in the writing process. The preset attribute information may be set based on the performance of the different touch screens themselves, and therefore, it should be clear that the present invention does not limit the preset attribute information.
In the actual running process of the program, the preset Brush pattern takes an ellipse as an example, when a user presses a finger or uses a touch pen on a touch screen, a Broad Brush class is created, the property and the width of the Brush are set, and the sizes of the long axis and the short axis of the Brush are initialized. And calling start Stroke () to calculate and draw the Path of the head track of the brush and record the initial collection point.
In some embodiments, the constructing the preset stroke pattern by using the initial sampling point or the key sampling point as a center of a circle and combining preset attribute information includes:
constructing an initial stroke pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information
And rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
In this embodiment, before obtaining the preset pen-touch pattern, the initial pen-touch pattern is rotated by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern. For example, the initial stroke pattern is rotated by-25 °, so that the finally presented handwriting has a certain inclination angle, which is closer to the actual handwriting effect.
It should be noted that the preset angle can be set based on the performance of different touch screens themselves, and therefore, it should be clear that the preset angle is not limited by the present invention.
And 104, determining common tangent lines between the adjacent preset pen touch patterns, and constructing a closed area according to all the common tangent lines.
In this embodiment, as shown in fig. 3, between two adjacent sampling points, a line segment parallel to and tangent to two adjacent predetermined touch patterns is taken as a common tangent of the two adjacent predetermined touch patterns. After the common tangent line is obtained, tangent points on the common tangent lines on two sides of the preset pen touch pattern on the moving track are respectively determined, all the tangent points on the same side are successively connected according to the acquisition time to obtain two parallel area boundary lines, and the two parallel area boundary lines are connected in an ending mode to obtain a closed area.
In some embodiments, in order to simulate the handwriting effect more truly, a bezier curve is selected for connection in the process of connecting the tangent points. Bezier curves (also known as bezier curves or bezier curves) are mathematical curves applied to two-dimensional graphics applications, by which curves can be drawn accurately.
In some embodiments, prior to constructing the enclosed area according to all common tangents, the method further comprises:
judging whether the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value or not;
and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
In order to avoid that sampling points acquired on a moving track are too dense, even if sampling frequency is preset, erroneous acquisition is difficult to avoid, so that the situation that excessive overlapping occurs between preset pen touch patterns constructed and obtained according to the sampling points is caused, further, the trend of a common tangent line is frequently changed, and finally, the problem that the edge of a displayed handwriting has a sawtooth shape or a wavy shape is solved, namely, the connection part is not smooth enough, and the aesthetic feeling is influenced. Therefore, in this embodiment, by determining whether the overlapping area between two adjacent preset pen contact patterns is greater than or equal to the preset threshold, if the overlapping area between two adjacent preset pen contact patterns is greater than or equal to the preset threshold, one of the tangent points (i.e., the control points shown in fig. 3) located on the same common tangent line is retained for region boundary line construction, so as to solve the problem caused by excessive density of sampling points.
And 105, filling the pattern into the closed area to obtain the handwriting.
In this embodiment, after the closed area is obtained, pattern filling is performed on the closed area to obtain the handwriting. For example, the closed area is filled with preset colors, and handwriting close to the real writing effect is obtained.
In some embodiments, after the pattern filling of the closed area and before the writing is obtained, the method further comprises:
when a termination operation acting on the display terminal is detected, determining a sampling point of the termination of the handwriting to be generated according to an initiation position of the termination operation on the display terminal;
and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
In the embodiment, as shown in fig. 4, the trigger condition for terminating the operation may be that the user's finger or the touch pen is lifted off the surface of the touch screen to trigger. When the termination operation acting on the touch screen is detected, determining a sampling point of the termination of the handwriting to be generated according to the initiation position of the termination operation on the touch screen, constructing a preset pen-touch pattern at the sampling point of the termination, and filling the preset pen-touch pattern to simulate the termination of the real handwriting.
All the above optional technical solutions may be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
In particular implementation, the present application is not limited by the execution sequence of the described steps, and some steps may be performed in other sequences or simultaneously without conflict.
As can be seen from the above, in the handwriting generating method provided in the embodiment of the present application, when a touch operation acting on a display terminal is detected, according to an initiation position of the touch operation on the display terminal, a sampling point of an initiation of a to-be-generated handwriting is determined; when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation; respectively constructing corresponding preset pen touch patterns based on the initial sampling points and the key sampling points; determining common tangent lines between the adjacent preset pen touch patterns, and constructing a closed area according to all the common tangent lines; and filling the pattern in the closed area to obtain the writing handwriting. According to the embodiment of the application, the closed area can be constructed according to the common tangent line between the adjacent preset pen touch patterns on the moving track, and the constructed closed area is filled with the patterns to obtain the handwriting with smooth and uninterrupted lines.
The embodiment of the application also provides a handwriting generating device, and the handwriting generating device can be integrated in the terminal equipment. The terminal equipment can be a television, a smart phone, a tablet computer and the like.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a handwriting generating device according to an embodiment of the present application. The writing handwriting generating apparatus 30 may include:
the first detection module 31 is configured to, when a touch operation acting on a display terminal is detected, determine a sampling point of an initial point of a to-be-generated handwriting according to an initiation position of the touch operation on the display terminal;
the second detection module 32 is configured to, when a movement operation acting on the display terminal is detected, sequentially collect key sampling points on a movement track corresponding to the movement operation;
the pattern construction module 33 is configured to respectively construct corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points;
the area construction module 34 is configured to determine common tangents between adjacent preset stroke patterns, and construct a closed area according to all the common tangents;
and the pattern filling module 35 is used for filling the pattern into the closed area to obtain the writing handwriting.
In some embodiments, the pattern construction module 33 is configured to construct the preset pen-touch pattern by using the initial sampling point or the key sampling point as a center and combining preset attribute information; wherein the preset stroke pattern comprises an ellipse or a circle; the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
In some embodiments, the pattern construction module 33 is configured to construct an initial stroke pattern by using the initial sampling point or the key sampling point as a center and combining preset attribute information; and rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
In some embodiments, the area constructing module 34 is configured to, between two adjacent sampling points, use a line segment connected in parallel to the two adjacent sampling points and a tangent line tangent to two adjacent predetermined brush touch patterns as the common tangent line.
In some embodiments, the region construction module 34 is configured to determine tangent points on common tangent lines at two sides of the preset pen-touch pattern on the moving trajectory, and connect all the tangent points located at the same side in sequence according to the acquisition time to obtain two parallel region boundary lines; and ending and connecting the two parallel area boundary lines to obtain the closed area.
In some embodiments, the apparatus further includes a determining module, configured to determine whether an overlapping area between two adjacent preset stroke patterns is greater than or equal to a preset threshold; and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
In some embodiments, the apparatus further includes a third detection module, configured to, when a termination operation acting on the display terminal is detected, determine, according to an initiation position of the termination operation on the display terminal, a sampling point at which the handwriting to be generated terminates; and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily and implemented as one or several entities.
As can be seen from the above, in the handwriting generating device 30 provided in the embodiment of the present application, when the touch operation acting on the display terminal is detected by the first detecting module 31, according to the initiating position of the touch operation on the display terminal, the initial sampling point of the handwriting to be generated is determined; when detecting the moving operation acting on the display terminal, the second detection module 32 sequentially collects key sampling points on a moving track corresponding to the moving operation; the pattern construction module 33 constructs corresponding preset pen-touch patterns respectively based on the initial sampling points and the key sampling points; the region construction module 34 determines common tangents between the adjacent preset stroke patterns, and constructs a closed region according to all the common tangents; and the pattern filling module 35 is used for filling the pattern into the closed area to obtain the handwriting.
Referring to fig. 8, fig. 8 is another schematic structural diagram of a writing script generating apparatus provided in the embodiment of the present application, the writing script generating apparatus 30 includes a memory 120, one or more processors 180, and one or more application programs, where the one or more application programs are stored in the memory 120 and configured to be executed by the processors 180; the processor 180 may include a user first detection module 31, a second detection module 32, a pattern building module 33, an area building module 34, and a pattern filling module 35.
For example, the structures and connection relationships of the above components may be as follows:
the memory 120 may be used to store applications and data. The memory 120 stores applications containing executable code. The application programs may constitute various functional modules. The processor 180 executes various functional applications and data processing by running the application programs stored in the memory 120. Further, the memory 120 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 120 may also include a memory controller to provide the processor 180 with access to the memory 120.
The processor 180 is a control center of the device, connects various parts of the entire terminal using various interfaces and lines, performs various functions of the device and processes data by running or executing an application program stored in the memory 120 and calling data stored in the memory 120, thereby monitoring the entire device. Optionally, processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application program, and the like.
Specifically, in this embodiment, the processor 180 loads the executable code corresponding to the process of one or more application programs into the memory 120 according to the following instructions, and the processor 180 runs the application programs stored in the memory 120, thereby implementing various functions:
the first detection module 31 is configured to, when a touch operation acting on a display terminal is detected, determine a sampling point of an initial point of a to-be-generated handwriting according to an initiation position of the touch operation on the display terminal;
the second detection module 32 is configured to, when a movement operation acting on the display terminal is detected, sequentially collect key sampling points on a movement track corresponding to the movement operation;
the pattern construction module 33 is configured to respectively construct corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points;
the area construction module 34 is configured to determine common tangents between adjacent preset stroke patterns, and construct a closed area according to all the common tangents;
and the pattern filling module 35 is used for filling the pattern into the closed area to obtain the writing handwriting.
In some embodiments, the pattern construction module 33 is configured to construct the preset pen-touch pattern by using the initial sampling point or the key sampling point as a center and combining preset attribute information; wherein the preset stroke pattern comprises an ellipse or a circle; the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
In some embodiments, the pattern construction module 33 is configured to construct an initial stroke pattern by using the initial sampling point or the key sampling point as a center and combining preset attribute information; and rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
In some embodiments, the area constructing module 34 is configured to, between two adjacent sampling points, use a line segment connected in parallel to the two adjacent sampling points and a tangent line tangent to two adjacent predetermined brush touch patterns as the common tangent line.
In some embodiments, the region construction module 34 is configured to determine tangent points on common tangent lines at two sides of the preset pen-touch pattern on the moving trajectory, and connect all the tangent points located at the same side in sequence according to the acquisition time to obtain two parallel region boundary lines; and ending and connecting the two parallel area boundary lines to obtain the closed area.
In some embodiments, the apparatus further includes a determining module, configured to determine whether an overlapping area between two adjacent preset stroke patterns is greater than or equal to a preset threshold; and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
In some embodiments, the apparatus further includes a third detection module, configured to, when a termination operation acting on the display terminal is detected, determine, according to an initiation position of the termination operation on the display terminal, a sampling point at which the handwriting to be generated terminates; and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
The embodiment of the application also provides the terminal equipment. The terminal equipment can be equipment such as a smart phone, a computer and a tablet computer.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a terminal device provided in an embodiment of the present application, where the terminal device may be used to implement the handwriting generating method provided in the foregoing embodiment. The terminal device 1200 may be a smart phone or a tablet computer.
As shown in fig. 9, the terminal device 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more computer-readable storage media (only one shown in the figure), an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more processing cores (only one shown in the figure), and a power supply 190. Those skilled in the art will appreciate that the terminal device 1200 configuration shown in fig. 9 does not constitute a limitation of terminal device 1200, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components. Wherein:
the RF circuit 110 is used for receiving and transmitting electromagnetic waves, and performs interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. The RF circuitry 110 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The RF circuitry 110 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network.
The memory 120 may be configured to store a software program and a module, such as a program instruction/module corresponding to the handwriting generating method in the foregoing embodiment, and the processor 180 executes various functional applications and data processing by operating the software program and the module stored in the memory 120, and may automatically select a vibration reminding mode to generate the handwriting according to a current scene where the terminal device is located, so as to ensure that scenes such as a conference and the like are not disturbed, ensure that a user can sense an incoming call, and improve intelligence of the terminal device. Memory 120 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 120 may further include memory located remotely from the processor 180, which may be connected to the terminal device 1200 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input unit 130 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 130 may include a touch-sensitive surface 131 as well as other input devices 132. The touch-sensitive surface 131, also referred to as a touch display screen or a touch pad, may collect touch operations by a user on or near the touch-sensitive surface 131 (e.g., operations by a user on or near the touch-sensitive surface 131 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 131 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts the touch information into touch sample points, sends the touch sample points to the processor 180, and can receive and execute commands sent by the processor 180. Additionally, the touch-sensitive surface 131 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface 131, the input unit 130 may also include other input devices 132. In particular, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 140 may be used to display information input by or provided to a user and various graphic user interfaces of the terminal apparatus 1200, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 140 may include a Display panel 141, and optionally, the Display panel 141 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when a touch operation is detected on or near the touch-sensitive surface 131, the touch operation is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of the touch event. Although in FIG. 9, touch-sensitive surface 131 and display panel 141 are shown as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 may be integrated with display panel 141 to implement input and output functions.
The terminal device 1200 may also include at least one sensor 150, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 141 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 141 and/or the backlight when the terminal device 1200 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which may be further configured in the terminal device 1200, detailed descriptions thereof are omitted.
The audio circuitry 160, speaker 161, microphone 162 may provide an audio interface between the user and the terminal device 1200. The audio circuit 160 may transmit the electrical signal converted from the received audio data to the speaker 161, and convert the electrical signal into a sound signal for output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 160, and then outputs the audio data to the processor 180 for processing, and then to the RF circuit 110 to be transmitted to, for example, another terminal, or outputs the audio data to the memory 120 for further processing. The audio circuitry 160 may also include an earbud jack to provide communication of peripheral headphones with the terminal device 1200.
The terminal device 1200, which may assist the user in sending and receiving e-mails, browsing web pages, accessing streaming media, etc., through the transmission module 170 (e.g., Wi-Fi module), provides the user with wireless broadband internet access. Although fig. 9 shows the transmission module 170, it is understood that it does not belong to the essential constitution of the terminal device 1200, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 180 is a control center of the terminal device 1200, connects various parts of the entire mobile phone by using various interfaces and lines, and performs various functions of the terminal device 1200 and processes data by running or executing software programs and/or modules stored in the memory 120 and calling data stored in the memory 120, thereby performing overall monitoring of the mobile phone. Optionally, processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 180.
Terminal device 1200 also includes a power supply 190 for powering the various components, which in some embodiments may be logically coupled to processor 180 via a power management system to manage power discharge and power consumption via the power management system. The power supply 190 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
Although not shown, the terminal device 1200 may further include a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the display unit 140 of the terminal device 1200 is a touch screen display, and the terminal device 1200 further includes a memory 120, and one or more programs, wherein the one or more programs are stored in the memory 120, and the one or more programs configured to be executed by the one or more processors 180 include instructions for:
the method comprises the steps that a first detection instruction is used for determining a sampling point of the initial of the handwriting to be generated according to the initiating position of touch operation on a display terminal when the touch operation acting on the display terminal is detected;
the second detection instruction is used for sequentially collecting key sampling points on a moving track corresponding to the moving operation when the moving operation acting on the display terminal is detected;
the pattern construction instruction is used for respectively constructing corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points;
the area construction instruction is used for determining common tangents between the adjacent preset pen touch patterns and constructing a closed area according to all the common tangents;
and the pattern filling instruction is used for filling the pattern in the closed area to obtain the writing handwriting.
In some embodiments, the pattern construction instruction is configured to construct the preset pen-touch pattern by using the initial sampling point or the key sampling point as a center of a circle and combining preset attribute information; wherein the preset stroke pattern comprises an ellipse or a circle; the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
In some embodiments, the pattern construction instruction is configured to construct an initial stroke pattern by using the initial sampling point or the key sampling point as a circle center and combining preset attribute information; and rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
In some embodiments, the area construction instructions are configured to, between two adjacent sampling points, use a line segment connected in parallel to the two adjacent sampling points and a tangent line tangent to two adjacent preset brush stroke patterns as the common tangent line.
In some embodiments, the area construction instructions are configured to respectively determine tangent points on common tangent lines at two sides of the preset pen-touch pattern on the movement trajectory, and successively connect all the tangent points at the same side according to the acquisition time to obtain two parallel area boundary lines; and ending and connecting the two parallel area boundary lines to obtain the closed area.
In some embodiments, the program further includes a determining instruction, configured to determine whether an overlapping area between two adjacent preset stroke patterns is greater than or equal to a preset threshold; and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
In some embodiments, the program further includes a third detection instruction, configured to, when a termination operation acting on the display terminal is detected, determine, according to an initiation position of the termination operation on the display terminal, a sampling point at which the handwriting to be generated terminates; and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
The embodiment of the application also provides the terminal equipment. The terminal equipment can be a television, a smart phone, a tablet computer and the like.
As can be seen from the above, an embodiment of the present application provides a terminal device 1200, where the terminal device 1200 executes the following steps:
an embodiment of the present application further provides a storage medium, where a computer program is stored in the storage medium, and when the computer program runs on a computer, the computer executes the handwriting generating method according to any of the above embodiments.
It should be noted that, for the method for generating writing descriptions herein, it can be understood by a person skilled in the art that all or part of the process of implementing the method for generating writing descriptions herein can be implemented by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory of a terminal device, and executed by at least one processor in the terminal device, and during the execution, the process of the embodiment of the method for generating writing descriptions herein can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
For the handwriting generating device of the embodiment of the present application, functional modules of the handwriting generating device may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The method, the device, the storage medium and the terminal device for generating handwriting provided by the embodiment of the application are described in detail above. The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A handwriting generating method, comprising:
when touch operation acting on a display terminal is detected, determining a sampling point of the initial of the handwriting to be generated according to the initiating position of the touch operation on the display terminal;
when the mobile operation acting on the display terminal is detected, sequentially collecting key sampling points on a mobile track corresponding to the mobile operation;
respectively constructing corresponding preset pen touch patterns based on the initial sampling points and the key sampling points;
determining common tangent lines between the adjacent preset pen touch patterns, and constructing a closed area according to all the common tangent lines;
and filling the pattern in the closed area to obtain the writing handwriting.
2. The handwriting generation method of claim 1, wherein the constructing the corresponding preset stroke pattern based on the initial sampling point and the key sampling point respectively comprises:
constructing the preset pen-touch pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information;
wherein the preset stroke pattern comprises an ellipse or a circle;
the preset attribute information includes major and minor axes of an ellipse, or a radius of a circle.
3. The handwriting generating method according to claim 2, wherein the constructing the preset stroke pattern by using the initial sampling point or the key sampling point as a center and combining preset attribute information comprises:
constructing an initial stroke pattern by taking the initial sampling point or the key sampling point as a circle center and combining preset attribute information;
and rotating the initial pen-touch pattern by a preset angle relative to the initial sampling point or the key sampling point to obtain the preset pen-touch pattern.
4. A handwriting generation method according to claim 1, wherein said determining a common tangent between adjacent said preset stroke patterns comprises:
and between two adjacent sampling points, a line segment which is parallel to the two adjacent sampling points and is connected with the two adjacent preset pen touch patterns in a tangent mode is used as the common tangent line.
5. A method for handwriting generation according to claim 1 and wherein said constructing an enclosed area from all said common tangents comprises:
respectively determining tangent points on common tangents on two sides of the preset pen touch pattern on the moving track, and connecting all the tangent points on the same side in sequence according to acquisition time to obtain two parallel area boundary lines;
and ending and connecting the two parallel area boundary lines to obtain the closed area.
6. A method for handwriting generation according to claim 1 and wherein prior to said building an enclosed area from all said common tangents, said method comprises:
judging whether the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value or not;
and if the overlapping area between two adjacent preset pen touch patterns is larger than or equal to a preset threshold value, one tangent point on the same common tangent line is reserved for constructing the boundary line of the region.
7. A method for handwriting generation according to claim 1 and wherein after said pattern filling of said closed area and before said handwriting is obtained, said method further comprises:
when a termination operation acting on the display terminal is detected, determining a sampling point of the termination of the handwriting to be generated according to an initiation position of the termination operation on the display terminal;
and constructing a preset pen-touch pattern at the terminated sampling point, and filling the preset pen-touch pattern.
8. A writing script generating apparatus, comprising:
the device comprises a first detection module, a second detection module and a display module, wherein the first detection module is used for determining a sampling point of the initial of the handwriting to be generated according to the initiating position of the touch operation on the display terminal when the touch operation acting on the display terminal is detected;
the second detection module is used for sequentially collecting key sampling points on a moving track corresponding to the moving operation when the moving operation acting on the display terminal is detected;
the pattern construction module is used for respectively constructing corresponding preset pen-touch patterns based on the initial sampling points and the key sampling points;
the area construction module is used for determining common tangents between the adjacent preset pen touch patterns and constructing a closed area according to all the common tangents;
and the pattern filling module is used for filling the pattern into the closed area to obtain the writing handwriting.
9. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform a method of handwriting generation according to any of claims 1-7.
10. A terminal device comprising a processor and a memory, the memory storing a plurality of instructions, the processor loading the instructions to perform a handwriting generation method according to any one of claims 1 to 7.
CN202111506512.1A 2021-12-10 2021-12-10 Handwriting generating method and device, storage medium and terminal equipment Pending CN114168059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111506512.1A CN114168059A (en) 2021-12-10 2021-12-10 Handwriting generating method and device, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111506512.1A CN114168059A (en) 2021-12-10 2021-12-10 Handwriting generating method and device, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN114168059A true CN114168059A (en) 2022-03-11

Family

ID=80485353

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111506512.1A Pending CN114168059A (en) 2021-12-10 2021-12-10 Handwriting generating method and device, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN114168059A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237321A (en) * 2022-07-25 2022-10-25 深圳市华胜软件技术有限公司 Erasing processing method and device, electronic equipment and computer-readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531875A (en) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 Write generation method, terminal device and the storage medium of the vigour of style in writing

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531875A (en) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 Write generation method, terminal device and the storage medium of the vigour of style in writing

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115237321A (en) * 2022-07-25 2022-10-25 深圳市华胜软件技术有限公司 Erasing processing method and device, electronic equipment and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN108762954B (en) Object sharing method and mobile terminal
CN108737904B (en) Video data processing method and mobile terminal
EP2851779A1 (en) Method, device, storage medium and terminal for displaying a virtual keyboard
WO2021083132A1 (en) Icon moving method and electronic device
CN108762634B (en) Control method and terminal
CN108920069B (en) Touch operation method and device, mobile terminal and storage medium
CN109062464B (en) Touch operation method and device, storage medium and electronic equipment
CN107390923B (en) Screen false touch prevention method and device, storage medium and terminal
CN108958629B (en) Split screen quitting method and device, storage medium and electronic equipment
CN110703972B (en) File control method and electronic equipment
CN111309419A (en) Split-screen display method and electronic equipment
CN108073405B (en) Application program unloading method and mobile terminal
CN108845730A (en) A kind of object control method and terminal
CN107656727A (en) A kind of font object library generating method and mobile terminal
CN113050863A (en) Page switching method and device, storage medium and electronic equipment
CN109189514B (en) Terminal device control method and terminal device
CN108696642B (en) Method for arranging icons and mobile terminal
CN109117037B (en) Image processing method and terminal equipment
CN110908750A (en) Screen capturing method and electronic equipment
CN107943406B (en) touch point determining method of touch screen and terminal
CN114168059A (en) Handwriting generating method and device, storage medium and terminal equipment
CN111522613B (en) Screen capturing method and electronic equipment
CN109600514B (en) Unlocking control method and device, mobile terminal and storage medium
CN111443968A (en) Screenshot method and electronic equipment
CN108845755A (en) split screen processing method, device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination