WO2021218445A1 - 笔迹处理方法、笔迹处理装置、存储介质 - Google Patents
笔迹处理方法、笔迹处理装置、存储介质 Download PDFInfo
- Publication number
- WO2021218445A1 WO2021218445A1 PCT/CN2021/080463 CN2021080463W WO2021218445A1 WO 2021218445 A1 WO2021218445 A1 WO 2021218445A1 CN 2021080463 W CN2021080463 W CN 2021080463W WO 2021218445 A1 WO2021218445 A1 WO 2021218445A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- trajectory
- circle
- points
- unit
- track
- Prior art date
Links
- 238000012545 processing Methods 0.000 title claims abstract description 58
- 238000003672 processing method Methods 0.000 title claims abstract description 57
- 238000005070 sampling Methods 0.000 claims abstract description 189
- 230000004044 response Effects 0.000 claims description 33
- 230000009471 action Effects 0.000 claims description 19
- 238000004364 calculation method Methods 0.000 claims description 5
- 230000001052 transient effect Effects 0.000 abstract 1
- 230000000875 corresponding effect Effects 0.000 description 213
- 238000010586 diagram Methods 0.000 description 36
- 238000004422 calculation algorithm Methods 0.000 description 26
- 230000000694 effects Effects 0.000 description 15
- 238000000034 method Methods 0.000 description 15
- 238000004891 communication Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 9
- 230000006870 function Effects 0.000 description 7
- 230000002452 interceptive effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 239000007787 solid Substances 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000013461 design Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 241000699666 Mus <mouse, genus> Species 0.000 description 1
- 241000699670 Mus sp. Species 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000002596 correlated effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 239000004984 smart glass Substances 0.000 description 1
- 239000000758 substrate Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 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
- 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 processing method, a handwriting processing device, and a non-transitory storage medium.
- An embodiment of the present disclosure provides a handwriting processing method, including: sampling the original handwriting trace on the touch display screen to obtain multiple sampling points; and calculating at least one trace point group based on the multiple sampling points, Wherein, each track point group in the at least one track point group includes N track points, the N track points include M sampling points, N is an integer greater than or equal to 3, and M is an integer greater than or equal to 3. M ⁇ N; based on the writing speed of at least part of the track points in the at least one track point group, determine multiple track units corresponding to all track points in the at least one track point group one-to-one, wherein the Each track unit of the multiple track units is a drop-shaped drop unit; the multiple track units are sequentially connected to obtain handwriting for display on the touch screen.
- each of the multiple trajectory drop units includes at least a polygon, a first circle, and a second circle, and the four vertices of the polygon are the The four external common tangent points between the first circle and the second circle are determined to be related to all the trajectories in the at least one trajectory point group based on the writing speed of at least part of the trajectory points in the at least one trajectory point group
- the multiple trajectory units corresponding to one-to-one points include: determining that the action type in all the trajectory points is the trajectory point of the pen, so as to obtain T1 pen trajectory points, where T1 is less than or equal to the number of all the trajectory points A positive integer of, the plurality of trajectory units include T1 pen trajectory units corresponding to the T1 pen trajectory points one-to-one; obtain the first average reference speed; for the p-th pen in the T1 pen trajectory points Trajectory points, according to the first reference average speed and the writing speed and position corresponding to the p-
- dt is the diameter of the first circle in the p-th pen trajectory unit
- dt-1 is the first circle of the previous trajectory unit adjacent in time to the p-th pen trajectory unit
- Kt is the radius adjustment coefficient corresponding to the p-th pen trajectory point
- vt is the writing speed corresponding to the p-th pen trajectory point
- vavg is the first average reference speed
- ds is the set line width
- the positional relationship of the center of the circle represents: the center line of the center of the first circle and the center of the second circle rotates a preset center angle in a counterclockwise direction to a corresponding direction, and the center of the first circle and the center of the second circle
- the center of the second circle satisfies the following relationship:
- R is the radius of the first circle, do is the distance between the center of the first circle and the center of the second circle, and C1 is a constant;
- the radius relationship indicates that the radius of the first circle is greater than the radius of the second circle, and the radius of the first circle and the radius of the second circle satisfy the following relationship:
- r is the radius of the second circle
- C2 is a constant.
- each of the multiple trajectory units includes at least a polygon, a first circle, and a second circle, and the four vertices of the polygon are the first circle.
- the four external common tangent points between a circle and the second circle are determined to be related to all the track points in the at least one track point group based on the writing speed of at least part of the track points in the at least one track point group
- One-to-one corresponding multiple trajectory units including: determining that the action type in all the trajectory points is the trajectory point of the ending pen, so as to obtain T2 ending trajectory points, where T2 is less than or equal to all the trajectory points
- the plurality of trajectory units include T2 pen-returning trajectory units corresponding to the T2 pen-returning trajectory points one-to-one; to obtain a second average reference speed, wherein the second average reference speed is less than the first An average reference speed, the first average reference speed is the reference speed corresponding to the pen movement stage
- dy is the diameter of the first circle in the i-th pen-in trajectory unit
- dy-1 is the first circle of the previous trajectory unit adjacent in time to the i-th pen-in trajectory unit
- Ki' is the radius adjustment coefficient corresponding to the i-th pen-in trajectory unit
- vi is the writing speed corresponding to the i-th pen-in trajectory point
- vavg' is the second average reference speed
- the positional relationship of the center of the circle represents: the center line of the center of the first circle and the center of the second circle rotates a preset center angle in a counterclockwise direction to a corresponding direction, and the center of the first circle and the center of the second circle
- the center of the second circle satisfies the following relationship:
- R is the adjusted radius of the first circle, do is the distance between the center of the first circle and the center of the second circle, and C1 is a constant;
- the radius relationship indicates that the radius of the first circle is greater than the radius of the second circle, and the radius of the first circle and the radius of the second circle satisfy the following relationship:
- r is the radius of the second circle
- C2 is a constant.
- each of the multiple trajectory units includes at least a polygon, a first circle, and a second circle, and the four vertices of the polygon are the first circle.
- the four external common tangent points between a circle and the second circle, and determining a plurality of trajectory units corresponding to all trajectory points in the at least one trajectory point group one-to-one includes: determining the The action type is the stroke point of the stroke to obtain T3 stroke points of the stroke, wherein T3 is a positive integer less than or equal to the number of all the trace points, and the plurality of trajectory units includes one-to-one with the T3 stroke points Corresponding T3 pen-start trajectory units; set the diameter of the first circle of the T3 pen-start trajectory units as the set line width; for the z-th pen-start trajectory point in the T3 pen-start trajectory points, according to the The position corresponding to z pen-start trajectory points determines the center of the first circle in the z-th pen
- R is the radius of the first circle, do is the distance between the center of the first circle and the center of the second circle, and C1 is a constant;
- the radius relationship indicates that the radius of the first circle is greater than the radius of the second circle, and the radius of the first circle and the radius of the second circle satisfy the following relationship:
- r is the radius of the second circle
- C2 is a constant.
- connecting the multiple trajectory units in sequence to obtain the handwriting for display on the touch screen includes: based on the at least one trajectory All the track points in the point group correspond to the positions on the original handwriting track, and the multiple track units are sorted; for any adjacent first track unit and the first track unit among the sorted multiple track units
- a second trajectory unit in response to that neither the first circle and the second circle of the first trajectory unit and any two of the first circle and the second circle of the second trajectory unit are in an implicit relationship, determine the The two first common tangent points and the two second common tangent points between the first circle of the first trajectory unit and the first circle of the second trajectory unit determine the sum of the second circle of the first trajectory unit
- the two third common tangent points and the two fourth common tangent points between the second circles of the second trajectory unit wherein the two first common tangent points are located at the first common tangent point of the first trajectory unit On the circle, the two second common tangent points are located on the first circle
- the handwriting processing method provided by an embodiment of the present disclosure further includes: responding to at least two of the first circle and the second circle of the first trajectory unit and the first circle and the second circle of the second trajectory unit If each circle is an inclusive relationship, it is determined that the first track unit and the second track unit do not need to be connected.
- the selection of four target common tangent points from the fourth common tangent point includes: determining the first outer common tangent line and the second outer common tangent line between the first circle and the second circle of the first trajectory unit, wherein the first trajectory unit The slope of a common tangent is smaller than the slope of the second common tangent; determining the third common tangent and the fourth common tangent between the second circle of the first trajectory unit and the second circle of the second trajectory unit; In response to the slope of the third common tangent line being greater than the slope of the fourth common tangent line, and the slope of the third common tangent line is greater than the slope of the first common tangent line and smaller than the first circle of the first trajectory unit The slope of the line connecting the center of the circle between the center of the circle and the center of the second circle, or, in response
- connecting the multiple trajectory units in sequence to obtain the handwriting for display on the touch display screen includes: The k-th track point group in the point group, wherein the N track points in the k-th track point group are arranged in sequence in the extension direction of the original handwriting track, and k is a positive integer and is less than or equal to the at least The number of a track point group; determine the first track point and the Nth track point in the k-th track point group in the extension direction of the original handwriting track; obtain the first track point of the first track point A coordinate and the second coordinate of the Nth track point; according to the first coordinate and the second coordinate, the direction of the track segment corresponding to the kth track point group is determined, and the direction of the track segment corresponding to the kth track point group is determined according to the The direction of the trajectory segment corresponding to the k-th trajectory point group is determined, and the first circle on the first circle of each trajectory unit in the N trajectory units corresponding to
- the direction of the trajectory segment corresponding to the trajectory point group is the horizontal direction, and in response to the first coordinate difference being 0 and the second coordinate difference being not 0, the trajectory corresponding to the k-th trajectory point group is determined
- the handwriting processing method according to the direction of the trajectory segment corresponding to the k-th trajectory point group, determine which of the N trajectory points in the k-th trajectory point group corresponds to
- the range of C1 is 1.2-2
- the range of C2 is 0.2-0.4
- the range of the preset circle center angle is 20°-40°
- the abscissa of the center of the first circle is greater than the abscissa of the center of the second circle
- the ordinate of the center of the first circle The ordinate greater than the center of the second circle.
- the handwriting processing method based on the writing speed of at least part of the track points in the at least one track point group, it is determined to be one-to-one with all the track points in the at least one track point group.
- the corresponding multiple trajectory units include: based on the writing speed of at least part of the trajectory points in the at least one trajectory point group, determining multiple intermediate trajectory units corresponding to all the trajectory points in the at least one trajectory point group one-to-one , Performing transparency processing on the plurality of intermediate track units to obtain the plurality of track units.
- performing transparency processing on the plurality of intermediate trajectory units to obtain the multiple trajectory units includes: according to the plurality of intermediate trajectory units, obtaining and A plurality of intermediate transparency track units corresponding to the plurality of intermediate track units one-to-one, wherein the shape and size of each transparency track unit are the same as the shape and size of the intermediate track unit corresponding to each transparency track unit;
- For the h-th intermediate transparency trajectory unit among the plurality of intermediate transparency trajectory units a plurality of edge transparency pixels are obtained at the edge of the h-th intermediate transparency trajectory unit, from the center of the h-th intermediate transparency trajectory unit In the direction extending outward, the transparency of the plurality of edge transparency pixels is gradually changed from 100% to 0% to obtain the transparency track unit corresponding to the h-th intermediate transparency track unit, thereby obtaining the transparency track unit corresponding to the plurality of edge transparency pixels.
- the intermediate transparency track units correspond to a plurality of transparency track units one-to-one, where h is a positive integer greater than or equal to 1 and less than or equal to the number of the plurality of intermediate transparency track units, and at least part of the edges of the plurality of edge transparency pixels
- the transparency pixel is located in the corresponding h-th intermediate transparency track unit, and the transparency of all pixels in the h-th intermediate transparency track unit except the plurality of edge transparency pixels is 100%;
- the middle track unit and the multiple transparency track units are superimposed respectively to obtain the multiple track units.
- calculating at least one trajectory point group based on the multiple sampling points includes: dividing the original handwriting trajectory into at least one group based on the multiple sampling points A trajectory segment, wherein each trajectory segment includes M sampling points; interpolation processing is performed on each trajectory segment in the at least one trajectory segment to obtain a trajectory point group corresponding to each trajectory segment, thereby obtaining the at least A track point group.
- performing interpolation processing on each trajectory segment in the at least one trajectory segment to obtain a group of trajectory points corresponding to each trajectory segment includes: Segment, according to the M sampling points corresponding to the trajectory segment, the Bezier curve corresponding to the trajectory segment is fitted by fitting, and points are taken on the Bezier curve to obtain the trajectory point corresponding to the trajectory segment Group.
- the tip type of the handwriting is a brush tip.
- An embodiment of the present disclosure further provides a handwriting processing device, including: a memory for non-transitory storage of computer-readable instructions; and a processor for running the computer-readable instructions, wherein the computer-readable instructions When run by the processor, the handwriting processing method according to any one of the above embodiments is executed.
- the handwriting processing apparatus further includes a touch display screen configured to obtain the original handwriting trajectory based on a user's touch operation.
- the touch display screen is further configured to display the handwriting.
- An embodiment of the present disclosure also provides a non-transitory storage medium that non-transitory stores computer-readable instructions, wherein when the computer-readable instructions are executed by a computer, the handwriting according to any of the above-mentioned embodiments can be executed.
- Approach a non-transitory storage medium that non-transitory stores computer-readable instructions, wherein when the computer-readable instructions are executed by a computer, the handwriting according to any of the above-mentioned embodiments can be executed.
- FIG. 1 is a schematic flowchart of a handwriting processing method provided by an embodiment of the present disclosure
- FIG. 2A is a schematic diagram of a track point group provided by some embodiments of the present disclosure.
- FIG. 2B is a schematic diagram of another track point group provided by some embodiments of the present disclosure.
- FIG. 3A is a schematic diagram of a trajectory unit provided by an embodiment of the present disclosure.
- 3B is a schematic diagram of the relationship between the writing speed of a track point and the diameter of the first circle of the track unit corresponding to the track point according to an embodiment of the present disclosure
- FIG. 4 is a schematic diagram of a handwriting used for display according to an embodiment of the present disclosure.
- FIG. 5A is a schematic diagram of a first trajectory unit and a second trajectory unit provided by an embodiment of the present disclosure
- FIG. 5B is a schematic diagram of another first track unit and a second track unit provided by an embodiment of the present disclosure
- FIG. 6A is a schematic diagram of still another first track unit and a second track unit provided by an embodiment of the present disclosure
- FIG. 6B is a schematic diagram of still another first track unit and second track unit provided by an embodiment of the present disclosure.
- FIG. 7 is a schematic diagram of still another first track unit and a second track unit provided by an embodiment of the present disclosure.
- FIG. 8A is a schematic diagram of a trajectory unit without transparency provided by an embodiment of the present disclosure.
- FIG. 8B is a schematic diagram of a trajectory unit with transparency provided by an embodiment of the present disclosure.
- FIG. 9 is a schematic diagram of a process of simulating the tip of a pencil provided by some embodiments of the present disclosure.
- FIG. 10 is an effect diagram of simulating the tip of a pencil provided by some embodiments of the present disclosure.
- FIG. 11 is a schematic block diagram of a handwriting processing device provided by at least one embodiment of the present disclosure.
- FIG. 12 is a schematic diagram of a storage medium provided by at least one embodiment of the present disclosure.
- FIG. 13 shows a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
- the automatic handwriting beautification technology can eliminate the jagged or stepped appearance of the handwriting, and at the same time has the pen-point effect, providing users with a smoother, rounder, smooth, and natural writing experience.
- An embodiment of the present disclosure provides a handwriting processing method, a handwriting processing device, and a computer storage medium.
- the handwriting processing method includes: sampling the original handwriting track on the touch display screen to obtain multiple sampling points; Sampling points, at least one trajectory point group is calculated, wherein each trajectory point group in the at least one trajectory point group includes N trajectory points, N trajectory points include M sampling points, N is an integer greater than or equal to 3, M Is an integer greater than or equal to 3, M ⁇ N; based on the writing speed of at least part of the track points in the at least one track point group, determine the multiple track units corresponding to all the track points in the at least one track point group one-to-one, where , Each track unit of the multiple track units is a drop-shaped water drop unit; the multiple track units are sequentially connected to obtain handwriting for display on the touch screen.
- the pressure-free writing track when a user writes on an electronic device with a hand or a pen, can also be beautified to have the display effect of the brush tip, so that the electronic device The smooth and beautified writing trajectory is displayed on the top, and the effect of handwriting beautification can be realized in real time and effectively without pressure sensitivity.
- the handwriting processing method has fast calculation speed, simple implementation principle, and good real-time performance, so that the handwriting processing method can be applied to electronic interactive whiteboards (for example, conference whiteboards, teaching whiteboards, etc.), electronic board newspapers, airport digital signature walls, cloud books Wait for scenes that require writing input.
- FIG. 1 is a schematic flowchart of a handwriting processing method provided by an embodiment of the present disclosure.
- the handwriting processing method provided by an embodiment of the present disclosure is suitable for a touch display screen with a touch display function, and may include the following steps S10-S13:
- Step S10 sampling the original handwriting trajectory on the touch display screen to obtain multiple sampling points
- Step S11 calculating at least one track point group based on multiple sampling points
- Step S12 Based on the writing speed of at least part of the track points in the at least one track point group, determine multiple track units corresponding to all the track points in the at least one track point group one-to-one;
- Step S13 Connect multiple track units in sequence to obtain handwriting for display on the touch screen.
- the handwriting processing method provided by the embodiments of the present disclosure can determine the trajectory unit corresponding to the trajectory point based on the speed of the stroke of the trajectory point, thereby realizing the writing effect of simulating the tip of a brush.
- the handwriting processing methods provided by these embodiments of the present disclosure can provide an interesting interactive way for airport display screens. As a landmark building of a city, the airport is an important way to attract tourists.
- the handwriting processing method provided by the present disclosure can be integrated on the display screen of an airport. When a tourist arrives at an airport in a certain city, a signature can be written on the display screen and displayed on the display screen in the form of beautified handwriting.
- the handwriting processing methods provided by these embodiments of the present disclosure can provide a new type of board newspaper method for smart classrooms.
- the handwriting processing method can beautify the writing on the blackboard and the board newspaper fonts of students or teachers, and give a clearer picture.
- the handwriting processing method can also design more handwriting styles, for example, pencil tip, pen tip, etc., without losing the original font, to form a more beautiful font.
- the handwriting processing method can be applied to an electronic device equipped with an Android system, and the electronic device can include an application layer and an algorithm layer.
- the application layer can be used to implement the above step S10, and the algorithm layer can be used to implement the above steps S11-S13.
- the application layer is used to obtain the original handwriting trajectory (for example, the initial data corresponding to the original handwriting trajectory) that the user writes on the touch screen and is collected by the touch screen.
- Initial data the initial data is processed to obtain the corresponding original handwriting trajectory (for example, the combination of touched points (touch capacitance) on the touch screen)), and the original handwriting trajectory is sampled to obtain multiple sampling points Relevant information such as coordinates, type, and writing time.
- the application layer can transmit the coordinates of multiple sampling points, the type and writing time and other related information corresponding to each sampling point to the algorithm layer, so that the algorithm layer can perform calculations, judgments, etc. to perform subsequent operations to beautify the handwriting, for example,
- the algorithm layer smoothes multiple sampling points and calculates the display scheme of the original handwriting trajectory under different strokes (for example, pencil or brush stroke), so that the original handwriting trajectory can achieve the effect of handwriting beautification.
- the display scheme of the original handwriting trajectory is realized through the application layer.
- the display scheme of the original handwriting trajectory includes the display scheme of the pen-starting phase, the display scheme of the pen-moving phase, and the display scheme of the pen-finishing phase.
- the algorithm layer may correspond to the application program itself (for example, a writing program, etc.), the application layer corresponds to the underlying driver, and the underlying driver is for the initial acquisition of the touch screen.
- the data is processed to obtain the corresponding original handwriting trajectory data, such as time, position, etc.; the algorithm layer obtains the original handwriting trajectory data fed back by the underlying driver program, and then performs further processing.
- the original handwriting trajectory may be the handwriting input by the user on the touch display screen by hand or pen, that is, the handwriting written by the user.
- the application layer can sample the original handwriting trajectory by sparsely sampling points to obtain multiple sampling points. The number of multiple sampling points can be determined according to the actual situation.
- multiple sampling points are spaced apart from each other along the original handwriting trajectory, that is, multiple sampling points do not overlap with each other.
- the original handwriting trajectory can have any shape.
- the original handwriting trajectory can be the trajectory of Chinese characters, or the trajectory of foreign characters (for example, English, Japanese, etc.).
- the original handwriting trajectory is not displayed on the touch screen; in another embodiment, the original handwriting trajectory can also be displayed on the touch screen, so that the user can watch at the same time To the original handwriting trajectory and beautified handwriting.
- FIG. 2A is a schematic diagram of a track point group provided by some embodiments of the present disclosure
- FIG. 2B is a schematic diagram of another track point group provided by some embodiments of the present disclosure.
- each track point group in at least one track point group includes N track points, N track points include M sample points, N is an integer greater than or equal to 3, and M is an integer greater than or equal to 3. , M is less than or equal to N.
- N is 9 and M is 3.
- the present disclosure includes but is not limited to this. The number of N and M can be determined according to actual conditions. In other embodiments, M can be 4 and N can be 13.
- step S11 may include: dividing the original handwriting trajectory into at least one trajectory segment based on a plurality of sampling points, wherein each trajectory segment includes M sampling points; and for each of the at least one trajectory segment Interpolation processing is performed on each trajectory segment to obtain a trajectory point group corresponding to each trajectory segment, thereby obtaining at least one trajectory point group.
- the application layer may sample points on the original handwriting trajectory 110 at equal time intervals to obtain 9 sampling points C1-C9 (black hollow points).
- the 9 sampling points C1-C9 are arranged in sequence, for example, the sampling point C1 and the sampling point C2 are adjacent, the sampling point C2 and the sampling point C3 are adjacent, and so on.
- the original handwriting trajectory 110 is sampled in real time to obtain sampling points.
- the application layer can Three sampling points are sampled and input to the algorithm layer, and then the algorithm layer can process the sampled three sampling points, which can save time.
- the application layer can sample the original handwriting trajectory 110.
- the application layer can sample the sample points C1-C3, the application layer can sample the sample points.
- C1-C3 are input to the algorithm layer for subsequent processing by the algorithm layer; at the same time, the application layer continues to sample.
- the application layer After the application layer samples the sampling points C4 and C5, the application layer can input the sampling points C3-C5 to the algorithm layer ,And so on. It should be noted that, for example, after the algorithm layer processes the sampling points C1-C3, the part of the handwriting for display corresponding to the sampling points C1-C3 can be displayed on the touch screen, thereby realizing real-time display . For another example, after all sampling points (for example, sampling points C1-C9) are processed in the algorithm layer, then the complete handwriting for display is displayed on the touch screen.
- the application layer samples the original handwriting trajectory 110 to obtain sampling points.
- 9 sampling points C1-C9 can divide the original handwriting trajectory into four trajectory segments, which are the first trajectory segment between sampling points C1-C3 and the second trajectory segment between sampling points C3-C5.
- the first trajectory section, the second trajectory section, the third trajectory section, and the fourth trajectory section are arranged in sequence in the extension direction of the original handwriting trajectory 110 (that is, the direction from the sampling point C1 to the sampling point C9).
- the two trajectory segments are adjacent and both correspond to the same sampling point C3, the second trajectory segment and the third trajectory segment are adjacent and both correspond to the same sampling point C5, and the third trajectory segment and the fourth trajectory segment are adjacent and both correspond to the same sampling point C7 .
- the original handwriting trajectory 110 includes a part corresponding to the pen-up phase, a part corresponding to the pen-handling phase, and a part corresponding to the pen-in phase.
- the part corresponding to the pen-up phase, the part corresponding to the pen-handling phase, and the part corresponding to the pen-in phase can be determined according to the event-driven rules of the Android system.
- the pen down event corresponds to the pen up phase
- the pen up event corresponds to the pen down phase, etc. .
- the first trajectory segment may represent the part of the original handwriting trajectory 110 corresponding to the pen-up phase
- the second trajectory segment and the third trajectory segment may represent the part of the original handwriting trajectory 110 corresponding to
- the fourth trajectory segment may represent the part of the original handwriting trajectory 110 that corresponds to the pen-returning stage.
- performing interpolation processing on each trajectory segment in at least one trajectory segment to obtain a trajectory point group corresponding to each trajectory segment includes: for each trajectory segment, according to the M sampling points in the trajectory segment, fitting The Bezier curve corresponding to the trajectory segment is obtained, and points are taken on the Bezier curve to obtain the trajectory point group corresponding to the trajectory segment.
- the second-order Bezier curve fitting can be performed on the three sampling points C1-C3 corresponding to the first trajectory segment to obtain the Bezier curve 100 corresponding to the first trajectory segment.
- two-order Bezier curve fitting can be performed on the three sampling points C3-C5 corresponding to the second trajectory segment to obtain the Bezier curve corresponding to the second trajectory segment;
- the second-order Bezier curve can be fitted to the three sampling points C5-C7 corresponding to the third trajectory segment to obtain the Bezier curve corresponding to the third trajectory segment; for the fourth trajectory segment, the first The three sampling points C7-C9 corresponding to the four trajectory segments are subjected to second-order Bezier curve fitting to obtain the Bezier curve corresponding to the fourth trajectory segment.
- the trajectory point group corresponding to the first trajectory segment includes 9
- the 9 trajectory points are the three sampling points C1-C3 corresponding to the first trajectory segment and the remaining 6 trajectory points on the Bezier curve 100 shown in FIG. 2A (black solid points, namely interpolation Points obtained). Interpolate points for all trajectory segments respectively, so as to obtain at least one trajectory point group one-to-one corresponding to at least one trajectory segment.
- the application layer may sample points on the original handwriting track, such as at equal time intervals, to obtain 5 sampling points A1-A5.
- the original handwriting trajectory five sampling points A1-A5 are arranged in sequence, for example, sampling point A1 is adjacent to sampling point A2, sampling point A2 is adjacent to sampling point A3, and so on.
- five sampling points A1-A5 can also divide the original handwriting trajectory into four trajectory segments, which are the first trajectory segment between sampling points A1-A2 and the first trajectory segment between sampling points A2-A3.
- the first trajectory segment, the second trajectory segment, the third trajectory segment, and the fourth trajectory segment are sequentially arranged in the extending direction of the original handwriting trajectory (that is, the direction from the sampling point A1 to the sampling point A5).
- the application layer transmits the two sampling points A1 and A2 corresponding to the first trajectory segment to the algorithm layer, and then the algorithm layer calculates the midpoint B1 of the sampling points A1 and A2, The points A1 and A2 and the midpoint B1 are fitted with a second-order Bezier curve to obtain the Bezier curve 100 corresponding to the first trajectory segment.
- the application layer transmits the two sampling points A2 and A3 corresponding to the second trajectory segment to the algorithm layer.
- the algorithm layer calculates the midpoint B2 of the sampling points A2 and A3.
- A3, midpoint B2 is fitted with a second-order Bezier curve to obtain the Bezier curve corresponding to the second trajectory segment; for the third trajectory segment, the application layer will perform two sampling points A3 and A3 and corresponding to the third trajectory segment.
- A4 is transmitted to the algorithm layer, and the algorithm layer calculates the midpoint B3 of the sampling points A3 and A4, and performs the second-order Bezier curve fitting on the sampling points A3 and A4 and the midpoint B3 to obtain the Bézier corresponding to the third trajectory segment Er curve; for the fourth trajectory segment, the application layer transmits the two sampling points A4 and A5 corresponding to the fourth trajectory segment to the algorithm layer.
- the algorithm layer calculates the midpoint B4 of the sampling points A4 and A5, and the sampling points A4 and A5 and the midpoint B4 perform second-order Bezier curve fitting to obtain the Bezier curve corresponding to the fourth trajectory segment.
- interpolation is performed on the Bezier curve 100 corresponding to the first trajectory segment to obtain a trajectory point group corresponding to the first trajectory segment, for example, in 3 trajectory points are sampled between sampling point A1 and sampling point B1, and 3 trajectory points are also sampled between sampling point B1 and sampling point A2. Interpolate points for all trajectory segments respectively, so as to obtain at least one trajectory point group one-to-one corresponding to at least one trajectory segment.
- the trajectory points can be sampled with equal curve intervals.
- the length of the curve segment between any two adjacent trajectory points in the points is a quarter of the length of the curve segment between the sampling point C1 and the sampling point C2.
- the sampling point C2 the sampling point C3, and the sampling point There are 3 trajectory points between C2 and sampling point C3.
- the length of the curve segment between any two adjacent trajectory points in these five trajectory points is the length of the curve segment between sampling point C2 and sampling point C3 A quarter.
- the track points can also be sampled at equal time intervals, that is, the time difference between any two adjacent track points in each track segment group of the nine track points is fixed. It should be noted that the present disclosure does not specifically limit the way of sampling track points.
- trajectory points in the trajectory point group corresponding to the first trajectory segment are located on the Bezier curve 100 corresponding to the first trajectory segment, and one of the trajectory point groups corresponding to the first trajectory segment or The multiple trajectory points may not be located on the first trajectory segment.
- multiple sampling points obtained by sampling may be directly used as the trajectory points in the trajectory point group, without performing interpolation processing on the sampling points.
- the first trajectory segment can be directly sampled to obtain nine sampling points, which can be used as trajectory points in the trajectory point group corresponding to the first trajectory segment.
- all the track points in the at least one track point group may be stroke points; in other embodiments, all the track points in the at least one track point group may be stroke points; In still other embodiments, all the track points in the at least one track point group may be pen-end track points.
- all the track points in the at least one track point group may include at least two of the stroke point, the stroke point, and the stroke point.
- FIG. 3A is a schematic diagram of a trajectory unit provided by an embodiment of the present disclosure
- FIG. 3B is a diagram showing the difference between the writing speed of a trajectory point provided by an embodiment of the present disclosure and the diameter of the first circle of the trajectory unit corresponding to the trajectory point Schematic diagram of the relationship.
- each trajectory unit includes at least a polygon 220, a first circle 200, and a second circle 210.
- the polygon 220 is a quadrilateral.
- the radius of the first circle 200 is greater than the radius of the first circle 200.
- the radius of the second circle 210 and the four vertices of the polygon 220 are the four external common tangent points q1-q4 between the first circle 200 and the second circle 210.
- the drop-shaped drop unit represents a drop-shaped closed track.
- each trajectory unit may include two line segments, a first circle and a second circle, and the two line segments are the outer common tangent point q1 of the two outer common tangents of the first circle and the second circle.
- the line segment between -q4, as shown in Figure 3A, is the line segment q1q3 and the line segment q2q4.
- the second circle in each track unit may be replaced with a triangle. The present disclosure does not specifically limit this.
- the application layer can transmit all track points obtained by sampling and related information of all track points to the algorithm layer.
- the relevant information of the track points may include the coordinates of each track point, the writing time of each track point, the writing speed of each track point, and the action type during the movement of the pen tip (hereinafter referred to as the action type of the track point).
- a pixel coordinate system OXY is determined by taking the upper left corner of the display screen of the touch display screen as the origin of coordinates, with the X axis extending to the right and the Y axis extending downwards.
- the X axis may be parallel to the horizontal direction
- the Y axis may be parallel to the vertical direction.
- the coordinates of the track point may be the coordinates of any one of the multiple pixels corresponding to the track point; or, the coordinates of the track point may be the coordinates of the middle pixel of the multiple pixels corresponding to the track point.
- the action type of the trajectory point may include pen up, pen stroke (also called pen stroke), and pen end.
- pen stroke also called pen stroke
- pen end When the action type of a certain track point is pen-starting, it means that the track point is in the part of the pen-starting phase of the original handwriting trajectory.
- pen-stroke When the action type of a certain track point is pen-stroke, it means that the trajectory point is in the pen-drawing phase of the original handwriting trajectory.
- the action type of a certain track point is the end of the pen, it means that the track point is in the end of the original handwriting track. For example, as shown in FIG.
- the action types of all track points corresponding to the first trajectory segment are strokes
- the action types of all track points corresponding to the second trajectory segment and the third trajectory segment are strokes.
- the action type of all the trajectory points corresponding to the fourth trajectory segment is the ending pen.
- the writing speed of the sampling point can be determined according to the coordinates and time of the adjacent sampling point, and the speed of the point obtained by interpolation (for example, the black solid point between C1 and C2 on the Bezier curve 100 shown in FIG. 2A)
- the sum type is determined based on two real sampling points (ie, sampling points C1 and C2) used for interpolation.
- the writing speed of the sampling point C3 can be determined according to the coordinates and time of the sampling point C2 and the coordinates and time of the sampling point C3, that is, according to the time difference between the sampling point C2 and the sampling point C3
- the position difference is determined, for example, the writing speed of the sampling point C3 can be obtained by dividing the position difference between the sampling point C2 and the sampling point C3 by the time difference between the sampling point C2 and the sampling point C3.
- the point speeds obtained by interpolation are all simulated.
- the writing speed of the points obtained by interpolation can be determined based on the writing speed of the sampling points.
- the difference between the writing speed of any two adjacent trajectory points among the five trajectory points is one-fourth of the difference between the writing speed of the sample point C2 and the writing speed of the sample point C3, that is, the five trajectory points.
- the writing speed of each track point is an arithmetic sequence.
- the writing speed of the three interpolated points is the writing speed of the sampling point C2 and the sampling point C3. The average value of writing speed.
- the velocity of the first sampling point corresponding to the original handwriting trajectory (for example, for the original handwriting trajectory 110 shown in FIG. 2A, the first sampling point is the sampling point C1) is 0, for (For example, for the original handwriting trajectory 110 shown in FIG. 2A, the second sampling point is the sampling point C2), the writing speed of the second sampling point can be based on the first sampling point (ie, the sampling point C1 ) And the second sampling point (ie sampling point C2) between the time difference and the position difference are determined.
- the writing speed corresponding to the sampling point can also be directly acquired, that is, the application layer can acquire the writing speed of the sampling point and transmit the writing speed to the algorithm layer.
- the type of points obtained by interpolation for example, the black solid point between C1 and C2 on the Bezier curve 100 shown in FIG. 2A
- the two real sampling points used for interpolation ie, sampling points C1 and C2
- the width of the handwriting is related to the writing speed of the track point.
- the width of the handwriting is small, and when the writing speed of the track point is slow, the width of the handwriting is large.
- step S12 for each track point on the original handwriting trajectory, the application layer sets a drop shape at the position corresponding to the track point to simulate the effect of writing by a brush, so as to simulate the stroke of the brush.
- step S12 includes: determining that the action type in all the trajectory points is the trajectory point of the pen to obtain T1 pen trajectory points, where T1 is a positive integer less than or equal to the number of all trajectory points,
- the multiple trajectory units include T1 pen trajectory units that correspond to the T1 pen trajectory points one-to-one; obtain the first average reference speed; for the p-th pen trajectory point among the T1 pen trajectory points, average according to the first reference Speed and the writing speed and position corresponding to the p-th pen trajectory point, determine the radius and center of the first circle in the p-th pen trajectory unit corresponding to the p-th pen trajectory unit in the T1 pen trajectory unit, where p Is a positive integer, and p is less than or equal to T1; according to the radius and center of the first circle in the p-th stroke unit, the radius relationship between the radius of the first circle and the radius of the second circle in each trajectory unit and each The positional relationship between the center of the first circle and the center of the second circle of each trajectory
- the writing speed of the p-th pen trajectory point can pass the time and position corresponding to the p-th pen trajectory point and the p-th pen trajectory point The time and position corresponding to the previous adjacent sampling point are determined.
- the writing speed of the p-th pen trajectory point can be determined by the writing speed of the two adjacent sampling points .
- the T1 pen trajectory points are all trajectory points between sample point C3 to sample point C7, sample point C3 and sample point C7; as shown in Figure 2B, T1 pen trajectory points are sample points All trajectory points from A2 to sampling point A4, sampling point A2 and sampling point A4.
- the center O1 of the first circle 200 is the trajectory point corresponding to the trajectory unit where the first circle 200 is located.
- the center of the first circle of the p-th pen trajectory unit is the coordinate of the p-th pen trajectory point; in other embodiments, it may be according to a predetermined rule, Determine the center of the first circle of the p-th pen-trajectory unit according to the coordinates of the p-th pen-trajectory point.
- the predetermined rule may be: the original handwriting trace is located in the first area of the touch display screen, the handwriting used for display is located in the second area of the touch display screen (the second area is located to the right of the first area), and the first circle
- the position of the preset distance located on the right side of the corresponding track point, etc., the size of the first area, the size of the second area, the predetermined rule and the preset distance can be set by the user according to the actual situation.
- the radius of the first circle 200 of the p-th pen-trajectory unit is determined by the writing speed and the first average reference speed corresponding to the p-th pen-trajectory point, and satisfies the following relationship:
- dt is the diameter of the first circle in the p-th pen trajectory unit
- dt-1 is the previous trajectory unit adjacent in time to the p-th pen trajectory unit
- the previous trajectory unit may be a pen
- the trajectory unit may also be the diameter of the first circle of the pen-starting trajectory unit described later
- kt is the radius adjustment coefficient corresponding to the p-th pen-trajectory point
- vt is the writing speed corresponding to the p-th pen-trajectory point
- vavg is The first average reference speed, for example, vavg may be 500 pixels per second.
- the previous trajectory point adjacent to sampling point C3 is trajectory point C30
- the trajectory unit corresponding to sampling point C3 is adjacent in time to trajectory point C30.
- the trajectory unit in time, in time, the previous trajectory point adjacent to sampling point C3 is trajectory point C30, and the trajectory unit corresponding to sampling point C3 is adjacent in time to trajectory point C30. The trajectory unit.
- the center of the second circle of the p-th pen stroke unit is the p-th pen stroke point, and then, according to the center of the circle between the center of the first circle and the center of the second circle , The center of the first circle of the p-th pen-trajectory unit is determined based on the center of the second circle of the p-th pen-trajectory unit.
- the algorithm layer presets the first average reference speed vavg of the writing process. If the writing speed of the current trajectory point is less than or equal to the first average reference speed, adjust the diameter of the first circle in the trajectory unit corresponding to the current trajectory point to increase. Make the stroke corresponding to the current trajectory point thicker; if the writing speed of the current trajectory point is greater than the first average reference speed, adjust the diameter of the first circle in the trajectory unit corresponding to the current trajectory point to decrease, so that the stroke corresponding to the current trajectory point changes thin.
- the adjustment range of the diameter of the first circle 200 is limited.
- the maximum value of the diameter of the first circle 200 shall not exceed 1.1 times the set line width, and the minimum value of the diameter of the first circle 200 shall not be lower than the set line width.
- ds is a constant and can be set by the user.
- the diameter of the first circle 200 actually corresponds to the writing speed of the track point, as shown in FIG. 3B, the maximum value of the diameter of the first circle 200 corresponds to the truncated low speed of the writing speed of the track point, the diameter of the first circle 200 The minimum value of corresponds to the truncated high speed of the writing speed of the track point. Near the average speed, the diameter of the first circle 200 changes relatively smoothly, thereby suppressing the jitter of the stroke width.
- the positional relationship of the center of the circle means: the center line O1O2 between the center O1 of the first circle 200 and the center O2 of the second circle 210 rotates the preset circle center angle ⁇ in the counterclockwise direction to the corresponding direction VD, the center of the first circle 200 O1 and the center O2 of the second circle 210 satisfy the following relationship:
- R is the radius of the first circle 200
- do is the distance between the center O1 of the first circle 200 and the center O2 of the second circle 210
- C1 is a constant.
- the radius relationship means: the radius of the first circle 200 is greater than the radius of the second circle 210, and the radius of the first circle 200 and the radius of the second circle 210 satisfy the following relationship:
- r is the radius of the second circle 210
- C2 is a constant.
- the range of C1 is 1.2-2, for example, C1 is 1.8; the range of C2 is 0.2-0.4, for example, C2 is 0.3; the range of the preset circle center angle ⁇ is 20°-40°, For example, the preset circle center angle ⁇ is 30 degrees.
- the values of C1 and C2 need to satisfy such that the first circle 200 and the second circle 210 do not intersect.
- the corresponding direction VD may be the opposite direction of the X axis.
- the abscissa of the center of the first circle 200 is greater than the abscissa of the center of the second circle 210
- the ordinate of the center of the first circle 200 is greater than the ordinate of the center of the second circle 210, and therefore, as shown in FIG. 3A, the second circle 210 is located at the upper left of the first circle 200.
- determining multiple track units corresponding to all track points in at least one track point group one-to-one includes: determining that the action type in all track points is a pen-starting track point , To obtain T3 pen-start trajectory points, where T3 is a positive integer less than or equal to the number of all the trajectory points, and the multiple trajectory units include T3 pen-start trajectory units corresponding to the T3 pen-start trajectory points one-to-one; set T3 The diameter of the first circle of each pen-start trajectory unit is the set line width; for the z-th pen-start trajectory point among T3 pen-start trajectory points, according to the position corresponding to the z-th pen-start trajectory point, determine the T3 pen-start trajectory unit and The center of the first circle in the zth stroke unit corresponding to the zth stroke point, where z is a positive integer, and z is less than or equal to T3; according to the radius of the first circle in the zth stroke unit and The center of the
- the center of the first circle of the z-th pen-start trajectory unit is the coordinate of the z-th pen-start trajectory point.
- the center of the first circle of the z-th pen-start trajectory unit may be determined according to the coordinates of the z-th pen-start trajectory point according to a predetermined rule.
- a predetermined rule For the position relationship of the center of the circle and the position of the radius, please refer to the relevant description above, and the repetition will not be repeated.
- the user can specify to use the set line width for writing.
- you can set the diameter and set line width of the first circle in the trajectory unit corresponding to the trajectory point of the pen. same.
- all trajectory points include only one pen-start trajectory point, that is, T3 is 1.
- the pen-start trajectory point can be sample point C1.
- the diameter of the first circle is the set line width; in other embodiments, all trajectory points include multiple starting trajectory points, that is, T3 is greater than 1, for example, T3 is 9, at this time, multiple starting trajectory points can be sampling points C1, sampling point C2, sampling point C3, sampling point C1 and sampling point C3, all the trajectory points, the diameter of the first circle of the multiple trajectory units corresponding to the multiple trajectory points are the same and they are all set lines width.
- FIG. 4 is a schematic diagram of a handwriting for display provided by an embodiment of the present disclosure.
- determining multiple track units corresponding to all track points in at least one track point group one-to-one includes: determining that the action type in all track points is the track of ending the pen Point to obtain T2 pen ending trajectory points, where T2 is a positive integer less than or equal to the number of all trajectory points, and the multiple trajectory units include T2 pen ending trajectory units corresponding to the T2 pen ending trajectory points one-to-one; obtaining The second average reference speed; for the i-th end-pen trajectory point of T2 end-pen trajectory points, determine the T2 end-pen trajectory according to the second average reference speed and the writing speed and position corresponding to the i-th end-pen trajectory point The radius and center of the first circle in the i-th pen-in trajectory unit corresponding to the i-th pen-in trajectory point in the unit, where i is a positive integer, and i is less than or equal to T2; according to the i-th pen-in trajectory The radius and center of the first circle in the trajectory unit
- the second average reference speed can be set. If the writing speed of the trajectory point in the closing phase is greater than the second average reference speed, the pen tip processing is performed on the trajectory point in the closing phase, that is, the closing phase is reduced.
- the trajectory point corresponding to the diameter of the first circle of the trajectory unit makes the width of the trajectory point in the closing phase smaller than the set line width.
- the line width of the pen-in part (the circled part in Figure 4) is smaller, which is similar to the tip of a writing brush; when the pen-in phase is not correct
- the line width of the end pen part is larger.
- the center of the first circle of the i-th pen-in trajectory unit is the coordinate of the i-th pen-in trajectory point.
- the coordinates of the trajectory point determine the center of the first circle of the i-th pen-returning trajectory unit.
- the radius of the first circle of the i-th end-pen trajectory unit is determined by the writing speed and the second average reference speed corresponding to the i-th end-pen trajectory point, and satisfies the following relationship:
- dy is the diameter of the first circle in the i-th pen-in trajectory unit
- dy-1 is the diameter of the first circle of the previous trajectory unit adjacent in time to the i-th pen-in trajectory unit
- vi is the writing speed corresponding to the i-th pen-in trajectory point
- vavg' is the second average reference speed.
- the first average reference speed is the reference speed corresponding to the pen moving phase
- the second average reference speed is the reference speed corresponding to the pen closing phase.
- the second average reference speed vavg' is less than the first average reference speed vavg.
- the type is the ending pen, that is, the N track points in the last track point group are used as the ending pen track points.
- the T2 ending pen track points can be sampling point C8, sampling point C9, and sampling point C7
- the T2 ending trajectory points are all trajectory points between sampling point A5, sampling point A4, and sampling point A5. It should be noted that the embodiments of the present disclosure include but are not limited thereto, and the number of T2 pen-returning trajectory points can be determined according to actual conditions.
- the touch and display are implemented in the same touch display screen as an example.
- the present disclosure is not limited to this.
- the original handwriting trace can be passed through the touch device.
- the handwriting used for display can be displayed by the display device.
- the touch device and the display device are set separately.
- the touch area of the touch device that is, the area where the user can write
- the angle is the origin, the direction extending to the right is used as the x-axis (the value of x is getting larger and larger), and the direction extending downward is used as the y-axis (the value of y is getting larger and larger) to construct the first coordinate system.
- the coordinates of the points are the coordinates of each track point in the first coordinate system.
- the upper left corner of the display area of the display device can be taken as the origin
- the direction extending to the right can be taken as the x-axis (the value of x is getting larger and larger)
- the direction extending downward can be taken as the y-axis (the value of y is getting larger and larger).
- the coordinates of each track point (the coordinates of each track point in the first coordinate system) need to be mapped to the second coordinate system to determine the second coordinate system
- the center of the first circle of the trajectory unit corresponding to each trajectory point in the system. In other words, the track point is located in the first coordinate system, and the center of the first circle is located in the second coordinate system.
- FIG. 5A is a schematic diagram of a first trajectory unit and a second trajectory unit provided by an embodiment of the present disclosure
- FIG. 5B is a schematic diagram of another first trajectory unit and a second trajectory unit provided by an embodiment of the present disclosure.
- first trajectory unit and second trajectory unit may be based on the difference between the first circle and second circle of the first trajectory unit and the first circle and second circle of the second trajectory unit.
- the common tangent point connects the first trajectory unit and the second trajectory unit, thereby accurately connecting multiple trajectory units, so that the displayed handwriting is smoother.
- step S13 includes: sorting multiple trajectory units based on the corresponding positions of all trajectory points in at least one trajectory point group on the original handwriting trajectory;
- the trajectory unit and the second trajectory unit in response to the first circle and the second circle of the first trajectory unit and any two circles of the first circle and the second circle of the second trajectory unit being not in an implicit relationship, determine the first
- the two first common tangent points and the two second common tangent points between the first circle of the trajectory unit and the first circle of the second trajectory unit determine the second circle of the first trajectory unit and the first circle of the second trajectory unit
- Two third common tangent points and two fourth common tangent points between two circles from two first common tangent points, two second common tangent points, two third common tangent points, and two fourth common tangent points
- Four target common tangent points are selected from the common tangent points; connect the four target common tangent points in sequence to determine a quadrilateral, so that the first trajectory unit and the second trajectory unit are connected, and the multiple trajectory units are processed
- the multiple trajectory units corresponding to all the trajectory points are sorted along the direction from the sampling point C1 to the sampling point C9.
- any adjacent first trajectory unit 300 and second trajectory unit 310 in the plurality of trajectory units if the first circle and the second circle of the first trajectory unit 300 and the second trajectory unit Any two circles in the first circle and the second circle of 310 are not inclusive. At this time, the two first circles between the first circle of the first trajectory unit 300 and the first circle of the second trajectory unit 310 are calculated.
- a common tangent point w11 and w12 and two second common tangent points w21 and w22 calculate two third common tangent points w31 between the second circle of the first trajectory unit 300 and the second circle of the second trajectory unit 310 And w32 and the two fourth common tangent points w41 and w42; for example, the two first common tangent points w11 and w12 are located on the first circle of the first trajectory unit 300, and the two second common tangent points w21 and w22 are located on the first circle On the first circle of the second trajectory unit 310, the two third common tangent points w31 and w32 are located on the second circle of the first trajectory unit 300, and the two fourth common tangent points w41 and w42 are located on the second circle of the second trajectory unit 310. On the second round.
- FIG. 5B shows various positional relationships between the first trajectory unit 300 and the second trajectory unit 310.
- a shaded circle represents the first trajectory unit 300
- an unshaded circle represents the second trajectory unit 310.
- the Jiugong grid is determined with the first trajectory unit 300 as the center, and the Jiugong grid includes areas 1-9.
- the first trajectory unit 300 is located in the second row and second column of the Jiugong grid, that is, the first trajectory unit 300 is located in area 5.
- the second trajectory unit 310 can be located at any position of the Jiugong grid.
- the two circles in the first trajectory unit 300 and the second trajectory unit 310 may have an intersection or an implicit relationship;
- the two trajectory units 310 are located in areas 1, 2, 3, 4, 6, 7, 8, and 9, any two circles in the first trajectory unit 300 and the second trajectory unit 310 are not in an implicit relationship.
- r 1 represents the radius of the first circle of the first trajectory unit 300
- r 2 represents the radius of the first circle of the second trajectory unit 310
- a 1 represents the abscissa of the center of the first circle of the first trajectory unit 300
- a 2 represents the abscissa of the center of the first circle of the second trajectory unit 310
- b 1 represents the ordinate of the center of the first circle of the first trajectory unit 300
- b 2 represents the center of the first circle of the second trajectory unit 310 The ordinate.
- two groups (k, b) can be calculated according to the above formulas (1) and (2). Substituting the two groups (k, b) into the following equations (3) and (4), the two first common tangent points w11 between the first circle of the first trajectory unit 300 and the first circle of the second trajectory unit 310 And w12 and the two second common tangent points w21 and w22.
- Two groups (x 1 , y 1 ) represent two first common tangent points w11 and w12, and two groups (x 2 , y 2 ) represent two second common tangent points w21 and w22.
- FIG. 6A is a schematic diagram of still another first trajectory unit and a second trajectory unit provided by an embodiment of the present disclosure
- FIG. 6B is a schematic diagram of still another first trajectory unit and a second trajectory unit provided by an embodiment of the present disclosure.
- the slope of the first outer common tangent between the first circle and the second circle of the first trajectory unit is k1, and the slope between the first circle and the second circle of the first trajectory unit
- the slope of the second tangent line is k2
- the slope of the line connecting the center of the first circle and the center of the second circle of the first trajectory unit is expressed as k0, when the first circle and the second circle of the first trajectory unit
- the slope of the third external common tangent between the second circle of the first trajectory unit and the second circle of the second trajectory unit is k3, and the second circle between the second circle of the first trajectory unit and the second circle of the second trajectory unit is the first
- the slope of the quadrant common tangent is k4.
- k3 is greater than k4, and in the example shown in FIG. 6B, k3 is less than k4.
- k3 and k4 are determined by the positional relationship between the first trajectory unit and the second trajectory unit.
- the slope k3 of the third common tangent line is greater than the slope k4 of the fourth common tangent line, that is, in the example shown in FIG.
- the slope of the line k0 between the center of the first circle and the center of the second circle of the unit, or, in response to the slope of the third external common tangent, k3 is less than the slope of the fourth common tangent, k4, as shown in Figure 6B
- the slope k3 of the third external common tangent is smaller than the slope k2 of the second external common tangent and is greater than the slope k0 of the line between the center of the first circle and the center of the second circle of the first trajectory unit.
- the second trajectory unit 310 may be located in the area 1 in the first row and first column of the Jiugong grid or in the area 9 in the third row and third column of the Jiugongge.
- the slope of the second grand tangent is k2.
- the first common tangent point of the second circle far away from the first trajectory unit and the two third common tangent points w31 and w32 of the two first common tangent points w11 and w12 can be far away from the first trajectory unit.
- the fourth common tangent point of the first circle of the second trajectory unit is used as the four target common tangent points.
- FIG. 7 is a schematic diagram of still another first track unit and a second track unit provided by an embodiment of the present disclosure.
- the distance between the first common tangent point w11 and the center of the second circle of the first trajectory unit 310 Is d1
- the distance between the first common tangent point w12 and the center of the second circle of the first track unit 310 is d2. Since d1 is greater than d2, the first common tangent point w11 can be selected as the target common tangent point.
- the handwriting processing method further includes: in response to the first circle and the second circle of the first trajectory unit and the first circle and the second circle of the second trajectory unit, at least two of the four circles have an inclusive relationship, It is determined that the first track unit and the second track unit do not need to be connected.
- the second trajectory unit 310 is located in the area 5 of the Jiugong grid, and the first circle of the first trajectory unit 300 and the first circle of the second trajectory unit 310 are in an implicit relationship. In this case , It can be determined that the first track unit and the second track unit do not need to be connected.
- step S13 includes: for the k-th track point group in at least one track point group, the N track points in the k-th track point group are arranged in sequence in the extension direction of the original handwriting track, and k is a positive integer, And less than or equal to the number of at least one track point group; determine the first track point and the Nth track point in the k-th track point group in the extension direction of the original handwriting track; obtain the first track point of the first track point Coordinates and the second coordinate of the Nth track point; according to the first coordinate and the second coordinate, determine the direction of the track segment corresponding to the k-th track point group; according to the track segment corresponding to the k-th track point group Direction, determine the first connection point on the first circle and the second connection
- the direction of the track segment can be set to include 6 directions, and the 6 directions are respectively the horizontal direction, the vertical direction, the skew direction, the nap direction, the lift direction, and other directions.
- the first coordinate difference being 0 and the second coordinate difference being 0
- it is determined that the direction of the track segment corresponding to the k-th track point group is other directions, and in response to the first coordinate difference being not 0 and the second coordinate difference being 0 ,
- the direction of the track segment corresponding to the k-th track point group is determined to be the horizontal direction, and in response to the first coordinate difference being 0 and the second coordinate difference being not 0, the direction of the track segment corresponding to the k-th track point group is determined to be vertical Direction, in response to the first coordinate difference being 0 and the second
- the first connection on the first circle of each of the N track units corresponding to the N track points in the k-th track point group Point and the second connection point on the second circle including:
- (xbj, ybj) is the coordinate of the first connection point corresponding to the jth trajectory unit in the N trajectory points corresponding to the N trajectory points in the kth trajectory point group
- (xsj, ysj) is the jth
- the coordinates of the second connection point corresponding to each trajectory unit (x2j, y2j) is the coordinate of the center of the first circle of the j-th trajectory unit
- Rj is the radius of the first circle of the j-th trajectory unit
- (x1j, y1j ) Is the coordinate of the center of the second circle of the j-th trajectory unit
- rj is the radius of the second circle of the j-th trajectory unit.
- the N trajectory units corresponding to the N trajectory points in the k-th trajectory point group include a third trajectory unit and a fourth trajectory unit, and the third trajectory unit and the fourth trajectory unit are adjacent to each other .
- the first connection point and the second connection point corresponding to the point and the second connection point and the fourth trajectory unit define a quadrilateral, thereby connecting the third trajectory unit and the fourth trajectory unit.
- first connect the first connection point and the second connection point corresponding to the third trajectory unit, connect the first connection point and the second connection point corresponding to the fourth trajectory unit, and then connect the third trajectory
- the first connection point corresponding to the unit and the first connection point corresponding to the fourth trajectory unit connect the second connection point corresponding to the third trajectory unit and the second connection point corresponding to the fourth trajectory unit to determine a quadrilateral so that the first connection point
- the three-track unit is connected to the fourth track unit.
- FIG. 8A is a schematic diagram of a trajectory unit without transparency provided by an embodiment of the present disclosure
- FIG. 8B is a schematic diagram of a trajectory unit with transparency provided by an embodiment of the present disclosure.
- step S12 includes: determining, based on the writing speed of at least part of the track points in the at least one track point group, a plurality of intermediate track units corresponding to all the track points in the at least one track point group one by one; Perform processing to obtain multiple trajectory units.
- processing multiple intermediate trajectory units to obtain multiple trajectory units includes: obtaining multiple intermediate transparency trajectory units one-to-one corresponding to the multiple intermediate trajectory units according to the multiple intermediate trajectory units, wherein each transparency The shape and size of the trajectory unit are the same as the shape and size of the intermediate trajectory unit corresponding to each transparency trajectory unit; for the hth intermediate transparency trajectory unit among the multiple intermediate transparency trajectory units, in the hth intermediate transparency trajectory unit Obtain multiple edge transparency pixels from the edge, and gradually change the transparency of multiple edge transparency pixels from 100% to 0% in the direction extending outward from the center of the h-th intermediate transparency track unit to obtain the h-th intermediate transparency track Transparency track unit corresponding to the unit, thereby obtaining a plurality of transparency track units corresponding to the multiple intermediate transparency track units one-to-one, where h is a positive integer greater than or equal to 1 and less than or equal to the number of multiple intermediate transparency track units, and multiple At least part of the edge transparency pixels in the edge transparency pixels are located in the corresponding h-th intermediate transparency track unit, and
- Figure 8A shows the intermediate track unit without transparency
- Figure 8B shows the intermediate track unit with transparency.
- the intermediate track unit without transparency and the intermediate track unit with transparency can be represented by a pixel matrix
- the intermediate track The shape of the unit is the same as the shape of the intermediate transparency track unit, and the size of the intermediate track unit and the size of the intermediate transparency track unit are also the same.
- the gray scale value of the pixels inside the middle track unit is 1, and the gray scale value of the pixels outside the middle track unit is 0.
- a grayscale value of 1 indicates that the pixel is opaque
- a grayscale value of 0 indicates that the pixel is transparent.
- the transparency of multiple edge transparency pixels at the edge of the intermediate transparency track unit is changed from 100% ( That is, the gray value is 1) gradually becomes 0% (that is, the gray value is 0), so as to obtain the transparency track unit corresponding to the middle track unit.
- the intermediate trajectory unit corresponding to the trajectory point and the transparency trajectory unit can be superimposed to obtain the trajectory unit corresponding to the trajectory point.
- the transparency of a certain pixel exceeds 100%, the transparency of the certain pixel is set to 100%.
- the transparency of the pixel is multiplied by the RGB value of the pixel to determine the true color of the pixel, and the true color of each pixel is combined to finally determine the color of the handwriting used for display.
- the transparent trajectory unit may not be provided.
- FIG. 9 is a schematic diagram of the process of simulating the tip of a pencil provided by some embodiments of the present disclosure
- FIG. 10 is an effect diagram of simulating the tip of a pencil provided by some embodiments of the present disclosure.
- the tip type used for handwriting displayed on the touch screen is a brush tip.
- the embodiments of the present disclosure include but are not limited thereto.
- the pen tip type used for the handwriting displayed on the touch display screen may also be a pencil tip. For example, during the simulation of the pencil tip, you can set the line width displayed on the application layer to a constant value.
- the application layer uses the set line width as the diameter and the initial sampling point (for example, the sampling point C1 shown in Figure 2A) as the center to determine the circle corresponding to the initial sampling point, so that the pen-starting part become rounded.
- the pen movement stage keep the line width constant, determine the circle corresponding to each track point in the pen movement stage, then calculate the connection point of the circle corresponding to each track point, and finally connect each track in turn based on the connection point of the circle corresponding to each track point The circle corresponding to the point.
- the sampling points corresponding to the writing speed are linearly positively correlated, and the direction of the long axis of the ellipse is related to the two circles corresponding to the last two sampling points collected by the application layer (for example, the sampling point C8 and the sampling point C9 shown in Figure 2A)
- the connection direction between the center of the circle is the same.
- the tip type of the two Chinese characters "Spring" is a pencil tip.
- FIG. 11 is a schematic block diagram of a handwriting processing device provided by at least one embodiment of the present disclosure.
- the handwriting processing apparatus 1200 includes a memory 1220 and a processor 1230. It should be noted that the components of the handwriting processing device 1200 shown in FIG. 11 are only exemplary and not restrictive. According to actual application requirements, the handwriting processing device 1200 may also have other components.
- the memory 1220 is used for non-transitory storage of computer readable instructions; the processor 1230 is used for running computer readable instructions, and the computer readable instructions are executed by the processor 1230 when they are executed in the handwriting processing method according to any of the above embodiments. One or more steps.
- the handwriting processing device 1200 further includes a touch screen 1240.
- the touch display screen 1240 is configured to obtain the original handwriting trajectory based on the user's touch operation.
- the touch screen 1240 may include input devices such as an electronic pen, a touch screen, a mouse, and a touch pad.
- the touch screen 1240 is also configured to display the handwriting for display.
- the touch screen 1240 may also include a display device such as the projector described above.
- the memory 1220 and the processor 1230 may be integrated in the touch display 1240.
- the memory 1220 and the processor 1230 may also be integrated in a cloud server.
- the handwriting processing device 1200 may also include a communication module, which is used to implement communication between the handwriting processing device 1200 and other electronic equipment.
- a communication module may be used to implement communication between the handwriting processing device 1200 and other electronic equipment.
- the communication module may The handwriting used for display is transmitted from the display screen of the airport to the user's mobile phone or tablet computer, so that the user's mobile phone or tablet computer can store the handwriting used for display.
- the processor 1230 may control other components in the handwriting processing apparatus 1200 to perform desired functions.
- the processor 1230 may be a central processing unit (CPU), a tensor processor (TPU), and other devices with data processing capabilities and/or program execution capabilities.
- the central processing unit (CPU) can be an X86 or ARM architecture.
- the memory 1220 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.
- the 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, and the like.
- ROM read only memory
- EPROM erasable programmable read only memory
- CD-ROM portable compact disk read only memory
- USB memory flash memory, and the like.
- One or more computer-readable instructions may be stored on the computer-readable storage medium, and the processor 1230 may run the computer-readable instructions to implement various functions of the handwriting processing apparatus 1200.
- the network may include a wireless network, a wired network, and/or any combination of a wireless network and a wired network.
- the network may include a local area network, the Internet, a telecommunications network, the Internet of Things (Internet of Things) based on the Internet and/or a telecommunications network, and/or any combination of the above networks, and so on.
- the wired network may, for example, use twisted pair, coaxial cable, or optical fiber transmission for communication, and the wireless network may use, for example, a 3G/4G/5G mobile communication network, Bluetooth, Zigbee, or WiFi.
- the present disclosure does not limit the types and functions of the network here.
- FIG. 12 is a schematic diagram of a storage medium provided by at least one embodiment of the present disclosure.
- one or more computer-readable instructions 1301 may be non-transitory stored on the storage medium 1300.
- the computer-readable instructions 1301 are executed by a computer, one or more steps in the handwriting processing method described above can be executed.
- the storage medium 1300 may be applied to the handwriting processing device 1200 described above, for example, it may be the memory 1220 in the handwriting processing device 1200.
- the description of the storage medium 1300 reference may be made to the description of the memory in the embodiment of the handwriting processing apparatus 1200, and repetitions are not repeated here.
- FIG. 13 shows a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
- the handwriting processing device 1200 provided in the present disclosure can be applied to the Internet system.
- the handwriting processing device 1200 involved in the present disclosure can be realized by using the computer system provided in FIG. 13.
- Such computer systems may include personal computers, laptops, tablet computers, mobile phones, personal digital assistants, smart glasses, smart watches, smart rings, smart helmets, and any smart portable devices or wearable devices.
- the specific system in this embodiment uses a functional block diagram to explain a hardware platform including a user interface.
- This kind of computer equipment can be a general purpose computer equipment or a special purpose computer equipment. Both types of computer equipment can be used to implement the handwriting processing apparatus 1200 in this embodiment.
- the computer system can implement any of the currently described components of the information needed to achieve handwriting beautification.
- a computer system can be realized by a computer device through its hardware device, software program, firmware, and their combination.
- the related computer functions described in this embodiment to realize the information required for handwriting beautification can be implemented by a group of similar platforms in a distributed manner. Distribute the processing load of the computer system.
- the computer system may include a communication port 250, which is connected to a network that realizes data communication.
- a computer system may send and receive information and data through the communication port 250, that is, the communication port 250 may realize the communication between the computer system and the computer system.
- Other electronic devices perform wireless or wired communication to exchange data.
- the computer system may also include a processor group 220 (ie, the processor described above) for executing program instructions.
- the processor group 220 may be composed of at least one processor (e.g., CPU).
- the computer system may include an internal communication bus 210.
- the computer system may include different forms of program storage units and data storage units (ie, the memory or storage medium described above), such as a hard disk 270, a read only memory (ROM) 230, and a random access memory (RAM) 240, which can be used for storage Various data files used for computer processing and/or communication, and possible program instructions executed by the processor group 220.
- the computer system may also include an input/output component 260, which is used to implement input/output data flow between the computer system and other components (for example, the user interface 280, etc.).
- the following devices can be connected to the input/output component 260: including input devices such as touch screens, touch pads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; including, for example, liquid crystal displays (LCD), speakers, vibrators, etc.
- the output device including storage devices such as tapes, hard disks, etc.; and communication interfaces.
- FIG. 13 shows a computer system with various devices, it should be understood that the computer system is not required to have all the devices shown, and instead, the computer system may have more or fewer devices.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- User Interface Of Digital Computer (AREA)
- Image Generation (AREA)
Abstract
Description
Claims (20)
- 一种笔迹处理方法,包括:对在触控显示屏上的原始笔迹轨迹进行采样以得到多个采样点;基于所述多个采样点,计算得到至少一个轨迹点组,其中,所述至少一个轨迹点组中的每个轨迹点组包括N个轨迹点,所述N个轨迹点包括M个采样点,N为大于等于3的整数,M为大于等于3的整数,M≤N;基于在所述至少一个轨迹点组中的至少部分轨迹点的书写速度,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个轨迹单元,其中,所述多个轨迹单元的每个轨迹单元为水滴状的水滴单元;依次连接所述多个轨迹单元,得到用于在所述触控显示屏上显示的笔迹。
- 根据权利要求1所述笔迹处理方法,其中,所述多个轨迹单元中的每个轨迹单元至少包括多边形、第一圆和第二圆,所述多边形的四个顶点为所述第一圆和所述第二圆之间的四个外公切点,基于在所述至少一个轨迹点组中的至少部分轨迹点的书写速度,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个轨迹单元,包括:确定在所述所有轨迹点中的动作类型为运笔的轨迹点,以得到T1个运笔轨迹点,其中,T1为小于等于所述所有轨迹点的数量的正整数,所述多个轨迹单元包括与所述T1个运笔轨迹点一一对应的T1个运笔轨迹单元;获取第一平均参考速度;对于所述T1个运笔轨迹点中的第p个运笔轨迹点,根据所述第一参考平均速度和所述第p个运笔轨迹点对应的书写速度和位置,确定所述T1个运笔轨迹单元中与所述第p个运笔轨迹点对应的第p个运笔轨迹单元中的第一圆的半径和圆心,其中,p为正整数,且p小于等于T1;根据所述第p个运笔轨迹单元中的第一圆的半径和圆心、每个轨迹单元的第一圆的半径和第二圆的半径之间的半径关系和每个轨迹单元的第一圆的圆心和第二圆的圆心之间的圆心位置关系,确定所述第p个运笔轨迹单元中的第二圆的半径和圆心;基于所述第p个运笔轨迹单元中的第一圆和第二圆,确定所述第p个运笔轨迹单元中的多边形,以确定所述第p个运笔轨迹单元,从而确定与所述T1个运笔轨迹点一一对应的所述T1个运笔轨迹单元,其中,所述第p个运笔轨迹单元的第一圆的半径由所述第p个运笔轨迹点对应的书写速度和所述第一平均参考速度决定,且满足以下关系式:dt=kt*dt-1,kt=2/(1+e [0.06*(vt-vavg)/vavg])其中,dt为在所述第p个运笔轨迹单元中的所述第一圆的直径,dt-1为与所述第p个运笔轨迹单元在时间上相邻的前一个轨迹单元的第一圆的直径,kt为所述第p个 运笔轨迹点对应的半径调整系数,vt为所述第p个运笔轨迹点对应的书写速度,vavg为所述第一平均参考速度,0.3*ds≤dt≤1.1*ds,ds为设定线宽,所述圆心位置关系表示:所述第一圆的圆心和所述第二圆的圆心之间的圆心连线沿逆时针方向旋转预设圆心角度到对应方向,所述第一圆的圆心和所述第二圆的圆心满足以下关系式:do/R=C1,其中,R为所述第一圆的半径,do为所述第一圆的圆心和所述第二圆的圆心之间的所述圆心连线的距离,C1为常数;所述半径关系表示:所述第一圆的半径大于所述第二圆的半径,且所述第一圆的半径和所述第二圆的半径满足以下关系式:r/R=C2,其中,r为所述第二圆的半径,C2为常数。
- 根据权利要求1所述笔迹处理方法,其中,所述多个轨迹单元中的每个轨迹单元至少包括多边形、第一圆和第二圆,所述多边形的四个顶点为所述第一圆和所述第二圆之间的四个外公切点,基于在所述至少一个轨迹点组中的至少部分轨迹点的书写速度,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个轨迹单元,包括:确定在所述所有轨迹点中的动作类型为收笔的轨迹点,以得到T2个收笔轨迹点,其中,T2为小于等于所述所有轨迹点的数量的正整数,所述多个轨迹单元包括与所述T2个收笔轨迹点一一对应的T2个收笔轨迹单元;获取第二平均参考速度,其中,所述第二平均参考速度小于第一平均参考速度,所述第一平均参考速度为运笔阶段对应的参考速度;对于所述T2个收笔轨迹点中的第i个收笔轨迹点,根据所述第二平均参考速度和所述第i个收笔轨迹点对应的书写速度和位置,确定所述T2个收笔轨迹单元中与所述第i个收笔轨迹点对应的第i个收笔轨迹单元中的第一圆的半径和圆心,其中,i为正整数,且i小于等于T2;根据所述第i个收笔轨迹单元中的第一圆的半径和圆心、每个轨迹单元的第一圆的半径和第二圆的半径之间的半径关系和每个轨迹单元的第一圆的圆心和第二圆的圆心之间的圆心位置关系,确定所述第i个收笔轨迹单元的第二圆的半径和圆心;基于所述第i个收笔轨迹单元中的第一圆和第二圆,确定所述第i个收笔轨迹单元中的多边形,以确定所述第i个收笔轨迹单元,从而确定与所述T2个收笔轨迹点一一对应的所述T2个收笔轨迹单元,其中,所述第i个收笔轨迹单元的第一圆的半径由所述第i个收笔轨迹点对应的书写速度和所述第二平均参考速度决定,满足以下关系式:dy=ki’*dy-1,ki’=6/(1+e [0.06*(vi-vavg’)/vavg’])其中,dy为在所述第i个收笔轨迹单元中的第一圆的直径,dy-1为与所述第i个收笔轨迹单元在时间上相邻的前一个轨迹单元的第一圆的直径,ki’为所述第i个收笔轨迹单元对应的半径调整系数,vi为所述第i个收笔轨迹点对应的书写速度,vavg’为所述第二平均参考速度,所述圆心位置关系表示:所述第一圆的圆心和所述第二圆的圆心之间的圆心连线沿逆时针方向旋转预设圆心角度到对应方向,所述第一圆的圆心和所述第二圆的圆心满足以下关系式:do/R=C1,其中,R为所述第一圆的调节后的半径,do为所述第一圆的圆心和所述第二圆的圆心之间的所述圆心连线的距离,C1为常数;所述半径关系表示:所述第一圆的半径大于所述第二圆的半径,且所述第一圆的半径和所述第二圆的半径满足以下关系式:r/R=C2,其中,r为所述第二圆的半径,C2为常数。
- 根据权利要求1所述笔迹处理方法,其中,所述多个轨迹单元中的每个轨迹单元至少包括多边形、第一圆和第二圆,所述多边形的四个顶点为所述第一圆和所述第二圆之间的四个外公切点,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个轨迹单元包括:确定在所述所有轨迹点中的动作类型为起笔的轨迹点,以得到T3个起笔轨迹点,其中,T3为小于等于所述所有轨迹点的数量的正整数,所述多个轨迹单元包括与所述T3个起笔轨迹点一一对应的T3个起笔轨迹单元;设定所述T3个起笔轨迹单元的第一圆的直径为设定线宽;对于所述T3个起笔轨迹点中的第z个起笔轨迹点,根据所述第z个起笔轨迹点对应的位置,确定所述T3个起笔轨迹单元中与所述第z个起笔轨迹点对应的第z个起笔轨迹单元中的第一圆的圆心,其中,z为正整数,且z小于等于T3;根据所述第z个起笔轨迹单元中的第一圆的半径和圆心、每个轨迹单元的第一圆的半径和第二圆的半径之间的半径关系和每个轨迹单元的第一圆的圆心和第二圆的圆心之间的圆心位置关系,确定所述第z个起笔轨迹单元中的第二圆的半径和圆心;基于所述第z个起笔轨迹单元中的第一圆和第二圆,确定所述第z个起笔轨迹单元中的多边形,以确定所述第z个起笔轨迹单元,从而确定所述T3个起笔轨迹点对应的所述T3个起笔轨迹单元,其中,所述圆心位置关系表示:所述第一圆的圆心和所述第二圆的圆心之间的圆心连线沿逆时针方向旋转预设圆心角度到对应方向,所述第一圆的圆心和所述第二圆的圆心满足以下关系式:do/R=C1,其中,R为所述第一圆的半径,do为所述第一圆的圆心和所述第二圆的圆心之间的所述圆心连线的距离,C1为常数;所述半径关系表示:所述第一圆的半径大于所述第二圆的半径,且所述第一圆的半径和所述第二圆的半径满足以下关系式:r/R=C2,其中,r为所述第二圆的半径,C2为常数。
- 根据权利要求2-4任一项所述笔迹处理方法,其中,依次连接所述多个轨迹单元,以得到用于在所述触控显示屏上显示的所述笔迹,包括:基于所述至少一个轨迹点组中的所有轨迹点在所述原始笔迹轨迹上对应的位置,对所述多个轨迹单元进行排序;对于排序后的所述多个轨迹单元中的任意相邻的第一轨迹单元和第二轨迹单元,响应于所述第一轨迹单元的第一圆和第二圆和所述第二轨迹单元的第一圆和第二圆中的任意两个圆均不是内含关系,确定所述第一轨迹单元的第一圆和所述第二轨迹单元的第一圆之间的两个第一公切点和两个第二公切点,确定所述第一轨迹单元的第二圆和所述第二轨迹单元的第二圆之间的两个第三公切点和两个第四公切点,其中,所述两个第一公切点位于所述第一轨迹单元的第一圆上,所述两个第二公切点位于所述第二轨迹单元的第一圆上,所述两个第三公切点位于所述第一轨迹单元的第二圆上,所述两个第四公切点位于所述第二轨迹单元的第二圆上;从所述两个第一公切点、所述两个第二公切点、所述两个第三公切点和所述两个第四公切点中选择得到四个目标公切点;依次连接所述四个目标公切点确定一个四边形,以使所述第一轨迹单元和所述第二轨迹单元连接,从而依次连接所述多个轨迹单元以得到所述笔迹。
- 根据权利要求5所述笔迹处理方法,还包括:响应于所述第一轨迹单元的第一圆和第二圆和所述第二轨迹单元的第一圆和第二圆中的至少两个圆是内含关系,则确定所述第一轨迹单元和所述第二轨迹单元不需要连接。
- 根据权利要求5所述笔迹处理方法,其中,从所述两个第一公切点、所述两个第二公切点、所述两个第三公切点和所述两个第四公切点中选择得到四个目标公切点,包括:确定所述第一轨迹单元的第一圆和第二圆之间的第一外公切线和第二外公切线,其中,所述第一外公切线的斜率小于所述第二外公切线的斜率;确定所述第一轨迹单元的第二圆和所述第二轨迹单元的第二圆之间的第三外公切线和第四外公切线;响应于所述第三外公切线的斜率大于所述第四公切线的斜率,且所述第三外公切线的斜率大于所述第一外公切线的斜率且小于所述第一轨迹单元的第一圆的圆心和第二圆的圆心之间的所述圆心连线的斜率,或者,响应于所述第三外公切线的斜率小于所述第四公切线的斜率,且所述第三外公切线的斜率小于所述第二外公切线的斜率且大于所述第一轨迹单 元的第一圆的圆心和第二圆的圆心之间的所述连线的斜率,将所述两个第一公切点和所述两个第二公切点作为所述四个目标公切点;响应于所述第三外公切线的斜率大于所述第四公切线的斜率且小于所述第一外公切线的斜率,或者,响应于所述第三外公切线的斜率小于所述第四公切线的斜率且大于所述第二外公切线的斜率,将所述两个第一公切点中远离所述第一轨迹单元的第二圆的第一公切点、所述两个第三公切点中远离所述第一轨迹单元的第一圆的第三公切点、所述两个第二公切点中远离所述第二轨迹单元的第二圆的第二公切点和所述两个第四公切点中远离所述第二轨迹单元的第一圆的第四公切点作为所述四个目标公切点。
- 根据权利要求2-4任一项所述笔迹处理方法,其中,依次连接所述多个轨迹单元,以得到用于在所述触控显示屏上显示的所述笔迹,包括:对于所述至少一个轨迹点组中第k个轨迹点组,其中,所述第k个轨迹点组中的N个轨迹点在所述原始笔迹轨迹的延伸方向上依次排列,k为正整数,且小于等于所述至少一个轨迹点组的数量;确定在所述原始笔迹轨迹的延伸方向上所述第k个轨迹点组中的第一个轨迹点和第N个轨迹点;获取所述第一个轨迹点的第一个坐标和所述第N个轨迹点的第二个坐标;根据所述第一个坐标和所述第二个坐标,确定所述第k个轨迹点组对应的轨迹段的方向,根据所述第k个轨迹点组对应的所述轨迹段的方向,确定所述第k个轨迹点组中的N个轨迹点对应的N个轨迹单元中的每个轨迹单元的第一圆上的第一连接点和第二圆上的第二连接点;根据所述N个轨迹单元对应的N个第一连接点和N个第二连接点依次连接所述N个轨迹单元,从而依次连接所述多个轨迹单元,以得到所述笔迹。
- 根据权利要求8所述笔迹处理方法,其中,根据所述第一个坐标和所述第二个坐标,确定所述第k个轨迹点组对应的轨迹段的方向,包括:根据所述第一个坐标和所述第二个坐标,确定第一坐标差和第二坐标差,其中,所述第一个坐标为(x1,y1),所述第二个坐标为(x2,y2),所述第一坐标差Δx表示为Δx=x2-x1,所述第二坐标差Δy表示为Δy=y2-y1;响应于所述第一坐标差为0和所述第二坐标差为0,确定所述第k个轨迹点组对应的所述轨迹段的方向为其他方向,响应于所述第一坐标差不为0和所述第二坐标差为0,确定所述第k个轨迹点组对应的所述轨迹段的方向为横方向,响应于所述第一坐标差为0和所述第二坐标差不为0,确定所述第k个轨迹点组对应的所述轨迹段的方向为竖方向,响应于所述第一坐标差不为0和所述第二坐标差不为0:当Δx<0且Δy<0,确定所述第k个轨迹点组对应的所述轨迹段的方向为所述其他提方向。
- 根据权利要求9所述笔迹处理方法,其中,根据所述第k个轨迹点组对应的所述轨迹段的方向,确定所述第k个轨迹点组中的N个轨迹点对应的N个轨迹单元中的每个轨迹单元的第一圆上的第一连接点和第二圆上的第二连接点,包括:当所述第k个轨迹点组对应的所述轨迹段的方向为横方向时:xsj=x1j,ysj=y1j-rj,xbj=x2j,ybj=y2j+Rj;当所述第k个轨迹点组对应的所述轨迹段的方向为竖方向时:xsj=x1j-rj,ysj=y1j,xbj=x2j+Rj,ybj=y2j;当所述第k个轨迹点组对应的所述轨迹段的方向为撇方向或提方向时:xsj=x1j-0.707*rj,ysj=y1j-0.707*rj,xbj=x2j+0.707*Rj,ybj=y2j+0.707*Rj;当所述第k个轨迹点组对应的所述轨迹段的方向为捺方向或其他方向时:xsj=x1j-0.707*rj,ysj=y1j+0.707*rj,xbj=x2j+0.707*Rj,ybj=y2j-0.707*Rj;其中,(xbj,ybj)为所述第k个轨迹点组中的N个轨迹点对应的N个轨迹单元中的第j个轨迹单元对应的第一连接点的坐标,(xsj,ysj)为所述第j个轨迹单元对应的第二连接点的坐标,(x2j,y2j)为所述第j个轨迹单元的第一圆的圆心的坐标,Rj为所述第j个轨迹单元的第一圆的半径,(x1j,y1j)为所述第j个轨迹单元的第二圆的圆心的坐标,rj为所述第j个轨迹单元的第二圆的半径。
- 根据权利要求2-10任一项所述笔迹处理方法,其中,所述C1的范围为1.2~2,所述C2的范围为0.2~0.4,所述预设圆心角度的范围为20°~40°,在基于所述触控显示屏的显示画面确定的像素坐标系中,所述第一圆的圆心的横坐标大于所述第二圆的圆心的横坐标,所述第一圆的圆心的纵坐标大于所述第二圆的圆心的纵坐标。
- 根据权利要求1-11任一项所述笔迹处理方法,其中,基于在所述至少一个轨迹点组中的至少部分轨迹点的书写速度,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个轨迹单元,包括:基于所述至少一个轨迹点组中的至少部分轨迹点的书写速度,确定与所述至少一个轨迹点组中的所有轨迹点一一对应的多个中间轨迹单元,对所述多个中间轨迹单元进行透明度处理,以得到所述多个轨迹单元。
- 根据权利要求12所述笔迹处理方法,其中,对所述多个中间轨迹单元进行透明度处理,以得到所述多个轨迹单元,包括:根据所述多个中间轨迹单元,得到与所述多个中间轨迹单元一一对应的多个中间透明度轨迹单元,其中,每个所述透明度轨迹单元的形状和尺寸与每个所述透明度轨迹单元对应的中间轨迹单元的形状和尺寸均相同;对于所述多个中间透明度轨迹单元中的第h个中间透明度轨迹单元,在所述第h个中间透明度轨迹单元的边缘获取多个边缘透明度像素,从所述第h个中间透明度轨迹单元的中心向外延伸的方向上,将所述多个边缘透明度像素的透明度从100%逐渐变为0%,以得到所述第h个中间透明度轨迹单元对应的透明度轨迹单元,从而得到与所述多个中间透明度轨迹单元一一对应的多个透明度轨迹单元,其中,h为大于等于1且小于等于所述多个中间透明度轨迹单元的数量的正整数,所述多个边缘透明度像素中的至少部分边缘透明度像素位于对应的所述第h个中间透明度轨迹单元内,所述第h个中间透明度轨迹单元中除了所述多个边缘透明度像素之外的所有像素的透明度为100%;将所述多个中间轨迹单元和所述多个透明度轨迹单元分别进行叠加,以得到所述多个轨迹单元。
- 根据权利要求1-13任一项所述笔迹处理方法,其中,基于所述多个采样点,计算得到至少一个轨迹点组,包括:基于所述多个采样点,将所述原始笔迹轨迹划分为至少一个轨迹段,其中,所述至少一个轨迹段中的每个轨迹段包括M个采样点;对所述至少一个轨迹段中的每个轨迹段进行插值处理以得到与每个轨迹段对应的轨迹点组,从而得到所述至少一个轨迹点组。
- 根据权利要求14所述笔迹处理方法,其中,对所述至少一个轨迹段中的每个轨迹段进行插值处理以得到与每个轨迹段对应的轨迹点组,包括:对于每个轨迹段,根据该轨迹段对应的M个采样点,拟合得到所述轨迹段对应的贝塞尔曲线,在所述贝塞尔曲线上进行取点,以得到与所述轨迹段对应的轨迹点组。
- 根据权利要求1-15任一项所述笔迹处理方法,其中,所述笔迹的笔锋类型为毛笔笔锋。
- 一种笔迹处理装置,包括:存储器,用于非暂时性存储计算机可读指令;以及处理器,用于运行所述计算机可读指令,其中,所述计算机可读指令被所述处理器运行时执行根据权利要求1-16任一项所述的笔迹处理方法。
- 根据权利要求17所述的笔迹处理装置,还包括:触控显示屏,其中,所述触控显示屏配置为基于用户的触控操作以获取所述原始笔迹轨迹。
- 根据权利要求18所述的笔迹处理装置,其中,所述触控显示屏还配置为显示所述笔迹。
- 一种非瞬时性存储介质,非暂时性地存储计算机可读指令,其中,当所述计算机可读指令由计算机执行时可以执行根据权利要求1-16任一项所述的笔迹处理方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010365298.1 | 2020-04-30 | ||
CN202010365298.1A CN113590000B (zh) | 2020-04-30 | 2020-04-30 | 笔迹处理方法、笔迹处理装置、存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021218445A1 true WO2021218445A1 (zh) | 2021-11-04 |
Family
ID=78237463
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/080463 WO2021218445A1 (zh) | 2020-04-30 | 2021-03-12 | 笔迹处理方法、笔迹处理装置、存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113590000B (zh) |
WO (1) | WO2021218445A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114510158A (zh) * | 2021-12-08 | 2022-05-17 | 深圳市康冠商用科技有限公司 | 电子笔画纠错方法、装置、触摸屏设备及存储介质 |
CN115098014A (zh) * | 2021-12-29 | 2022-09-23 | 山东蓝贝思特教装集团股份有限公司 | 书写笔迹显示方法、控制器及tft液晶书写装置 |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114115673B (zh) * | 2021-11-25 | 2023-10-27 | 海信集团控股股份有限公司 | 车载屏幕的控制方法 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521858A (zh) * | 2011-11-28 | 2012-06-27 | 北京盛世宣合信息科技有限公司 | 电子毛笔书写笔迹生成方法 |
CN102937848A (zh) * | 2012-12-04 | 2013-02-20 | 上海合合信息科技发展有限公司 | 对手写笔迹进行编辑处理的方法及电子设备 |
CN107292936A (zh) * | 2017-05-18 | 2017-10-24 | 湖南大学 | 一种汉字字体矢量化方法 |
CN110321054A (zh) * | 2019-06-20 | 2019-10-11 | 广州视源电子科技股份有限公司 | 毛笔笔迹绘制方法、装置、设备及可读存储介质 |
CN110531875A (zh) * | 2019-08-21 | 2019-12-03 | 深圳市威屏科技有限公司 | 书写笔锋的生成方法、终端设备及存储介质 |
US20200042109A1 (en) * | 2017-06-22 | 2020-02-06 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for dynamically displaying interface content and device thereof |
-
2020
- 2020-04-30 CN CN202010365298.1A patent/CN113590000B/zh active Active
-
2021
- 2021-03-12 WO PCT/CN2021/080463 patent/WO2021218445A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102521858A (zh) * | 2011-11-28 | 2012-06-27 | 北京盛世宣合信息科技有限公司 | 电子毛笔书写笔迹生成方法 |
CN102937848A (zh) * | 2012-12-04 | 2013-02-20 | 上海合合信息科技发展有限公司 | 对手写笔迹进行编辑处理的方法及电子设备 |
CN107292936A (zh) * | 2017-05-18 | 2017-10-24 | 湖南大学 | 一种汉字字体矢量化方法 |
US20200042109A1 (en) * | 2017-06-22 | 2020-02-06 | Tencent Technology (Shenzhen) Company Limited | Method and apparatus for dynamically displaying interface content and device thereof |
CN110321054A (zh) * | 2019-06-20 | 2019-10-11 | 广州视源电子科技股份有限公司 | 毛笔笔迹绘制方法、装置、设备及可读存储介质 |
CN110531875A (zh) * | 2019-08-21 | 2019-12-03 | 深圳市威屏科技有限公司 | 书写笔锋的生成方法、终端设备及存储介质 |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114510158A (zh) * | 2021-12-08 | 2022-05-17 | 深圳市康冠商用科技有限公司 | 电子笔画纠错方法、装置、触摸屏设备及存储介质 |
CN114510158B (zh) * | 2021-12-08 | 2022-12-30 | 深圳市康冠商用科技有限公司 | 电子笔画纠错方法、装置、触摸屏设备及存储介质 |
CN115098014A (zh) * | 2021-12-29 | 2022-09-23 | 山东蓝贝思特教装集团股份有限公司 | 书写笔迹显示方法、控制器及tft液晶书写装置 |
CN115098014B (zh) * | 2021-12-29 | 2024-05-14 | 山东蓝贝思特教装集团股份有限公司 | 书写笔迹显示方法、控制器及tft液晶书写装置 |
Also Published As
Publication number | Publication date |
---|---|
CN113590000B (zh) | 2023-01-17 |
CN113590000A (zh) | 2021-11-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021218445A1 (zh) | 笔迹处理方法、笔迹处理装置、存储介质 | |
US11687233B2 (en) | Handwriting processing method, touch display device, computer device and storage medium | |
CN103310474B (zh) | 一种手写原笔迹的实现方法及系统 | |
CN109284059B (zh) | 笔迹绘制方法、装置、交互智能平板和存储介质 | |
US11460988B2 (en) | Method of styling content and touch screen device for styling content | |
KR20210038446A (ko) | 제스처를 기반으로 전자기기를 제어하는 방법 및 장치 | |
WO2013010027A1 (en) | Drawing aid system for multi-touch devices | |
US20130215045A1 (en) | Stroke display method of handwriting input and electronic device | |
CN112463012B (zh) | 纸屏同步中手写笔迹一致性显示的方法 | |
US10664072B2 (en) | Multi-stroke smart ink gesture language | |
US11475617B2 (en) | Path-constrained drawing with visual properties based on drawing tool | |
WO2023093458A1 (zh) | 确定墨水屏的刷新模式的方法、电子设备和存储介质 | |
CN104517302A (zh) | 显示设备和用于提供该显示设备的字体效果的方法 | |
WO2021218446A1 (zh) | 笔迹处理方法、笔迹处理装置、非瞬时性存储介质 | |
WO2021218448A1 (zh) | 笔迹形成方法、笔迹形成装置及电子设备 | |
US20240020893A1 (en) | Handwriting Forming Method and Apparatus, and Electronic Device | |
CN113238710B (zh) | 一种智能交互平板、其显示方法及可读存储介质 | |
WO2023206257A1 (zh) | 手写笔迹生成方法、装置、计算机设备和可读介质 | |
US11900568B2 (en) | Writing trajectory processing method, touch control device, writing system and storage medium | |
WO2023070334A1 (zh) | 手写输入显示方法及装置、计算机可读存储介质 | |
CN107730571A (zh) | 用于绘制图像的方法和装置 | |
CN116027954A (zh) | 一种笔迹的生成方法及相关装置 | |
CN115509431A (zh) | 笔迹绘制方法、装置、设备及存储介质 | |
CN114201075A (zh) | 一种触屏设备及其相同的触摸输入功能冲突的解决方法 | |
CN116136721A (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: 21797276 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: 21797276 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 07.07.2023) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21797276 Country of ref document: EP Kind code of ref document: A1 |