WO2021218446A1 - 笔迹处理方法、笔迹处理装置、非瞬时性存储介质 - Google Patents

笔迹处理方法、笔迹处理装置、非瞬时性存储介质 Download PDF

Info

Publication number
WO2021218446A1
WO2021218446A1 PCT/CN2021/080493 CN2021080493W WO2021218446A1 WO 2021218446 A1 WO2021218446 A1 WO 2021218446A1 CN 2021080493 W CN2021080493 W CN 2021080493W WO 2021218446 A1 WO2021218446 A1 WO 2021218446A1
Authority
WO
WIPO (PCT)
Prior art keywords
handwriting
handwriting point
point
points
model pattern
Prior art date
Application number
PCT/CN2021/080493
Other languages
English (en)
French (fr)
Inventor
贾红红
胡风硕
Original Assignee
京东方科技集团股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东方科技集团股份有限公司 filed Critical 京东方科技集团股份有限公司
Priority to US17/763,704 priority Critical patent/US11789604B2/en
Publication of WO2021218446A1 publication Critical patent/WO2021218446A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04883Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures for inputting data by handwriting, e.g. gesture or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03545Pens or stylus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/22Character recognition characterised by the type of writing
    • G06V30/226Character recognition characterised by the type of writing of cursive writing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/32Digital ink
    • G06V30/333Preprocessing; Feature extraction
    • G06V30/347Sampling; Contour coding; Stroke extraction

Definitions

  • the embodiments of the present disclosure relate to a handwriting processing method, a handwriting processing device, and a non-transitory storage medium.
  • At least one embodiment of the present disclosure provides a handwriting processing method, including: acquiring a handwriting point group corresponding to a stroke on a working surface of a touch device, wherein the handwriting point group includes a plurality of handwriting points arranged in sequence, so The data of each handwriting point in the plurality of handwriting points includes coordinates and an action type; a plurality of model patterns corresponding to the plurality of handwriting points are determined based on the coordinates and the action type of the plurality of handwriting points, wherein the A plurality of model patterns are in one-to-one correspondence with the plurality of handwriting points; and the plurality of model patterns are sequentially connected to determine a handwriting trajectory for display corresponding to the handwriting point group.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points includes: responding to the plurality of handwriting points
  • the action type of the first handwriting point in the handwriting point is the stroke type
  • the model corresponding to the first handwriting point is determined according to the corresponding basic line width during the writing process in the writing application and the coordinates of the first handwriting point The size and center coordinates of the pattern.
  • determining multiple model patterns corresponding to the multiple handwriting points based on the coordinates and action types of the multiple handwriting points further includes:
  • determining the starting stroke type corresponding to the handwriting point group, and determining the corresponding based on the starting stroke type and the model pattern corresponding to the first handwriting point The size and center coordinates of the auxiliary model pattern at the first handwriting point, and based on the model pattern and the auxiliary model pattern corresponding to the first handwriting point, it is determined to correspond to the first handwriting
  • determining the stroke type corresponding to the handwriting point group includes: determining the t-th handwriting point among the plurality of handwriting points, where t is positive An integer, t ⁇ 1, and the coordinates of the t-th handwriting point are different from the coordinates of the first handwriting point; and based on the coordinates of the first handwriting point and the coordinates of the t-th handwriting point, Determine the starting stroke type corresponding to the handwriting point group.
  • the coordinates of the first handwriting point are (x1, y1)
  • the coordinates of the t-th handwriting point are (x2, y2)
  • determining the model pattern corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points further includes: responding to the first handwriting
  • the action type of the point is the stroke type
  • the size and center coordinates of the model pattern corresponding to the second handwriting point are determined according to the basic line width and the coordinates of the second handwriting point among the plurality of handwriting points, where , The first handwriting point is adjacent to the second handwriting point.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points includes: responding to the plurality of handwriting points
  • the action type of the first handwriting point in the handwriting points is the stroke type, and the size and size of the model pattern corresponding to the first handwriting point in the plurality of handwriting points are determined according to the previous handwriting point group of the handwriting point group.
  • the center coordinates of the model pattern corresponding to the first handwriting point are determined according to the coordinates of the first handwriting point, and according to The coordinates of the second handwriting point determine the center coordinates of the model pattern corresponding to the second handwriting point.
  • the size and correspondence of the model pattern corresponding to the first handwriting point of the plurality of handwriting points are determined according to the previous handwriting point group of the handwriting point group.
  • the size of the model pattern of the second handwriting point in the plurality of handwriting points includes: the coordinates of the Nth handwriting point in response to the previous handwriting point group and the first handwriting of the handwriting point group The coordinates of the points are the same, the size of the model pattern corresponding to the Nth handwriting point of the previous handwriting point group is taken as the size of the model pattern corresponding to the first handwriting point of the handwriting point group, and the The third distance between the second handwriting point of the handwriting point group and the first handwriting point and the fourth distance between the Nth handwriting point of the previous handwriting point group and the N-1th handwriting point, and according to the basic line Width, the size of the model pattern corresponding to the first handwriting point of the handwriting point group, the third distance and the fourth
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points further includes: Starting from the i-th handwriting point in the handwriting points, determine the first distance between the i-th handwriting point and the i-1th handwriting point and the distance between the i-1th handwriting point and the i-2th handwriting point The second distance, and according to the basic line width, the size of the model pattern corresponding to the i-1th handwriting point, the first distance and the second distance, it is determined to correspond to the i-th handwriting The size of the model pattern of the point; and determining the center coordinate of the model pattern corresponding to the i-th handwriting point according to the coordinates of the i-th handwriting point, where i is a positive integer and i ⁇ 3.
  • the M-th handwriting point in the plurality of handwriting points is the last handwriting point of the handwriting point group, based on the coordinate sum of the plurality of handwriting points
  • the action type determining the multiple model patterns corresponding to the multiple handwriting points includes: in response to the action type of the M-th handwriting point being the ending type, determining the starting stroke type corresponding to the handwriting point group, and The size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point in the plurality of handwriting points is set according to the stroke type, where j is a positive integer and j ⁇ 1.
  • the stroke type of the stroke includes horizontal, vertical, skew, pin, lift, and other types
  • the stroke type setting corresponds to the plurality of handwriting points according to the stroke type.
  • the size of each model pattern from the Mj-th handwriting point to the M-th handwriting point includes: if the stroke type is horizontal or ⁇ , sequentially increasing corresponding to the Mj-th handwriting point to The size of each model pattern of the M-th handwriting point; if the stroke type of the stroke is vertical or skewed or lifted, according to a second preset ratio, the size corresponding to the Mj-th handwriting point is sequentially reduced to the M-th handwriting point.
  • each model pattern of each handwriting point and if the starting stroke type is another type, it is not set according to the starting stroke type to correspond to the Mjth handwriting point to the Mth handwriting point in the plurality of handwriting points The size of each model pattern.
  • the model pattern corresponding to each handwriting point of the handwriting point group includes a circle or an ellipse
  • the plurality of model patterns are sequentially connected to determine the pattern corresponding to the
  • the handwriting trajectory of the handwriting point group for display includes: sequentially connecting the four extrinsic tangent points of the model pattern corresponding to each two adjacent handwriting points among the plurality of handwriting points to form each of the two adjacent handwriting points.
  • obtaining the set of handwriting points corresponding to the strokes on the work surface of the touch device includes: To obtain multiple sampling points; and based on the multiple sampling points, using a Bezier curve fitting algorithm to perform interpolation to obtain multiple interpolation points, wherein the multiple of the set of handwriting points
  • Each handwriting point includes the plurality of sampling points and the plurality of interpolation points
  • the action type of each sampling point in the plurality of sampling points is one of a set consisting of a stroke type, a stroke type, and a stroke type .
  • the stroke corresponds to a plurality of handwriting point groups
  • the action type of the first handwriting point of the first handwriting point group in the plurality of handwriting point groups is Stroke up type
  • the action type of the last handwriting point of the last handwriting point group in the plurality of handwriting point groups is the ending stroke type.
  • the tip type of the handwriting track used for display is a brush tip.
  • At least one 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 the instructions are executed by the processor, the handwriting processing method provided by any embodiment of the present disclosure is executed.
  • the handwriting processing device further includes a touch device, wherein the touch device is configured to obtain a handwriting point group corresponding to a stroke on a working surface of the touch device.
  • the handwriting processing device further includes: a display device, wherein the display device is configured to display a handwriting trace for display corresponding to the handwriting point group.
  • At least one embodiment of the present disclosure further provides a non-transitory storage medium that non-transitory stores computer-readable instructions, wherein, when the non-transitory computer-readable instructions are executed by a computer, any implementation of the present disclosure can be executed
  • the example provides instructions for the handwriting processing method.
  • FIG. 1 is a schematic flowchart of a handwriting processing method provided by at least one embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of a method for obtaining a handwriting point group provided by at least one embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a handwriting point group provided by at least one embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of a water drop unit provided by at least one embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of the effect of simulating the end of the brush tip provided by at least one embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of calculating the tangent point of the grandiose provided by at least one embodiment of the present disclosure
  • FIG. 7 is an effect diagram of a simulated brush tip provided by at least one embodiment of the present disclosure.
  • FIG. 8 is a schematic block diagram of a handwriting processing device provided by at least one embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of a storage medium provided by at least one embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
  • the electronic interactive whiteboard plays an extremely important role in the interaction and sharing of information.
  • the processing speed and handwriting processing effects of electronic interactive whiteboards restrict the user experience of the product.
  • the method to achieve the effect of the brush stroke of the non-pressure-sensitive handwriting input is usually more complicated. It takes a lot of time to calculate to output the strokes with the effect of the stroke. It requires high computing resources for the hardware, lacks real-time performance, and it is difficult for users to get comfort. Handwriting input experience.
  • the handwriting automatic processing technology can eliminate the jagged or stepped appearance of handwriting, and at the same time has a pen-point effect, providing users with a smoother, rounder, smooth, and natural writing experience.
  • the handwriting processing method includes: acquiring a handwriting point group corresponding to a stroke on a working surface of a touch device, wherein the handwriting point group includes a plurality of handwriting points arranged in sequence ,
  • the data of each handwriting point in the multiple handwriting points includes the coordinates and the action type;
  • the model pattern corresponding to the multiple handwriting points is determined based on the coordinates and the action type of the multiple handwriting points; and the model patterns corresponding to the multiple handwriting points are sequentially connected To determine the handwriting track for display corresponding to the handwriting point group.
  • Some embodiments of the present disclosure also provide a note processing device and a non-transitory storage medium corresponding to the above note processing method.
  • the handwriting processing method can obtain the handwriting point group based on the strokes written by the user on the working surface of the touch device, and correspond to the handwriting point group according to the coordinates and action types of each handwriting point in the handwriting point group
  • the handwriting trajectory is processed and used for display.
  • the handwriting processing method can realize the effect of real-time handwriting processing without pressure sensitivity, and at the same time make the handwriting trajectory used for display have a stroke effect.
  • the handwriting processing method also has the advantages of fast calculation speed, simple implementation principle, and good real-time performance. It can be widely used in electronic interactive whiteboards (for example, conference whiteboards, teaching whiteboards, etc.), electronic board newspapers, airport digital signature walls, cloud notebooks, and handwriting Scenes that require handwriting input, such as boards.
  • FIG. 1 is a schematic flowchart of a handwriting processing method provided by at least one embodiment of the present disclosure.
  • the handwriting processing method is applied to a computing device, and the computing device includes any electronic device with computing function, such as a mobile phone, a notebook computer, a tablet computer, a desktop computer, a server, etc., which is not limited in the embodiments of the present disclosure.
  • the computing device has a central processing unit (Central Processing Unit, CPU) or a graphics processing unit (Graphics Processing Unit, GPU), and also includes a memory.
  • the memory is, for example, a non-volatile memory (for example, Read Only Memory (ROM)), and the code of the operating system is stored thereon.
  • the memory also stores codes or instructions, and by running these codes or instructions, the handwriting processing method provided by the embodiments of the present disclosure can be implemented.
  • ROM Read Only Memory
  • the computing device may also include a touch device, such as a touch screen or a touch pad, to obtain the initial handwriting formed on the working surface of the touch device when the user writes.
  • the touch screen can not only receive the initial handwriting, but also display correspondingly at the same time.
  • the user can write directly on the working surface of the touch screen with a finger, or can write on the working surface of the touch screen with an active stylus or a passive stylus, which is not limited in the embodiments of the present disclosure.
  • the work surface refers to a surface used to detect a user's touch operation, such as the touch surface of a touch screen.
  • the type of the touch device is not limited, and it can be not only a touch screen, but also any device with touch function such as an interactive whiteboard, which can be determined according to actual needs.
  • the handwriting processing method includes the following steps S100 to S300.
  • Step S100 Obtain a handwriting point group corresponding to the strokes on the working surface of the touch device, where the handwriting point group includes a plurality of handwriting points arranged in sequence, and the data of each handwriting point in the plurality of handwriting points includes Coordinates and action types.
  • the pen down action corresponds to the beginning of the stroke writing process
  • the pen up action corresponds to the end of the stroke writing process.
  • the pen down action and the pen up action In between is the pen movement, which corresponds to the continuation of the stroke writing process; when the user completes a complete stroke writing process, the writing track on the working surface of the touch device corresponds to one stroke.
  • the aforementioned strokes may have any shape.
  • the aforementioned strokes may be strokes of Chinese characters, or strokes of foreign characters (for example, English, Japanese, Korean, etc.).
  • FIG. 2 is a schematic flowchart of a method for obtaining a handwriting point group provided by at least one embodiment of the present disclosure.
  • FIG. 3 is a schematic diagram of a handwriting point group provided by at least one embodiment of the present disclosure. The method for obtaining the handwriting point group shown in FIG. 2 will be described in detail below in conjunction with FIG. 3.
  • obtaining a set of handwriting points corresponding to strokes on the work surface of the touch device may include the following steps S101 to S102:
  • Step S101 sampling the strokes on the working surface of the touch device to obtain multiple sampling points
  • Step S102 Based on a plurality of sampling points, interpolation is performed using a Bezier curve fitting algorithm to obtain a plurality of interpolation points.
  • the touch device itself can execute the above steps S11 to S12 based on hardware (such as touch circuits, sampling circuits, etc.) and software (such as related program algorithms).
  • hardware such as touch circuits, sampling circuits, etc.
  • software such as related program algorithms
  • the touch device may sample the strokes written by the user on the work surface according to a predetermined timing to obtain the coordinates of a plurality of sampling points arranged in sequence (arranged according to the order of sampling).
  • the stroke can be sampled by sparsely sampling points to obtain multiple sampling points, and the number of the multiple sampling points can be determined according to actual conditions.
  • FIG. 3 by sampling the strokes 110 on the working surface of the touch device in real time (for example, sampling at equal time intervals), nine sampling points C1 to C9 arranged in sequence can be obtained (as shown in FIG. 3). (Shown by the hollow black circle).
  • the touch device may also determine the action type of each sampling point according to event-driven rules. For example, as shown in Figure 3, the action type of the sampling point C1 corresponding to the pen down action can be determined as the pen up type according to the pen down action (ie pen down event); The action type of the sampling point C9 corresponding to the pen action is determined as the closing type; the sampling points C2 ⁇ C8 located between the sampling point C1 and the sampling point C9 correspond to the pen movement, and the action types of the sampling points C2 ⁇ C8 can be determined as Pen type.
  • the action type of the sampling point C1 corresponding to the pen down action can be determined as the pen up type according to the pen down action (ie pen down event);
  • the action type of the sampling point C9 corresponding to the pen action is determined as the closing type; the sampling points C2 ⁇ C8 located between the sampling point C1 and the sampling point C9 correspond to the pen movement, and the action types of the sampling points C2 ⁇ C8 can be determined as Pen type.
  • ACTION_DOWN represents a pen down event
  • ACTION_MOVE represents a pen movement event
  • ACTION_UP represents a pen up event
  • the 9 sampling points C1 to C9 can divide the stroke 110 into four trajectory segments, and the four trajectory segments are the first trajectory segments corresponding to the sampling points C1 to C3. , The second trajectory segment corresponding to sampling points C3 to C5, the third trajectory segment corresponding to sampling points C5 to C7, and the fourth trajectory segment corresponding to sampling points C7 to C9.
  • the first trajectory section, the second trajectory section, the third trajectory section, and the fourth trajectory section are arranged in sequence in the extending direction of the stroke 110 (that is, the direction from the sampling point C1 to the sampling point C9), the first trajectory section and the second trajectory section
  • the 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
  • the third trajectory segment and the fourth trajectory segment are adjacent and both correspond to the same sampling point C7.
  • the Bezier curve fitting algorithm can be used to perform interpolation to obtain 6 interpolation points, and then the handwriting point group corresponding to the trajectory segment can be obtained.
  • the handwriting point group includes 9 Trajectory points (ie 3 sampling points and 6 interpolation points).
  • the 9 track points are arranged in order according to the extension direction of the stroke.
  • the Bezier curve fitting algorithm is used to perform interpolation to obtain 6 interpolation points, which means that the second-order Bézier is fitted based on the three sampling points C1 ⁇ C3 Er curve (shown as the black solid line in Figure 3), and take 3 interpolation points in the curve segment between sampling point C1 and sampling point C2, and take 3 interpolation points in the curve segment between sampling point C2 and sampling point C3 Interpolate points to obtain the coordinates of 6 interpolation points (as shown by the solid black point C30 in Figure 3), from which the handwriting point group corresponding to the sampling points C1 to C3 (that is, the handwriting corresponding to the first track segment) can be obtained Point group).
  • the handwriting point group corresponding to the second trajectory segment, the handwriting point group corresponding to the third trajectory segment, and the handwriting point group corresponding to the fourth trajectory segment can be obtained respectively.
  • the action type of the trajectory point that is essentially an interpolation point can also be determined as the pen type.
  • the stroke 110 corresponds to multiple (four) handwriting point groups, where the action type of the first handwriting point of the first handwriting point group is the stroke type, and the last handwriting point
  • the action type of the last handwriting point of the group is the closing type
  • the action type of the remaining handwriting points is the pen type.
  • the data of each handwriting point may include a type identifier for marking the action type of the handwriting point; for example, when the type identifier is 1, the action type of the handwriting point is the stroke type; When the type is identified as 2, the action type of the handwriting point is the pen type; when the type is identified as 3, the action type of the handwriting point is the pen type.
  • each handwriting point group can be made to correspond to a type identification; for example, when the handwriting point group corresponds to When the type identification of the handwriting point group is 1, the action type of the first handwriting point of the handwriting point group is the stroke type, and the action type of the remaining handwriting points of the handwriting point group is the pen type by default; when the type identification of the handwriting point group is 2 , The action type of each handwriting point of the handwriting point group is the pen stroke type by default; when the type mark corresponding to the handwriting point group is 3, the action type of the last handwriting point of the handwriting point group is the ending type, and the handwriting The action type of the remaining handwriting points in the point group defaults to the pen type.
  • the action type of each handwriting point in the handwriting point group is the stroke type; when the type identifier corresponding to the handwriting point group is 2, each handwriting point in the handwriting point group is The action types of are all pen stroke types; when the type mark corresponding to the handwriting point group is 3, the action type of each handwriting point in the handwriting point group is the pen type.
  • a stroke may only correspond to 1 handwriting point group; in this case, the action type of the first handwriting point of the handwriting point group is the stroke type, and the last handwriting point of the handwriting point group The action type of is the pen type, and the action type of the remaining handwriting points in the handwriting point group is the pen type by default.
  • the handwriting point group includes interpolation points obtained by interpolation using the Bezier curve fitting algorithm, which can make the subsequent handwriting trajectory for display smoother and more beautiful.
  • the Bezier curve fitting algorithm is not limited to the case of fitting a second-order Bezier curve.
  • each trajectory segment of the stroke may correspond to 4 sampling points.
  • the interpolation point may be obtained by fitting a third-order Bezier curve.
  • the handwriting point group may only include a plurality of sampling points, but not the interpolation points. This disclosure does not limit this.
  • the present disclosure does not limit the acquisition method of the handwriting point group, as long as the data of the handwriting point group can be obtained.
  • the handwriting processing method provided by the embodiments of the present disclosure may be executed by the handwriting processing device, and the handwriting point group data may be received from the outside by the handwriting processing device.
  • Step S200 Determine multiple model patterns corresponding to the multiple handwriting points based on the coordinates and action types of the multiple handwriting points, wherein the multiple model patterns correspond to the multiple handwriting points one-to-one.
  • the shape of the model pattern may be preset, for example, may include a circle and an ellipse (for example, the ratio of the minor axis and the major axis of the ellipse is preset), but is not limited to this.
  • the embodiment of the present disclosure is mainly described by taking the model pattern as a circle as an example, it should not be regarded as a limitation of the present disclosure.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points may include operation P201: responding to the first one of the plurality of handwriting points
  • the action type of the handwriting point is the stroke type
  • the size and center coordinates of the model pattern corresponding to the first handwriting point are determined according to the corresponding basic line width and the coordinates of the first handwriting point during the writing process in the writing application. For example, taking the stroke 110 shown in FIG. 3 as an example, based on the operation P201, the model pattern corresponding to the first handwriting point C1 of the first trajectory segment of the stroke 110 can be determined.
  • the basic line width is the line width of the writing track.
  • the basic line width is set to a certain default value in the writing program; for example, in other examples, the basic line width has multiple optional values in the writing program, and the user can select one of the multiple optional values according to needs.
  • One is the basic line width; for example, in some other examples, the writing program only sets the value range of the basic line width, and the user can set the basic line width within the value range. The embodiment of the present disclosure does not limit this.
  • the model pattern is a circle, and the radius of the circle can be used to indicate the size of the model pattern; for example, the radius of the circular model pattern corresponding to the first handwriting point can be set to 1 of the basic line width. /2.
  • the model pattern is elliptical, and the semi-minor axis of the ellipse (that is, half of the minor axis) can be used to represent the size of the model pattern; for example, the elliptical model corresponding to the first handwriting point can be The semi-minor axis of the pattern is set to 1/2 of the basic line width.
  • the upper left corner of the touch area of the touch device (that is, the area where the user can write) can be taken as the origin O, and the direction extending to the right can be taken as the x axis (the value of x is getting larger and larger), and the direction of extending downward As the y axis (the value of y is getting larger and larger), to construct the coordinate system Oxy1, the coordinate of each track point in the handwriting point group is the coordinate of each track point in the coordinate system Oxy1.
  • the upper left corner of the display area (the upper left corner of the display device (e.g., configured to display the handwriting trace for subsequent display) as the origin O, and the direction extending to the right as the x-axis (the value of x becomes larger and larger)
  • the downward extending direction is used as the y-axis (the value of y is getting larger and larger) to construct the coordinate system Oxy2, as long as the coordinates of each handwriting point (relative to the coordinate system Oxy1) are mapped to the coordinate system Oxy2,
  • the center coordinates of the model pattern corresponding to each handwriting point in the coordinate system Oxy2 can be obtained.
  • the touch area of the touch device and the display area of the display device have the same shape and size, here
  • the coordinates of each handwriting point can be directly used as the center coordinates of the model pattern corresponding to each handwriting point. Therefore, the corresponding coordinates can be determined according to the coordinates of any handwriting point (including but not limited to the first handwriting point)
  • the center coordinates of the model pattern at any handwriting point will not be described in detail later.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points may further include operation P202: responding to the first one of the plurality of handwriting points.
  • the action type of each handwriting point is the starting stroke type, and the starting stroke type corresponding to the handwriting point group is determined; based on the starting stroke type and the model pattern corresponding to the first handwriting point, the auxiliary model pattern corresponding to the first handwriting point is determined Size and center coordinates; and based on the model pattern and auxiliary model pattern corresponding to the first handwriting point, determine the auxiliary quadrilateral corresponding to the first handwriting point, where the auxiliary quadrilateral corresponding to the first handwriting point is used to connect the first handwriting point Model pattern and auxiliary model pattern corresponding to 1 handwriting point.
  • the pattern of the first handwriting point C1 corresponding to the first trajectory segment of the stroke 110 can be set as a water drop unit, so that the stroke of a brush can be simulated. Pen effect.
  • determining the stroke type corresponding to the handwriting point group may include: determining the t-th handwriting point among the multiple handwriting points in the handwriting point group, where t is a positive integer, t ⁇ 1, and The coordinates of the t-th handwriting point are different from the coordinates of the first handwriting point; and based on the coordinates of the first handwriting point and the coordinates of the t-th handwriting point, determine the stroke type corresponding to the handwriting point group.
  • t can be preset to 2. If the coordinates of the second handwriting point are different from the coordinates of the first handwriting point, it is based on the coordinates of the first handwriting point and the coordinates of the second handwriting point , Determine the stroke type corresponding to the handwriting point group; if the coordinates of the second handwriting point are the same as the coordinates of the first handwriting point, set t to 3, 4,..., M (M is the handwriting point group The number of handwriting points) until the coordinates of the t-th handwriting point are different from the coordinates of the first handwriting point, and then based on the coordinates of the first handwriting point and the coordinates of the t-th handwriting point, determine the corresponding handwriting point group The type of starting strokes.
  • t can be set to M, M-1,..., 2 in sequence until the coordinates of the t-th handwriting point are different from the coordinates of the first handwriting point, and then based on the first handwriting point
  • the coordinates of and the coordinates of the t-th handwriting point determine the stroke type corresponding to the handwriting point group. It should be noted that the embodiment of the present disclosure does not limit the manner of determining the t-th handwriting point, as long as the coordinates of the t-th handwriting point are different from the coordinates of the first handwriting point.
  • the coordinates of the first handwriting point are (x1, y1)
  • the coordinates of the t-th handwriting point are (x2, y2)
  • dx x2–x1
  • dy y2–y1
  • the coordinates of a handwriting point and the coordinates of the t-th handwriting point determine the stroke type corresponding to the handwriting point group, including:
  • the size of the auxiliary model pattern corresponding to the first handwriting point is determined
  • center coordinates including:
  • the stroke type is priming or lifting
  • R represents the size of the model pattern corresponding to the first handwriting point
  • O 1 represents the center of the model pattern corresponding to the first handwriting point
  • r represents the size of the auxiliary model pattern corresponding to the first handwriting point
  • O 2 represents the center of the auxiliary model pattern corresponding to the first handwriting point
  • O 1 O 2 represents the distance between the center line between the model pattern corresponding to the first handwriting point and the auxiliary model pattern
  • w represents the basic line width
  • represents the angle between the center line and the horizontal line (that is, the center angle of the circle that the center line needs to be rotated in the counterclockwise direction to the horizontal line).
  • Fig. 4 is a schematic diagram of a water drop unit provided by at least one embodiment of the present disclosure.
  • the model pattern corresponding to the first handwriting point and the auxiliary model pattern are both circles
  • R represents the radius of the circular model pattern corresponding to the first handwriting point
  • O 1 represents the center of the circular model pattern corresponding to the first handwriting point
  • r represents the radius of the circular auxiliary model pattern corresponding to the first handwriting point
  • O 2 represents the circular auxiliary model corresponding to the first handwriting point
  • the center of the pattern, O 1 O 2 represents the distance between the center line of the model pattern corresponding to the first handwriting point and the auxiliary model pattern
  • represents the angle between the center line and the horizontal line (that is, the line of the center of the circle moves counterclockwise) The angle of the center of the circle required to rotate the direction to the horizontal direction).
  • determining the auxiliary quadrilateral corresponding to the first handwriting point may include: determining the circular model pattern corresponding to the first handwriting point and the four grand tangent points of the circular auxiliary model pattern, and connecting the four grand tangents in sequence Point to form an auxiliary quadrilateral corresponding to the first handwriting point.
  • the auxiliary quadrilateral is used to connect the model pattern corresponding to the first handwriting point and the auxiliary model pattern to form a connected pattern.
  • the auxiliary quadrilateral formed by four external common tangent points is used to connect the model pattern and the auxiliary model pattern, which is beneficial to eliminate jagged and burrs.
  • the auxiliary quadrilateral of the first handwriting point may include: determining the first diameter in the circular model pattern that is perpendicular to the center line of the circular model pattern and the circular auxiliary model pattern, and determining the and circle in the circular auxiliary model pattern
  • the second diameter is perpendicular to the line of the center of the shape model pattern and the circular auxiliary model pattern, and the two end points of the first diameter and the two end points of the second diameter are used as the four vertices of the auxiliary quadrilateral to determine the auxiliary quadrilateral.
  • the water drop unit shown in FIG. 4 is exemplary and should not be regarded as a limitation of the present disclosure.
  • the model pattern and auxiliary model pattern corresponding to the first handwriting point may both be oval.
  • the corresponding The auxiliary quadrilateral at the first handwriting point may include: determining the elliptical model pattern corresponding to the first handwriting point and four external common tangent points of the elliptical auxiliary model pattern, and sequentially connecting the four external common tangent points to form a corresponding The auxiliary quadrilateral at the first handwriting point.
  • determining multiple model patterns corresponding to the multiple handwriting points based on the coordinates and action types of the multiple handwriting points may further include operation P203: the action type in response to the first handwriting point is
  • the size and center coordinates of the model pattern corresponding to the second handwriting point are determined according to the basic line width and the coordinates of the second handwriting point among the multiple handwriting points.
  • the first handwriting point and the second handwriting point are adjacent in the direction of stroke extension.
  • the model pattern corresponding to the second handwriting point of the first trajectory segment of the stroke 110 can be determined.
  • the radius of the circular model pattern corresponding to the second handwriting point may be set to 1/2 of the basic line width.
  • the semi-minor axis of the ellipse model pattern corresponding to the second handwriting point can be set to 1/2 of the basic line width. That is, in response to the action type of the first handwriting point being the stroke type, the size of the model pattern corresponding to the second handwriting point may be the same as the size of the model pattern corresponding to the first handwriting point.
  • the embodiments of the present disclosure include but are not limited thereto.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points may further include operation P204: From the i-th handwriting of the plurality of handwriting points Start from point, determine the first distance d1 between the i-th handwriting point and the i-1th handwriting point and the second distance d2 between the i-1th handwriting point and the i-2th handwriting point, and based on the basic line width w , model pattern corresponding to the i-1 th dot size of R & lt handwriting i-1, the first distance d1 and second distance d2, R i determines the size of the i-th stroke corresponding to the dot pattern models; and in accordance with the i
  • the coordinates of the handwriting points determine the center coordinates of the model pattern corresponding to the i-th handwriting point, where i is a positive integer and i ⁇ 3.
  • the model patterns of the remaining track points except the first handwriting point and the second handwriting point corresponding to the first trajectory segment of the stroke 110 can be determined.
  • operation P204 can adjust the size of the model pattern corresponding to the handwriting point according to the change of the distance between the adjacent handwriting points, so that the stroke effect of the brush tip can be simulated.
  • the first distance d1 can be calculated according to the coordinates of the i-th handwriting point and the coordinates of the i-1th handwriting point, and the coordinates of the i-1th handwriting point and the i-2th handwriting point Calculate the second distance d2 from the coordinates.
  • the second distance d2, to determine the size R i of the model pattern corresponding to the i-th handwriting point may include:
  • the values of t1, t2, and p are all preset, and t1 ⁇ 1, t2>1, and p is a positive number.
  • t1, t2, and p can all be set according to actual needs.
  • the value range of t1 can be set to [0.7, 0.9], and the embodiments of the present disclosure include but are not limited to this.
  • t1 can be 0.8.
  • the value range of t2 can be set to [1.1, 1.3], and the embodiments of the present disclosure include but are not limited to this.
  • t2 can be 1.2.
  • the value range of p can be set to [w/3,w/2].
  • p can be w/2.
  • determining a plurality of model patterns corresponding to the plurality of handwriting points based on the coordinates and action types of the plurality of handwriting points may further include operation P211: responding to the first one of the plurality of handwriting points.
  • the action type of each handwriting point is the stroke type. According to the previous handwriting point group of the handwriting point group, the size of the model pattern corresponding to the first handwriting point of the multiple handwriting points and the size of the model pattern corresponding to the multiple handwriting points are determined.
  • the center coordinate of the model pattern of the handwriting point For example, taking the stroke 110 shown in FIG. 3 as an example, based on the operation P211, it is possible to determine the first trajectory segment of any trajectory segment in the group consisting of the second trajectory segment, the third trajectory segment, and the fourth trajectory segment of the stroke 110.
  • the model pattern of one handwriting point and the second handwriting point is possible to determine the first trajectory segment of any trajectory segment in the group consisting of the second trajectory segment, the third trajectory segment, and the fourth trajectory segment of the stroke 110.
  • the size of the model pattern corresponding to the first handwriting point in the plurality of handwriting points and the size of the model pattern corresponding to the second handwriting point in the plurality of handwriting points are determined according to the previous handwriting point group of the handwriting point group.
  • the size of the model pattern of each handwriting point including operation 2210: In response to the coordinate of the Nth handwriting point of the previous handwriting point group being the same as the coordinates of the first handwriting point of the handwriting point group, it will correspond to the previous handwriting point
  • the size of the model pattern of the Nth handwriting point of the group is taken as the size of the model pattern corresponding to the first handwriting point of the handwriting point group, and the size of the second handwriting point and the first handwriting point of the handwriting point group is determined
  • the size, the third distance and the fourth distance determine the size of the model pattern corresponding to the second handwriting point of the handwriting point group, where the N-1 handwriting point and the Nth handwriting point of the previous handwriting point group It is the last two handwriting points of the previous handwriting point
  • the handwriting point group and the previous handwriting point group are two adjacent handwriting point groups, and the handwriting point group corresponding to the second trajectory segment of the stroke 110 shown in FIG. 3 is the current handwriting point group and the first trajectory segment.
  • the corresponding handwriting point group is the previous handwriting point group, and the first handwriting point of the handwriting point group corresponding to the second trajectory segment coincides with the last handwriting point of the handwriting point group corresponding to the first trajectory segment (that is, the coordinates are the same), thus
  • the size of the model pattern corresponding to the last handwriting point of the first trajectory segment can be directly used as the size of the model pattern corresponding to the first handwriting point of the second trajectory segment, and the corresponding calculation process is omitted.
  • the stroke 110 is divided into multiple trajectory segments to improve the real-time performance of the handwriting processing method.
  • the second trajectory segment is essentially a continuation of the pen motion of the first trajectory segment. Therefore, it is determined that it corresponds to the second trajectory.
  • the size of the model pattern of each handwriting point of the segment except the first handwriting point please refer to the relevant description of the aforementioned operation P204. That is to say, in operation 2210, to determine the size of the model pattern corresponding to the second handwriting point of the handwriting point group, reference may be made to the related description of the aforementioned operation P204, which will not be repeated here.
  • the model patterns of the remaining track points except the first handwriting point and the second handwriting point corresponding to each trajectory segment of the stroke 110 can be determined.
  • the ending effect of the brush tip is related to the starting stroke type of the stroke; for example, the starting stroke type includes horizontal, vertical, skimming, pinning, lifting and other types.
  • the starting stroke of the stroke when the starting stroke of the stroke is horizontal or narrow, the end of the stroke usually gradually widens, showing a "blunt" effect; when the starting stroke of the stroke is vertical or slanted or lifted, the tail of the stroke usually gradually narrows, showing "Pointy" effect.
  • determining multiple model patterns corresponding to the multiple handwriting points based on the coordinates and action types of the multiple handwriting points may further include operation P221: responding to the multiple handwriting points.
  • the action type of the M-th handwriting point in the two handwriting points is the ending type, and the starting stroke type corresponding to the handwriting point group is determined; and according to the starting stroke type, the Mj-th handwriting point corresponding to the multiple handwriting points is set to The size of each model pattern of the M-th handwriting point, where j is a positive integer, and j ⁇ 1.
  • the action type of the M-th handwriting point among the multiple handwriting points in the handwriting point group is the end type, it corresponds to the first handwriting point to the Mj-1th handwriting point group of the handwriting point group.
  • the size of each model pattern of the handwriting point can still be determined through the aforementioned operations P201 to P204, operation P211 (including operation P2210), and so on.
  • the current handwriting point group is the last handwriting point group in the multiple handwriting point groups, so the multiple handwriting point groups can be determined retrospectively The first handwriting point group in the first handwriting point group; since the starting stroke type of the first handwriting point group has been determined (refer to the relevant description of the aforementioned operation P202), the starting stroke type of the first handwriting point group can be used as the current handwriting The starting stroke type corresponding to the point group.
  • the starting stroke type of the current handwriting point group has been determined in the aforementioned operation P202, so it can be directly obtained based on the result of the aforementioned operation P202.
  • FIG. 5 is a schematic diagram of the closing effect of simulating the tip of a writing brush provided by at least one embodiment of the present disclosure.
  • setting the size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point among the multiple handwriting points according to the stroke type may include: The stroke type of the stroke is horizontal or ⁇ , and the size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point is sequentially increased according to the first preset ratio; The second preset ratio reduces the size of each model pattern corresponding to the Mj-th handwriting point to the M-th handwriting point in sequence.
  • setting the size of each model pattern corresponding to the Mj-th handwriting point to the M-th handwriting point among the multiple handwriting points according to the stroke type may also include: if the stroke type is another type , The size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point among the multiple handwriting points is not set according to the stroke type. That is, when the stroke type is another type, the aforementioned operation P204 can be referred to to determine the size of each model pattern corresponding to the M-jth handwriting point to the Mth handwriting point among the multiple handwriting points.
  • the embodiments of the present disclosure include but are not limited to this.
  • the size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point can be sequentially increased according to the first preset ratio, or the size of each model pattern corresponding to the Mjth handwriting point can be increased according to the first preset ratio.
  • the second preset ratio reduces the size of each model pattern corresponding to the Mj-th handwriting point to the M-th handwriting point in sequence.
  • the first preset ratio can be set according to actual needs, as long as the size of each model pattern corresponding to the Mjth handwriting point to the Mth handwriting point is increased in order; for example, the second preset ratio can be set according to The actual setting is required, as long as the size of each model pattern corresponding to the Mj-th handwriting point to the M-th handwriting point is reduced in order.
  • the setting of the first preset ratio can prevent the model pattern corresponding to the Mth handwriting point from being too large
  • the setting of the second preset ratio can prevent the model pattern corresponding to the Mth handwriting point from being too large. The size is too small.
  • first preset ratio or the second preset ratio corresponding to different stroke types may be different or the same, which is not limited in the embodiment of the present disclosure. It should also be understood that j corresponding to different stroke types may be the same or different, and the embodiment of the present disclosure does not limit this. For example, in some embodiments, j may be 2.
  • Step S300 Connect the plurality of model patterns in sequence to determine the handwriting trace for display corresponding to the handwriting point group.
  • Step S300 may include operation P301: sequentially connecting the four extrinsic tangent points of the model pattern corresponding to every two adjacent handwriting points in the plurality of handwriting points to form a quadrilateral between every two adjacent handwriting points, where , The quadrilateral between every two adjacent handwriting points is used to connect the model patterns corresponding to every two adjacent handwriting points.
  • FIG. 6 is a schematic diagram of calculating the external common tangent point provided by at least one embodiment of the present disclosure.
  • the any two circles are the first circle and the second circle respectively, the center coordinates of the first circle are (a1, b1), and the radius of the first circle is r1, the coordinates of the center of the second circle are (a2, b2), and the radius of the second circle is r2, then the coordinates of the four external common tangent points are determined based on the following classification and discussion.
  • represents the acute angle between the center line of the first circle and the second circle and the abscissa axis (refer to Figure 6).
  • represents the acute angle between the center line of the first circle and the second circle and any outer common tangent line (refer to Figure 6),
  • represents the acute angle between the center line of the first circle and the second circle and the abscissa axis
  • represents the acute angle between the center line of the first circle and the second circle and any outer common tangent
  • represents the acute angle between the center line of the first circle and the second circle and the abscissa axis
  • the model corresponding to each handwriting point of the handwriting point group is a circle
  • the model corresponding to each two adjacent handwriting points can be obtained
  • the coordinates of the four external common tangent points of the pattern that is, the four external common tangent points are determined), and the four external common tangent points are sequentially connected to obtain a quadrilateral between every two adjacent handwriting points.
  • the quadrilateral is used to connect the model patterns corresponding to each two adjacent handwriting points, thereby helping to eliminate jagged and burrs, and making the finally obtained handwriting trajectory for display smoother.
  • the four extern common tangents of the elliptical model pattern corresponding to every two adjacent handwriting points can be calculated based on the knowledge of analytical geometry. Points to form a quadrilateral between two adjacent handwriting points, which will not be repeated here.
  • the model pattern corresponding to each handwriting point of the handwriting point group includes a circle
  • the other diameter of the corresponding elliptical model pattern then, the two end points of the third diameter and the two end points of the fourth diameter are used as the end points of the quadrilateral to determine the quadrilateral between each two adjacent handwriting points .
  • This solution is beneficial to reduce the amount of calculation and increase the processing speed of the handwriting processing method.
  • the note track used for display obtained in step S300 may be displayed in real time by the display device.
  • the display device can display the display corresponding to the first trajectory segment in real time. The handwriting trajectory.
  • the user may not have completed the writing process of the stroke 110 (for example, the user may be writing the second trajectory segment of the stroke 110, etc.).
  • the above-mentioned handwriting processing method can provide an interesting interactive way for an airport display screen.
  • 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.
  • a signature can be written on the display screen and displayed on the display screen in the form of processed brush handwriting.
  • Tourists take photos with their signatures to form a unique way of "checking in” to attract tourists and help promote the development of the city's tourism industry.
  • the above-mentioned handwriting processing method can provide a new type of board newspaper method for smart classrooms.
  • the handwriting processing method can process the fonts of students or teachers on the blackboard and board newspaper to give a clearer presentation.
  • the embodiments of the present disclosure are all described by taking the type of the pen tip used for displaying the handwriting trace as the brush tip as an example, it should not be regarded as a limitation of the present disclosure.
  • the handwriting processing method provided by the embodiments of the present disclosure can also design more handwriting styles, such as pencil tip, pen tip, etc., to form a more beautiful font without losing the original font.
  • FIG. 7 is an effect diagram of a simulated brush tip provided by at least one embodiment of the present disclosure.
  • the tip type used for the displayed handwriting trace is a brush tip.
  • the Chinese character "Xie" shown in Figure 7 shows a better simulation effect of the brush stroke.
  • the handwriting processing method can obtain the handwriting point group based on the strokes written by the user on the working surface of the touch device, and correspond to the handwriting point group according to the coordinates and action types of each handwriting point in the handwriting point group
  • the handwriting trajectory is processed and used for display.
  • the handwriting processing method can realize the effect of real-time handwriting processing without pressure sensitivity, and at the same time make the handwriting trajectory used for display have a stroke effect.
  • the handwriting processing method also has the advantages of fast calculation speed, simple implementation principle, and good real-time performance. It can be widely used in electronic interactive whiteboards (for example, conference whiteboards, teaching whiteboards, etc.), electronic board newspapers, airport digital signature walls, cloud notebooks, and handwriting Scenes that require handwriting input, such as boards.
  • FIG. 8 is a schematic block diagram of a handwriting processing device provided by at least one embodiment of the present disclosure.
  • the handwriting processing device 100 includes a memory 110 and a processor 120. It should be understood that the components of the handwriting processing device 100 shown in FIG. 8 are only exemplary and not restrictive. According to actual application requirements, the handwriting processing device 100 may also have other components. For example, the handwriting processing device 100 may use operating systems such as Windows, Android, etc., and the handwriting forming method according to the embodiments of the present disclosure is implemented by an application program running in the operating system.
  • the memory 110 is used for non-transitory storage of computer readable instructions;
  • the processor 120 is used for running computer readable instructions, and when the computer readable instructions are executed by the processor 120, the handwriting processing method according to any of the above embodiments can be executed.
  • the handwriting processing device 100 may further include a touch device 130.
  • the touch device 130 is configured to obtain a set of handwriting points corresponding to strokes on the work surface of the touch device 130.
  • the touch device 130 may include any input device with a touch function, such as an electronic pen, a touch screen, a mouse, a touch pad, and an interactive whiteboard.
  • the touch screen may be a capacitive touch screen, such as a self-capacitive touch screen or a mutual-capacitive touch screen, and may also be a resistive touch screen, a surface acoustic wave touch screen, an infrared touch screen, and the like.
  • the touch device 130 may include a touch sensor and a controller (for example, a driver IC).
  • the controller receives the electrical signal collected by the touch sensor, processes the electrical signal to obtain a touch signal, and provides the touch signal to the processor for further processing.
  • the embodiment of the present disclosure does not limit the type, structure, and communication mode of the touch device 130.
  • the touch device 130 includes a working surface with a certain area. The user can write directly on the working surface of the touch device 130 with fingers, or use an active stylus or a passive stylus to write on the working surface of the touch device 130. Write on the above, and the embodiments of the present disclosure do not limit this.
  • the work surface refers to a surface used to detect a user's touch operation, such as the touch surface of the touch device 130.
  • the handwriting processing device 100 may further include a display device 140.
  • the display device 140 is configured to display the handwriting trace for display corresponding to the handwriting point group.
  • the display device 140 may include a display device such as a display screen and a projector.
  • the display screen of the display device 140 is, for example, an LCD display screen, an OLED display screen, a QLED display screen, a projection component, a VR head-mounted display device (such as a VR helmet, VR glasses), an AR display device, etc. This is not limited.
  • the display device 140 can display the handwriting formed by the handwriting forming method provided by the embodiment of the present disclosure, for example, a brush handwriting.
  • the touch device 130 and the display device 140 may be integrated into, for example, a touch display screen, so as to have both a touch function and a display function.
  • the memory 110 and the processor 120 may be integrated in a touch display screen.
  • the memory 110 and the processor 120 may also be integrated in a cloud server.
  • the handwriting processing device 100 may also include a communication module, which is used to implement communication between the handwriting processing device 100 and other electronic equipment.
  • the communication module may The display handwriting trajectory 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 display handwriting trajectory.
  • the processor 120 may control other components in the handwriting processing apparatus 100 to perform desired functions.
  • the processor 120 may be a central processing unit (CPU), a tensor processor (TPU), or 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 110 may include any combination of one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory.
  • Volatile memory may include random access memory (RAM) and/or cache memory (cache), for example.
  • Non-volatile memory may include, for example, read only memory (ROM), hard disk, erasable programmable read only memory (EPROM), portable compact disk read only memory (CD-ROM), USB memory, flash memory, etc.
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • CD-ROM portable compact disk read only memory
  • USB memory flash memory, etc.
  • One or more computer-readable instructions may be stored on the computer-readable storage medium, and the processor 120 may execute the computer-readable instructions to implement various functions of the handwriting processing apparatus 100.
  • 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. 9 is a schematic diagram of a storage medium provided by at least one embodiment of the present disclosure.
  • one or more computer-readable instructions 201 may be non-transitory stored on the storage medium 200.
  • the computer-readable instructions 201 are executed by a computer, one or more steps in the handwriting processing method described above can be executed.
  • the storage medium 200 can be applied to the handwriting processing device 100 described above, for example, it can be used as the memory 110 in the handwriting processing device 100.
  • the description of the storage medium 200 reference may be made to the description of the memory 100 in the embodiment of the handwriting processing apparatus 100, and the repetitive parts will not be repeated.
  • FIG. 10 is a schematic diagram of a hardware environment provided by at least one embodiment of the present disclosure.
  • the handwriting processing device 100 provided in the present disclosure can be applied to an Internet system.
  • the handwriting processing apparatus 100 involved in the present disclosure can be realized by using the computer system provided in FIG. 10.
  • 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 100 in this embodiment.
  • the computer system can implement any of the currently described components that implement the information required for handwriting processing.
  • a computer system can be realized by a computer device through its hardware device, software program, firmware, and their combination.
  • the computer functions described in this embodiment to realize the information required for handwriting processing 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 (for example, a 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. 10 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)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种笔迹处理方法、笔迹处理装置和非瞬时性存储介质。该笔迹处理方法包括:获取对应于在触控装置的工作表面上的笔划的笔迹点组,其中,笔迹点组包括依次排列的多个笔迹点,多个笔迹点中的每个笔迹点的数据包括坐标和动作类型;基于多个笔迹点的坐标和动作类型确定对应于多个笔迹点的多个模型图案,其中,多个模型图案与多个笔迹点一一对应;以及依次连接多个模型图案,以确定对应于笔迹点组的用于显示的笔迹轨迹。

Description

笔迹处理方法、笔迹处理装置、非瞬时性存储介质
本申请要求于2020年4月30日递交的中国专利申请第202010363753.4号的优先权,在此全文引用上述中国专利申请公开的内容以作为本申请的一部分。
技术领域
本公开的实施例涉及一种笔迹处理方法、笔迹处理装置、非瞬时性存储介质。
背景技术
随着信息技术的迅速发展,通过持笔或手指在智能交互平板上的手写输入的技术越来越成熟,用户对手写笔迹效果的要求也越来越高,用户不仅希望手写输入的笔迹能被识别,更希望笔迹达到美观且具有较佳笔锋的效果。
发明内容
本公开至少一个实施例提供一种笔迹处理方法,包括:获取对应于在触控装置的工作表面上的笔划的笔迹点组,其中,所述笔迹点组包括依次排列的多个笔迹点,所述多个笔迹点中的每个笔迹点的数据包括坐标和动作类型;基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,其中,所述多个模型图案与所述多个笔迹点一一对应;以及依次连接所述多个模型图案,以确定对应于所述笔迹点组的用于显示的笔迹轨迹。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:响应于所述多个笔迹点中的第1个笔迹点的动作类型为起笔类型,根据书写应用中书写过程中对应的基本线宽和所述第1个笔迹点的坐标确定对应于所述第1个笔迹点的模型图案的尺寸和中心坐标。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,还包括:
响应于所述第1个笔迹点的动作类型为起笔类型,确定对应于所述笔迹点组的起笔笔画类型,基于所述起笔笔画类型和所述第1个笔迹点对应的模型图案,确定对应于所述第1个笔迹点的辅助模型图案的尺寸和中心坐标,以及基于对应于所述第1个笔迹点的所述模型图案和所述辅助模型图案,确定对应于所述第1个笔迹点的辅助四边形,其中,对应于所述第1个笔迹点的所述辅助四边形用于连接所述第1个笔迹点对应的所述模型图案和所述辅助模型图案。
例如,在本公开一些实施例提供的笔迹处理方法中,确定对应于所述笔迹点组的 起笔笔画类型,包括:在所述多个笔迹点中确定第t个笔迹点,其中,t为正整数,t≠1,且所述第t个笔迹点的坐标不同于所述第1个笔迹点的坐标;以及基于所述第1个笔迹点的坐标和所述第t个笔迹点的坐标,确定对应于所述笔迹点组的起笔笔画类型。
例如,在本公开一些实施例提供的笔迹处理方法中,所述第1个笔迹点的坐标为(x1,y1),所述第t个笔迹点的坐标为(x2,y2),dx=x2–x1,dy=y2–y1,基于所述第1个笔迹点的坐标和所述第t个笔迹点的坐标,确定对应于所述笔迹点组的起笔笔画类型,包括:
响应于dx=0且dy≠0,确定对应于所述笔迹点组的起笔笔画类型为横,
响应于dx≠0且dy=0,确定对应于所述笔迹点组的起笔笔画类型为竖,
响应于dx≠0且dy≠0:
若dx>0且0≤|dy/dx|≤0.27,确定对应于所述笔迹点组的起笔笔画类型为横,
若dy>0且0≤|dx/dy|≤0.27,确定对应于所述笔迹点组的起笔笔画类型为竖,
若dx<0、dy>0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为撇,
若dx>0、dy>0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为捺,
当dx>0、dy<0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为提,
若dx<0且dy<0,确定对应于所述笔迹点组的起笔笔画类型为其他类型。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述起笔笔画类型和所述第1个笔迹点对应的模型图案,确定对应于所述第1个笔迹点的辅助模型图案的尺寸和中心坐标,包括:若所述起笔笔画类型为横,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,α=57°~63°;若所述起笔笔画类型为竖,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,α=67°~73°;若所述起笔笔画类型为撇或者提,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,α=42°~48°;若所述起笔笔画类型为捺或者其他类型,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,α=7°~13°,其中,R表示对应于所述第1个笔迹点的模型图案的尺寸,O 1表示对应于所述第1个笔迹点的模型图案的中心,r表示对应于所述第1个笔迹点的辅助模型图案的尺寸,O 2表示对应于所述第1个笔迹点的辅助模型图案的中心,O 1O 2表示对应于所述第1个笔迹点的所述模型图案和所述辅助模型图案之间的中心连线的距离,w表示所述基本线宽,α表示所述中心连线与水平线的夹角。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述多个笔迹点的坐标和动作类型确定所述多个笔迹点对应的模型图案,还包括:响应于所述第1个笔迹点的动作类型为起笔类型,根据所述基本线宽和所述多个笔迹点中的第2个笔迹点的坐 标确定对应于所述第2个笔迹点的模型图案的尺寸和中心坐标,其中,所述第1个笔迹点和所述第2个笔迹点相邻。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:响应于所述多个笔迹点中的第1个笔迹点的动作类型为运笔类型,根据所述笔迹点组的前一个笔迹点组确定对应于所述多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于所述多个笔迹点中的第2个笔迹点的模型图案的尺寸,根据所述第1个笔迹点的坐标确定对应于所述第1个笔迹点的模型图案的中心坐标,以及根据所述第2个笔迹点的坐标确定对应于所述第2个笔迹点的模型图案的中心坐标。
例如,在本公开一些实施例提供的笔迹处理方法中,根据所述笔迹点组的前一个笔迹点组确定对应于所述多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于所述多个笔迹点中的第2个笔迹点的模型图案的尺寸,包括:响应于所述前一个笔迹点组的第N个笔迹点的坐标与所述笔迹点组的第1个笔迹点的坐标相同,将对应于所述前一个笔迹点组的第N个笔迹点的模型图案的尺寸作为对应于所述笔迹点组的第1个笔迹点的模型图案的尺寸,以及确定所述笔迹点组的第2个笔迹点与第1个笔迹点的第三距离和所述前一个笔迹点组的第N个笔迹点与第N-1个笔迹点的第四距离,并根据基本线宽、对应于所述笔迹点组的第1个笔迹点的模型图案的尺寸、所述第三距离和所述第四距离,确定对应于所述笔迹点组的第2个笔迹点的模型图案的尺寸,其中,所述前一个笔迹点组的第N-1个笔迹点与第N个笔迹点为所述前一个笔迹点组的最后两个笔迹点。
例如,在本公开一些实施例提供的笔迹处理方法中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,还包括:从所述多个笔迹点中的第i个笔迹点开始,确定所述第i个笔迹点与第i-1个笔迹点的第一距离以及所述第i-1个笔迹点与第i-2个笔迹点的第二距离,并根据所述基本线宽、对应于所述第i-1个笔迹点的模型图案的尺寸、所述第一距离和所述第二距离,确定对应于所述第i个笔迹点的模型图案的尺寸;以及根据所述第i个笔迹点的坐标确定对应于所述第i个笔迹点的模型图案的中心坐标,其中,i为正整数,且i≥3。
例如,在本公开一些实施例提供的笔迹处理方法中,所述多个笔迹点中的第M个笔迹点为所述笔迹点组的最后一个笔迹点,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:响应于所述第M个笔迹点的动作类型为收笔类型,确定对应于所述笔迹点组的起笔笔画类型,以及根据所述起笔笔画类型设置对应于所述多个笔迹点中的第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸,其中,j为正整数,且j≥1。
例如,在本公开一些实施例提供的笔迹处理方法中,所述起笔笔画类型包括横、竖、撇、捺、提和其他类型,根据所述起笔笔画类型设置对应于所述多个笔迹点中的 第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸,包括:若所述起笔笔画类型为横或者捺,按照第一预设比例依次增大对应于所述第M-j个笔迹点至所述第M个笔迹点的各个模型图案的尺寸;若所述起笔笔画类型为竖或者撇或者提,按照第二预设比例依次减小对应于所述第M-j个笔迹点至所述第M个笔迹点的各个模型图案的尺寸;以及若所述起笔笔画类型为其他类型,则不根据所述起笔笔画类型设置对应于所述多个笔迹点中的第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸。
例如,在本公开一些实施例提供的笔迹处理方法中,对应于所述笔迹点组的每个笔迹点的模型图案包括圆或椭圆,依次连接所述多个模型图案,以确定对应于所述笔迹点组的用于显示的笔迹轨迹,包括:依次连接所述多个笔迹点中每相邻的两个笔迹点对应的模型图案的四个外公切点以形成所述每相邻的两个笔迹点之间的四边形,其中,所述每相邻的两个笔迹点之间的四边形用于连接所述每相邻的两个笔迹点对应的模型图案。
例如,在本公开一些实施例提供的笔迹处理方法中,获取对应于在所述触控装置的工作表面上的笔划的所述笔迹点组,包括:对在所述触控装置的工作表面上的笔划进行采样,以得到多个采样点;以及基于所述多个采样点,采用贝塞尔曲线拟合算法进行插值,以得到多个插值点,其中,所述笔迹点组的所述多个笔迹点包括所述多个采样点和所述多个插值点,所述多个采样点中的每个采样点的动作类型为起笔类型、运笔类型和收笔类型组成的集合中的一种。
例如,在本公开一些实施例提供的笔迹处理方法中,所述笔划对应多个笔迹点组,所述多个笔迹点组中的第一个笔迹点组的第1个笔迹点的动作类型为起笔类型,所述多个笔迹点组中的最后一个笔迹点组的最后一个笔迹点的动作类型为收笔类型。
例如,在本公开一些实施例提供的笔迹处理方法中,所述用于显示的笔迹轨迹的笔锋类型为毛笔笔锋。
本公开至少一个实施例还提供一种笔迹处理装置,包括:存储器,用于非暂时性存储计算机可读指令;以及处理器,用于运行所述计算机可读指令,其中,所述计算机可读指令被所述处理器运行时执行本公开任一实施例提供的笔迹处理方法。
例如,本公开一些实施例提供的笔迹处理装置,还包括:触控装置,其中,所述触控装置被配置为获取对应于在所述触控装置的工作表面上的笔划的笔迹点组。
例如,本公开一些实施例提供的笔迹处理装置,还包括:显示装置,其中,所述显示装置被配置为显示对应于所述笔迹点组的用于显示的笔迹轨迹。
本公开至少一个实施例还提供一种非瞬时性存储介质,非暂时性地存储计算机可读指令,其中,当所述非暂时性计算机可读指令由计算机执行时,能够执行本公开任一实施例提供的笔迹处理方法的指令。
附图说明
为了更清楚地说明本公开实施例的技术方案,下面将对实施例的附图作简单地介绍,显而易见地,下面描述中的附图仅仅涉及本公开的一些实施例,而非对本公开的限制。
图1为本公开至少一实施例提供的一种笔迹处理方法的示意性流程图;
图2为本公开至少一实施例提供的一种获取笔迹点组的方法的示意性流程图;
图3为本公开至少一实施例提供的一种笔迹点组的示意图;
图4为本公开至少一实施例提供的一种水滴单元的示意图;
图5为本公开至少一实施例提供的一种模拟毛笔笔锋的收笔效果的示意图;
图6为本公开至少一实施例提供的计算外公切点的示意图;
图7为本公开至少一实施例提供的一种模拟毛笔笔锋的效果图;
图8为本公开至少一实施例提供的一种笔迹处理装置的示意性框图;
图9为本公开至少一个实施例提供的一种存储介质的示意图;以及
图10为本公开至少一实施例提供的一种硬件环境的示意图。
具体实施方式
为了使得本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例的附图,对本公开实施例的技术方案进行清楚、完整地描述。显然,所描述的实施例是本公开的一部分实施例,而不是全部的实施例。基于所描述的本公开的实施例,本领域普通技术人员在无需创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。
除非另外定义,本公开使用的技术术语或者科学术语应当为本公开所属领域内具有一般技能的人士所理解的通常意义。本公开中使用的“第一”、“第二”以及类似的词语并不表示任何顺序、数量或者重要性,而只是用来区分不同的组成部分。“包括”或者“包含”等类似的词语意指出现该词前面的元件或者物件涵盖出现在该词后面列举的元件或者物件及其等同,而不排除其他元件或者物件。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。“上”、“下”、“左”、“右”等仅用于表示相对位置关系,当被描述对象的绝对位置改变后,则该相对位置关系也可能相应地改变。为了保持本公开实施例的以下说明清楚且简明,本公开省略了部分已知功能和已知部件的详细说明。
在教育、办公、医疗等领域内,电子交互白板作为一种便捷的工具,对信息的交互与共享产生了极其重要的作用。但是,电子交互白板的处理速度、笔迹处理效果等制约着产品的用户体验。目前,实现无压感手写输入毛笔笔锋效果的方法通常比较复杂,需要花费时间进行大量的计算才能输出具有笔锋效果的笔画,对硬件的计算资源要求较高,实时性欠缺,用户很难获得畅快的手写输入体验。
并且,近年来,随着平板电脑、智能手机等智能设备的技术进步,用户对手写功 能的要求越来越高。然而,由于在智能设备的屏幕上的书写感受与在实际纸张上的书写感受不同,以及用户本身对书法的不熟悉,在智能设备上的手写效果不佳。笔迹自动处理技术能够消除手写笔迹的锯齿状或台阶状外观,同时具有笔锋效果,为用户提供更加光滑、圆润、流畅、自然的书写体验。
本公开至少一个实施例提供一种笔迹处理方法,该笔迹处理方法包括:获取对应于在触控装置的工作表面上的笔划的笔迹点组,其中,笔迹点组包括依次排列的多个笔迹点,多个笔迹点中的每个笔迹点的数据包括坐标和动作类型;基于多个笔迹点的坐标和动作类型确定多个笔迹点对应的模型图案;以及依次连接多个笔迹点对应的模型图案,以确定笔迹点组对应的用于显示的笔迹轨迹。
本公开的一些实施例还提供对应于上述笔记处理方法的笔记处理装置以及非瞬时性存储介质。
本公开的实施例提供的笔迹处理方法,可以基于用户在触控装置的工作表面上书写的笔划获取笔迹点组,并根据笔迹点组中的各个笔迹点的坐标和动作类型对笔迹点组对应的笔迹轨迹进行针对性的处理并用于显示。该笔迹处理方法可以在无压感的情况下实现实时的笔迹处理的效果,同时使得用于显示的笔迹轨迹具有笔锋效果。该笔迹处理方法还具有计算速度快、实现原理简单、实时性好等优点,可以广泛应用于电子交互白板(例如,会议白板、教学白板等)、电子板报、机场数字签名墙、云本、手写板等需要手写输入的场景。
下面结合附图对本公开的一些实施例及其示例进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本公开,并不用于限制本公开。
图1为本公开至少一实施例提供的一种笔迹处理方法的示意性流程图。例如,该笔迹处理方法应用于计算设备,该计算设备包括具有计算功能的任何电子设备,例如可以为手机、笔记本电脑、平板电脑、台式计算机、服务器等,本公开的实施例对此不作限制。例如,该计算设备具有中央处理单元(Central Processing Unit,CPU)或图形处理单元(Graphics Processing Unit,GPU),以及还包括存储器。该存储器例如为非易失性存储器(例如只读存储器(Read Only Memory,ROM)),其上存储有操作系统的代码。例如,存储器上还存储有代码或指令,通过运行这些代码或指令,可以实现本公开实施例提供的笔迹处理方法。
例如,该计算设备还可以包括触摸装置,例如触摸屏或触摸板,以获取用户书写时在触摸装置的工作表面上形成的初始笔迹。该触摸屏不但可以接收初始笔迹并且还可以同时进行相应的显示。用户可以用手指直接在触摸屏的工作表面上进行书写,也可以利用主动式触控笔或被动式触控笔在触摸屏的工作表面上进行书写,本公开的实施例对此不作限制。这里,工作表面是指用于检测用户的触摸操作的表面,例如触摸屏的触摸表面。需要说明的是,本公开的实施例中,触摸装置的类型不受限制,不仅可以为触摸屏,还可以为交互白板等任意的具有触控功能的装置,这可以根据实际需 求而定。
例如,如图1所示,该笔迹处理方法包括以下步骤S100至步骤S300。
步骤S100:获取对应于在触控装置的工作表面上的笔划的笔迹点组,其中,该笔迹点组包括依次排列的多个笔迹点,该多个笔迹点中的每个笔迹点的数据包括坐标和动作类型。
例如,在一些实施例中,当用户在触控装置的工作表面上进行笔划书写时,落笔动作对应于笔划书写过程的开始,抬笔动作对应于笔划书写过程的结束,落笔动作与抬笔动作之间为运笔动作,运笔动作对应于笔划书写过程的持续;用户完成一个完整的笔划书写过程时,其在触控装置的工作表面上的书写轨迹对应于一个笔划。
例如,上述笔划可以具有任意形状。例如,上述笔划可以为中文字的笔划,也可以为外文字(例如,英文、日文、韩文等)的笔划。
图2为本公开至少一实施例提供的一种获取笔迹点组的方法的示意性流程图。图3为本公开至少一实施例提供的一种笔迹点组的示意图。以下结合图3对图2所示的获取笔迹点组的方法进行详细说明。
例如,如图2所示,获取对应于在触控装置的工作表面上的笔划的笔迹点组,即步骤S100,可以包括以下步骤S101至步骤S102:
步骤S101:对在触控装置的工作表面上的笔划进行采样,以得到多个采样点;
步骤S102:基于多个采样点,采用贝塞尔曲线拟合算法进行插值,以得到多个插值点。
例如,在一些实施例中,触控装置本身可以基于硬件(例如触控电路、采样电路等)和软件(例如,相关的程序算法)等执行上述步骤S11至步骤S12,本公开包括但不限于此。
例如,在一些实施例中,触控装置可以按照预定时序对用户在其工作表面上书写的笔划进行采样,以得到依次排列(依据采样的先后顺序排列)的多个采样点的坐标。例如,可以通过稀疏采点的方式对笔划进行采样以到多个采样点,该多个采样点的数量可以根据实际情况确定。例如,如图3所示,通过对在触控装置的工作表面上的笔划110进行实时采样(例如,等时间间隔采样),可以得到依次排列的9个采样点C1~C9(如图3中的空心黑圈所示)的坐标。
例如,在一些实施例中,触控装置还可以根据事件驱动的规则,确定各个采样点的动作类型。例如,如图3所示,可以根据落笔动作(即落笔事件),将与落笔动作对应的采样点C1的动作类型确定为起笔类型;可以根据抬笔动作(即抬笔事件),将与抬笔动作对应的采样点C9的动作类型确定为收笔类型;位于采样点C1和采样点C9之间的采样点C2~C8与运笔动作对应,可以将采样点C2~C8的动作类型均确定为运笔类型。例如,对于在Android操作系统中实现上述实施例的笔迹处理方法时,对于触控装置的输入事件(MotionEvent),ACTION_DOWN表示落笔事件;ACTION_MOVE表示运笔 事件;ACTION_UP表示抬笔事件。
例如,在一些实施例中,如图3所示,9个采样点C1~C9可以将笔划110划分为四个轨迹段,四个轨迹段分别为对应于采样点C1~C3的第一轨迹段、对应于采样点C3~C5的第二轨迹段、对应于采样点C5~C7的第三轨迹段和对应于采样点C7~C9的第四轨迹段。第一轨迹段、第二轨迹段、第三轨迹段和第四轨迹段在笔划110的延伸方向(即从采样点C1到采样点C9的方向)上依次排列,第一轨迹段和第二轨迹段相邻且均与同一个采样点C3对应,第二轨迹段和第三轨迹段相邻且均与同一个采样点C5对应,第三轨迹段和第四轨迹段相邻且均与同一个采样点C7对应。
例如,可以基于每个轨迹段对应的3个采样点,采用贝塞尔曲线拟合算法进行插值以得到6个插值点,进而得到对应于该轨迹段的笔迹点组,该笔迹点组包括9个轨迹点(即3个采样点和6个插值点)。例如,在该笔迹点组中,该9个轨迹点按笔划的延伸方向依次排列。以第一轨迹段对应的3个采样点C1~C3为例,采用贝塞尔曲线拟合算法进行插值以得到6个插值点,是指基于3个采样点C1~C3拟合二阶贝塞尔曲线(如图3中黑色实线所示),并在采样点C1和采样点C2之间的曲线段取3个插值点、在采样点C2和采样点C3之间的曲线段取3个插值点,以得到6个插值点(如图3中的实心黑点C30所示)的坐标,由此可以得到对应于采样点C1~C3的笔迹点组(即对应于第一轨迹段的笔迹点组)。以此类推,可以分别得到对应于第二轨迹段的笔迹点组、对应于第三轨迹段的笔迹点组以及对应于第四轨迹段的笔迹点组。例如,在每个笔迹点组中,还可以将本质上是插值点的轨迹点的动作类型确定为运笔类型。
例如,在图3所示的实施例中,笔划110对应多个(四个)笔迹点组,其中,第一个笔迹点组的第1个笔迹点的动作类型为起笔类型,最后一个笔迹点组的最后一个笔迹点的动作类型为收笔类型,其余笔迹点的动作类型为运笔类型。例如,在一些示例中,每个笔迹点的数据可以包括一个类型标识,用于标记该笔迹点的动作类型;例如,当该类型标识为1时,该笔迹点的动作类型为起笔类型;当该类型标识为2时,该笔迹点的动作类型为运笔类型;当该类型标识为3时,该笔迹点的动作类型为收笔类型。例如,在另一些示例中,为了节省存储空间以及减少数据传输量,在笔划110对应多个笔迹点组的情况下,可以使每个笔迹点组对应一个类型标识;例如,当笔迹点组对应的类型标识为1时,该笔迹点组的第1个笔迹点的动作类型为起笔类型,该笔迹点组的其余笔迹点的动作类型默认为运笔类型;当笔迹点组对应的类型标识为2时,该笔迹点组的各个笔迹点的动作类型均默认为运笔类型;当笔迹点组对应的类型标识为3时,该笔迹点组的最后一个笔迹点的动作类型为收笔类型,该笔迹点组的其余笔迹点的动作类型默认为运笔类型。又例如,当笔迹点组对应的类型标识为1时,该笔迹点组的各个笔迹点的动作类型为起笔类型;当笔迹点组对应的类型标识为2时,该笔迹点组的各个笔迹点的动作类型均为运笔类型;当笔迹点组对应的类型标识为3时,该笔迹点组的各个笔迹点的动作类型为收笔类型。
需要说明的是,图3所示的实施例是示例性的,虽然图3所示的实施例仅示出了一个笔划对应多个笔迹点组的情形,但不应视为对本公开的限制。例如,在一些实施例中,一个笔划可以仅对应1个笔迹点组;在此情况下,该笔迹点组的第1个笔迹点的动作类型为起笔类型,该笔迹点组的最后一个笔迹点的动作类型为收笔类型,该笔迹点组的其余笔迹点的动作类型默认为运笔类型。
还需要说明的是,笔迹点组中包括采用贝塞尔曲线拟合算法进行插值得到的插值点,可以使后续用于显示的笔迹轨迹更加平滑和美观。但是,在本公开的实施例中,贝塞尔曲线拟合算法不限于拟合二阶贝塞尔曲线的情形。例如,在一些实施例中,笔划的每个轨迹段可以对应于4个采样点,在此情况下,可以通过拟合三阶贝塞尔曲线以得到插值点。
当然,在一些实施例中,笔迹点组可以仅包括多个采样点,而不包括插值点。本公开对此不作限制。
需要说明的是,本公开对笔迹点组的获取方式不作限制,只要能得到笔迹点组的数据即可。例如,在一些实施例中,本公开的实施例提供的笔迹处理方法可以由笔迹处理装置执行,而笔迹点组的数据可以由笔迹处理装置从外部接收得到。
步骤S200:基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,其中,该多个模型图案与该多个笔迹点一一对应。
例如,在步骤S200中,模型图案的形状可以是预先设定的,例如可以包括圆形和椭圆形(例如,椭圆形的短轴和长轴的比例是预先设定的),但不限于此。虽然本公开的实施例主要以模型图案为圆形为例进行说明,但不应视作对本公开的限制。
例如,在一些实施例中,基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,可以包括操作P201:响应于该多个笔迹点中的第1个笔迹点的动作类型为起笔类型,根据书写应用中书写过程中对应的基本线宽和第1个笔迹点的坐标确定对应于第1个笔迹点的模型图案的尺寸和中心坐标。例如,以图3所示的笔划110为例,基于操作P201可以确定对应于笔划110的第一轨迹段的第1个笔迹点C1的模型图案。
例如,在一些示例中,基本线宽为书写轨迹的线宽。该基本线宽在书写程序中被设置为某一默认值;例如,在另一些示例中,基本线宽在书写程序中具有多个可选值,用户可以根据需要选择该多个可选值之一作为基本线宽;例如,在再一些示例中,书写程序仅设置了基本线宽的取值范围,用户可以在该取值范围内对基本线宽进行设置。本公开的实施例对此不作限制。
例如,在一些示例中,模型图案为圆形,可以用圆形的半径表示模型图案的尺寸;例如,可以将对应于第1个笔迹点的圆形模型图案的半径设置为基本线宽的1/2。例如,在另一些示例中,模型图案为椭圆形,可以用椭圆形的半短轴(即短轴的一半)表示模型图案的尺寸;例如,可以将对应于第1个笔迹点的椭圆形模型图案的半短轴设置 为基本线宽的1/2。
例如,可以将触控装置的触控区域(即可供用户书写的区域)的左上角作为原点O、向右延伸的方向作为x轴(x的值越来越大),向下延伸的方向作为y轴(y的值越来越大),以构建坐标系Oxy1,笔迹点组中的每个轨迹点的坐标为每个轨迹点在坐标系Oxy1中的坐标。例如,类似地,可以将显示装置(例如,配置为显示后续用于显示的笔迹轨迹)的显示区域(的左上角作为原点O、向右延伸的方向作为x轴(x的值越来越大),向下延伸的方向作为y轴(y的值越来越大),以构建坐标系Oxy2,只要将每个笔迹点的坐标(相对于坐标系Oxy1的坐标)映射到坐标系Oxy2中,就可以得到在坐标系Oxy2中对应于每个笔迹点的模型图案的中心坐标。例如,在一些示例中,触控装置的触控区域与显示装置的显示区域具有相同的形状和尺寸,在此情况下,可以将每个笔迹点的坐标直接作为对应于每个笔迹点的模型图案的中心坐标。由此,可以根据任一笔迹点(包括但不限于第1个笔迹点)的坐标确定对应于该任一笔迹点的模型图案的中心坐标,后续不再赘述。
例如,在一些实施例中,基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,还可以包括操作P202:响应于该多个笔迹点中的第1个笔迹点的动作类型为起笔类型,确定对应于笔迹点组的起笔笔画类型;基于该起笔笔画类型和第1个笔迹点对应的模型图案,确定对应于第1个笔迹点的辅助模型图案的尺寸和中心坐标;以及基于对应于第1个笔迹点的模型图案和辅助模型图案,确定对应于第1个笔迹点的辅助四边形,其中,对应于第1个笔迹点的辅助四边形用于连接第1个笔迹点对应的模型图案和辅助模型图案。例如,以图3所示的笔划110为例基于操作P201和操作P202,可以将对应于笔划110的第一轨迹段的第1个笔迹点C1图案设置为水滴单元,从而,可以模拟毛笔笔锋的起笔效果。
例如,在一些示例中,确定对应于笔迹点组的起笔笔画类型,可以包括:在笔迹点组的多个笔迹点中确定第t个笔迹点,其中,t为正整数,t≠1,且第t个笔迹点的坐标不同于第1个笔迹点的坐标;以及基于第1个笔迹点的坐标和第t个笔迹点的坐标,确定对应于笔迹点组的起笔笔画类型。
例如,在一些示例中,可以将t预先设置为2,若第2个笔迹点的坐标不同于第1个笔迹点的坐标,则基于第1个笔迹点的坐标和第2个笔迹点的坐标,确定对应于笔迹点组的起笔笔画类型;若第2个笔迹点的坐标与第1个笔迹点的坐标相同,则将t依次设置为3,4,…,M(M为笔迹点组中的笔迹点的数目),直到第t个笔迹点的坐标不同于第1个笔迹点的坐标为止,再基于第1个笔迹点的坐标和第t个笔迹点的坐标,确定对应于笔迹点组的起笔笔画类型。例如,在另一些示例中,可以将t依次设置为M,M-1,…,2,直到第t个笔迹点的坐标不同于第1个笔迹点的坐标为止,再基于第1个笔迹点的坐标和第t个笔迹点的坐标,确定对应于笔迹点组的起笔笔画类型。需要说明的是,本公开的实施例对确定第t个笔迹点的方式不作限制,只要第t个笔迹 点的坐标不同于第1个笔迹点的坐标即可。
例如,在一些示例中,第1个笔迹点的坐标为(x1,y1),第t个笔迹点的坐标为(x2,y2),dx=x2–x1,dy=y2–y1,则基于第1个笔迹点的坐标和第t个笔迹点的坐标,确定对应于笔迹点组的起笔笔画类型,包括:
响应于dx=0且dy≠0,确定对应于笔迹点组的起笔笔画类型为横;
响应于dx≠0且dy=0,确定对应于笔迹点组的起笔笔画类型为竖;
响应于dx≠0且dy≠0:
若dx>0且0≤|dy/dx|≤0.27,确定对应于笔迹点组的起笔笔画类型为横,
若dy>0且0≤|dx/dy|≤0.27,确定对应于笔迹点组的起笔笔画类型为竖,
若dx<0、dy>0且0.27<|dy/dx|≤3.73,确定对应于笔迹点组的起笔笔画类型为撇,
若dx>0、dy>0且0.27<|dy/dx|≤3.73,确定对应于笔迹点组的起笔笔画类型为捺,
当dx>0、dy<0且0.27<|dy/dx|≤3.73,确定对应于笔迹点组的起笔笔画类型为提,
若dx<0且dy<0,确定对应于笔迹点组的起笔笔画类型为其他类型。
例如,在一些示例中,在确定对应于笔迹点组的起笔笔画类型后,基于该起笔笔画类型和第1个笔迹点对应的模型图案,确定对应于第1个笔迹点的辅助模型图案的尺寸和中心坐标,包括:
若起笔笔画类型为横,将辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,α=57°~63°(例如,α=60°,但不限于此);
若起笔笔画类型为竖,将辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,α=67°~73°(例如,α=70°,但不限于此);
若起笔笔画类型为撇或者提,将辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,α=42°~48°(例如,α=45°,但不限于此);
若起笔笔画类型为捺或者其他类型,将辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,α=7°~13°(例如,α=10°,但不限于此),
其中,R表示对应于第1个笔迹点的模型图案的尺寸,O 1表示对应于第1个笔迹点的模型图案的中心,r表示对应于第1个笔迹点的辅助模型图案的尺寸,O 2表示对应于第1个笔迹点的辅助模型图案的中心,O 1O 2表示对应于第1个笔迹点的模型图案和辅助模型图案之间的中心连线的距离,w表示基本线宽,α表示中心连线与水平线的夹角(即将中心连线沿逆时针方向旋转到水平线方向所需要旋转的圆心角度)。
图4为本公开至少一实施例提供的一种水滴单元的示意图。例如,在一些示例中,如图4所示,对应于第1个笔迹点的模型图案和辅助模型图案均为圆形,R表示对应于第1个笔迹点的圆形模型图案的半径,O 1表示对应于第1个笔迹点的圆形模型图案的圆心,r表示对应于第1个笔迹点的圆形辅助模型图案的半径,O 2表示对应于第1个笔迹点的圆形辅助模型图案的圆心,O 1O 2表示对应于第1个笔迹点的模型图案和辅助模型图案之间的圆心连线的距离,α表示圆心连线与水平线的夹角(即将圆心连线沿逆 时针方向旋转到水平线方向所需要旋转的圆心角度)。
例如,在一些示例中,如图4所示,在对应于第1个笔迹点的模型图案和辅助模型图案均为圆形的情况下,基于对应于第1个笔迹点的模型图案和辅助模型图案,确定对应于第1个笔迹点的辅助四边形,可以包括:确定对应于第1个笔迹点的圆形模型图案和圆形辅助模型图案的四个外公切点,依次连接该四个外公切点以形成对应于第1个笔迹点的辅助四边形。例如,如图4所示,该辅助四边形用于连接第1个笔迹点对应的模型图案和辅助模型图案,以形成一个连通的图案。例如,在对应于第1个笔迹点的模型图案和辅助模型图案均为圆形的情况下,采用四个外公切点形成的辅助四边形连接模型图案和辅助模型图案,有利于消除锯齿和毛刺。
例如,在另一些示例中,在对应于第1个笔迹点的模型图案和辅助模型图案均为圆形的情况下,基于对应于第1个笔迹点的模型图案和辅助模型图案,确定对应于第1个笔迹点的辅助四边形,可以包括:确定圆形模型图案中的与圆形模型图案和圆形辅助模型图案的圆心连线垂直的第一直径,确定圆形辅助模型图案中的与圆形模型图案和圆形辅助模型图案的圆心连线垂直的第二直径,将第一直径的两个端点及第二直径的两个端点作为辅助四边形的四个顶点,以确定辅助四边形。该方案有利于减少计算量,提高笔迹处理方法的处理速度。
需要说明的是,图4所示的水滴单元是示例性的,不应视作对本公开的限制。例如,在一些示例中,对应于第1个笔迹点的模型图案和辅助模型图案可以均为椭圆形,在此情况下,基于对应于第1个笔迹点的模型图案和辅助模型图案,确定对应于第1个笔迹点的辅助四边形,可以包括:确定对应于第1个笔迹点的椭圆形模型图案和椭圆形辅助模型图案的四个外公切点,依次连接该四个外公切点以形成对应于第1个笔迹点的辅助四边形。
例如,在一些实施例中,基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,还可以包括操作P203:响应于第1个笔迹点的动作类型为起笔类型,根据基本线宽和多个笔迹点中的第2个笔迹点的坐标确定对应于第2个笔迹点的模型图案的尺寸和中心坐标。例如,第1个笔迹点和第2个笔迹点在笔划延伸方向上相邻。例如,以图3所示的笔划110为例,基于操作P203可以确定对应于笔划110的第一轨迹段的第2个笔迹点的模型图案。
例如,在一些示例中,在模型图案为圆形的情况下,可以将对应于第2个笔迹点的圆形模型图案的半径设置为基本线宽的1/2。例如,在另一些示例中,在模型图案为椭圆形的情况下,可以将对应于第2个笔迹点的椭圆形模型图案的半短轴设置为基本线宽的1/2。即响应于第1个笔迹点的动作类型为起笔类型,对应于第2个笔迹点的模型图案的尺寸可以与对应于第1个笔迹点的模型图案的尺寸相同。本公开的实施例包括但不限于此。
例如,在一些实施例中,基于该多个笔迹点的坐标和动作类型确定对应于该多个 笔迹点的多个模型图案,还可以包括操作P204:从多个笔迹点中的第i个笔迹点开始,确定第i个笔迹点与第i-1个笔迹点的第一距离d1以及第i-1个笔迹点与第i-2个笔迹点的第二距离d2,并根据基本线宽w、对应于第i-1个笔迹点的模型图案的尺寸R i-1、第一距离d1和第二距离d2,确定对应于第i个笔迹点的模型图案的尺寸R i;以及根据第i个笔迹点的坐标确定对应于第i个笔迹点的模型图案的中心坐标,其中,i为正整数且i≥3。例如,以图3所示的笔划110为例,基于操作P204可以确定对应于笔划110的第一轨迹段的除第1个笔迹点和第2个笔迹点以外的其余轨迹点的模型图案。例如,操作P204可以根据相邻笔迹点之间的距离的变化调整对应于笔迹点的模型图案的尺寸,从而可以模拟毛笔笔锋的运笔效果。
例如,在一些示例中,可以根据第i个笔迹点的坐标和第i-1个笔迹点的坐标计算第一距离d1,根据第i-1个笔迹点的坐标与第i-2个笔迹点的坐标计算第二距离d2。
例如,在一些示例中,以模型图案为圆形或椭圆形为例,根据基本线宽w、对应于第i-1个笔迹点的模型图案的尺寸R i-1、第一距离d1和第二距离d2,确定对应于第i个笔迹点的模型图案的尺寸R i,可以包括:
响应于d2-d1>w/2,若R i-1≤0.25w,则R i=R i-1,否则,R i=t1*R i-1
响应于d2-d1<-p,若R i-1≥0.75w,则R i=R i-1,否则,R i=t2*R i-1
响应于-p≤d2-d1≤w/2,R i=R i-1
其中,t1、t2、p的数值均预先设置,且t1<1,t2>1,p为正数。
例如,t1、t2、p均可以根据实际需要进行设置。例如,t1的取值范围可以设置为[0.7,0.9],本公开的实施例包括但不限于此。例如,t1可以为0.8。例如,t2的取值范围可以设置为[1.1,1.3],本公开的实施例包括但不限于此。例如,t2可以为1.2。例如p的取值范围可以设置为[w/3,w/2]。例如,p可以为w/2。
例如,在一些实施例中,基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,还可以包括操作P211:响应于该多个笔迹点中的第1个笔迹点的动作类型为运笔类型,根据该笔迹点组的前一个笔迹点组确定对应于该多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于该多个笔迹点中的第2个笔迹点的模型图案的尺寸;根据第1个笔迹点的坐标确定对应于第1个笔迹点的模型图案的中心坐标;以及根据第2个笔迹点的坐标确定对应于第2个笔迹点的模型图案的中心坐标。例如,以图3所示的笔划110为例,基于操作P211可以确定对应于笔划110的第二轨迹段、第三轨迹段和第四轨迹段组成的群组中的任一轨迹段的第1个笔迹点和第二个笔迹点的模型图案。
例如,在一些示例中,根据该笔迹点组的前一个笔迹点组确定对应于该多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于该多个笔迹点中的第2个笔迹点的模型图案的尺寸,包括操作2210:响应于前一个笔迹点组的第N个笔迹点的坐标与该笔迹点组的第1个笔迹点的坐标相同,将对应于前一个笔迹点组的第N个笔迹点的模型 图案的尺寸作为对应于该笔迹点组的第1个笔迹点的模型图案的尺寸,以及确定该笔迹点组的第2个笔迹点与第1个笔迹点的第三距离和前一个笔迹点组的第N个笔迹点与第N-1个笔迹点的第四距离,并根据基本线宽、对应于该笔迹点组的第1个笔迹点的模型图案的尺寸、第三距离和第四距离,确定对应于该笔迹点组的第2个笔迹点的模型图案的尺寸,其中,前一个笔迹点组的第N-1个笔迹点与第N个笔迹点为前一个笔迹点组的最后两个笔迹点。
例如,笔迹点组和前一个笔迹点组为相邻的两个笔迹点组,以图3所示的笔划110的第二轨迹段对应的笔迹点组为当前的笔迹点组、第一轨迹段对应的笔迹点组为前一个笔迹点组,第二轨迹段对应的笔迹点组的第1个笔迹点和第一轨迹段对应的笔迹点组的最后一个笔迹点重合(即坐标相同),从而可以直接将对应于第一轨迹段的最后一个笔迹点的模型图案的尺寸作为对应于第二轨迹段的第1个笔迹点的模型图案的尺寸,并省略相应的计算过程。应当理解的是,笔划110被划分为多个轨迹段,是为了改善笔迹处理方法的实时性,第二轨迹段本质上是第一轨迹段的运笔动作的延续,因此,确定对应于第二轨迹段的除第1个笔迹点以外的各个笔迹点的模型图案的尺寸可以参考前述操作P204的相关描述。也就是说,操作2210中,确定对应于该笔迹点组的第2个笔迹点的模型图案的尺寸,可以参考前述操作P204的相关描述,在此不再重复赘述。
也就是说,基于操作P204可以确定对应于笔划110的每个轨迹段的除第1个笔迹点和第2个笔迹点以外的其余轨迹点的模型图案。
在研究中,本申请的发明人注意到:毛笔笔锋的收笔效果与笔划的起笔笔画类型有关;例如,起笔笔画类型包括横、竖、撇、捺、提和其他类型。例如,当笔划的起笔为横或者捺时,笔划的尾部通常逐渐变宽,呈现出“钝”的效果;当笔划的起笔为竖或者撇或者提时,笔划的尾部通常逐渐变窄,呈现出“尖”的效果。
例如,在一些实施例中,为了模拟毛笔笔锋的效果,基于该多个笔迹点的坐标和动作类型确定对应于该多个笔迹点的多个模型图案,还可以包括操作P221:响应于该多个笔迹点中的第M个笔迹点的动作类型为收笔类型,确定对应于该笔迹点组的起笔笔画类型;以及根据该起笔笔画类型设置对应于多个笔迹点中的第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸,其中,j为正整数,且j≥1。应当理解的是,在笔迹点组的多个笔迹点中的第M个笔迹点的动作类型为收笔类型的情况下,对应于该笔迹点组的第1个笔迹点至第M-j-1个笔迹点的各个模型图案的尺寸仍然可以通过前述操作P201至操作P204、操作P211(包括操作P2210)等确定。
例如,在一些示例中,在笔划对应多个笔迹点组的情况下,当前的笔迹点组为该多个笔迹点组中的最后一个笔迹点组,因此,可以追溯确定该多个笔迹点组中的第一个笔迹点组;由于该第一个笔迹点组的起笔笔画类型已经确定(参考前述操作P202的相关描述),因此可以将该第一个笔迹点组的起笔笔画类型作为当前笔迹点组对应的起笔笔画类型。例如,在另一些示例中,,在笔划对应一个笔迹点组的情况下,当前的笔 迹点组的起笔笔画类型已经在前述操作P202中得以确定,因此可以基于前述操作P202的结果直接得到。
图5为本公开至少一实施例提供的一种模拟毛笔笔锋的收笔效果的示意图。例如,在一些实施例中,如图5所示,根据该起笔笔画类型设置对应于多个笔迹点中的第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸,可以包括:若起笔笔画类型为横或者捺,按照第一预设比例依次增大对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸;若起笔笔画类型为竖或者撇或者提,按照第二预设比例依次减小对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸。
例如,在一些示例中,根据该起笔笔画类型设置对应于多个笔迹点中的第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸,还可以包括:若起笔笔画类型为其他类型,则不根据起笔笔画类型设置对应于多个笔迹点中的第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸。即在起笔笔画类型为其他类型的情况下,可以参考前述操作P204确定对应于多个笔迹点中的第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸。当然,本公开的实施例包括但不限于此。例如,在另一些示例中,若起笔笔画类型为其他类型,可以按照第一预设比例依次增大对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸,或者可以按照第二预设比例依次减小对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸。
例如,第一预设比例可以根据实际需要进行设置,只要确保对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸依次增大即可;例如,第二预设比例可以根据实际需要进行设置,只要确保对应于第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸依次减小即可。例如,在一些示例中,第一预设比例的设置可以避免对应于第M个笔迹点的模型图案的尺寸过大,第二预设比例的设置可以避免对应于第M个笔迹点的模型图案的尺寸过小。
应当理解的是,不同的起笔笔画类型对应的第一预设比例或第二预设比例可以不同,也可以相同,本公开的实施例对此不作限制。还应当理解的是,不同的起笔笔画类型对应的j可以相同,也可以不同,本公开的实施例对此亦不作限制。例如,在一些实施例中,j可以为2。
例如,如图5所示,基于操作P221可以模拟横、竖、撇、捺、提的毛笔笔锋的收笔效果。
步骤S300:依次连接该多个模型图案,以确定对应于该笔迹点组的用于显示的笔迹轨迹。
例如,以对应于所述笔迹点组的每个笔迹点的模型图案包括圆或椭圆为例,依次连接该多个模型图案,以确定对应于该笔迹点组的用于显示的笔迹轨迹,即步骤S300,可以包括操作P301:依次连接该多个笔迹点中每相邻的两个笔迹点对应的模型图案的四个外公切点以形成每相邻的两个笔迹点之间的四边形,其中,每相邻的两个笔迹点 之间的四边形用于连接该每相邻的两个笔迹点对应的模型图案。
下面简单介绍计算任意两个圆之间的精确外公切点的方式。图6为本公开至少一实施例提供的计算外公切点的示意图。例如,如图6所示,在坐标系oxy中,假设所述任意两个圆分别为第一圆和第二圆,第一圆的圆心坐标为(a1,b1),第一圆的半径为r1,第二圆的圆心坐标为(a2,b2),第二圆的半径为r2,则基于以下分类讨论的情况确定四个外公切点的坐标。
(1)在r1=r2的情况下:
若a1=a2且b1≠b2,则四个外公切点的坐标分别为:
(a1-r1,b1),(a2-r2,b2),(a2+r2,b2),(a1+r1,b1);
若a1≠a2且b1=b2,则四个外公切点的坐标分别为:
(a1,b1-r1),(a2,b2-y2),(a2,b2+y2),(a1,b1+r1);
若a1≠a2且b1≠b2,则
1)当(b2-b1)/(a2-a1)>0时,四个外公切点的坐标分别为:
(a1+r1 sinγ,b1-r1 cosγ),(a2+r2 sinγ,b2-r2 cosγ),
(a2-r2 sinγ,b2+r2 cosγ),(a1-r1 sinγ,b1+r1 cosγ),
2)当(b2-b1)/(a2-a1)<0时,四个外公切点的坐标分别为:
(a1-r1 sinγ,b1-r1 cosγ),(a2-r2 sinγ,b2-r2 cosγ),
(a2+r2 sinγ,b2+r2 cosγ),(a1+r1 sinγ,b1+r1 cosγ),
其中,
Figure PCTCN2021080493-appb-000001
a2≠a1,γ表示第一圆和第二圆的圆心连线与横坐标轴所夹的锐角(参考图6所示)。
(2)在r1<r2的情况下:
若a1=a2且b1≠b2,则四个外公切点的坐标分别为:
(a1-r1 cosθ,b1-r1 sinθ),(a2-r2 cosθ,b2-r2 sinθ),
(a2+r2 cosθ,b2-r2 sinθ),(a1+r1 cosθ,b1-r1 sinθ);
若a1≠a2且b1=b2,则四个外公切点的坐标分别为:
(a1-r1 sinθ,b1-r1 cosθ),(a2-r2 sinθ,b2-r2 cosθ),
(a2+r2 sinθ,b2-r2 cosθ),(a1+r1 sinθ,b1-r1 cosθ);
若a1≠a2且b1≠b2,则
1)当a1<a2且b1<b2时,四个外公切点的坐标分别为:
(a1+r1 sinφ,b1-r1 cosφ),(a2+r2 sinφ,b2-r2 cosφ),
Figure PCTCN2021080493-appb-000002
2)当a1>a2且b1<b2时,四个外公切点的坐标分别为:
(a1-r1 sinφ,b1-r1 cosφ),(a2-r2 sinφ,b2-r2 cosφ),
Figure PCTCN2021080493-appb-000003
3)当a1>a2且b1>b2时,四个外公切点的坐标分别为:
(a1+r1 cosφ,b1-r1 sinφ),(a2+r2 cosφ,b2-r2 sinφ),
Figure PCTCN2021080493-appb-000004
4)当a1<a2且b1>b2时,四个外公切点的坐标分别为:
(a1-r1 cosφ,b1-r1 sinφ),(a2-r2 cosφ,b2-r2 sinφ),
Figure PCTCN2021080493-appb-000005
其中,
Figure PCTCN2021080493-appb-000006
θ表示第一圆和第二圆的圆心连线与任一外公切线所夹的锐角(参考图6所示),
Figure PCTCN2021080493-appb-000007
a2≠a1,γ表示第一圆和第二圆的圆心连线与横坐标轴所夹的锐角,
φ=γ-θ,
Figure PCTCN2021080493-appb-000008
(3)在r1>r2的情况下:
若a1=a2且b1≠b2,则四个外公切点的坐标分别为:
(a1-r1 cosθ,b1+r1 sinθ),(a2-r2 cosθ,b2+r2 sinθ),
(a2+r2 cosθ,b2+r2 sinθ),(a1+r1 cosθ,b1+r1 sinθ);
若a1≠a2且b1=b2,则四个外公切点的坐标分别为:
(a1+r1 sinθ,b1-r1 cosθ),(a2+r2 sinθ,b2-r2 cosθ),
(a2+r2 sinθ,b2+r2 cosθ),(a1+r1 sinθ,b1+r1 cosθ);
若a1≠a2且b1≠b2,则
1)当a1<a2且b1<b2时,四个外公切点的坐标分别为:
(a1+r1 cosφ,b1-r1 sinφ),(a2+r2 cosφ,b2-r2 sinφ),
Figure PCTCN2021080493-appb-000009
2)当a1>a2且b1<b2时,四个外公切点的坐标分别为:
(a1-r1 cosφ,b1-r1 sinφ),(a2-r2 cosφ,b2-r2 sinφ),
Figure PCTCN2021080493-appb-000010
3)当a1>a2且b1>b2时,四个外公切点的坐标分别为:
(a1+r1 sinφ,b1-r1 cosφ),(a2+r2 sinφ,b2-r2 cosφ),
Figure PCTCN2021080493-appb-000011
4)当a1<a2且b1>b2时,四个外公切点的坐标分别为:
(a1-r1 sinφ,b1-r1 cosφ),(a2-r2 sinφ,b2-r2 cosφ),
Figure PCTCN2021080493-appb-000012
其中,
Figure PCTCN2021080493-appb-000013
θ表示第一圆和第二圆的圆心连线与任一外公切线所夹的锐角,
Figure PCTCN2021080493-appb-000014
a2≠a1,γ表示第一圆和第二圆的圆心连线与横坐标轴所 夹的锐角,
φ=γ-θ,
Figure PCTCN2021080493-appb-000015
当对应于所述笔迹点组的每个笔迹点的模型图案为圆形时,基于上述任意两个圆之间的精确外公切点计算公式,可以得到每相邻的两个笔迹点对应的模型图案的四个外公切点的坐标(即确定该四个外公切点),依次连接该四个外公切点可以得到每相邻的两个笔迹点之间的四边形。该四边形用于连通每相邻的两个笔迹点对应的模型图案,从而有利于消除锯齿和毛刺,使得最终得到的用于显示的笔迹轨迹更加平滑。
应当理解的是,前述辅助四边形的四个顶点的坐标也可以采用上述计算公式计算得到,在此不再赘述。
例如,在对应于所述笔迹点组的每个笔迹点的模型图案包括椭圆的情况下,可以基于解析几何的知识计算每相邻的两个笔迹点对应的椭圆形模型图案的四个外公切点以形成每相邻的两个笔迹点之间的四边形,在此不再赘述。
例如,在另一些实施例中,在对应于所述笔迹点组的每个笔迹点的模型图案包括圆的情况下,可以确定与每相邻的两个笔迹点对应的椭圆形模型图案中的圆心连线垂直的第三直径和第四直径,其中,第三直径为每相邻的两个笔迹点对应的椭圆形模型图案之一的直径,第四直径为每相邻的两个笔迹点对应的椭圆形模型图案之另一的直径;然后,将第三直径的两个端点及第四直径的两个端点作为四边形的端点,以确定每相邻的两个笔迹点之间的四边形四边形。该方案有利于减少计算量,提高笔迹处理方法的处理速度。
例如,步骤S300得到的用于显示的笔记轨迹可以通过显示装置实时显示。例如,在一些实施例中,以用户书写图3所示的笔划110为例,当用户书写完笔划110的第一轨迹段后,显示装置可以实时显示对应于第一轨迹段的用于显示的笔迹轨迹,此时,用户可能还未完成笔划110的书写过程(例如,用户可能正在书写笔划110的第二轨迹段等)。
例如,在一些实施例中,上述笔迹处理方法能够为机场显示屏提供一种趣味交互方式。机场作为一个城市的地标性建筑,是吸引游客的重要方式。本公开提供的笔迹处理方法可以集成到机场的显示屏上,当游客到达某个城市的机场时,可以在显示屏上书写签名,并以处理后的毛笔笔迹形式展示在显示屏上。游客与签名合影,形成一种独特的旅游“打卡”方式,从而吸引游客,有助于促进城市旅游业的发展。在另一些实施例中,上述笔迹处理方法能够为智慧教室提供一种新型板报方式,该笔迹处理方法可以对学生或老师的板书、板报字体做处理,给出更清晰的呈现。
应当理解的是,虽然本公开的实施例均以用于显示的笔迹轨迹的笔锋类型为毛笔笔锋为例进行说明,但不应视作对本公开的限制。例如,本公开的实施例提供的笔迹处理方法也可以设计更多的笔迹风格,例如,铅笔笔锋、钢笔笔锋等,在不丧失原有字体的基础上,形成更美观的字体。
图7为本公开至少一实施例提供的一种模拟毛笔笔锋的效果图。例如,如图7所 示,用于显示的笔迹轨迹的笔锋类型为毛笔笔锋。图7所示的中文汉字“谢”字呈现出较好的毛笔笔锋模拟效果。
本公开的实施例提供的笔迹处理方法,可以基于用户在触控装置的工作表面上书写的笔划获取笔迹点组,并根据笔迹点组中的各个笔迹点的坐标和动作类型对笔迹点组对应的笔迹轨迹进行针对性的处理并用于显示。该笔迹处理方法可以在无压感的情况下实现实时的笔迹处理的效果,同时使得用于显示的笔迹轨迹具有笔锋效果。该笔迹处理方法还具有计算速度快、实现原理简单、实时性好等优点,可以广泛应用于电子交互白板(例如,会议白板、教学白板等)、电子板报、机场数字签名墙、云本、手写板等需要手写输入的场景。
本公开至少一个实施例还提供一种笔迹处理装置,图8为本公开至少一实施例提供的一种笔迹处理装置的示意性框图。
例如,如图8所示,笔迹处理装置100包括存储器110和处理器120。应当理解的是,图8所示的笔迹处理装置100的组件只是示例性的,而非限制性的,根据实际应用需要,该笔迹处理装置100还可以具有其他组件。例如,该笔迹处理装置100可以采用Windows、Android等操作系统,根据本公开实施例的笔迹形成方法通过运行于该操作系统中的应用程序实现。
例如,存储器110用于非暂时性存储计算机可读指令;处理器120用于运行计算机可读指令,计算机可读指令被处理器120运行时能够执行根据上述任一实施例所述的笔迹处理方法中的一个或多个步骤。
例如,如图8所示,笔迹处理装置100还可以包括触控装置130。触控装置130被配置为获取对应于在触控装置130的工作表面上的笔划的笔迹点组。例如,触控装置130可以包括电子笔、触摸屏、鼠标、触摸板、交互白板等任意的具有触控功能的等输入装置。例如,该触摸屏可以为电容式触摸屏,例如自容式触摸屏或互容式触摸屏,还可以为电阻式触摸屏、表面声波式触摸屏、红外式触摸屏等。
例如,触控装置130可以包括触摸传感器以及控制器(例如驱动IC),该控制器接收触摸传感器采集的电信号,将该电信号处理后得到触摸信号并提供给处理器等以用于进一步处理,以实现本公开实施例提供的笔迹处理方法。本公开的实施例对触控装置130的类型、结构以及通信方式等不作限制。触控装置130包括具有一定面积的工作表面,用户可以用手指直接在触控装置130的工作表面上进行书写,也可以利用主动式触控笔或被动式触控笔在触控装置130的工作表面上进行书写,本公开的实施例对此不作限制。这里,工作表面是指用于检测用户的触摸操作的表面,例如触控装置130的触摸表面。
例如,如图8所示,笔迹处理装置100还可以包括显示装置140。显示装置140被配置为显示对应于所述笔迹点组的用于显示的笔迹轨迹。例如,显示装置140可以包括显示屏、投影仪等显示装置。该显示装置140的显示屏例如为LCD显示屏、OLED 显示屏、QLED显示屏、投影部件、VR头戴式显示设备(例如VR头盔、VR眼镜)、AR显示设备等,本公开的实施例对此不作限制。该显示装置140可以显示由本公开实施例提供的笔迹形成方法所形成的笔迹,例如毛笔笔迹。
例如,在一些实施例中,触控装置130和显示装置140可以集成为例如触控显示屏,从而既具有触控功能又具有显示功能。
例如,存储器110和处理器120可以集成在触控显示屏中,又例如,存储器110和处理器120也可以集成在云端服务器中。
例如,笔迹处理装置100还可以包括通信模块,通信模块用于实现笔迹处理装置100与其他电子设备之间的通信,例如,当笔迹处理装置100应用于机场的显示屏中时,通信模块可以将显示笔迹轨迹从机场的显示屏传输至用户的手机或平板电脑内,从而用户的手机或平板电脑可以存储该显示笔迹轨迹。
例如,处理器120可以控制笔迹处理装置100中的其它组件以执行期望的功能。处理器120可以是中央处理单元(CPU)、张量处理器(TPU)等具有数据处理能力和/或程序执行能力的器件。中央处理元(CPU)可以为X86或ARM架构等。
例如,存储器110可以包括一个或多个计算机程序产品的任意组合,计算机程序产品可以包括各种形式的计算机可读存储介质,例如易失性存储器和/或非易失性存储器。易失性存储器例如可以包括随机存取存储器(RAM)和/或高速缓冲存储器(cache)等。非易失性存储器例如可以包括只读存储器(ROM)、硬盘、可擦除可编程只读存储器(EPROM)、便携式紧致盘只读存储器(CD-ROM)、USB存储器、闪存等。在所述计算机可读存储介质上可以存储一个或多个计算机可读指令,处理器120可以运行所述计算机可读指令,以实现笔迹处理装置100的各种功能。
例如,存储器110、存储器120、触控装置130和显示装置140等组件之间可以通过网络进行通信。网络可以包括无线网络、有线网络、和/或无线网络和有线网络的任意组合。网络可以包括局域网、互联网、电信网、基于互联网和/或电信网的物联网(Internet of Things)、和/或以上网络的任意组合等。有线网络例如可以采用双绞线、同轴电缆或光纤传输等方式进行通信,无线网络例如可以采用3G/4G/5G移动通信网络、蓝牙、Zigbee或者WiFi等通信方式。本公开对网络的类型和功能在此不作限制。
例如,关于笔迹处理装置100执行笔迹处理的过程的详细说明可以参考笔迹处理方法的实施例中的相关描述,重复之处不再赘述。
本公开至少一实施例还提供一种存储介质。图9为本公开至少一个实施例提供的一种存储介质的示意图。例如,如图9所示,在存储介质200上可以非暂时性地存储一个或多个计算机可读指令201。例如,当所述计算机可读指令201由计算机执行时能够执行根据上文所述的笔迹处理方法中的一个或多个步骤。
例如,该存储介质200可以应用于上述笔迹处理装置100中,例如,其可以作为笔迹处理装置100中的存储器110。关于存储介质200的说明可以参考笔迹处理装置 100的实施例中对于存储器100的描述,重复之处不再赘述。
图10为本公开至少一实施例提供的一种硬件环境的示意图。本公开提供的笔迹处理装置100可以应用在互联网系统。
利用图10中提供的计算机系统可以实现本公开中涉及的笔迹处理装置100。这类计算机系统可以包括个人电脑、笔记本电脑、平板电脑、手机、个人数码助理、智能眼镜、智能手表、智能指环、智能头盔及任何智能便携设备或可穿戴设备。本实施例中的特定系统利用功能框图解释了一个包含用户界面的硬件平台。这种计算机设备可以是一个通用目的的计算机设备,或一个有特定目的的计算机设备。两种计算机设备都可以被用于实现本实施例中的笔迹处理装置100。计算机系统可以实施当前描述的实现笔迹处理所需要的信息的任何组件。例如,计算机系统能够被计算机设备通过其硬件设备、软件程序、固件以及它们的组合所实现。为了方便起见,图10中只绘制了一台计算机设备,但是本实施例所描述的实现笔迹处理所需要的信息的相关计算机功能是可以以分布的方式、由一组相似的平台所实施的,分散计算机系统的处理负荷。
如图10所示,计算机系统可以包括通信端口250,与之相连的是实现数据通信的网络,例如,计算机系统可以通过通信端口250发送和接收信息及数据,即通信端口250可以实现计算机系统与其他电子设备进行无线或有线通信以交换数据。计算机系统还可以包括一个处理器组220(即上面描述的处理器),用于执行程序指令。处理器组220可以由至少一个处理器(例如,CPU)组成。计算机系统可以包括一个内部通信总线210。计算机系统可以包括不同形式的程序储存单元以及数据储存单元(即上面描述的存储器或存储介质),例如硬盘270、只读存储器(ROM)230、随机存取存储器(RAM)240,能够用于存储计算机处理和/或通信使用的各种数据文件,以及处理器组220所执行的可能的程序指令。计算机系统还可以包括一个输入/输出组件260,输入/输出组件260用于实现计算机系统与其他组件(例如,用户界面280等)之间的输入/输出数据流。
通常,以下装置可以连接输入/输出组件260:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置;包括例如磁带、硬盘等的存储装置;以及通信接口。
虽然图10示出了具有各种装置的计算机系统,但应理解的是,并不要求计算机系统具备所有示出的装置,可以替代地,计算机系统可以具备更多或更少的装置。
对于本公开,还有以下几点需要说明:(1)本公开实施例附图只涉及到与本公开实施例涉及到的结构,其他结构可参考通常设计。(2)为了清晰起见,在用于描述本发明的实施例的附图中,层或结构的厚度和尺寸被放大。可以理解,当诸如层、膜、区域或基板之类的元件被称作位于另一元件“上”或“下”时,该元件可以“直接”位于另一元件“上”或“下”,或者可以存在中间元件。(3)在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合以得到新的实施例。
以上所述仅为本公开的具体实施方式,但本公开的保护范围并不局限于此,本公开的保护范围应以所述权利要求的保护范围为准。

Claims (20)

  1. 一种笔迹处理方法,包括:
    获取对应于在触控装置的工作表面上的笔划的笔迹点组,其中,所述笔迹点组包括依次排列的多个笔迹点,所述多个笔迹点中的每个笔迹点的数据包括坐标和动作类型;
    基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,其中,所述多个模型图案与所述多个笔迹点一一对应;以及
    依次连接所述多个模型图案,以确定对应于所述笔迹点组的用于显示的笔迹轨迹。
  2. 根据权利要求1所述的笔迹处理方法,其中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:响应于所述多个笔迹点中的第1个笔迹点的动作类型为起笔类型,根据书写应用中书写过程中对应的基本线宽和所述第1个笔迹点的坐标确定对应于所述第1个笔迹点的模型图案的尺寸和中心坐标。
  3. 根据权利要求2所述的笔迹处理方法,其中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,还包括:
    响应于所述第1个笔迹点的动作类型为起笔类型,确定对应于所述笔迹点组的起笔笔画类型,
    基于所述起笔笔画类型和所述第1个笔迹点对应的模型图案,确定对应于所述第1个笔迹点的辅助模型图案的尺寸和中心坐标,以及
    基于对应于所述第1个笔迹点的所述模型图案和所述辅助模型图案,确定对应于所述第1个笔迹点的辅助四边形,其中,对应于所述第1个笔迹点的所述辅助四边形用于连接所述第1个笔迹点对应的所述模型图案和所述辅助模型图案。
  4. 根据权利要求3所述的笔迹处理方法,其中,确定对应于所述笔迹点组的起笔笔画类型,包括:
    在所述多个笔迹点中确定第t个笔迹点,其中,t为正整数,t≠1,且所述第t个笔迹点的坐标不同于所述第1个笔迹点的坐标;以及
    基于所述第1个笔迹点的坐标和所述第t个笔迹点的坐标,确定对应于所述笔迹点组的起笔笔画类型。
  5. 根据权利要求4所述笔迹处理方法,其中,所述第1个笔迹点的坐标为(x1,y1),所述第t个笔迹点的坐标为(x2,y2),dx=x2–x1,dy=y2–y1,
    基于所述第1个笔迹点的坐标和所述第t个笔迹点的坐标,确定对应于所述笔迹点组的起笔笔画类型,包括:
    响应于dx=0且dy≠0,确定对应于所述笔迹点组的起笔笔画类型为横,
    响应于dx≠0且dy=0,确定对应于所述笔迹点组的起笔笔画类型为竖,
    响应于dx≠0且dy≠0:
    若dx>0且0≤|dy/dx|≤0.27,确定对应于所述笔迹点组的起笔笔画类型为横,
    若dy>0且0≤|dx/dy|≤0.27,确定对应于所述笔迹点组的起笔笔画类型为竖,
    若dx<0、dy>0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为撇,
    若dx>0、dy>0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为捺,
    当dx>0、dy<0且0.27<|dy/dx|≤3.73,确定对应于所述笔迹点组的起笔笔画类型为提,
    若dx<0且dy<0,确定对应于所述笔迹点组的起笔笔画类型为其他类型。
  6. 根据权利要求5所述的笔迹处理方法,其中,基于所述起笔笔画类型和所述第1个笔迹点对应的模型图案,确定对应于所述第1个笔迹点的辅助模型图案的尺寸和中心坐标,包括:
    若所述起笔笔画类型为横,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,a=57°~63°;
    若所述起笔笔画类型为竖,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,a=67°~73°;
    若所述起笔笔画类型为撇或者提,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/2,O 1O 2=w/2,a=42°~48°;
    若所述起笔笔画类型为捺或者其他类型,将所述辅助模型图案的尺寸和中心坐标设置为使得r=R/1.5,O 1O 2=w/1.5,a=7°~13°,
    其中,R表示对应于所述第1个笔迹点的模型图案的尺寸,O 1表示对应于所述第1个笔迹点的模型图案的中心,r表示对应于所述第1个笔迹点的辅助模型图案的尺寸,O 2表示对应于所述第1个笔迹点的辅助模型图案的中心,O 1O 2表示对应于所述第1个笔迹点的所述模型图案和所述辅助模型图案之间的中心连线的距离,w表示所述基本线宽,a表示所述中心连线与水平线的夹角。
  7. 根据权利要求2-6任一项所述的笔迹处理方法,其中,基于所述多个笔迹点的坐标和动作类型确定所述多个笔迹点对应的模型图案,还包括:
    响应于所述第1个笔迹点的动作类型为起笔类型,根据所述基本线宽和所述多个笔迹点中的第2个笔迹点的坐标确定对应于所述第2个笔迹点的模型图案的尺寸和中心坐标,
    其中,所述第1个笔迹点和所述第2个笔迹点相邻。
  8. 根据权利要求1-7任一项所述的笔迹处理方法,其中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:
    响应于所述多个笔迹点中的第1个笔迹点的动作类型为运笔类型,根据所述笔迹 点组的前一个笔迹点组确定对应于所述多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于所述多个笔迹点中的第2个笔迹点的模型图案的尺寸,
    根据所述第1个笔迹点的坐标确定对应于所述第1个笔迹点的模型图案的中心坐标,以及
    根据所述第2个笔迹点的坐标确定对应于所述第2个笔迹点的模型图案的中心坐标。
  9. 根据权利要求8所述的笔迹处理方法,其中,根据所述笔迹点组的前一个笔迹点组确定对应于所述多个笔迹点中的第1个笔迹点的模型图案的尺寸和对应于所述多个笔迹点中的第2个笔迹点的模型图案的尺寸,包括:
    响应于所述前一个笔迹点组的第N个笔迹点的坐标与所述笔迹点组的第1个笔迹点的坐标相同,将对应于所述前一个笔迹点组的第N个笔迹点的模型图案的尺寸作为对应于所述笔迹点组的第1个笔迹点的模型图案的尺寸,以及
    确定所述笔迹点组的第2个笔迹点与第1个笔迹点的第三距离和所述前一个笔迹点组的第N个笔迹点与第N-1个笔迹点的第四距离,并根据基本线宽、对应于所述笔迹点组的第1个笔迹点的模型图案的尺寸、所述第三距离和所述第四距离,确定对应于所述笔迹点组的第2个笔迹点的模型图案的尺寸,
    其中,所述前一个笔迹点组的第N-1个笔迹点与第N个笔迹点为所述前一个笔迹点组的最后两个笔迹点。
  10. 根据权利要求7或9所述的笔迹处理方法,其中,基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,还包括:
    从所述多个笔迹点中的第i个笔迹点开始,确定所述第i个笔迹点与第i-1个笔迹点的第一距离以及所述第i-1个笔迹点与第i-2个笔迹点的第二距离,并根据所述基本线宽、对应于所述第i-1个笔迹点的模型图案的尺寸、所述第一距离和所述第二距离,确定对应于所述第i个笔迹点的模型图案的尺寸;以及
    根据所述第i个笔迹点的坐标确定对应于所述第i个笔迹点的模型图案的中心坐标,
    其中,i为正整数,且i≥3。
  11. 根据权利要求1-10任一项所述的笔迹处理方法,其中,所述多个笔迹点中的第M个笔迹点为所述笔迹点组的最后一个笔迹点,
    基于所述多个笔迹点的坐标和动作类型确定对应于所述多个笔迹点的多个模型图案,包括:
    响应于所述第M个笔迹点的动作类型为收笔类型,确定对应于所述笔迹点组的起笔笔画类型,以及
    根据所述起笔笔画类型设置对应于所述多个笔迹点中的第M-j个笔迹点至第M个笔迹点的各个模型图案的尺寸,
    其中,j为正整数,且j≥1。
  12. 根据权利要求11所述的笔迹处理方法,其中,所述起笔笔画类型包括横、竖、撇、捺、提和其他类型,
    根据所述起笔笔画类型设置对应于所述多个笔迹点中的第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸,包括:
    若所述起笔笔画类型为横或者捺,按照第一预设比例依次增大对应于所述第M-j个笔迹点至所述第M个笔迹点的各个模型图案的尺寸;
    若所述起笔笔画类型为竖或者撇或者提,按照第二预设比例依次减小对应于所述第M-j个笔迹点至所述第M个笔迹点的各个模型图案的尺寸;以及
    若所述起笔笔画类型为其他类型,则不根据所述起笔笔画类型设置对应于所述多个笔迹点中的第M-j笔迹点至第M个笔迹点的各个模型图案的尺寸。
  13. 根据权利要求1-12任一项所述的笔迹处理方法,其中,对应于所述笔迹点组的每个笔迹点的模型图案包括圆或椭圆,
    依次连接所述多个模型图案,以确定对应于所述笔迹点组的用于显示的笔迹轨迹,包括:
    依次连接所述多个笔迹点中每相邻的两个笔迹点对应的模型图案的四个外公切点以形成所述每相邻的两个笔迹点之间的四边形,其中,所述每相邻的两个笔迹点之间的四边形用于连接所述每相邻的两个笔迹点对应的模型图案。
  14. 根据权利要求1-13任一项所述的笔迹处理方法,其中,获取对应于在所述触控装置的工作表面上的笔划的所述笔迹点组,包括:
    对在所述触控装置的工作表面上的笔划进行采样,以得到多个采样点;以及
    基于所述多个采样点,采用贝塞尔曲线拟合算法进行插值,以得到多个插值点,
    其中,所述笔迹点组的所述多个笔迹点包括所述多个采样点和所述多个插值点,所述多个采样点中的每个采样点的动作类型为起笔类型、运笔类型和收笔类型组成的集合中的一种。
  15. 根据权利要求1-14任一项所述的笔迹处理方法,其中,所述笔划对应多个笔迹点组,所述多个笔迹点组中的第一个笔迹点组的第1个笔迹点的动作类型为起笔类型,所述多个笔迹点组中的最后一个笔迹点组的最后一个笔迹点的动作类型为收笔类型。
  16. 根据权利要求1-15任一项所述的笔迹处理方法,其中,所述用于显示的笔迹轨迹的笔锋类型为毛笔笔锋。
  17. 一种笔迹处理装置,包括:
    存储器,用于非暂时性存储计算机可读指令;以及
    处理器,用于运行所述计算机可读指令,其中,所述计算机可读指令被所述处理器运行时执行根据权利要求1-16任一项所述的笔迹处理方法。
  18. 根据权利要求17所述的笔迹处理装置,还包括:触控装置,
    其中,所述触控装置被配置为获取对应于在所述触控装置的工作表面上的笔划的笔迹点组。
  19. 根据权利要求17或18所述的笔迹处理装置,还包括:显示装置,
    其中,所述显示装置被配置为显示对应于所述笔迹点组的用于显示的笔迹轨迹。
  20. 一种非瞬时性存储介质,非暂时性地存储计算机可读指令,其中,当所述非暂时性计算机可读指令由计算机执行时,能够执行根据权利要求1-16任一项所述的笔迹处理方法的指令。
PCT/CN2021/080493 2020-04-30 2021-03-12 笔迹处理方法、笔迹处理装置、非瞬时性存储介质 WO2021218446A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/763,704 US11789604B2 (en) 2020-04-30 2021-03-12 Handwriting processing method, handwriting processing device and non-transitory storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010363753.4 2020-04-30
CN202010363753.4A CN113589999B (zh) 2020-04-30 2020-04-30 笔迹处理方法、笔迹处理装置、非瞬时性存储介质

Publications (1)

Publication Number Publication Date
WO2021218446A1 true WO2021218446A1 (zh) 2021-11-04

Family

ID=78237320

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/080493 WO2021218446A1 (zh) 2020-04-30 2021-03-12 笔迹处理方法、笔迹处理装置、非瞬时性存储介质

Country Status (3)

Country Link
US (1) US11789604B2 (zh)
CN (1) CN113589999B (zh)
WO (1) WO2021218446A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114092945B (zh) * 2022-01-21 2022-04-19 广州文石信息科技有限公司 一种基于墨水屏的手写输入方法及装置
US20240143158A1 (en) * 2022-10-31 2024-05-02 Optoma Corporation Electronic whiteboard system and operation method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105405159A (zh) * 2015-10-27 2016-03-16 深圳市东向同人科技有限公司 一种书写笔迹的显示方法及装置
CN106293232A (zh) * 2016-08-11 2017-01-04 江苏中威科技软件系统有限公司 一种实现笔锋效果的手写输入方法及系统
CN107798717A (zh) * 2017-09-13 2018-03-13 深圳市创易联合科技有限公司 电子毛笔书写方法、装置、计算机设备和存储介质
CN110321054A (zh) * 2019-06-20 2019-10-11 广州视源电子科技股份有限公司 毛笔笔迹绘制方法、装置、设备及可读存储介质
CN110531875A (zh) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 书写笔锋的生成方法、终端设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1026659A3 (en) * 1999-02-01 2002-01-30 Sharp Kabushiki Kaisha Character display apparatus, character display method, and recording medium
US8331682B2 (en) * 2008-08-27 2012-12-11 Northrop Grumman Systems Corporation System and method for single stroke character recognition
CN102937850B (zh) * 2012-12-04 2015-07-22 上海合合信息科技发展有限公司 实时手写笔迹的美化方法及美化装置
JP6043020B1 (ja) * 2013-11-19 2016-12-14 株式会社ワコム インクデータの生成、インクデータのレンダリング、インクデータの操作、及び、インクデータの伝達のための方法及びシステム
CN106708413A (zh) * 2017-01-20 2017-05-24 山西大学 触摸屏手写输入呈现为具有型笔特征笔迹的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105405159A (zh) * 2015-10-27 2016-03-16 深圳市东向同人科技有限公司 一种书写笔迹的显示方法及装置
CN106293232A (zh) * 2016-08-11 2017-01-04 江苏中威科技软件系统有限公司 一种实现笔锋效果的手写输入方法及系统
CN107798717A (zh) * 2017-09-13 2018-03-13 深圳市创易联合科技有限公司 电子毛笔书写方法、装置、计算机设备和存储介质
CN110321054A (zh) * 2019-06-20 2019-10-11 广州视源电子科技股份有限公司 毛笔笔迹绘制方法、装置、设备及可读存储介质
CN110531875A (zh) * 2019-08-21 2019-12-03 深圳市威屏科技有限公司 书写笔锋的生成方法、终端设备及存储介质

Also Published As

Publication number Publication date
CN113589999A (zh) 2021-11-02
US20220365670A1 (en) 2022-11-17
US11789604B2 (en) 2023-10-17
CN113589999B (zh) 2024-01-30

Similar Documents

Publication Publication Date Title
US11687233B2 (en) Handwriting processing method, touch display device, computer device and storage medium
WO2021218445A1 (zh) 笔迹处理方法、笔迹处理装置、存储介质
US8860675B2 (en) Drawing aid system for multi-touch devices
WO2021218446A1 (zh) 笔迹处理方法、笔迹处理装置、非瞬时性存储介质
KR20210038446A (ko) 제스처를 기반으로 전자기기를 제어하는 방법 및 장치
KR102393295B1 (ko) 컨텐트를 스타일링하는 장치 및 방법
US10664072B2 (en) Multi-stroke smart ink gesture language
US9927971B2 (en) Electronic apparatus, method and storage medium for generating chart object
WO2021218448A1 (zh) 笔迹形成方法、笔迹形成装置及电子设备
WO2020056619A1 (zh) 文字书写检错方法、终端设备及存储介质
US10324618B1 (en) System and method for formatting and manipulating digital ink
US20200225787A1 (en) Stroke-based object selection for digital board applications
US20240020893A1 (en) Handwriting Forming Method and Apparatus, and Electronic Device
CN113487704B (zh) 一种燕尾箭头标的绘制方法、装置、存储介质及终端设备
WO2020133386A1 (zh) 一种笔记局部选取方法、装置、电子终端和可读存储介质
TWI831166B (zh) 影像處理方法及非暫態電腦可讀取紀錄媒體
WO2023070334A1 (zh) 手写输入显示方法及装置、计算机可读存储介质
WO2022088011A1 (zh) 人机交互方法、装置和系统,以及计算机可读存储介质
CN115509431A (zh) 笔迹绘制方法、装置、设备及存储介质
CN116027954A (zh) 一种笔迹的生成方法及相关装置
CN116136721A (zh) 无延迟线条绘制显示方法、装置、设备及存储介质
WO2017083876A1 (en) Free hand messaging and ink cluster editor
JP2018010456A (ja) 表示システム、表示制御装置、および表示方法
TW201523514A (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: 21797832

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: 21797832

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 26.06.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21797832

Country of ref document: EP

Kind code of ref document: A1