Summary of the invention
It writes the generation method of the vigour of style in writing, terminal device the main purpose of the present invention is to provide a kind of and computer-readable deposits
Storage media, it is intended to the existing mode for realizing vigour of style in writing writing effect is solved, even if carrying out style of writing pattern using very high frequency
Drafting in the case of, be also easy to eventually lead to stroke adjacent two because user's operation of quickly wieling the pen forms incoherent style of writing point
A incoherent technical problem of style of writing pattern.
The embodiment of the present invention proposes that a kind of generation method for writing the vigour of style in writing, the generation method of the writing vigour of style in writing include:
The handwriting trace got in real time is sampled to obtain each sampled point on the handwriting trace;
Sample information entrained by each sampled point is extracted, and the sample information is handled to determine default pen
Touch pattern;
Each default style of writing pattern is connected using the common tangent of the default style of writing pattern;
The common tangent and the default style of writing pattern area defined are filled to generate the handwriting trace
The writing vigour of style in writing.
Optionally, the default style of writing pattern includes at least the ellipse element figure of angle tilt, and the sample information includes:
The point position of the sampled point and writing speed;
It is described to extract sample information entrained by each sampled point, and the sample information is handled pre- to determine
If the step of style of writing pattern, comprising:
Writing speed when the point position for extracting each sampled point and the handwriting trace are by each sampled point;
It distributes the ellipse element figure and is overlapped the geometric center of each ellipse element figure with described position, and root
The length unit of the ellipse element figure is determined according to the writing speed.
Optionally, the sample information further includes writing physical strength;
It is described to extract sample information entrained by each sampled point, and the sample information is handled pre- to determine
If the step of style of writing pattern, further includes:
Writing physical strength when the point position for extracting each sampled point and the handwriting trace are by each sampled point;
It distributes the ellipse element figure and is overlapped the geometric center of each ellipse element figure with described position, and root
The length unit of the ellipse element figure is determined according to the writing physical strength.
Optionally, the handwriting trace got in real time is sampled described to obtain respectively adopting on the handwriting trace
After the step of sampling point, the method also includes:
Increase auxiliary sampling point on the handwriting trace based on Bezier.
Optionally, the Bezier that is based on is the step of increasing auxiliary sampling point on the handwriting trace, comprising:
Persistently detect the auxiliary sampling point on the handwriting trace and the line curvature between each sampled point
Whether predetermined curvature is greater than;
Gradually increase the auxiliary between the destination sample point that the line curvature is greater than the predetermined curvature to adopt
Sampling point, until detecting that the line curvature is less than or equal to the predetermined curvature.
Optionally, the step of determination default style of writing pattern, further includes:
Distribute the ellipse element figure and by the geometric center of each ellipse element figure and each auxiliary sampling point
Point position is overlapped, and the length unit of the ellipse element figure is calculated based on interpolation algorithm.
Optionally, the step of connecting each default style of writing pattern using the common tangent of the default style of writing pattern, comprising:
Calculate the common tangent of the two neighboring ellipse element figure in each ellipse;
Each ellipse element figure is attached using the common tangent.
Optionally, described that the common tangent and the default style of writing pattern area defined are filled to generate
The step of stating the writing vigour of style in writing of handwriting trace, comprising:
Each common tangent is detected to be connected with each two neighboring ellipse element figure with the common tangent line at point of contact
The quadrilateral area constituted;
Each quadrilateral area is filled using color identical with the ellipse element figure, to generate the book
Write the writing vigour of style in writing of track.
In addition, to achieve the above object, the present invention also provides a kind of terminal device, the terminal device include: memory,
Processor and the generation program for writing the vigour of style in writing that is stored on the memory and can run on the processor, the writing
The step of generation method as described above for writing the vigour of style in writing is realized when the generation program of the vigour of style in writing is executed by the processor.
In addition, to achieve the above object, it is described computer-readable the present invention also provides a kind of computer readable storage medium
The generation program for writing the vigour of style in writing is stored on storage medium, the generation program for writing the vigour of style in writing is realized such as when being executed by processor
The step of generation method of the upper writing vigour of style in writing.
Generation method, terminal device and the computer-readable storage medium for a kind of writing vigour of style in writing that the embodiment of the present invention proposes
Matter, by being sampled to the handwriting trace got in real time to obtain each sampled point on the handwriting trace;Extract each institute
Sample information entrained by sampled point is stated, and the sample information is handled to determine default style of writing pattern;Using described
The common tangent of default style of writing pattern connects each default style of writing pattern;The common tangent and the default style of writing pattern are enclosed
At region be filled to generate the writing vigour of style in writing of the handwriting trace.
By being based on one to touch screen when carrying out handwriting input based on hardware devices such as large scale touch screen, felt pens
Determine the handwriting tracks that frequency is got in real time to be sampled, to obtain user on carrying out its written handwriting of handwriting input moment
Each sampled point, by extracting sample information entrained on collected each sampled point, and based on to sample information into
The processing such as row identification and conversion, determines preset each style of writing pattern in each sampling point position, based on the existing algorithm of calling
The common tangent of each style of writing pattern is calculated, and determining each style of writing pattern is attached by the common tangent by being calculated, and final
The closed area surrounded between the common tangent for connecting each style of writing pattern and each style of writing pattern is filled, thus in user hand
It writes on the handwriting trace of input, generates the coherent writing vigour of style in writing.Realize, the common tangent based on style of writing pattern to style of writing pattern into
Row connection, and mode that region surrounded between common tangent and style of writing pattern is filled is drawn to the vigour of style in writing of handwriting input,
Not only avoid in the stroke ultimately generated that there are gaps to cause the incoherent technical problem of the vigour of style in writing between adjacent style of writing pattern, more
Do not require hardware device that there is superior performance to be sampled using very high frequency.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The primary solutions of the embodiment of the present invention are: being sampled to the handwriting trace got in real time described to obtain
Each sampled point on handwriting trace;Extract sample information entrained by each sampled point, and to the sample information at
Reason is to determine default style of writing pattern;Each default style of writing pattern is connected using the common tangent of the default style of writing pattern;By institute
It states common tangent and the default style of writing pattern area defined is filled to generate the writing vigour of style in writing of the handwriting trace.
Due to existing " lasting superposition " mode in order to obtain smooth effect of wieling the pen, it is necessary to high-frequency drafting style of writing figure
Case, but even using very high frequency carry out style of writing pattern drafting, when user quickly wield the pen when, also always can shape
At incoherent style of writing point, lead between the two neighboring style of writing pattern of stroke that there are incoherent gaps.
The present invention provides a solution, and the common tangent based on style of writing pattern is attached style of writing pattern, and will be public
The mode that surrounded region is filled between tangent line and style of writing pattern draws the stroke of handwriting input, does not need hardware not only
Equipment is sampled using very high frequency, more avoids in the stroke ultimately generated that there are discontinuous between adjacent style of writing pattern
The technical issues of.
As shown in Figure 1, Fig. 1 is the terminal structure schematic diagram for the hardware running environment that the embodiment of the present invention is related to.
The terminal of that embodiment of the invention equipment can be touch screen, the terminal devices such as especially large-sized touch screen, equally
It can be various network-termination devices, such as PC, smart phone, tablet computer, E-book reader, MP3 (Moving
Picture Experts Group Audio Layer III, dynamic image expert's compression standard audio level 3) player,
MP4 (Moving Picture Experts Group Audio Layer IV, dynamic image expert's compression standard audio level
3) player, digit broadcasting receiver, wearable device (such as Intelligent bracelet, smartwatch etc.), navigation device, portable calculating
The packaged types such as machine terminal device or immovable terminal device.
As shown in Figure 1, the terminal device may include: processor 1001, such as CPU, network interface 1004, user interface
1003, memory 1005, communication bus 1002.Wherein, communication bus 1002 is for realizing the connection communication between these components.
User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface
1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connects
Mouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory
(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
It will be understood by those skilled in the art that terminal structure shown in Fig. 1 does not constitute the restriction to terminal device, it can
To include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe module, Subscriber Interface Module SIM and the generation program for writing the vigour of style in writing.
In terminal device shown in Fig. 1, network interface 1004 is mainly used for connecting background server, with background server
Carry out data communication;User interface 1003 is mainly used for connecting client (user terminal), carries out data communication with client;And locate
Reason device 1001 can be used for calling the generation program of the writing vigour of style in writing stored in memory 1005, and execute following operation:
The handwriting trace got in real time is sampled to obtain each sampled point on the handwriting trace;
Sample information entrained by each sampled point is extracted, and the sample information is handled to determine default pen
Touch pattern;
Each default style of writing pattern is connected using the common tangent of the default style of writing pattern;
The common tangent and the default style of writing pattern area defined are filled to generate the handwriting trace
The writing vigour of style in writing.
Further, the default style of writing pattern includes at least the ellipse element figure of angle tilt, the sample information packet
It includes: the point position of the sampled point and writing speed;
Processor 1001 can be also used for call memory 1005 in store writing the vigour of style in writing generation program, and execute with
Lower operation:
Writing speed when the point position for extracting each sampled point and the handwriting trace are by each sampled point;
It distributes the ellipse element figure and is overlapped the geometric center of each ellipse element figure with described position, and root
The length unit of the ellipse element figure is determined according to the writing speed.
Further, the sample information further includes writing physical strength;
Processor 1001 can be also used for call memory 1005 in store writing the vigour of style in writing generation program, and execute with
Lower operation:
Writing physical strength when the point position for extracting each sampled point and the handwriting trace are by each sampled point;
It distributes the ellipse element figure and is overlapped the geometric center of each ellipse element figure with described position, and root
The length unit of the ellipse element figure is determined according to the writing physical strength.
Further, processor 1001 can be also used for calling the generation journey of the writing vigour of style in writing stored in memory 1005
Sequence, execute the handwriting trace got in real time is sampled to obtain each sampled point on the handwriting trace the step of it
Afterwards, following operation is executed:
Increase auxiliary sampling point on the handwriting trace based on Bezier.
Further, processor 1001 can be also used for calling the generation journey of the writing vigour of style in writing stored in memory 1005
Sequence, and execute following operation:
Persistently detect the auxiliary sampling point on the handwriting trace and the line curvature between each sampled point
Whether predetermined curvature is greater than;
Gradually increase the auxiliary between the destination sample point that the line curvature is greater than the predetermined curvature to adopt
Sampling point, until detecting that the line curvature is less than or equal to the predetermined curvature.
Further, processor 1001 can be also used for calling the generation journey of the writing vigour of style in writing stored in memory 1005
Sequence, and execute following operation:
Distribute the ellipse element figure and by the geometric center of each ellipse element figure and each auxiliary sampling point
Point position is overlapped, and the length unit of the ellipse element figure is calculated based on interpolation algorithm.
Further, processor 1001 can be also used for calling the generation journey of the writing vigour of style in writing stored in memory 1005
Sequence, and execute following operation:
Calculate the common tangent of the two neighboring ellipse element figure in each ellipse element figure;
Each ellipse element figure is attached using the common tangent.
Further, processor 1001 can be also used for calling the generation journey of the writing vigour of style in writing stored in memory 1005
Sequence, and execute following operation:
Each common tangent is detected to be connected with each two neighboring ellipse element figure with the common tangent line at point of contact
The quadrilateral area constituted;
Each quadrilateral area is filled using color identical with the ellipse element figure, to generate the book
Write the writing vigour of style in writing of track.
Based on above-mentioned hardware configuration, propose that the present invention writes each embodiment of the generation method of the vigour of style in writing.
Referring to figure 2., in the generation method first embodiment that the present invention writes the vigour of style in writing, the generation method of the writing vigour of style in writing
Include:
Step S10 samples the handwriting trace got in real time to obtain each sampled point on the handwriting trace.
When terminal device detects that user carries out handwriting input, user is obtained in real time and is based on produced by handwriting input
Handwriting trace, and the handwriting trace of user's handwriting input is sampled using predeterminated frequency, to obtain on handwriting trace
Multiple sampled points.
In the present embodiment, terminal device can be touch screen, especially large scale (65 cun or more) touch screen and touching
Touch the hardware devices such as pen.
Specifically, for example, when touch screen detects that user carries out handwriting input on the touchscreen using felt pen to produce
When raw handwriting trace, the handwriting trace, and the sample frequency each using 30ms are obtained in real time, to touch screen writing generated
Track is sampled, to obtain user, using felt pen, multiple on the handwriting trace of handwriting input on current touch screen are adopted
Sampling point.
In the present embodiment, predeterminated frequency that handwriting trace is sampled can the performance based on different touch screens itself into
Row setting, it is therefore apparent that ground is, the present invention is not limited the predeterminated frequency sampled to handwriting trace.
Step S20 extracts sample information entrained by each sampled point, and is handled the sample information with true
Surely style of writing pattern is preset.
In the present embodiment, terminal device get user carry out sampled point produced by handwriting input on handwriting trace it
Afterwards, for each of these sampled point, frequency size, the position of sampled point on the terminal device when by based on sampling are sat
Mark, writing speed and writing physical strength even when the user that each sampling point moment terminal device is recorded carries out handwriting input
Etc. parameters, calculate and extract sample information entrained by each sampled point, be then based on conversion calculate etc. processing, in each sampled point
Position, the shape size etc. of default style of writing pattern are determined at coordinate position.
In the present embodiment, sampled point is at least extracted based on above-mentioned calculation processing sample information entrained by each sampled point
Position and user carry out handwriting input when through oversampled points when writing speed mention in other embodiments of the invention
Writing physical strength when sample information out further including user's progress handwriting input through oversampled points, it should be apparent that ground is this hair
It is bright sample information entrained by extraction sampled point not to be limited.
Further, step S20, comprising:
Book when each sampled point is passed through in step A, the point position and the handwriting trace for extracting each sampled point
Writing rate.
For each of the multiple sampled points got sampled point, touch screen will acquire each sampling point moment and be remembered
The user of record carries out the position coordinates of the handwriting trace of handwriting input using felt pen, as sample information entrained by each sampled point
In location information, and the 30ms that is sampled of handwriting trace according to produced by carrying out handwriting input using felt pen to user is adopted
It is separated by a distance between sample frequency and two neighboring sample point coordinate position to be calculated, to extract each sampled point institute
It carries in sample information, user carries out writing speed information when handwriting input.
Step B distributes the ellipse element figure and weighs the geometric center of each ellipse element figure and described position
It closes, and determines the length unit of the ellipse element figure according to the writing speed.
In the present embodiment, presetting style of writing pattern can be 135 ° of angle tilt as shown in FIG. 6, i.e. touch screen display is horizontal
The ellipse that angle between direction (in figure shown in X-axis) and transverse extending direction is 135 °, major and minor axis ratio is 2:1, is answered
When being clearly, the present invention is not to the elliptical tilt angle, major and minor axis ratio, or even whether has the ginseng such as broken edge
Number is limited.
Touch screen will acquire each sampling according to the location information in sample information entrained by each sampled point extracted
Cluster center position of each position coordinates that point moment is recorded as ellipse element figure, at coordinate at various locations
Distribution and the ellipse element figure of sampled point same number, and by sample information entrained by each sampled point extracted, Yong Hujin
Writing speed information when row handwriting input is converted to the zoom factor of ellipse element figure at each sample point coordinate position, example
Such as, function: (1/e) can be usedSpeed (speed)(speed is bigger, ellipse element diagram shape is smaller) carries out conversion process, thus base
The length unit for being located at the ellipse element figure of each sampling point position is determined in the zoom factor converted out, is based on ellipse element figure
Middle ellipse long and short shaft ratio is the length unit of 2:1 and determination, that is, can determine the shape size of ellipse element figure.
Further, in another embodiment, step S20, further includes:
Book when each sampled point is passed through in step C, the point position and the handwriting trace for extracting each sampled point
Write dynamics.
For each of the multiple sampled points got sampled point, touch screen will acquire each sampling point moment and be remembered
The user of record carries out the position coordinates of the handwriting trace of handwriting input using felt pen, as sample information entrained by each sampled point
In location information, and extract that touch screen recorded is getting each sampling point moment, and user carries out hand using felt pen
Write writing physical strength information when input.
Step D distributes the ellipse element figure and weighs the geometric center of each ellipse element figure and described position
It closes, and determines the length unit of the ellipse element figure according to the writing physical strength.
Touch screen will acquire each sampling according to the location information in sample information entrained by each sampled point extracted
Cluster center position of each position coordinates that point moment is recorded as ellipse element figure, at coordinate at various locations
The ellipse element figure of distribution and sampled point same number, by sample information entrained by each sampled point extracted, user is carried out
Writing physical strength information when handwriting input is converted to the zoom factor of ellipse element figure at each sample point coordinate position, for example,
Function can be used: (1/e) * strength (strength) (strength is bigger, ellipse element diagram shape is bigger) carries out conversion process, from
And the length unit for being located at the ellipse element figure of each sampling point position is determined based on the zoom factor converted out, based on oval single
Ellipse long and short shaft ratio is the length unit of 2:1 and determination in first figure, that is, can determine the shape size of ellipse element figure.
Step S30 connects each default style of writing pattern using the common tangent of the default style of writing pattern.
Terminal device is after determining each ellipse element figure positioned at each sample point coordinate position, based on existing
Calculation formula calculates all two common tangents between each two neighboring ellipse element figure, and will using the common tangent being calculated
Each ellipse element figure is attached, and connection effect is as shown in Figure 7.
Further, step S30, comprising:
Step E calculates the common tangent of the two neighboring ellipse element figure in each ellipse element figure.
Each ellipse element figure is attached by step F using the common tangent.
Terminal device is according to the chronological order for getting each sampling, from determining whole ellipse element figures, once
Two ellipse element figures at two neighboring sample point coordinate position are extracted, and call existing oval common tangent calculation formula,
All two common tangents for calculating two ellipse element figures, in the public affairs by two adjacent ellipses unit figures are calculated
After tangent line, closing connection is carried out to two ellipse element figures using two common tangents.
The common tangent and the default style of writing pattern area defined are filled described in generation by step S40
The writing vigour of style in writing of handwriting trace.
Further, referring to figure 3., Fig. 3 is the refinement flow diagram of step S40 in the present embodiment, step S40, packet
It includes:
Step S41, each common tangent of detection, which is connected with each two neighboring ellipse element figure with the common tangent, to be cut
The quadrilateral area that the line of point is constituted.
Specifically, for example, touch screen successively detects connection phase in the flow diagram of the generation vigour of style in writing as shown in Figure 7
The common tangent of adjacent two ellipse element figures, together with the line at two public point of contacts being in contact with common tangent on each ellipse element figure
The quadrilateral area being enclosed jointly.
Step S42 is filled each quadrilateral area using color identical with the ellipse element figure, with life
At the writing vigour of style in writing of the handwriting trace.
Specifically, for example, touch screen is true by detecting in the flow diagram of the generation vigour of style in writing as shown in Figure 7
The color of fixed ellipse element figure, and use color identical with ellipse element figure color, the whole public affairs having been detected by are cut
The quadrilateral area that line is enclosed with oval point of contact line is filled, after being finished to the filling of whole quadrilateral areas,
It can generate and show on current touch screen, user is using felt pen based on produced by writing input on current touch screen
The writing vigour of style in writing of handwriting trace.
Further, in another embodiment, touch screen can also directly detect user and use the conscientious hand of felt pen
Input selected theme colors in the past are write, and using the theme colors to the whole common tangents having been detected by and oval point of contact
The quadrilateral area that line is enclosed is filled.
In the present embodiment, by being sampled to the handwriting trace got in real time to obtain on the handwriting trace
Each sampled point;Sample information entrained by each sampled point is extracted, and the sample information is handled default to determine
Style of writing pattern;Each default style of writing pattern is connected using the common tangent of the default style of writing pattern;By the common tangent and institute
Default style of writing pattern area defined is stated to be filled to generate the writing vigour of style in writing of the handwriting trace.
When terminal device detects that user carries out handwriting input, user is obtained in real time and is based on produced by handwriting input
Handwriting trace, and the handwriting trace of user's handwriting input is sampled using predeterminated frequency, to obtain on handwriting trace
Multiple sampled points, terminal device after getting the sampled point that user carries out produced by handwriting input on handwriting trace, for
Each of these sampled point, frequency size, sampled point position coordinates on the terminal device when by based on sampling even exist
The parameters such as writing speed and writing physical strength when user's progress handwriting input that each sampling point moment terminal device is recorded, meter
Sample information entrained by each sampled point is calculated and extracted, the processing such as conversion calculating are then based on, in each sample point coordinate position
Place determines position, the shape size etc. of default style of writing pattern, calculates each two neighboring default style of writing based on existing calculation formula
All two common tangents between pattern, and be attached each default style of writing pattern using the common tangent being calculated, it examines
Survey each common tangent be connected with each two neighboring default style of writing pattern with common tangent point of contact the enclosed composition of line quadrangle area
Domain is filled each quadrilateral area using color identical with default style of writing pattern, to generate the book of handwriting trace
Write the vigour of style in writing.
It realizes, does not need hardware device and sampled using very high frequency, but the common tangent based on style of writing pattern
Style of writing pattern is attached, and will not acquire and draw because of high-frequency and generate a large amount of brush stroke data, causes hardware device
Storage pressure, reduce the performance cost to hardware device, another convenience, by using institute between common tangent and style of writing pattern
The mode that region is filled is surrounded to draw the vigour of style in writing of handwriting input, ensure that adjacent style of writing pattern on the vigour of style in writing ultimately generated
Between be not in incoherent gap, improve the formation efficiency of the vigour of style in writing.
Further, on the basis of above-mentioned first embodiment, propose that the present invention writes the second of the generation method of the vigour of style in writing
Embodiment, referring to figure 4., in the second embodiment that the present invention writes the generation method of the vigour of style in writing, in above-mentioned steps S10, to reality
When the handwriting trace that gets the step of being sampled to obtain each sampled point on the handwriting trace after, the present invention writes
The generation method of the vigour of style in writing, further includes:
Step S50 increases auxiliary sampling point based on Bezier on the handwriting trace.
Terminal device samples the handwriting trace of user's handwriting input using predeterminated frequency, to obtain handwriting trace
On sampled point after, based on detection continuous sampling point between connect curvature of a curve, between the continuous sampled point, use shellfish plug
You add auxiliary sampling point by curve.
In the present embodiment, the performance requirement based on terminal device, the present invention can choose using second order Bezier algorithm or
Person carries out calculating addition auxiliary sampling point using three rank Bezier algorithms, and therefore, the present invention is not to Bezier selected to use
Algorithm is defined.
Further, referring to figure 5., Fig. 5 is the refinement flow diagram of step S50 in the present embodiment, step S40, packet
It includes:
Step S51 is persistently detected between the auxiliary sampling point and each sampled point on the handwriting trace
Whether line curvature is greater than predetermined curvature.
Terminal device based on curvature of a curve is connected between three sampled points, is being combined Bezier at this three every time
After adding auxiliary sampling point between sampled point, circulation to the company's curvature of a curve formed between auxiliary sampling point and sampled point
It is detected, and judges whether the line curvature detected is greater than predetermined curvature.
In the present embodiment, predetermined curvature be for determine whether there is still a need for adjacent auxiliary sampling point and sampled point it
Between, or the curvature threshold of new auxiliary sampling point is added between two adjacent auxiliary sampling points, specifically, for example, will
It is 175 ° that predetermined curvature, which is set as corresponding three sampled point line angles, then detects auxiliary sampling point and sampled point in touch screen
Between company's curvature of a curve for being formed when to be greater than the sampled point line angle be 175 ° of corresponding predetermined curvatures, determine there is still a need for
New auxiliary sampling point is added between current adjacent auxiliary sampling point and sampled point.
Step S52 gradually increases an institute between the destination sample point that the line curvature is greater than the predetermined curvature
Auxiliary sampling point is stated, until detecting that the line curvature is less than or equal to the predetermined curvature.
When terminal detects that the company's curvature of a curve formed between auxiliary sampling point and sampled point is greater than predetermined curvature every time,
Then between adjacent the auxiliary sampling point and sampled point, or between two adjacent auxiliary sampling points add new auxiliary
Sampled point then stops adding new auxiliary sampling point when the company's of detecting curvature of a curve is less than or equal to predetermined curvature.
Specifically, for example, detecting the song of the line formed between auxiliary sampling point and sampled point in touch screen each time
Rate is greater than the sampled point line angle when being 175 ° of corresponding predetermined curvatures, i.e., in current adjacent auxiliary sampling point and sampled point
Between add new auxiliary sampling point, when touch screen detect auxiliary sampling point and sampled point (or sampled point and sampled point) it
Between company's curvature of a curve for being formed when to be less than the sampled point line angle be 175 ° of corresponding predetermined curvatures, stop continuing adjacent
Between auxiliary sampling point and sampled point, or new auxiliary sampling point is added between two adjacent auxiliary sampling points.
Further, in above-mentioned steps S20, the step of determining the default style of writing pattern, further includes:
Step G distributes the ellipse element figure and adopts the geometric center of each ellipse element figure and each auxiliary
The point position of sampling point is overlapped, and the length unit of the ellipse element figure is calculated based on interpolation algorithm.
In terminal device between multiple sampled point sampled points on the hand-written input writing track of user got, complete
Contracting after adding auxiliary sampling point, based on mature interpolation algorithm to each ellipse element figure at each auxiliary sampling point coordinate position
It puts coefficient to be calculated, to determine the length unit for being located at each ellipse element figure based on zoom factor, is based on ellipse element figure
Middle ellipse long and short shaft ratio is the length unit of 2:1 and determination, that is, can determine the shape size of ellipse element figure.
Further, propose that the present invention writes the generation method of the vigour of style in writing based on the excellent of Bezier addition auxiliary sampling point
Embodiment is selected, Fig. 8 is please referred to, Fig. 8 is that the present invention writes in one embodiment of generation method of the vigour of style in writing based on Bezier addition
The flow diagram of auxiliary sampling point, in the present embodiment,
When sampled point than it is sparse when, be directly connected to broken line turnover clearly (three neighbouring samples of neighbouring sample point
Line curvature is smaller between point), so that the simulation to the practical vigour of style in writing not enough coincide, therefore, calculated based on every three sampled points
One section of Bezier line segment connects each sampled point using Bezier line segment, and in the curvilinear path that Bezier line segment passes through
Simulation addition auxiliary sampling point, is considered based on touch screen performance and maximizing the benefits, the quantity of simulation addition auxiliary sampling point
It is appropriate, it is unsuitable too many, therefore, related scheme is selected with curvature, adds auxiliary sampling point in the big local analog of curvature,
The opposite place small in curvature then carries out simulation addition less, and camber line as shown in the figure is the track for being Bezier line segment, rail
Position shown in " X " symbol is the position for carrying out simulation and adding auxiliary sampling point gone out according to curvature estimation on mark, finally,
The auxiliary sampling point of simulation addition is also carried out according to each sampled point obtained by sampling processing to the drafting of default style of writing pattern
It handles (being drawn using ellipse), wherein two elliptical unit lengths that elliptical length unit utilizes front and back adjacent
Interpolation (such as using ratio of distance between current oval and former and later two ellipses as weight) is taken, then between each adjacent ellipses
It calculates common tangent and is attached to form closed area based on common tangent, carry out style of writing pattern compared to based on broken line to generate
(ellipse) draws more smooth vigour of style in writing effect.
In the present embodiment, it based on curvature of a curve is connected between three sampled points, is being combined every time by terminal device
After Bezier added auxiliary sampling point between three sampled points, circulation to auxiliary sampling point and sampled point it
Between company's curvature of a curve for being formed detected, and judge whether the line curvature detected is greater than predetermined curvature, it is every in terminal
It is secondary when detecting that company's curvature of a curve for being formed between auxiliary sampling point and sampled point is greater than predetermined curvature, then in the adjacent auxiliary
Between sampled point and sampled point, or new auxiliary sampling point is added between two adjacent auxiliary sampling points, until detection
To when even curvature of a curve is less than or equal to predetermined curvature, then stop adding new auxiliary sampling point.
It realizes, based on curvature of a curve is connected between detection continuous sampling point, between continuous sampled point, uses Bezier
Curve adds auxiliary sampling point, and after completing to add auxiliary sampling point, based on interpolation algorithm to each auxiliary sampling point coordinate
The shape size of each ellipse element figure is calculated at position, is avoided and is connected each sampled point by broken line to generate user hand-written defeated
The vigour of style in writing for entering person's handwriting seems very stiff unsmooth, further improves the formation efficiency of the vigour of style in writing, and only person's handwriting curvature compared with
Auxiliary sampling point is added using Bezier in big position, slows down the storage pressure of terminal device.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, deposited on computer readable storage medium
The generation program for writing the vigour of style in writing is contained, is write and is realized when the generation program of the vigour of style in writing is executed by processor and as described above write the vigour of style in writing
Generation method the step of.
The generation method that computer readable storage medium specific embodiment of the present invention is referred to the above-mentioned writing vigour of style in writing is each
Embodiment, details are not described herein.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in one as described above
In storage medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be with big
The display equipment of size touch screen, smart phone, computer, server or the network equipment etc.) execute each implementation of the present invention
Method described in example.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.