WO2021218448A1 - 笔迹形成方法、笔迹形成装置及电子设备 - Google Patents
笔迹形成方法、笔迹形成装置及电子设备 Download PDFInfo
- Publication number
- WO2021218448A1 WO2021218448A1 PCT/CN2021/080511 CN2021080511W WO2021218448A1 WO 2021218448 A1 WO2021218448 A1 WO 2021218448A1 CN 2021080511 W CN2021080511 W CN 2021080511W WO 2021218448 A1 WO2021218448 A1 WO 2021218448A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- trajectory
- point
- connection
- points
- coordinates
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 202
- 238000005070 sampling Methods 0.000 claims abstract description 80
- 238000012545 processing Methods 0.000 claims abstract description 56
- 230000015654 memory Effects 0.000 claims description 32
- 230000035945 sensitivity Effects 0.000 claims description 31
- 230000006870 function Effects 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 17
- 230000003247 decreasing effect Effects 0.000 claims description 4
- 238000010586 diagram Methods 0.000 description 24
- 230000000694 effects Effects 0.000 description 13
- 230000008569 process Effects 0.000 description 9
- 238000004364 calculation method Methods 0.000 description 8
- 238000009499 grossing Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000008859 change Effects 0.000 description 4
- 238000001514 detection method Methods 0.000 description 4
- 238000003672 processing method Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 241001422033 Thestylus Species 0.000 description 2
- 239000011521 glass Substances 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 238000010897 surface acoustic wave method Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 241000699670 Mus sp. Species 0.000 description 1
- 230000001154 acute effect Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000001427 coherent effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000006698 induction Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000010422 painting Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000007619 statistical method Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction 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/0488—Interaction 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/04883—Interaction 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
- G06T11/203—Drawing of straight lines or curves
Definitions
- the embodiments of the present disclosure relate to a handwriting forming method, a handwriting forming device, and electronic equipment.
- touch screens have been widely used in smart terminals.
- the user can interact with the smart terminal through the touch screen, thereby conveniently completing the operation process of the smart terminal.
- Various applications for smart terminals have also been widely developed, for example, applications for writing and drawing on terminal devices.
- the user can use the corresponding application program to operate on the touch screen with a finger or a stylus, thereby writing or drawing various patterns.
- At least one embodiment of the present disclosure provides a handwriting forming method, including: determining a set of track points according to multiple sampling points on a writing path on a working surface of a touch device and obtaining track information of each track point, wherein
- the trajectory information includes coordinates, flags, and pressure values, the flags include data indicating whether the corresponding trajectory point is a pen point; based on the trajectory information, multiple raindrop shapes corresponding to the multiple trajectory points are established one-to-one
- the trajectory unit based on the trajectory information, determine the connection mode between the trajectory units corresponding to the adjacent trajectory points; calculate the connection point of the trajectory unit according to the connection mode, and correspond to the adjacent trajectory points
- the polygon formed by the connecting points of the trajectory unit is filled to form the displayed handwriting.
- establishing multiple raindrop-shaped trajectory units corresponding to the multiple trajectory points one-to-one based on the trajectory information includes: determining the first center coordinates and the first center coordinates of the first circle A radius; determine the second center coordinates and the second radius of the second circle; fill the first circle and the second circle, and form a polygon formed by the common tangent point of the first circle and the second circle Fill it.
- the first circle center coordinate is the coordinate of the corresponding track point
- the first radius is the product of the pressure sensitivity and the preset values of a plurality of writing parameters
- the pressure The sensing amount is obtained based on the pressure value of the corresponding track point
- the first radius is greater than the second radius.
- the pressure sensitivity is calculated according to the following pressure sensitivity function:
- Pz represents the pressure sensitivity
- P represents the pressure value
- the second circle center coordinate is obtained according to the first circle center coordinate, the center distance, and the angle of the line connecting the center of the circle, and the center distance is the distance between the brush length and the corresponding track point.
- Q times the product of the pressure value, 2 ⁇ Q ⁇ 7, the angle of the line connecting the center of the circle is the line between the center of the first circle and the center of the second circle and the coordinate system where the first center of the circle is located.
- the included angle in the x-axis direction, the angle of the line connecting the center of the circle is 15-60 degrees.
- 4.5 ⁇ Q ⁇ 5.5, and the angle of the line connecting the center of the circle is 25 to 35 degrees.
- determining the connection mode between the trajectory units corresponding to adjacent trajectory points based on the trajectory information includes: for trajectory points other than the pen point, calculating the current trajectory The slope of the line connecting the point and the previous trajectory point; determining the connection mode used by the trajectory unit corresponding to the current trajectory point according to the slope, the coordinates of the current trajectory point, and the coordinates of the previous trajectory point; Wherein, the slope is calculated according to the following formula:
- k represents the slope
- (x2, y2) represents the coordinates of the current trajectory point
- (x1, y1) represents the coordinates of the previous trajectory point.
- the connection mode includes a first connection mode, a second connection mode, a third connection mode, and a fourth connection mode, and according to the slope, the The coordinates of the current trajectory point and the coordinates of the previous trajectory point are used to determine the connection method used by the trajectory unit corresponding to the current trajectory point, including: if
- connection points of the trajectory units are calculated according to the connection mode, and the polygons formed by the connection points of the trajectory units corresponding to the adjacent trajectory points are filled to
- the handwriting used to form the display includes: for track points other than the pen down point, according to the determined first connection mode, the second connection mode, the third connection mode, and the first connection mode.
- One of the four connection modes is to calculate the connection points of the trajectory units; fill the polygon formed by the connection points of the trajectory units corresponding to adjacent trajectory points.
- the connection points of the trajectory unit include a first connection point m1 and a second connection point n1.
- the first connection mode the following formula is used to calculate the The first connection point m1 and the second connection point n1:
- (mx, my) represents the coordinates of the first connection point m1
- (nx, ny) represents the coordinates of the second connection point n1
- (c1.x, c1.y) represents the coordinates of the first circle center
- (C2.x, c2.y) represents the coordinates of the second circle center
- R1 represents the first radius
- R2 represents the second radius
- ⁇ represents the angle of the circle center connection
- the coordinates of the second connection point n1, the first circle center coordinates, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- the connection points of the trajectory unit include a first connection point m2 and a second connection point n2.
- the following formula is used to calculate the The first connection point m2 and the second connection point n2: Wherein (mx, my) represents the coordinates of the first connection point m2, (nx, ny) represents the coordinates of the second connection point n2, (c2.x, c2.y) represents the coordinates of the second circle center , R1 represents the first radius, R2 represents the second radius, the coordinates of the first connection point m2, the coordinates of the second connection point n2, and the coordinates of the second circle center are located in the working area of the touch device In the same coordinate system on the surface.
- the connection points of the trajectory unit include a first connection point m3 and a second connection point n3.
- the following formula is used to calculate the The first connection point m3 and the second connection point n3: Wherein (mx, my) represents the coordinates of the first connection point m3, (nx, ny) represents the coordinates of the second connection point n3, (c2.x, c2.y) represents the coordinates of the second circle center , R2 represents the second radius, the coordinates of the first connection point m3, the coordinates of the second connection point n3, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- the connection points of the trajectory unit include a first connection point m4 and a second connection point n4.
- the following formula is used to calculate the The first connection point m4 and the second connection point n4: Wherein (mx, my) represents the coordinates of the first connection point m4, (nx, ny) represents the coordinates of the second connection point n4, and (c1.x, c1.y) represents the coordinates of the first circle center , (C2.x, c2.y) represents the coordinates of the second circle center, R1 represents the first radius, R2 represents the second radius, ⁇ represents the angle of the circle center connection, and the coordinates of the first connection point m4
- the coordinates of the second connection point n4, the first circle center coordinates, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- connection points of the trajectory units are calculated according to the connection mode, and the polygons formed by the connection points of the trajectory units corresponding to the adjacent trajectory points are filled to
- the handwriting used to form the display further includes: for the track point as the pen down point, determining the connection of the track unit corresponding to the pen down point according to the connection mode of the track unit corresponding to the track point adjacent to the pen down point point.
- the trajectory corresponding to the pen down point is determined according to the connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen down point
- the connection point of the unit includes: if the connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen down point is the first connection mode, the second connection mode or the third connection mode , The connection point of the track unit corresponding to the pen point is determined by the connection of the track unit corresponding to the track point adjacent to the pen point; if the track unit corresponding to the track point adjacent to the pen point is The connection mode is the fourth connection mode, and the first connection point m5 and the second connection point n5 of the trajectory unit corresponding to the pen point are calculated according to the following formula: Wherein, (mx, my) represents the coordinates of the first connection point m5, (nx, ny) represents the coordinates of the second connection point n5, and (c1.x, c1.y) represents the coordinates of
- connection points of the trajectory units are calculated according to the connection mode, and the polygons formed by the connection points of the trajectory units corresponding to the adjacent trajectory points are filled to
- the handwriting used to form the display further includes: before filling the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points, judging the connection mode of the trajectory unit corresponding to the current trajectory point and the Whether the connection mode of the trajectory unit corresponding to the previous trajectory point is different; if it is different, use the connection mode of the trajectory unit corresponding to the current trajectory point to calculate the connection point of the trajectory unit corresponding to the previous trajectory point as The repeated connection point of the trajectory unit corresponding to the previous trajectory point; wherein, when filling the polygon formed by the connection points of the trajectory unit corresponding to the adjacent trajectory point, the previous trajectory point and the The polygon between the trajectory units corresponding to the current trajectory point is formed based on the repeated connection points.
- the method before establishing the multiple raindrop-shaped trajectory units, the method further includes: selecting consecutive Z trajectory points including the pen down point, The pressure value in the trajectory information of each of the Z trajectory points is respectively added with a compensation value to obtain an updated pressure value, and the updated pressure value is used to replace the pressure value in the trajectory information; where 5 ⁇ Z ⁇ 15 and Z is an integer.
- the Z compensation values corresponding to the Z trajectory points are sequentially decreased.
- the method provided by an embodiment of the present disclosure further includes: performing anti-aliasing processing on the edge lines of the filling pattern.
- performing the anti-aliasing processing on the edge line of the filling pattern includes: dividing each display pixel passed by the edge line according to the diagonal of the display pixel Are two regions, where the sign of the slope of the diagonal line is the same as the sign of the slope of the edge line; it is determined that the edge line passes through the area where the line segment of the display pixel is located; if the If the line segment is located in one of the two areas, the display pixel where the line segment is located and the display pixels adjacent to the area where the line segment is located in the y direction are displayed; If they overlap, the display pixel where the line segment is located is displayed.
- the transparency of the display pixels adjacent to the area where the line segment is located in the y direction is calculated according to the following formula: Wherein, Td represents the transparency, and d MN represents the distance between the vertex of the area where the line segment is located and the line segment.
- determining a set of track points based on multiple sampling points on the writing path on the working surface of the touch device and obtaining the track information of each track point includes: Part of the sampling points among all the sampling points on the writing path; obtaining the plurality of trajectory points based on the part of the sampling points, and obtaining trajectory information of the plurality of trajectory points.
- the ratio of the number of the part of the sampling points to the total number of the sampling points is 1% to 5%.
- At least one embodiment of the present disclosure further provides a handwriting forming device, including: a sampling unit configured to determine a set of trajectory points according to multiple sampling points on the writing path on the working surface of the touch device and obtain the value of each trajectory point Trajectory information, wherein the trajectory information includes coordinates, flags, and pressure values, and the flags include data indicating whether the corresponding trajectory point is a pen point; the modeling unit is configured to establish a connection with the trajectory information Multiple raindrop-shaped trajectory units corresponding to multiple trajectory points one-to-one; a connection mode determining unit configured to determine a connection mode between trajectory units corresponding to adjacent trajectory points based on the trajectory information; a filling unit, configured In order to calculate the connection points of the trajectory unit according to the connection mode, and fill the polygon formed by the connection points of the trajectory unit corresponding to the adjacent trajectory points to form the displayed handwriting.
- a sampling unit configured to determine a set of trajectory points according to multiple sampling points on the writing path on the working surface of the touch device and obtain the value of each trajectory
- At least one embodiment of the present disclosure further provides an electronic device, including: a processor; a memory, including one or more computer program modules; wherein the one or more computer program modules are stored in the memory and configured To be executed by the processor, the one or more computer program modules include instructions for implementing the handwriting forming method described in any of the foregoing embodiments.
- the electronic device provided by an embodiment of the present disclosure further includes the touch device, wherein the touch device is configured to obtain the initial handwriting on the working surface of the touch device.
- the electronic device provided by an embodiment of the present disclosure further includes a display device, wherein the display device is configured to display the handwriting formed by the handwriting forming method.
- FIG. 1 is a schematic flowchart of a handwriting forming method provided by at least one embodiment of the present disclosure
- step S110 in the handwriting forming method shown in FIG. 1;
- step S120 in the handwriting forming method shown in FIG. 1;
- FIG. 4A is one of the schematic diagrams of the trajectory unit provided by at least one embodiment of the present disclosure.
- 4B is the second schematic diagram of the trajectory unit provided by at least one embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of pressure value samples provided by at least one embodiment of the present disclosure.
- FIG. 6 is a schematic flowchart of step S130 in the handwriting forming method shown in FIG. 1;
- FIG. 7A is a schematic diagram of a first connection method provided by at least one embodiment of the present disclosure.
- FIG. 7B is a schematic diagram of a second connection method provided by at least one embodiment of the present disclosure.
- FIG. 7C is a schematic diagram of a third connection method provided by at least one embodiment of the present disclosure.
- FIG. 7D is a schematic diagram of a fourth connection method provided by at least one embodiment of the present disclosure.
- FIG. 8 is one of the schematic flowcharts of step S140 in the handwriting forming method shown in FIG. 1;
- FIG. 9 is the second schematic diagram of the flow of step S140 in the handwriting forming method shown in FIG. 1;
- FIG. 10 is a schematic diagram of model connection of different connection modes provided by at least one embodiment of the present disclosure.
- FIG. 11 is a schematic flowchart of anti-aliasing processing provided by at least one embodiment of the present disclosure.
- FIG. 12A is a schematic diagram showing the anti-aliasing processing provided by at least one embodiment of the present disclosure
- Fig. 12B is an enlarged view of area F in Fig. 12A;
- FIG. 13 is an effect comparison diagram of anti-aliasing processing provided by at least one embodiment of the present disclosure.
- FIG. 14 is an application flowchart of a handwriting forming method provided by at least one embodiment of the present disclosure.
- 15 is a schematic diagram of a system that can be used to implement the handwriting forming method provided by the embodiments of the present disclosure
- 16 is a schematic block diagram of a handwriting forming device provided by at least one embodiment of the present disclosure.
- FIG. 17 is a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure.
- FIG. 18 is a schematic block diagram of another electronic device provided by at least one embodiment of the present disclosure.
- FIG. 19 is a schematic block diagram of still another electronic device provided by at least one embodiment of the present disclosure.
- the smart terminal can simulate and display the handwriting written by the user, and the handwriting can be displayed in various types, such as brush writing, pen writing, etc., as required.
- the writing brush is a traditional Chinese writing tool and painting tool.
- the brush tip is made of animal hair, for example, and grows into a cone shape after absorbing ink for writing.
- Brush writing has strong Chinese characteristics, reflects the charm of Chinese calligraphy, and can provide users with attractive visual effects.
- the usual methods of simulating calligraphy with brushes mainly establish handwriting models for different writing skills when writing with a brush, such as the Vietnamese front and the exposed front of the pen, the slanted front and the side front in the stroke, etc., while ignoring the connection between the models.
- the formed brush strokes are not smooth enough, lack of aesthetics, and the processing method is complicated, and the practicability is not strong.
- At least one embodiment of the present disclosure provides a handwriting forming method, handwriting forming device, and electronic equipment.
- the handwriting forming method can obtain beautiful handwriting with a brush, smooth handwriting, can embody a variety of strokes, small calculation amount, high processing efficiency, strong real-time performance, and simple and practical.
- the handwriting forming method includes: determining a set of trajectory points according to a plurality of sampling points on a writing path on a working surface of a touch device and obtaining trajectory information of each trajectory point ,
- the trajectory information includes coordinates, flags, and pressure values, the flags include data indicating whether the corresponding trajectory point is a pen point; based on the trajectory information, multiple raindrop-shaped trajectory units corresponding to multiple trajectory points are established one-to-one; based on the trajectory
- the information determines the connection mode between the trajectory units corresponding to the adjacent trajectory points; calculates the connection points of the trajectory units according to the connection mode, and fills the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points, Used to form the displayed handwriting.
- FIG. 1 is a schematic flowchart of a handwriting forming method provided by at least one embodiment of the present disclosure.
- the handwriting forming method is applied to a computing device, and the computing device includes any electronic device with computing functions, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, a server, etc., which is not limited by the embodiments of the present disclosure.
- the computing device has a central processing unit (Central Processing Unit, CPU) or a graphics processing unit (Graphics Processing Unit, GPU), and also includes a memory.
- the memory is, for example, a non-volatile memory (for example, Read Only Memory (ROM)), and the code of the operating system is stored thereon.
- the memory also stores codes or instructions, and by running these codes or instructions, the handwriting forming method provided by the embodiments of the present disclosure can be realized.
- the computing device may also include a touch device, such as a touch screen or a touch pad, to obtain the initial handwriting formed on the working surface of the touch device when the user writes.
- the touch screen can not only receive the initial handwriting, but also display correspondingly at the same time.
- it can be a capacitive touch screen, such as a self-capacitive touch screen or a mutual capacitive touch screen, or a resistive touch screen, a surface acoustic wave touch screen, an infrared touch screen, etc.
- the embodiment of the present disclosure does not limit this.
- the user can write directly on the working surface of the touch screen with a finger, or can write on the working surface of the touch screen with an active stylus or a passive stylus, which is not limited in the embodiments of the present disclosure.
- the work surface refers to a surface used to detect a user's touch operation, such as the touch surface of a touch screen.
- the type of the touch device is not limited, and it can be not only a touch screen, but also any device with touch function such as an interactive whiteboard, which can be determined according to actual needs.
- the computing device may also include a display device, such as a liquid crystal display (LCD), an organic light emitting diode (OLED) display, and a quantum dot light emitting diode (Quantum Dot Light Emitting).
- a display device such as a liquid crystal display (LCD), an organic light emitting diode (OLED) display, and a quantum dot light emitting diode (Quantum Dot Light Emitting).
- Diode, QLED QLED
- the display device can display the handwriting formed by the handwriting forming method provided by the embodiment of the present disclosure, for example, the handwriting of a brush.
- the handwriting forming method includes the following operations.
- Step S110 Determine a set of trajectory points according to multiple sampling points on the writing path on the working surface of the touch device and obtain trajectory information of each trajectory point.
- the trajectory information includes coordinates, flags and pressure values, and the flags include Indicate whether the corresponding track point is the data of the pen point;
- Step S120 Establish multiple raindrop-shaped trajectory units corresponding to multiple trajectory points one-to-one based on the trajectory information
- Step S130 Determine the connection mode between the trajectory units corresponding to the adjacent trajectory points based on the trajectory information
- Step S140 Calculate the connection points of the trajectory units according to the connection method, and fill the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points to form the displayed handwriting.
- the touch device may be a touch screen, and accordingly, the work surface may be a touch surface of the touch screen to detect a user's touch operation.
- the touch device can detect the amount of force distributed along the writing path.
- Sampling points For example, when the touch device detects these sampling points, it can obtain the pressure values, coordinates, and flags of these sampling points.
- the touch device can obtain a set of trajectory points and trajectory information of the trajectory points. For example, a group of trajectory points includes multiple trajectory points.
- the trajectory information includes pressure values, coordinates, and flags.
- the pressure value represents the force with which the user touches the corresponding track point (corresponding sampling point).
- the pressure value may be the original pressure value or the pressure value after normalization, which is not limited in the embodiment of the present disclosure.
- the pressure value may be detected by a pressure sensor provided in the touch device, and the pressure sensor may include a piezoelectric film to sense the pressure applied to the work surface when the user writes on the work surface of the touch device; or, when the user uses When the stylus pen writes on the work surface of the touch device, the stylus pen may be provided with a pressure sensor to detect the pressure applied by the user to the work surface.
- the embodiment of the present disclosure does not limit the way of detecting the pressure value.
- the coordinates indicate the position of the corresponding track point (corresponding sampling point) in the work surface.
- the coordinates are coordinates in a rectangular coordinate system within the work surface, and the origin of the rectangular coordinate system is determined by the setting of the touch device itself.
- the flag includes data indicating whether the corresponding track point is a pen-down point, and the pen-down point refers to, for example, the first sampling point detected in a continuous writing path.
- the flag can be a preset number, character, character string, etc.
- the flag bit can be set to "down".
- the flag bit may also include data indicating whether the corresponding track point is a pen ending point or a pen moving point, for example, "up” and “move-on” respectively.
- the setting mode and setting rule of the flag bit can be determined according to actual requirements, and the embodiment of the present disclosure does not limit this.
- the pressure value, coordinates, and flags in the trajectory information are detected by the touch device, and the method of obtaining and displaying these information can be determined according to the settings of the touch device itself.
- the embodiment does not limit this.
- the trajectory information of the trajectory point that is, the pressure value, the coordinates, and the flag can be directly obtained from the touch device.
- the foregoing step S110 may include the following operations.
- Step S111 Select a part of all the sampling points on the writing path
- Step S112 Obtain multiple trajectory points based on a part of the sampling points, and obtain trajectory information of the multiple trajectory points.
- a part of the sampling points is selected, that is, all sampling points are sparsely sampled.
- the ratio of the number of selected sampling points to all sampling points is 1% to 5%, such as 2%.
- 1 to 5 sampling points are selected from every 100 sampling points, for example, 2 sampling points are selected.
- the ratio of the number of selected sampling points to all sampling points is 1%-40%.
- sampling points as pen down points are numbered 1, and all the sampling points located on the writing path are sequentially numbered to form a sequence, and the selected sampling points are more evenly distributed in the sequence composed of all the sampling points.
- sparse sampling the number of sampling points that need to be processed can be greatly reduced, processing efficiency is improved, and real-time performance is improved.
- trajectory points are obtained based on the selected sampling points.
- the selected sampling point may be used as the trajectory point, and accordingly, the trajectory information of each trajectory point can be obtained from the touch device.
- the selected sampling points can be smoothed, and after smoothing, the track points and the corresponding track information can be obtained.
- the smoothing process may adopt a common smoothing process algorithm and a smoothing process method, which is not limited in the embodiment of the present disclosure.
- a sampling point is a point obtained by touch detection by a touch collection component in a touch device, and the sampling point carries information such as speed, coordinates, and type (for example, whether it is a pen point).
- the sampling points provided by the touch device sparse sampling and interpolation are performed, so that the track points can be obtained.
- sparse sampling has been described above and will not be repeated this time.
- the interpolation processing can make the obtained multiple track points smoother, that is, the interpolation processing can achieve the effect of the smoothing processing described above.
- the required parameters include, for example, the information of the other two sampling points adjacent to the sampling point, such as the information of the sampling point before the sampling point and the sampling after the sampling point Point of information. Therefore, the information of the trajectory point corresponding to the sampling point, such as speed, coordinates, type, etc., can be obtained through interpolation calculation.
- a set of trajectory points can be obtained.
- the type of the trajectory point is the same as the type of the corresponding sampling point
- the velocity of the trajectory point is obtained by simulation calculation, for example, by calculating the mean value or the numerical arithmetic difference of the velocities of the two sampling points before and after.
- the interpolation processing please refer to the conventional design, which will not be repeated here.
- step S120 multiple raindrop-shaped trajectory units corresponding to multiple trajectory points one-to-one are established based on trajectory information, that is, a trajectory unit is created for each trajectory point.
- the trajectory unit includes two solid circles of different sizes and a common tangent of the two circles, and has a shape similar to a raindrop.
- step S120 may include the following operations.
- Step S121 Determine the first center coordinate and the first radius of the first circle
- Step S122 Determine the second center coordinate and the second radius of the second circle
- Step S123 Fill the first circle and the second circle, and fill the polygon formed by the common tangent point of the first circle and the second circle.
- the trajectory unit includes a first circle 01 and a second circle 02.
- the radius of the first circle 01 is called the first radius R1
- the radius of the second circle 02 is called the second radius R2
- the first radius R1 is greater than the second radius R2, that is, the first circle 01 is a larger circle
- the second circle 02 is a smaller circle.
- the common tangent points of the first circle 01 and the second circle 02 are A1, A2, A3, A4, and the common tangent line is with
- the trajectory unit is composed of a polygon formed by the first circle 01, the second circle 02, and the common tangent points A1, A2, A3, and A4.
- step S121 the coordinates of the center c1 of the first circle 01 are called the first center coordinates, and the first center coordinates are the coordinates of the corresponding track points.
- the coordinates in the track information may be directly used as the first center coordinates.
- the first radius R1 is the product of the pressure sensitivity and the preset values of a plurality of writing parameters.
- multiple preset values of writing parameters include brush diameter and line width.
- the first radius R1 is the product of pressure sensitivity, brush diameter and line width.
- Different brush diameters and different line widths can make the formed handwriting have different visual effects.
- the brush diameter and the line width of the drawing line can adopt preset default values, or can be set by the user before executing the handwriting forming method, which can be determined according to actual needs, and the embodiment of the present disclosure does not limit this.
- the pressure sensitivity is obtained based on the pressure value of the corresponding track point. Since the strength of the user when writing on the touch device is variable, the strength can be light or heavy. Only when the size of the track unit corresponding to the adjacent track point does not change significantly, a more beautiful writing handwriting can be formed. Moreover, the handwriting is usually thinner when the brush is lighter when writing. Based on the above considerations, the pressure sensitivity is used to establish the trajectory unit, so that the formed handwriting is relatively smooth, and it can also reflect the characteristics of the speed of the pen. As shown in Figure 5, the pressure values of a large number of sampling points when different users are writing can be collected through experiments to obtain a large number of pressure value samples, and then the pressure sensitivity function can be obtained according to the pressure value samples.
- the pressure value is the data after normalization processing.
- the pressure sensitivity function can be obtained by using statistical methods and combining with simulation optimization processing.
- the pressure sensitivity function is as follows:
- Pz represents the pressure sensitivity
- P represents the pressure value
- the pressure value provided by the touch device after the touch detection is completed is the normalized data, and the pressure value can be directly substituted into the above formula to obtain the pressure sensitivity.
- the pressure value provided by the touch device after the touch detection has not been normalized. Therefore, before the pressure sensitivity is calculated, the pressure value provided by the touch device needs to be normalized. The normalized pressure value is substituted into the above formula to obtain the pressure sensitivity.
- the value range of the pressure sensitivity Pz is between 0 and 1.
- the pressure value P is less than 0.4
- the pressure sensitivity is set to a fixed value of 0.25, thereby ensuring a relatively stable pen down effect when the user writes.
- the pressure value is 0.4 ⁇ P ⁇ 0.8
- the pressure sensitivity is set to a fixed value of 1, thereby preventing the handwriting from suddenly becoming larger and affecting the appearance.
- the above-mentioned pressure-sensitive function is only exemplary and not restrictive.
- the pressure-sensitive function can be adjusted according to actual needs, and the embodiment of the present disclosure does not limit this.
- the coefficients in the pressure sensitivity function can be adjusted, such as appropriately increasing or decreasing, the division area of the pressure value P in the pressure sensitivity function can also be adjusted, and the induction pressure sensitivity function can be redesigned, which can be based on It depends on actual needs.
- the coordinates of the center c2 of the second circle 02 are called the second center coordinates, and the second center coordinates are obtained from the first center coordinates, the center distance, and the angle of the line connecting the center of the center.
- the center distance is the distance between the center c1 of the first circle 01 and the center c2 of the second circle 02.
- the center distance is Q times the product of the brush length and the pressure value of the corresponding track point, 2 ⁇ Q ⁇ 7.
- the brush length may adopt a preset default value, or it may be set by the user before executing the handwriting forming method, which may be determined according to actual needs, which is not limited in the embodiment of the present disclosure.
- the connecting angle of the center of the circle is the angle ⁇ between the connecting line L1 of the center c1 of the first circle 01 and the center c2 of the second circle 02 and the x-axis direction of the coordinate system of the first circle center.
- the included angle ⁇ is an acute angle, and is the included angle between the line L1 and the negative direction of the x-axis.
- the first circle center coordinates are the coordinates of the corresponding track points, which are provided by the touch device
- the coordinate system where the first circle center coordinates are located is the coordinate system located on the work surface defined by the touch device.
- the angle of the line connecting the center of the circle is 15-60 degrees, such as 20-45 degrees, or 30 degrees.
- the second circle center coordinate can be obtained by using the knowledge of plane geometry.
- 4.5 ⁇ Q ⁇ 5.5, and the angle of the line connecting the center of the circle is 25 to 35 degrees.
- t represents the ink density
- t max (0.8*T/n, 0.6).
- T is a constant and can be set to 0.8.
- n is the number of the track point.
- the serial number of the trajectory point as the pen-down point is 1, and the subsequent trajectory points are sequentially numbered 2, 3, 4, and so on.
- the above formula for calculating the ink concentration t is exemplary and not restrictive, and can be adjusted according to actual needs, which is not limited in the embodiments of the present disclosure.
- step S123 on the premise that the first circle center coordinates, the first radius R1, the second circle center coordinates, and the second radius R2 are known, the common tangent point A1 of the first circle 01 and the second circle 02 can be calculated. , A2, A3, and A4, and then fill the polygon formed by the first circle 01, the second circle 02, and the common tangent points A1, A2, A3, and A4 to obtain the trajectory unit corresponding to the trajectory point.
- step S130 the connection mode between the trajectory units corresponding to adjacent trajectory points is determined based on the trajectory information.
- “adjacent” does not mean that the two track points are adjacent to each other on the working surface of the touch device, but refers to the one obtained by the two track points based on multiple sampling points located on the writing path.
- the group of track points are adjacent in a sequence composed of serial numbers, that is, the sequence numbers of the two track points are adjacent.
- the track point with serial number 1 is adjacent to the track point with serial number 2.
- the track point with sequence number 4 is not only adjacent to the track point with sequence number 5, but also with the track point with sequence number 3.
- step S130 may include the following operations.
- Step S131 Calculate the slope of the line connecting the current trajectory point and the previous trajectory point for the trajectory points other than the pen-down point;
- Step S132 According to the slope, the coordinates of the current trajectory point and the coordinates of the previous trajectory point, determine the connection mode adopted by the trajectory unit corresponding to the current trajectory point.
- step S131 the slope can be calculated according to the following formula:
- k represents the slope
- (x2, y2) represents the coordinates of the current trajectory point
- (x1, y1) represents the coordinates of the previous trajectory point.
- the above-mentioned connection modes include a first connection mode, a second connection mode, a third connection mode, and a fourth connection mode.
- the first connection method corresponds to the stroke "horizontal”
- the second connection method corresponds to the stroke " ⁇ ”
- the third connection method corresponds to the stroke "lift”
- the fourth connection method corresponds to Strokes other than the above three strokes.
- the following rules can be used to determine the connection method of the trajectory unit corresponding to the current trajectory point.
- the first connection mode is, for example, the connection mode shown in FIG. 7A, that is, The connection method corresponding to the stroke "horizontal". If -0.9 ⁇ k ⁇ -0.6 and x2>x1, it is determined that the trajectory unit corresponding to the current trajectory point adopts the second connection method.
- the second connection method is, for example, the connection method shown in FIG. 7B, that is, the stroke " ⁇ " corresponds to the connection method. If 0.6 ⁇ k ⁇ 1 and y2 ⁇ y1, it is determined that the trajectory unit corresponding to the current trajectory point adopts the third connection method.
- the third connection method is, for example, the connection method shown in FIG. Corresponding connection method. Otherwise, determine that the trajectory unit corresponding to the current trajectory point adopts the fourth connection method.
- the fourth connection method is, for example, the connection method shown in FIG. .
- connection method when determining the connection method, it can be determined in order according to the foregoing content. That is, first determine whether the conditions for using the first connection method are met; if not, then determine whether the conditions for using the second connection method are met; if it is still not met, then determine whether the conditions for using the third connection method are met. Conditions; if not satisfied, the fourth connection method is used.
- trajectory point as the pen point (the trajectory point with serial number 1, that is, the first trajectory point on a continuous writing path)
- the connection method of the trajectory unit corresponding to the trajectory point Determining the connection point of the trajectory unit corresponding to the trajectory point will be described later, and will not be repeated here.
- connection points of the trajectory units are calculated according to the connection mode, and the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points Fill in to form the displayed handwriting.
- step S140 may include the following operations.
- Step S141 Calculate the connection points of the trajectory unit according to the determined one of the first connection mode, the second connection mode, the third connection mode and the fourth connection mode for the trajectory points other than the pen-down point;
- Step S142 Fill the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points;
- Step S143 For the trajectory point as the pen down point, the connection point of the trajectory unit corresponding to the pen down point is determined according to the connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen down point.
- step S141 according to different connection methods, different formulas are used to calculate the connection points of the trajectory units, and the calculated connection points are used to subsequently fill the area between adjacent trajectory units.
- the method of calculating the connection point will be described in detail below in conjunction with the connection method shown in FIGS. 7A-7D.
- connection points of the track unit E2 include a first connection point m1 and a second connection point n1.
- (mx, my) represents the coordinates of the first connection point m1
- (nx, ny) represents the coordinates of the second connection point n1
- (c1.x, c1.y) represents the coordinates of the first circle center in the trajectory unit E2
- (C2.x, c2.y) represents the second circle center coordinates in the trajectory unit E2
- R1 represents the first radius in the trajectory unit E2
- R2 represents the second radius in the trajectory unit E2
- ⁇ represents the trajectory The angle of the line connecting the center of the circle in unit E2.
- the coordinates of the first connection point m1, the coordinates of the second connection point n1, the first circle center coordinates, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- "floor" means round-down operation.
- the first connection mode corresponds to the stroke "horizontal”
- the part between the trajectory unit E2 corresponding to the current trajectory point and the trajectory unit E1 corresponding to the previous trajectory point is a line in the stroke "horizontal”.
- the first connection point m1 and the second connection point n1 calculated in the above manner are used for subsequent filling, which can make the formed handwriting more consistent with the "horizontal" writing characteristics of the stroke.
- connection points of the trajectory unit E2 include a first connection point m2 and a second connection point n2.
- (mx, my) represents the coordinates of the first connection point m2
- (nx, ny) represents the coordinates of the second connection point n2
- (c2.x, c2.y) represents the coordinates of the second circle center in the trajectory unit E2
- R1 represents the first radius in the track unit E2
- R2 represents the second radius in the track unit E2.
- the coordinates of the first connection point m2, the coordinates of the second connection point n2, and the coordinates of the second circle center are located in the same coordinate system on the working surface of the touch device.
- "floor” means round-down operation
- "ceil” means round-up operation.
- the second connection method corresponds to the stroke " ⁇ "
- the part between the trajectory unit E2 corresponding to the current track point and the trajectory unit E1 corresponding to the previous trajectory point is a line in the stroke " ⁇ ”.
- the first connection point m2 and the second connection point n2 calculated in the above manner are used for subsequent filling, which can make the formed handwriting more consistent with the writing characteristics of the stroke " ⁇ ".
- connection points of the track unit E2 include the first connection point m3 and the second connection point n3.
- (mx, my) represents the coordinates of the first connection point m3
- (nx, ny) represents the coordinates of the second connection point n3
- (c2.x, c2.y) represents the coordinates of the second circle center in the trajectory unit E2
- R2 represents the second radius in the track unit E2.
- the coordinates of the first connection point m3, the coordinates of the second connection point n3, and the coordinates of the second circle center are located in the same coordinate system on the working surface of the touch device.
- “floor” means round-down operation
- "ceil” means round-up operation.
- the third connection mode corresponds to the stroke "lift"
- the part between the trajectory unit E2 corresponding to the current trajectory point and the trajectory unit E1 corresponding to the previous trajectory point is a line in the stroke "lift”.
- the first connection point m3 and the second connection point n3 calculated in the above manner are used for subsequent filling, which can make the formed handwriting more consistent with the writing characteristics of the stroke "lifting".
- connection points of the track unit E2 include the first connection point m4 and the second connection point n4.
- (mx, my) represents the coordinates of the first connection point m4
- (nx, ny) represents the coordinates of the second connection point n4
- (c1.x, c1.y) represents the coordinates of the first circle center in the trajectory unit E2
- (C2.x, c2.y) represents the second circle center coordinates in the trajectory unit E2
- R1 represents the first radius in the trajectory unit E2
- R2 represents the second radius in the trajectory unit E2
- ⁇ represents the trajectory The angle of the line connecting the center of the circle in unit E2.
- the coordinates of the first connection point m4, the coordinates of the second connection point n4, the first circle center coordinates, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- "floor” means round-down operation
- "ceil” means round-up operation.
- the fourth connection method corresponds to strokes other than the above three strokes, and the part between the track unit E2 corresponding to the current track point and the track unit E1 corresponding to the previous track point is a line in the stroke.
- the first connection point m4 and the second connection point n4 calculated in the above manner are used for subsequent filling, which can make the formed handwriting have better continuity, and is suitable for forming a variety of strokes.
- the formulas for calculating the connection points respectively adopted by the first connection mode, the second connection mode, the third connection mode, and the fourth connection mode are only exemplary. In a non-limiting manner, the above formulas can be adjusted according to actual needs, and the embodiments of the present disclosure do not limit this.
- connection points of the trajectory units corresponding to each trajectory point are calculated, the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points is filled, thereby making the multiple trajectory units corresponding to the multiple trajectory points Form continuous handwriting between each other.
- the first connection point m1 and the second connection point n1 are two adjacent vertices of a polygon (such as a quadrilateral) between the track unit E2 and the track unit E1,
- the other two vertices of the polygon are the two connection points on the track unit E1.
- Filling the polygon can make a continuous handwriting formed between the track unit E2 and the track unit E1.
- the second connection method shown in FIG. 7A the second connection method shown in FIG.
- the first connection point m2 and the second connection point n2 are two adjacent vertices of a polygon (for example, a quadrilateral) between the track unit E2 and the track unit E1,
- the other two vertices of the polygon are the two connection points on the track unit E1.
- Filling the polygon can make a continuous handwriting formed between the track unit E2 and the track unit E1.
- the filling of the polygon adopts a similar method, which will not be repeated here.
- the connection point of the trajectory unit corresponding to the pen entry point is determined according to the connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen entry point. For example, if the serial number of the trajectory point as the pen point is 1, then the connection point of the trajectory unit corresponding to the pen point is determined according to the connection mode of the trajectory unit corresponding to the trajectory point with serial number 2, so that the trajectory unit corresponding to the pen point can be
- the trajectory units corresponding to the trajectory points with the sequence number 2 form polygons and fill them.
- connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen down point (that is, the trajectory point with sequence number 2) is the first connection mode, the second connection mode or the third connection mode, then the same as the pen down
- the connection mode of the trajectory unit corresponding to the adjacent trajectory point determines the connection point of the trajectory unit corresponding to the pen point. For example, in some examples, when the connection mode of the trajectory unit corresponding to the trajectory point with sequence number 2 is the first connection mode, the first connection mode is used to calculate the connection point of the trajectory unit corresponding to the pen point, that is, Calculate the first connection point and the second connection point of the trajectory unit corresponding to the pen point by using the formula corresponding to the aforementioned first connection mode.
- connection mode of the trajectory unit corresponding to the trajectory point with sequence number 2 is the second connection mode or the third connection mode
- the second connection mode or the third connection mode is used to calculate the trajectory unit corresponding to the pen point
- the connection point, that is, the first connection point and the second connection point of the trajectory unit corresponding to the pen point are calculated using the formula corresponding to the aforementioned second connection mode or the third connection mode, which will not be repeated here.
- connection mode of the trajectory unit corresponding to the trajectory point adjacent to the pen point is the fourth connection mode
- the first connection point of the trajectory unit corresponding to the pen point is calculated according to the following formula m5 and the second connection point n5:
- (mx, my) represents the coordinates of the first connection point m5
- (nx, ny) represents the coordinates of the second connection point n5
- (c1.x, c1.y) represents the first center of the trajectory unit corresponding to the pen point Coordinates
- (c2.x, c2.y) represent the second circle center coordinates of the trajectory unit corresponding to the pen point
- R1 represents the first radius of the trajectory unit corresponding to the pen point
- R2 represents the second radius of the trajectory unit corresponding to the pen point
- ⁇ represents the connecting angle of the center of the trajectory unit corresponding to the pen down point.
- the coordinates of the first connection point m5, the coordinates of the second connection point n5, the first circle center coordinates, and the second circle center coordinates are located in the same coordinate system on the working surface of the touch device.
- the first connection point m5 and the second connection point n5 are used for subsequent filling, it can have a better pen-down shape and make the handwriting more beautiful.
- connection points of the trajectory units corresponding to any two adjacent trajectory points can form a polygon (for example, using these connection points as vertices can form a quadrilateral), Fill these polygons, so that a coherent handwriting can be formed between multiple trajectory units.
- step S140 in FIG. 1 may further include the following operations.
- Step S144 Before filling the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points, determine the connection mode of the trajectory unit corresponding to the current trajectory point and the connection mode of the trajectory unit corresponding to the previous trajectory point Whether it's different
- Step S145 if they are different, the connection point of the trajectory unit corresponding to the previous trajectory point is calculated using the connection method of the trajectory unit corresponding to the current trajectory point as the repeated connection point of the trajectory unit corresponding to the previous trajectory point.
- the polygon between the previous trajectory point and the trajectory unit corresponding to the current trajectory point is formed based on the repeated connection points.
- FIG. 10 is a schematic diagram of model connection of different connection modes provided by at least one embodiment of the present disclosure. The above steps S144 and S145 will be described below with reference to FIG. 10.
- the three trajectory units E3, E4, and E5 are respectively the trajectory units corresponding to three adjacent trajectory points. These three adjacent trajectory points are, for example, serial numbers 3, 4, and 5 respectively. Three track points. In the following description, these three trajectory points are called No. 3 trajectory point, No. 4 trajectory point, and No. 5 trajectory point, respectively. Correspondingly, these 3 trajectory units are called No. 3 trajectory unit E3 and No. 4 trajectory respectively. Unit E4 and No. 5 track unit E5.
- the track unit No. 4 corresponding to track point No. 4 uses the first connection method.
- the two connection points m and n of the track unit E4 No. 4 are calculated.
- the track unit No. 5 corresponding to track point No. 5 adopts the second connection method, thus
- the two connection points B1 and B2 of the No. 5 trajectory unit E5 are calculated.
- the two connection points B3 and B4 of the No. 3 trajectory unit E3 can be calculated based on the No. 3 trajectory point and the No. 2 trajectory point (not shown in the figure), For example, the track unit E3 No. 3 adopts the first connection method.
- connection method of track unit E4 No. 4 is the same as the connection method of track unit E3 No. 3, which is the first connection method, so the polygon formed by connecting points m, n, B3, and B4 is filled That's it.
- connection method of track unit E5 No. 5 is different from the connection method of track unit E4 No. 5
- the connection method of track unit E5 No. 5 is the second connection method
- the connection method of track unit E4 No. 4 The line mode is the first connection mode. Therefore, it is necessary to use the connection method of No. 5 trajectory unit E5 (that is, the second connection method) to calculate the connection point of No. 4 trajectory unit E4 again to obtain connection points m'and n', and call the connection points m'and n' It is the repeated connection point of track unit E4.
- the track unit No. 4 E4 has not only connection points m and n, but also repeated connection points m'and n'.
- the polygon between the 4th track unit E4 and the 5th track unit E5 is formed based on the repeated connection points m'and n', while the polygon between the 4th track unit E4 and the 3rd track unit E3 is formed based on the connection points m and n, Therefore, the handwriting formed after filling can have no gap at the joint (that is, the position where the track unit E4 No. 4 is located), so that different strokes can be continuously connected and smoothly transitioned, thereby improving the aesthetics of the handwriting.
- the handwriting forming method may further include an operation for realizing a stroke effect, and the operation is as follows:
- Step S160 Select consecutive Z trajectory points including pen down points, add the compensation value to the pressure value in the trajectory information of each of the Z trajectory points to obtain the updated pressure value, and replace it with the updated pressure value The pressure value in the trajectory information.
- 5 ⁇ Z ⁇ 15 and Z is an integer.
- Z 9.
- step S160 the pressure values corresponding to the consecutive Z trajectory points including the pen down point are compensated, and then the compensated pressure value is used to establish a trajectory unit and perform subsequent processing. Thereby, a stable and full pen-down can be formed to form a pen-point effect.
- the Z compensation values corresponding to the above Z trajectory points are sequentially decreased.
- the pressure sensitivity is equal to the constant 0.25, which also helps to obtain the pen sharp effect.
- the pressure values corresponding to the 9 consecutive track points including the pen down point are respectively added to the compensation value 0.3, 0.23, 0.2, 0.17, 0.15, 0.1, 0.08, 0.04, 0.01.
- the updated pressure value replace the pressure value in the trajectory information with the updated pressure value, and then perform subsequent operations such as establishing a trajectory unit based on the trajectory information.
- the trajectory units corresponding to the 9 trajectory points are sequentially reduced, and by filling the polygons between the trajectory units, a full pen down can be formed, which has a beautiful stroke effect.
- the specific value of the compensation value used for pen tip processing is not limited, and the compensation value in the above example is only exemplary and not restrictive, which can be based on actual needs. However, it is only necessary to sequentially reduce the multiple compensation values, which is not limited in the embodiments of the present disclosure.
- the number of trajectory points used for pen tip processing is also not limited, which can be determined according to actual needs, for example, depending on the pen tip effect that needs to be achieved.
- the handwriting forming method may further include the following operations:
- Step S170 Perform anti-aliasing processing on the edge lines of the filling pattern.
- a jagged or stepped appearance may appear on non-horizontal and non-vertical straight or polygonal boundaries, forming edge burrs.
- the post-reconstruction information distortion caused by insufficient sampling caused by such discrete sampling is called aliasing.
- anti-aliasing can be performed on the edge lines of the filling pattern to reduce or eliminate the edge burrs of the lines.
- the above step S170 may be performed simultaneously with the step S120 shown in FIG. 1 or after the step S120 to eliminate the burr at the boundary of the trajectory unit.
- the above-mentioned step S170 may be performed at the same time as the step S140 shown in FIG. 1 or after the step S140, so as to eliminate the burr at the boundary of the polygon between the trajectory units.
- the above step S170 may be executed before the handwriting is displayed by the display device, so as to completely eliminate edge burrs in the handwriting.
- the embodiment of the present disclosure does not limit this.
- step S170 may include the following operations:
- Step S171 Divide each display pixel passed by the edge line into two regions according to the diagonal line of the display pixel, and the sign of the slope of the diagonal line is the same as the sign of the slope of the edge line;
- Step S172 Determine the area where the edge line passes through the line segment of the display pixel
- Step S173 if the line segment is located in one of the two areas, display the display pixel where the line segment is located and the display pixels adjacent to the area where the line segment is located in the y direction;
- Step S174 If the line segment coincides with the diagonal line, display the display pixel where the line segment is located.
- FIG. 12A is a schematic display diagram of anti-aliasing processing provided by at least one embodiment of the present disclosure
- FIG. 12B is an enlarged view of area F in FIG. 12A. The above steps S171-S174 will be described below with reference to FIG. 12A and FIG. 12B.
- the line where the two coordinate points are located is the central axis and w is the line
- the line Lz with a slope of k shown in the figure needs to be subjected to anti-aliasing processing, and a plurality of squares arranged in an array in the figure represent display pixels arranged in an array.
- each display pixel passed by the edge line is divided into two regions according to the diagonal line of the display pixel, and the sign of the slope of the diagonal line is the same as the sign of the slope of the edge line.
- the display pixel D1 through which the line Lz passes is divided into two areas according to the diagonal line L1 of the display pixel D1, namely a first area Z1 and a second area Z2.
- the sign of the slope of the diagonal line L1 is the same as the sign of the slope k of the line Lz.
- the slope k of the line Lz is a negative number, so the slope of the diagonal line L1 is also a negative number.
- the display pixel D1 is a square with two diagonal lines perpendicular to each other, the slope of one diagonal line is a positive number, and the slope of the other diagonal line is a negative number.
- the sign of the slope of the diagonal line used is the same as the sign of the slope k of the line Lz.
- step S172 it is determined that the edge line passes through the area where the line segment of the display pixel is located.
- the line Lz passing through the line segment of the display pixel D1 is located in the second area Z2.
- step S173 if the line segment is located in one of the two areas, the display pixel where the line segment is located and the display pixels adjacent to the area where the line segment is located in the y direction are displayed.
- the line segment of the line Lz passing through the display pixel D1 is located in the second area Z2, so that the display pixel D1 and the display adjacent to the second area Z2 in the y direction are displayed
- the pixel D2 performs display.
- the line Lz passes through the display pixel D1 and does not pass through the display pixel D2
- both the display pixel D1 and the display pixel D2 are displayed.
- the display pixel D1 and the display pixels adjacent to the first area Z1 in the y direction need to be displayed.
- step S174 if the line segment coincides with the diagonal line, the display pixel where the line segment is located is displayed. At this time, only the display pixels passing by the line segment are displayed, and other display pixels adjacent to the display pixel in the y direction are not displayed. This situation is not shown in Figure 12B.
- the above steps S172-S174 may also be implemented in the following manner.
- the coordinate value of the center of the display pixel (that is, the center of the grid) is a floating-point value
- xi represents the x-axis coordinate of the center of the display pixel
- any point on the line segment where the line Lz passes through the display pixel D1 can be expressed as M( xi,kx+b)
- k represents the slope
- b represents the offset of the line Lz.
- the line Lz passing through the vertex of the area where the line segment of the display pixel D1 is located (in FIG. 12B, the point at the upper right corner of the display pixel D1) can be expressed as N(int(xi)+1,int(kx+b)+1).
- the distance d MN from N to the line Lz is equal to It is determined that the line segment Lz passing through the display pixel D1 coincides with the diagonal of the display pixel D1, so that the display pixel D1 is displayed, and other display pixels adjacent to the display pixel D1 in the y direction are not displayed. If the distance d MN from N to the line Lz is less than It is determined that the line segment where the line Lz passes through the display pixel D1 is located in the second area Z2, so that the display pixel D1 and the display pixel D2 adjacent to the second area Z2 in the y direction are displayed.
- the display pixel D2 is the display pixel where the coordinate point (xi, kx+b+1) is located.
- the display pixel is the display pixel where the coordinate point (xi, kx+b-1) is located.
- the side length of the display pixel is normalized to 1, the distance from the vertex of the display pixel to its diagonal is equal to From this, it is determined that the distance d MN from vertex N to line Lz and The relationship of is essentially consistent with the area where the line segment where the line Lz passes through the display pixel is judged.
- the slope k of the line Lz is a negative value, the point at the upper right corner of the display pixel is selected as the aforementioned vertex.
- the slope of the line is a positive value, the point at the upper left corner of the display pixel needs to be selected as the aforementioned vertex.
- FIG. 13 is a comparison diagram of the effects of anti-aliasing processing provided by at least one embodiment of the present disclosure. It can be seen from FIG. 13 that after anti-aliasing processing, the smoothness of the edge lines of the display pattern is greatly improved, the edge burr is significantly improved, and the aesthetics of the display pattern is improved.
- the transparency of the adjacent display pixel can be set to Achieve better treatment effect.
- the transparency of the adjacent display pixels can be calculated according to the following formula:
- Td represents transparency
- d MN represents the distance between the vertex of the region where the corresponding line segment is located and the line segment.
- 0 ⁇ Td ⁇ 1 means transparent to a certain extent and the degree of transparency decreases as the value increases.
- the closer the line segment is to the vertex the more opaque the adjacent display pixel is; the closer the line segment is to the diagonal of the display pixel, the more transparent the adjacent display pixel is.
- the product of the color value (or grayscale value) and the transparency is the final displayed color value (or grayscale value).
- the method of performing anti-aliasing processing is not limited to the method described above, and can also be any applicable anti-aliasing processing method, which can be determined according to actual needs. There is no restriction on this.
- a general anti-aliasing processing method can be used, or the anti-aliasing processing method described above can also be modified and adjusted, which is not limited in the embodiments of the present disclosure.
- the execution order of the steps of the handwriting forming method is not limited. Although the execution process of each step is described in a specific order above, this does not constitute a limitation to the embodiment of the present disclosure. .
- the steps in the handwriting forming method can be executed serially or in parallel, which can be determined according to actual requirements.
- the handwriting forming method may also include more or fewer steps, which is not limited in the embodiment of the present disclosure.
- FIG. 14 is an application flowchart of a handwriting forming method provided by at least one embodiment of the present disclosure.
- the application process of the handwriting forming method provided by the embodiment of the present disclosure will be exemplarily described below with reference to FIG. 14.
- the user writes on the working surface of a touch device (such as a touch screen) with a finger or a stylus.
- a touch device such as a touch screen
- the writing path is the Chinese character " ⁇ ”
- the touch device detects and obtains all sampling points and corresponding coordinates and pressures on the writing path. Value and flag bits.
- all sampling points are sparsely sampled, and smoothing (or interpolation processing) is performed to obtain multiple trajectory points and trajectory information.
- the trajectory information includes, for example, coordinates, pressure values, and flags.
- trajectory point-level processing is performed. Based on the trajectory information, a trajectory unit is established for each trajectory point, and the edge lines of the trajectory unit are processed for anti-aliasing.
- the connection mode between the trajectory units corresponding to the adjacent trajectory points is determined based on the trajectory information. After the connection mode is determined, the connection points of the trajectory units are calculated according to the connection mode, and the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points is filled. In addition, anti-aliasing processing is performed on the edge lines of the filled polygons.
- the displayed handwriting can be formed, for example, it can be displayed as a brush character "Jia".
- the corresponding brush writing can be formed by using the above methods, thereby providing the user with a new sensory experience and improving the user experience.
- the handwriting forming method can obtain beautiful handwriting with a brush, smooth handwriting, can embody a variety of strokes, small calculation amount, high processing efficiency, strong real-time performance, and simple and practical.
- FIG. 15 is a schematic diagram of a system that can be used to implement the handwriting forming method provided by the embodiments of the present disclosure.
- the system 10 may include a user terminal 11, a network 12, a server 13 and a database 14.
- the system 10 can be used to implement the handwriting forming method provided by any embodiment of the present disclosure.
- the user terminal 11 is, for example, a computer 11-1 or a mobile phone 11-2. It is understandable that the user terminal 11 may be any other type of electronic device capable of performing data processing and having a touch detection function, which may include, but is not limited to, a desktop computer, a notebook computer, a tablet computer, a smart phone, a smart home device, and Wearable equipment, vehicle electronic equipment, monitoring equipment, outdoor billboards, conference whiteboards, etc. The user terminal 11 may also be any equipment provided with electronic equipment, such as a vehicle, a robot, and the like.
- the user can operate the application program installed on the user terminal 11.
- the application program transmits user behavior data to the server 13 through the network 12, and the user terminal 11 can also receive data transmitted by the server 13 through the network 12.
- the user terminal 11 may implement the handwriting forming method provided by the embodiment of the present disclosure by running a program or thread.
- the user terminal 11 may use its built-in application to execute the handwriting forming method. In other examples, the user terminal 11 may execute the handwriting forming method by calling an application program stored externally of the user terminal 11. For example, the user can write on the work surface of the touch device of the user terminal 11 with a finger or a stylus, and the user terminal 11 executes the handwriting forming method provided by the embodiment of the present disclosure, thereby displaying the user's handwriting as a brush handwriting.
- the network 12 may be a single network, or a combination of at least two different networks.
- the network 12 may include, but is not limited to, one or a combination of several of a local area network, a wide area network, a public network, a private network, etc., for example, a wired network, a wireless network, or any combination thereof.
- the server 13 may be a single server or a server group, and each server in the group is connected through a wired or wireless network; the server 13 may also be a cloud server.
- a server group can be centralized, such as a data center, or distributed.
- the server 13 may be local or remote.
- the database 14 can generally refer to a device with a storage function.
- the database 14 is mainly used to store various data used, generated, and output by the user terminal 11 and the server 13 in their work.
- the database 14 may be local or remote.
- the database 14 may include various memories, such as random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), and so on.
- RAM Random Access Memory
- ROM Read Only Memory
- the storage devices mentioned above are just a few examples, and the storage devices that can be used by the system 10 are not limited thereto.
- the database 14 may be connected or communicated with the server 13 or a part thereof via the network 12, or directly connected or communicated with the server 13 or a combination of the above two methods.
- the database 14 may be a stand-alone device. In other examples, the database 14 may also be integrated in at least one of the user terminal 11 and the server 13. For example, the database 14 may be set on the user terminal 11 or on the server 13. For another example, the database 14 may also be distributed, a part of which is set on the user terminal 11 and the other part is set on the server 13.
- At least one embodiment of the present disclosure also provides a handwriting forming device, which can obtain beautiful brush writing handwriting, smooth handwriting, can embody a variety of strokes, small calculation amount, high processing efficiency, strong real-time performance, and simple and practical.
- FIG. 16 is a schematic block diagram of a handwriting forming apparatus provided by at least one embodiment of the present disclosure.
- the handwriting forming device 20 includes a sampling unit 21, a modeling unit 22, a connection mode determining unit 23 and a filling unit 24.
- the handwriting forming device 20 can be applied to application programs such as writing software, painting software, etc., and can also be applied to any equipment or system that needs to form handwriting with a brush, which is not limited in the embodiments of the present disclosure.
- the sampling unit 21 is configured to determine a set of trajectory points according to multiple sampling points on the writing path on the working surface of the touch device and obtain trajectory information of each trajectory point.
- the trajectory information includes coordinates, flags, and pressure values, and the flags include data indicating whether the corresponding trajectory point is a pen point.
- the sampling unit 21 may perform step S110 of the handwriting forming method shown in FIG. 1.
- the modeling unit 22 is configured to establish multiple raindrop-shaped trajectory units corresponding to multiple trajectory points one-to-one based on trajectory information.
- the modeling unit 22 may execute step S120 of the handwriting forming method shown in FIG. 1.
- the connection mode determining unit 23 is configured to determine the connection mode between the trajectory units corresponding to adjacent trajectory points based on the trajectory information.
- connection mode determining unit 23 may execute step S130 of the handwriting forming method shown in FIG. 1.
- the filling unit 24 is configured to calculate the connection points of the trajectory units according to the connection method, and fill the polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points to form the displayed handwriting.
- the filling unit 24 may execute step S140 of the handwriting forming method shown in FIG. 1.
- the sampling unit 21, the modeling unit 22, the connection mode determining unit 23, and the filling unit 24 may be hardware, software, firmware, and any feasible combination thereof.
- the sampling unit 21, the modeling unit 22, the connection mode determining unit 23, and the filling unit 24 may be dedicated or general-purpose circuits, chips or devices, etc., or may be a combination of a processor and a memory.
- the embodiments of the present disclosure do not limit this.
- the units of the handwriting forming device 20 correspond to the steps of the aforementioned handwriting forming method.
- the specific functions of the handwriting forming device 20 please refer to the relevant description about the handwriting forming method. No longer.
- the components and structures of the handwriting forming device 20 shown in FIG. 16 are only exemplary, and not restrictive.
- the handwriting forming device 20 may further include other components and structures as required.
- At least one embodiment of the present disclosure further provides an electronic device including a processor and a memory, one or more computer program modules are stored in the memory and configured to be executed by the processor, and one or more computers
- the program module includes instructions for implementing the handwriting forming method provided by any embodiment of the present disclosure.
- the electronic device can obtain beautiful handwriting with a brush, smooth handwriting, can embody a variety of strokes, small calculation amount, high processing efficiency, strong real-time performance, and simple and practical.
- FIG. 17 is a schematic block diagram of an electronic device provided by at least one embodiment of the present disclosure.
- the electronic device 30 includes a processor 31 and a memory 32.
- the memory 32 is used to store non-transitory computer readable instructions (for example, one or more computer program modules).
- the processor 31 is configured to run non-transitory computer-readable instructions, and when the non-transitory computer-readable instructions are executed by the processor 31, one or more steps in the handwriting forming method described above can be executed.
- the memory 32 and the processor 31 may be interconnected by a bus system and/or other forms of connection mechanisms (not shown).
- the electronic device 30 may use operating systems such as Windows and Android, and the handwriting forming method according to the embodiments of the present disclosure is implemented by an application program running in the operating system.
- the processor 31 may be a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), or other forms of processing units with data processing capabilities and/or program execution capabilities, such as field programmable Gate array (FPGA), etc.; for example, the central processing unit (CPU) can be an X86 or ARM architecture.
- the processor 31 may be a general-purpose processor or a special-purpose processor, and may control other components in the electronic device 30 to perform desired functions.
- the memory 32 may include any combination of one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
- Volatile memory may include random access memory (RAM) and/or cache memory (cache), for example.
- Non-volatile memory may include, for example, read only memory (ROM), hard disk, erasable programmable read only memory (EPROM), portable compact disk read only memory (CD-ROM), USB memory, flash memory, etc.
- One or more computer program modules may be stored on the computer-readable storage medium, and the processor 31 may run one or more computer program modules to implement various functions of the electronic device 30.
- the computer-readable storage medium may also store various application programs and various data, various data used and/or generated by the application programs, and the like.
- FIG. 18 is a schematic block diagram of another electronic device provided by at least one embodiment of the present disclosure.
- the electronic device 30 may further include a touch device 33 and a display device 34.
- the touch device 33 is configured to acquire the initial handwriting on the work surface of the touch device 33.
- the touch device 33 may be a touch screen or a touch pad.
- the touch screen may be a capacitive touch screen, such as a self-capacitive touch screen or a mutual-capacitive touch screen, or a resistive touch screen, a surface acoustic wave touch screen, an infrared touch screen, etc.; for example, the touch device 33 may include a touch sensor and a controller (for example, Driver IC).
- the controller receives the electrical signal collected by the touch sensor, processes the electrical signal to obtain the touch signal, and provides the touch signal to the processor 31 for further processing, so as to implement the handwriting forming method provided by the embodiment of the present disclosure.
- the embodiment of the present disclosure does not limit the type, structure, and communication mode of the touch device 33.
- the touch device 33 includes a working surface with a certain area. The user can write directly on the working surface of the touch device 33 with fingers, or write on the working surface of the touch device 33 with an active stylus or a passive stylus.
- the embodiment of the present disclosure does not limit this.
- the work surface refers to a surface for detecting a user's touch operation, such as the touch surface of the touch device 33.
- the type of the touch device 33 is not limited, and it can be not only a touch screen, but also any device with touch function such as an interactive whiteboard, which can be determined according to actual needs.
- the display device 34 is configured to display handwriting formed by a handwriting forming method.
- the handwriting forming method is the handwriting forming method provided by any embodiment of the present disclosure.
- the display device 34 is, for example, an LCD display screen, an OLED display screen, a QLED display screen, a projection component, a VR head-mounted display device (such as a VR helmet, VR glasses), an AR display device, etc., which are not limited in the embodiments of the present disclosure .
- the display device 34 can display the handwriting formed by the handwriting forming method provided by the embodiment of the present disclosure, for example, a brush handwriting.
- the touch device 33 and the display device 34 are two independent devices, the touch device 33 has a touch function but not a display function, and the display device 34 has a display function but not a touch function.
- the touch device 33 and the display device 34 are the same device, and the device has both a touch function and a display function.
- FIG. 19 is a schematic block diagram of still another electronic device provided by at least one embodiment of the present disclosure.
- the electronic device 40 is, for example, suitable for implementing the handwriting forming method provided by the embodiment of the present disclosure.
- the electronic device 40 may be a terminal device or the like. It should be noted that the electronic device 40 shown in FIG. 19 is only an example, which does not bring any limitation to the function and scope of use of the embodiments of the present disclosure.
- the electronic device 40 may include a processing device (such as a central processing unit, a graphics processor, etc.) 41, which may be loaded into a random access device according to a program stored in a read-only memory (ROM) 42 or from a storage device 48.
- the program in the memory (RAM) 43 executes various appropriate actions and processing.
- various programs and data required for the operation of the electronic device 40 are also stored.
- the processing device 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44.
- An input/output (I/O) interface 45 is also connected to the bus 44.
- the following devices can be connected to the I/O interface 45: including input devices 46 such as touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCD), speakers, vibration An output device 47 such as a device; a storage device 48 such as a magnetic tape, a hard disk, etc.; and a communication device 49.
- the communication device 49 may allow the electronic device 40 to perform wireless or wired communication with other electronic devices to exchange data.
- FIG. 19 shows an electronic device 40 having various devices, it should be understood that it is not required to implement or have all the illustrated devices, and the electronic device 40 may alternatively implement or have more or fewer devices.
- the above-mentioned handwriting forming method may be implemented as a computer software program.
- an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program code for executing the above-mentioned handwriting forming method.
- the computer program may be downloaded and installed from the network through the communication device 49, or installed from the storage device 48, or installed from the ROM 42.
- the computer program is executed by the processing device 41, it can execute the functions defined in the handwriting forming method provided by the embodiment of the present disclosure.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
Description
Claims (28)
- 一种笔迹形成方法,包括:根据在触摸装置的工作表面上的书写路径上的多个采样点确定一组轨迹点并得到每个轨迹点的轨迹信息,其中,所述轨迹信息包括坐标、标志位和压力值,所述标志位包括指示对应的轨迹点是否为落笔点的数据;基于所述轨迹信息建立与所述多个轨迹点一一对应的多个雨滴状的轨迹单元;基于所述轨迹信息确定相邻的轨迹点对应的轨迹单元之间的连线方式;根据所述连线方式计算所述轨迹单元的连接点,并对相邻的轨迹点对应的轨迹单元的连接点所形成的多边形进行填充,以用于形成显示的笔迹。
- 根据权利要求1所述的方法,其中,基于所述轨迹信息建立与所述多个轨迹点一一对应的多个雨滴状的轨迹单元包括:确定第一圆的第一圆心坐标和第一半径;确定第二圆的第二圆心坐标和第二半径;填充所述第一圆和所述第二圆,并对所述第一圆和所述第二圆的公切点形成的多边形进行填充。
- 根据权利要求2所述的方法,其中,所述第一圆心坐标为对应的轨迹点的坐标,所述第一半径为压感量与多个书写参数预设值的乘积,所述压感量基于对应的轨迹点的压力值得到,所述第一半径大于所述第二半径。
- 根据权利要求2-4任一所述的方法,其中,所述第二圆心坐标根据所述第一圆心坐标、圆心距离和圆心连线角度得到,所述圆心距离为笔刷长度与对应的轨迹点的压力值的乘积的Q倍,2≤Q≤7,所述圆心连线角度为所述第一圆的圆心与所述第二圆的圆心的连线与所述第一圆心坐标所在坐标系的x轴方向的夹角,所述圆心连线角度为15~60度。
- 根据权利要求5所述的方法,其中,4.5≤Q≤5.5,所述圆心连线角度为25~35度。
- 根据权利要求2-6任一所述的方法,其中,所述第二半径根据如下公式计算得到:R2=0.5*R1*t,其中,R1表示所述第一半径,R2表示所述第二半径,t表示墨水浓度,t=max(0.8*T/n,0.6),T为常量,n为所述轨迹点的序号。
- 根据权利要求8所述的方法,其中,所述连线方式包括第一连线方式、第二连线方式、第三连线方式和第四连线方式,根据所述斜率、所述当前轨迹点的坐标和所述前一个轨迹点的坐标,确定所述当前轨迹点对应的轨迹单元采用的连线方式,包括:若|k|≤0.6或者|x2-x1|<1,则确定所述当前轨迹点对应的轨迹单元采用所述第一连线方式;若-0.9<k<-0.6且x2>x1,则确定所述当前轨迹点对应的轨迹单元采用所述第二连线方式;若0.6<k<1且y2<y1,则确定所述当前轨迹点对应的轨迹单元采用所述第三连线方式;否则,确定所述当前轨迹点对应的轨迹单元采用所述第四连线方式。
- 根据权利要求9所述的方法,其中,根据所述连线方式计算所述轨迹单元的连接点,并对相邻的轨迹点对应的轨迹单元的连接点所形成的多边形进行填充,以用于形成显示的笔迹,包括:对于除了所述落笔点以外的轨迹点,根据确定的所述第一连线方式、所述第二连线方式、所述第三连线方式和所述第四连线方式其中之一,计算所述轨迹单元的连接点;对相邻的轨迹点对应的轨迹单元的连接点所形成的所述多边形进行填充。
- 根据权利要求10所述的方法,其中,根据所述连线方式计算所述轨迹单元的连接点,并对相邻的轨迹点对应的轨迹单元的连接点所形成的多边形进行填充,以用于形成显示的笔迹,还包括:对于作为所述落笔点的轨迹点,根据与所述落笔点相邻的轨迹点对应的轨迹单元的连线方式确定所述落笔点对应的轨迹单元的连接点。
- 根据权利要求15所述的方法,其中,对于作为所述落笔点的轨迹点,根据与所述落笔点相邻的轨迹点对应的轨迹单元的连线方式确定所述落笔点对应的轨迹单元的连接点,包括:若与所述落笔点相邻的轨迹点对应的轨迹单元的连线方式为所述第一连线方式、所述第二连线方式或所述第三连线方式,则采用与所述落笔点相邻的轨迹点对应的轨迹单元的连线方式确定所述落笔点对应的轨迹单元的连接点;若与所述落笔点相邻的轨迹点对应的轨迹单元的连线方式为所述第四连线方式,则根据如下公式计算所述落笔点对应的轨迹单元的第一连接点m5和第二连接点n5:其中,(m.x,m.y)表示所述第一连接点m5的坐标,(n.x,n.y)表示所述第二连接点n5的坐标,(c1.x,c1.y)表示所述第一圆心坐标,(c2.x,c2.y)表示所述第二圆心坐标,R1表示所述第一半径,R2表示所述第二半径,θ表示圆心连线角度,所述第一连接点m5的坐标、所述第二连接点n5的坐标、所述第一圆心坐标和所述第二圆心坐标位于所述触摸装置的工作表面上的同一坐标系中。
- 根据权利要求10-16任一所述的方法,其中,根据所述连线方式计算所述轨迹单元的连接点,并对相邻的轨迹点对应的轨迹单元的连接点所形成的多边形进行填充,以用于形成显示的笔迹,还包括:在对相邻的轨迹点对应的轨迹单元的连接点所形成的所述多边形进行填充之前,判断所述当前轨迹点对应的轨迹单元的连线方式与所述前一个轨迹点对应的轨迹单元的连线方式是否不同;若不同,则采用所述当前轨迹点对应的轨迹单元的连线方式计算所述前一个轨迹点对应的轨迹单元的连接点以作为所述前一个轨迹点对应的轨迹单元的重复连接点;其中,在对相邻的轨迹点对应的轨迹单元的连接点所形成的所述多边形进行填充时,所述前一个轨迹点与所述当前轨迹点对应的轨迹单元之间的多边形基于所述重复连接点形成。
- 根据权利要求1-17任一所述的方法,其中,在建立所述多个雨滴状的轨迹单元之前,所述方法还包括:选取包含所述落笔点在内的连续的Z个轨迹点,将所述Z个轨迹点中每个的轨迹信息中的压力值分别加上补偿值以得到更新的压力值,并用所述更新的压力值替换所述轨迹信息中的压力值;其中,5≤Z≤15且Z为整数。
- 根据权利要求18所述的方法,其中,与所述Z个轨迹点对应的Z个补偿值依次 减小。
- 根据权利要求1-19任一所述的方法,还包括:对填充图案的边缘线条进行反走样处理。
- 根据权利要求20所述的方法,其中,对所述填充图案的边缘线条进行所述反走样处理包括:将所述边缘线条经过的每个显示像素按照所述显示像素的对角线划分为两个区域,其中,所述对角线的斜率的正负符号与所述边缘线条的斜率的正负符号相同;判断所述边缘线条经过所述显示像素的线段所在的区域;若所述线段位于所述两个区域其中之一,则使所述线段所在的显示像素以及在y方向上与所述线段所在的区域相邻的显示像素进行显示;若所述线段与所述对角线重合,则使所述线段所在的显示像素进行显示。
- 根据权利要求1-22任一所述的方法,其中,根据在所述触摸装置的工作表面上的书写路径上的多个采样点确定一组轨迹点并得到每个轨迹点的轨迹信息包括:选择所述书写路径上全部采样点中的一部分采样点;基于所述一部分采样点得到所述多个轨迹点,并得到所述多个轨迹点的轨迹信息。
- 根据权利要求23所述的方法,其中,所述一部分采样点与所述全部采样点的数量之比为1%~5%。
- 一种笔迹形成装置,包括:采样单元,配置为根据在触摸装置的工作表面上的书写路径上的多个采样点确定一组轨迹点并得到每个轨迹点的轨迹信息,其中,所述轨迹信息包括坐标、标志位和压力值,所述标志位包括指示对应的轨迹点是否为落笔点的数据;建模单元,配置为基于所述轨迹信息建立与所述多个轨迹点一一对应的多个雨滴状的轨迹单元;连线方式确定单元,配置为基于所述轨迹信息确定相邻的轨迹点对应的轨迹单元之间的连线方式;填充单元,配置为根据所述连线方式计算所述轨迹单元的连接点,并对相邻的轨迹点对应的轨迹单元的连接点所形成的多边形进行填充,以用于形成显示的笔迹。
- 一种电子设备,包括:处理器;存储器,包括一个或多个计算机程序模块;其中,所述一个或多个计算机程序模块被存储在所述存储器中并被配置为由所述处理器执行,所述一个或多个计算机程序模块包括用于实现权利要求1-24任一所述的笔迹形成方法的指令。
- 根据权利要求26所述的电子设备,还包括所述触摸装置,其中,所述触摸装置配置为获取所述触摸装置的工作表面上的初始笔迹。
- 根据权利要求26或27所述的电子设备,还包括显示装置,其中,所述显示装置配置为显示经所述笔迹形成方法形成的笔迹。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/626,683 US11809701B2 (en) | 2020-04-30 | 2021-03-12 | Handwriting forming method and apparatus, and electronic device |
US18/474,773 US20240020893A1 (en) | 2020-04-30 | 2023-09-26 | Handwriting Forming Method and Apparatus, and Electronic Device |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010367901.X | 2020-04-30 | ||
CN202010367901.XA CN113590002B (zh) | 2020-04-30 | 2020-04-30 | 笔迹形成方法、笔迹形成装置及电子设备 |
Related Child Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US17/626,683 A-371-Of-International US11809701B2 (en) | 2020-04-30 | 2021-03-12 | Handwriting forming method and apparatus, and electronic device |
US18/474,773 Continuation-In-Part US20240020893A1 (en) | 2020-04-30 | 2023-09-26 | Handwriting Forming Method and Apparatus, and Electronic Device |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021218448A1 true WO2021218448A1 (zh) | 2021-11-04 |
Family
ID=78237716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/080511 WO2021218448A1 (zh) | 2020-04-30 | 2021-03-12 | 笔迹形成方法、笔迹形成装置及电子设备 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11809701B2 (zh) |
CN (1) | CN113590002B (zh) |
WO (1) | WO2021218448A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115098014B (zh) * | 2021-12-29 | 2024-05-14 | 山东蓝贝思特教装集团股份有限公司 | 书写笔迹显示方法、控制器及tft液晶书写装置 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101373539A (zh) * | 2008-10-07 | 2009-02-25 | 广东威创视讯科技股份有限公司 | 毛笔笔迹的书写方法及书写装置 |
US20130308863A1 (en) * | 2011-01-31 | 2013-11-21 | Xueping Zou | Method and device for implementing original handwriting, and electronic device |
CN103823628A (zh) * | 2013-12-15 | 2014-05-28 | 北京工业大学 | 结合笔压的毛笔字笔锋模拟方法 |
CN107219941A (zh) * | 2017-05-23 | 2017-09-29 | 中国科学院自动化研究所 | 软笔实时轨迹生成方法、存储介质、处理设备 |
CN109671133A (zh) * | 2018-12-12 | 2019-04-23 | 成都四方伟业软件股份有限公司 | 轨迹的生成方法、装置、电子设备及存储介质 |
CN110515527A (zh) * | 2019-07-12 | 2019-11-29 | 沈阳美行科技有限公司 | 一种书写笔迹显示方法、装置及相关系统 |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7227993B2 (en) * | 2003-01-27 | 2007-06-05 | Microsoft Corporation | Learning-based system and process for synthesizing cursive handwriting |
CA2717609C (en) * | 2008-03-20 | 2016-11-29 | Basf Se | Polymer dispersions containing phosphorous polymers and emulsifiers |
CN102937850B (zh) * | 2012-12-04 | 2015-07-22 | 上海合合信息科技发展有限公司 | 实时手写笔迹的美化方法及美化装置 |
CN110531875B (zh) * | 2019-08-21 | 2023-12-12 | 华诺科技武汉有限公司 | 书写笔锋的生成方法、终端设备及存储介质 |
-
2020
- 2020-04-30 CN CN202010367901.XA patent/CN113590002B/zh active Active
-
2021
- 2021-03-12 WO PCT/CN2021/080511 patent/WO2021218448A1/zh active Application Filing
- 2021-03-12 US US17/626,683 patent/US11809701B2/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101373539A (zh) * | 2008-10-07 | 2009-02-25 | 广东威创视讯科技股份有限公司 | 毛笔笔迹的书写方法及书写装置 |
US20130308863A1 (en) * | 2011-01-31 | 2013-11-21 | Xueping Zou | Method and device for implementing original handwriting, and electronic device |
CN103823628A (zh) * | 2013-12-15 | 2014-05-28 | 北京工业大学 | 结合笔压的毛笔字笔锋模拟方法 |
CN107219941A (zh) * | 2017-05-23 | 2017-09-29 | 中国科学院自动化研究所 | 软笔实时轨迹生成方法、存储介质、处理设备 |
CN109671133A (zh) * | 2018-12-12 | 2019-04-23 | 成都四方伟业软件股份有限公司 | 轨迹的生成方法、装置、电子设备及存储介质 |
CN110515527A (zh) * | 2019-07-12 | 2019-11-29 | 沈阳美行科技有限公司 | 一种书写笔迹显示方法、装置及相关系统 |
Also Published As
Publication number | Publication date |
---|---|
US20220261146A1 (en) | 2022-08-18 |
CN113590002B (zh) | 2024-04-16 |
US11809701B2 (en) | 2023-11-07 |
CN113590002A (zh) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11687233B2 (en) | Handwriting processing method, touch display device, computer device and storage medium | |
US9020266B2 (en) | Methods and devices for processing handwriting input | |
US8860675B2 (en) | Drawing aid system for multi-touch devices | |
US8854342B2 (en) | Systems and methods for particle-based digital airbrushing | |
JP2017529623A (ja) | ウェットインク予測器 | |
CN102939575A (zh) | 墨水呈现 | |
US10438385B2 (en) | Generating ink effects for a digital ink stroke | |
CN104345948A (zh) | 一种手写原笔迹的实现方法、实现装置及电子设备 | |
KR102188543B1 (ko) | 그래픽 처리 장치 | |
WO2021218445A1 (zh) | 笔迹处理方法、笔迹处理装置、存储介质 | |
CN106155540B (zh) | 电子毛笔笔形处理方法和装置 | |
WO2018103227A1 (zh) | 对称图形的绘制方法和装置 | |
WO2022242379A1 (zh) | 笔画渲染方法、装置、存储介质以及终端 | |
US9955065B2 (en) | Dynamic motion path blur user interface | |
US11789604B2 (en) | Handwriting processing method, handwriting processing device and non-transitory storage medium | |
KR20160046574A (ko) | 그래픽 프로세싱 유닛, 이를 포함하는 그래픽 프로세싱 시스템, 및 이를 이용한 안티 에일리어싱 방법 | |
WO2021218448A1 (zh) | 笔迹形成方法、笔迹形成装置及电子设备 | |
CN103310409A (zh) | 一种Tile-based渲染架构GPU的三角形快速分块方法 | |
CN115237320A (zh) | 笔迹显示方法、触控显示设备、计算机设备及介质 | |
US20240020893A1 (en) | Handwriting Forming Method and Apparatus, and Electronic Device | |
US11551391B2 (en) | Digital image dynamic shadow generation | |
US11232608B1 (en) | Polybezier-based digital ink strokes | |
CN113487704B (zh) | 一种燕尾箭头标的绘制方法、装置、存储介质及终端设备 | |
CN114585992B (zh) | 书写轨迹处理方法、触控设备、书写系统及存储介质 | |
WO2022242013A1 (zh) | 笔迹擦除方法、装置、交互平板及存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21795422 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21795422 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 23.06.2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21795422 Country of ref document: EP Kind code of ref document: A1 |