CN116092095B - Original handwriting stroke form generation method - Google Patents

Original handwriting stroke form generation method Download PDF

Info

Publication number
CN116092095B
CN116092095B CN202310388630.XA CN202310388630A CN116092095B CN 116092095 B CN116092095 B CN 116092095B CN 202310388630 A CN202310388630 A CN 202310388630A CN 116092095 B CN116092095 B CN 116092095B
Authority
CN
China
Prior art keywords
point
circle
center
stroke
straight line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310388630.XA
Other languages
Chinese (zh)
Other versions
CN116092095A (en
Inventor
何冉冉
何中
顾志平
严伟
蔡亚军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Zhongwei Technology Software System Co ltd
Original Assignee
Jiangsu Zhongwei Technology Software System Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Zhongwei Technology Software System Co ltd filed Critical Jiangsu Zhongwei Technology Software System Co ltd
Priority to CN202310388630.XA priority Critical patent/CN116092095B/en
Publication of CN116092095A publication Critical patent/CN116092095A/en
Priority to TW112127230A priority patent/TW202347265A/en
Application granted granted Critical
Publication of CN116092095B publication Critical patent/CN116092095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • 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
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method for generating an original handwriting pen point, which comprises the following steps: setting a penpoint effect coefficient parameter; triggering the handwriting trigger element and the screen to generate an array; acquiring point positions, and putting the acquired position information of the point positions into an array; generating a circle by using the stroke effect coefficient parameters by taking each point in the array as the circle center; acquiring intersection points of straight lines of connecting lines perpendicular to circle centers of two circles and circles, and acquiring intermediate points between the intersection points of the two circles; all intermediate points generated in the handwriting process are acquired by circulating the operations, and are sequentially connected to form a closed polygonal area by making a Bezier curve; finally filling to form a pen point, and storing. The method is executed without depending on customized hardware outside the screen, and has the advantages of smooth connection, pen breakage prevention, good user experience and the like.

Description

Original handwriting stroke form generation method
Technical Field
The invention relates to the field of handwriting stroke generation, in particular to a method for generating an original handwriting stroke.
Background
With the rapid development of information technology, man-machine interaction equipment is developed into an important input equipment for electronic handwriting from simple text input. Current human-computer interaction devices need to rely on customized handwriting input devices, such as: an intelligent handwriting pen and the like, wherein handwriting input positions of users are provided through handwriting input equipment, and handwriting speed related information provided by the handwriting input equipment is converted into a speed scaling factor for generating a pen point; still other forms the closed region and fills and generate the stroke end by adopting the mode of public tangent point, and if the stroke range of variation is too big simultaneously fast under this circumstances, can lead to broken pen, because the distance between the public tangent point of adjacent point is great, and the leading end gradually connects and has the interval, and the blank gap will appear when filling.
Disclosure of Invention
The invention aims to provide a method for generating an original handwriting stroke, which calculates the stroke width by combining the acquisition density with the stroke parameter, and can generate the stroke without combining a screen with a customized handwriting input device.
In a first aspect, the present invention provides a method for generating an original handwriting stroke, including the following steps:
setting a penpoint effect coefficient parameter;
the handwriting trigger element is contacted with the screen to carry out handwriting so as to generate an array;
acquiring the point position, acquiring the position information of the current point position, and putting the position information into an array;
generating a circle by using the stroke effect coefficient parameters by taking each point in the array as the circle center;
acquiring the diameter of a connecting line perpendicular to the centers of two circles on two adjacent circles and the intersection point of the straight line where the diameter is located and the circle;
obtaining intermediate points between intersection points of two adjacent circles on the same side of the connecting line, and accordingly obtaining all intermediate points generated in the handwriting process;
sequentially connecting to form a closed polygonal area;
filling the polygonal area to form a pen point and storing.
In some embodiments of the present invention, in some embodiments,
the screen adopts a capacitive screen;
resetting the stroke effect coefficient parameters when the contact between the handwriting trigger unit and the screen is released, wherein the stroke effect coefficient parameters comprise colors, stroke widths and stroke parameters and effect coefficients;
the position information includes x-axis coordinates and y-axis coordinates.
In some embodiments, the time of generating three continuous points according to the first-to-last sequence is respectively marked as a point p2, a point p1 and a point cp, the obtained current point is marked as a point p, and the process of judging and assigning is as follows:
the length of the array is equal to 1, the point p is the first point position, and the position information of the point p is simultaneously assigned to the point p2, the point p1 and the point cp;
the length of the array is greater than 1, the position information of the point p is assigned to the point cp, the position information of the origin cp is assigned to the point p1, and the position information of the origin p1 is assigned to the point p2.
In some embodiments, the effect coefficients include an initial effect coefficient and a process effect coefficient, the set stroke width value, the stroke edge parameter, the initial effect coefficient, and the process effect coefficient are w, pressure, d1 and d2, respectively, the actual stroke width value w1 is set, w1=w×pressure, the maximum stroke width value is set to max_w, max_w=w1, and the minimum stroke width value is set to min_w;
the radius of the circle generated by taking each point in the array as the circle center is calculated according to the density value among the collected points, and the specific calculation process is as follows:
the length of the array is equal to 1, the density value of the first point is 0, and the radius is equal to the minimum radius value: min_r=w1/d 1;
traversing the points in the array from the second point, wherein the distance between the current point and the previous point is marked as I, I is smaller than w, the density value of the current point is marked as I x d2, performing cyclic traversal, obtaining the sum of the density values of the current point and all the previous points, marking as sum, dividing the sum by the number of the points to obtain an average density value, and calculating r, wherein r is equal to w1 minus (the square of the absolute value of the difference between the average density value of the current point and the average density value of the previous point);
comparing r with min_w, and if r is smaller than min_w, taking the radius of the circle taking the current point as the circle center as min_w; whereas the radius of a circle centered on the current point is r.
In some embodiments, d1 has a value ranging from 1 to w1, d2 has a value ranging from 5 to 10, min_w is 2, and the unit of pen width and the unit of radius of the circle are pixels.
In some embodiments, the center coordinates of three adjacent circles are p2 (x 2, y 2), p1 (x 1, y 1), and cp (x 0, y 0), the radii are r2, r1, and r0, respectively, and the formula of the circle is (x-x 0) taking p0 (x 0, y 0) as an example 2 +(y-y0) 2 =r0 2 ,
The process of obtaining the diameter of a connecting line perpendicular to the centers of two circles or the intersection point of the straight line where the diameter is located and the circle on two adjacent circles is as follows:
calculating the slope k1 of a connecting line of the centers of two adjacent circles, wherein k1= (y 2-y 1)/(x 2-x 1);
judging whether k1 exists or not, wherein if k1 exists and is not 0, the slope k= -1/k1 of a line perpendicular to the connecting line;
according to the slope k and the circle center coordinates p1 (x 1, y 1) and p2 (x 2, y 2) of the two circles, respectively obtaining equations of straight lines I1 and I2 which pass through the two circle centers and are perpendicular to the connecting line, wherein the equation of I1 is as follows: y-y1=k (x-x 1), and the equation of I2 is y-y2=k (x-x 2);
solving a first equation set to obtain values of x and y, and obtaining an intersection point coordinate of a straight line I1 and a circle with a circle center of p1 (x 1, y 1), wherein the first equation set comprises y-y1= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 1) and (x-x 1) 2 +(y-y1) 2 =r1 2
Solving a second equation set to obtain values of x and y, so as to obtain an intersection point coordinate of the straight line I2 and a circle with the center of p2 (x 2, y 2), wherein the second equation set comprises y-y2= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 2) and (x-x 2) 2 +(y-y2) 2 =r2 2
If k1 is absent, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are y=y1, y=y2, respectively, and y=y1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of x to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting y=y2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of x to obtain the intersection point coordinate of the straight line I2 and the circle with the center of p2 (x 2, y 2);
if k1 is 0, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are x=x1, x=x2, respectively, and x=x1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of y to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting x=x2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of y to obtain the intersection point coordinate of the straight line I2 and the circle with the center of p2 (x 2, y 2).
In some embodiments, a Bezier curve is used to connect all intermediate points generated during handwriting to form a closed polygonal area.
In some embodiments of the present invention, in some embodiments,
let I0 be the straight line passing through the center cp (x 0, y 0) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0), and I1 be the straight line passing through the center p1 (x 1, y 1) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0) ,
Setting coordinates of two intersection points of a straight line I2 and a circle with a circle center of p2 (x 2, y 2) as A2_1 (x2_1, y2_1) and A2_2 (x2_2, y2_2) respectively; the coordinates of two intersection points of the straight line I1 and a circle with the center of p1 (x 1, y 1) are A1_1 (x1_1, y1_1) and A1_2 (x1_2, y1_2) respectively; straight line I1 The coordinates of two intersection points with a circle with the center of p1 (x 1, y 1) are A1_3 (x1_3, y1_3) and A1_4 (x1_4, y1_4) respectively; coordinates of two intersections of the straight line I0 and a circle with a center of cp (x 0, y 0) are a0_1 (x0_1, y0_1) and a0_2 (x0_2, y0_2), respectively; the middle point of the connection line between the A2_1 and the A1_1 is Mid1_1, the middle point of the connection line between the A1_3 and the A0_1 is Mid0_1, the middle point of the connection line between the A2_2 and the A1_2 is Mid1_2, the middle point of the connection line between the A1_4 and the A0_2 is Mid0_2,
the specific process of connecting all intermediate points generated in the handwriting process by adopting Bezier curves to form a closed polygonal area is as follows:
starting from point mid 1-1, taking a Bezier curve from point mid 0-1, taking A1_1 (x1_1, y1_1) as the control point of the Bezier curve, taking a Bezier curve from point mid 1-2 to mid 0-2, taking A1_2 (x1_2, y1_2) as the control point of the Bezier curve,
and (3) performing Bezier curve on all intermediate points generated in the handwriting process according to the method to form a closed polygonal area.
In a second aspect, the present invention provides a system for generating an original handwriting stroke, including a handwriting acquisition unit, a calculation unit, a frame forming unit, a filling unit, a storage unit and a main control unit, wherein the handwriting acquisition unit, the calculation unit, the frame forming unit, the filling unit and the storage unit are all connected with the main control unit
The main control unit is used for coordinating the work of other units connected with the main control unit;
the storage unit is used for storing parameters for setting the stroke effect coefficient, other data information generated in the execution process of the original handwriting stroke generation method and the stroke;
the handwriting acquisition unit is connected with the screen and is used for acquiring the position information of points generated during handwriting, generating an array and placing the position information of the points into the array;
the calculation unit is used for calculating the radius of a circle with each point in the array as the center of the circle, the diameter of a connecting line perpendicular to the centers of the two circles on two adjacent circles or the intersection point of the straight line where the diameter is located and the circle, and the middle point of a line segment formed by connecting the intersection points of the two adjacent circles on the same side of the connecting line;
the frame forming unit is used for sequentially connecting all intermediate points generated in the handwriting process to form a closed polygonal area;
the filling unit is used for filling the polygonal area to form a pen point.
In some embodiments, the system further comprises an editing unit, wherein the editing unit is connected with the main control unit and used for modifying the set pen width value, the pen tip parameter and the effect coefficient stored in the storage unit.
The original handwriting stroke generation method has the advantages that:
the mode of setting the pressure sensing coefficient is adopted, and the stroke order parameters are directly acquired without a screen, so that the pressure sensing can be set under the condition of not depending on customized hardware outside the screen;
adopting the middle point of the intersection point and adopting the control point to draw the Bezier curve, so that no gap is generated, and the Bezier curve of the intersection point piece is more smooth through the control point, so that the connecting line between each line segment is more smooth, and the phenomenon of pen breakage is avoided;
the vertical connecting line passing through the center of a circle is adopted instead of the common tangent point, the phenomenon that the distance between the common tangent points is large is avoided, the pen breaking is avoided, meanwhile, the intersection point of the vertical line and the circle is further arranged, the thickness of the taken line segment is more similar to the set pen width, and a user can obtain a better experience effect.
Drawings
FIG. 1 is a flow chart of a method of generating an original handwriting stroke in some embodiments of the invention;
FIG. 2 is a conceptual diagram of a circle generated and intermediate points in some embodiments of the invention;
FIG. 3 is a schematic block diagram of a system employing a method of generating an original handwriting stroke in some embodiments of the invention;
fig. 4 is a schematic diagram of a stroke order generated in some embodiments of the invention.
Detailed Description
Example 1
With reference to the contents shown in fig. 1 and fig. 2, in this embodiment, a method for generating an original handwriting style is provided, including the following steps:
s1, setting a stroke effect coefficient parameter, wherein the stroke effect coefficient parameter comprises a color, a stroke width, a stroke parameter and an effect coefficient, the effect coefficient comprises an initial effect coefficient and a process effect coefficient, the set stroke width value, the stroke parameter, the initial effect coefficient and the process effect coefficient are w, pressure, d and d2 respectively, an actual stroke width value w1 is set, w1=w is compression, a maximum stroke width value is set to be max_w, max_w=w1, and a minimum stroke width value is set to be min_w;
s2, the handwriting trigger element is contacted with the screen to carry out handwriting, an array L is generated, a capacitive screen is preferably used as the screen, the handwriting trigger unit can be an intelligent handwriting pen, and fingers of a user and other matters which can be contacted with the screen but cannot damage the screen can be used;
s3, carrying out point location acquisition, namely recording the currently acquired point as a point p, acquiring the position information of the point p, and putting the position information of the point p into an array L, wherein the position information comprises an x-axis coordinate and a y-axis coordinate;
s4, recording continuous three point judgment assignment, and generating a circle by setting a pen width value, a pen tip parameter and an effect coefficient by taking each point in the array L as a circle center;
s5, acquiring diameters of connecting lines perpendicular to circle centers of two circles or intersection points of straight lines where the diameters are located and the circles;
s6, connecting intersection points of two adjacent circles on the same side of the connecting line to form a line segment, and obtaining a middle point of the line segment;
s7, all intermediate points generated in the handwriting process are acquired through circulation of the operations, and the intermediate points are sequentially connected to form a closed polygonal area;
s8, filling the polygonal area to form a pen point, and storing.
In the process of executing the original handwriting stroke edge generating method, the stroke width value, the stroke edge parameter and the effect coefficient can be reset when the handwriting trigger unit is out of contact with the screen, so that a user can conveniently adjust the stroke width according to the requirements, and the like, and better experience is provided for the user.
The continuous three points in S4 are respectively marked as a point p2, a point p1 and a point cp according to the time generated by the first-to-last sequence, and the judging and assigning process comprises the following steps:
the length of the array L is equal to 1, the point p is the first point position, and the position information of the point p is simultaneously assigned to the point p2, the point p1 and the point cp;
the length of the array L is greater than 1, the position information of the point p is assigned to the point cp, the position information of the origin cp is assigned to the point p1, and the position information of the origin p1 is assigned to the point p2. The process of determining the assignment described herein may be implemented using for loop execution.
In the S4, the radius of the circle generated by taking each point in the array L as the center of the circle is calculated according to the density value among the collected points, and the specific calculation process is as follows:
the length of the array L is equal to 1, the density value of the first point is 0, and the radius is equal to the minimum radius value: min_r=w1/d 1;
traversing the points in the array L from the second point, wherein the distance between the current point and the previous point is marked as I, I is smaller than w, the density value of the current point is marked as I d2, performing cyclic traversal, obtaining the sum of the density values of the current point and all the previous points and marking as sum, dividing the sum by the number of the points to obtain an average density value, and calculating r, wherein r is equal to w1 minus (the square of the absolute value of the difference between the average density value of the current point and the average density value of the previous point);
comparing r with min_w, and if r is smaller than min_w, taking the radius of the circle taking the current point as the circle center as min_w; whereas the radius of a circle centered on the current point is r.
The unit of the pen width and the unit of the radius of the circle are pixels.
It should be noted that, in some specific implementations, d1 has a value range of 1-w1, d2 has a value range of 5-10, and min_w is 2.
Setting the center coordinates of three adjacent circles as p2 (x 2, y 2), p1 (x 1, y 1) and cp (x 0, y 0) respectively, the radii as r2, r1 and r0 respectively,
the formula of the circle with the center of the circle being p0 (x 0, y 0) is (x-x 0) 2 +(y-y0) 2 =r0 2 ,
The formula of the circle when the center of the circle is p1 (x 1, y 1) is (x-x 1) 2 +(y-y1) 2 =r1 2 ,
The formula of the circle with the center of the circle being p2 (x 2, y 2) is (x-x 2) 2 +(y-y2) 2 =r2 2 ,
Taking two circles with the circle centers of p2 (x 2, y 2) and p1 (x 1, y 1) as examples, the process of obtaining the diameter of a connecting line perpendicular to the circle centers of the two circles or the intersection point of the straight line where the diameter is located and the circle in the S5 is as follows:
calculating the slope k1 of a connecting line of the centers of two adjacent circles, wherein k1= (y 2-y 1)/(x 2-x 1);
judging whether k1 exists or not, wherein if k1 exists and is not 0, the slope k= -1/k1 of a line perpendicular to the connecting line;
according to the slope k and the circle center coordinates p1 (x 1, y 1) and p2 (x 2, y 2) of the two circles, respectively obtaining equations of straight lines I1 and I2 which pass through the two circle centers and are perpendicular to the connecting line, wherein the equation of I1 is as follows: y-y1=k (x-x 1), and the equation of I2 is y-y2=k (x-x 2);
solving a first equation set to obtain values of x and y, and obtaining an intersection point coordinate of a straight line I1 and a circle with a circle center of p1 (x 1, y 1), wherein the first equation set comprises y-y1= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 1) and (x-x 1) 2 +(y-y1) 2 =r1 2
Solving a second equation set to obtain values of x and y, and obtaining the coordinate of the intersection point of the straight line I2 and a circle with the center of p2 (x 2, y 2), wherein the second equation setComprising y-y2= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 2) and (x-x 2) 2 +(y-y2) 2 =r2 2
If k1 is absent, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are y=y1, y=y2, respectively, and y=y1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of x to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting y=y2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of x to obtain the intersection point coordinate of the straight line I2 and the circle with the center of p2 (x 2, y 2);
if k1 is 0, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are x=x1, x=x2, respectively, and x=x1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of y to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting x=x2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of y to obtain the intersection point coordinate of the straight line I2 and the circle with the center of p2 (x 2, y 2).
And S7, connecting all intermediate points generated in the handwriting process by adopting a Bezier curve to form a closed polygonal area.
Let I0 be the straight line passing through the center cp (x 0, y 0) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0), and I1 be the straight line passing through the center p1 (x 1, y 1) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0) ,
Setting coordinates of two intersection points of a straight line I2 and a circle with a circle center of p2 (x 2, y 2) as A2_1 (x2_1, y2_1) and A2_2 (x2_2, y2_2) respectively; the coordinates of two intersection points of the straight line I1 and a circle with the center of p1 (x 1, y 1) are A1_1 (x1_1, y1_1) and A1_2 (x1_2, y1_2) respectively; straight line I1 The coordinates of two intersection points with a circle with the center of p1 (x 1, y 1) are A1_3 (x1_3, y1_3) and A1_4 (x1_4, y1_4) respectively; coordinates of two intersections of the straight line I0 and a circle with a center of cp (x 0, y 0) are a0_1 (x0_1, y0_1) and a0_2 (x0_2, y0_2), respectively; the intermediate point of the connection between A2_1 and A1_1 is Mid1_1, the intermediate point of the connection between A1_3 and A0_1 is Mid0_1, A2_2 andthe middle point of the A1_2 connecting line is mid1_2, the middle point of the A1_4 connecting line and the A0_2 connecting line is mid0_2,
the specific process of connecting all intermediate points generated in the handwriting process by adopting Bezier curves to form a closed polygonal area is as follows:
starting from point mid 1-1, taking a Bezier curve from point mid 0-1, taking A1_1 (x1_1, y1_1) as the control point of the Bezier curve, taking a Bezier curve from point mid 1-2 to mid 0-2, taking A1_2 (x1_2, y1_2) as the control point of the Bezier curve,
and (3) performing Bezier curve on all intermediate points generated in the handwriting process according to the method to form a closed polygonal area. Such as forming a polygonal closed area with shadows as shown in fig. 4.
Example 2
In combination with the content shown in fig. 3, the present embodiment provides a system for generating a handwriting stroke by applying an original handwriting, which includes a handwriting acquisition unit, a calculation unit, a frame forming unit, a filling unit, a storage unit and a main control unit, wherein the handwriting acquisition unit, the calculation unit, the frame forming unit, the filling unit and the storage unit are all connected with the main control unit
The main control unit is used for coordinating the work of other units connected with the main control unit;
the storage unit is used for storing the set pen width value, the pen tip parameter, the effect coefficient, other data information generated in the execution process of the original handwriting pen tip generating method and the pen tip;
the handwriting acquisition unit is connected with the screen and is used for acquiring the position information of points generated during handwriting, generating an array L and placing the position information of the points into the array L;
the calculating unit is used for calculating the radius of a circle with each point in the array L as the center of the circle, the diameter of a connecting line perpendicular to the centers of the two circles on two adjacent circles or the intersection point of the straight line where the diameter is located and the circle, and the middle point of a line segment formed by connecting the intersection points of the two adjacent circles on the same side of the connecting line;
the frame forming unit is used for sequentially connecting all intermediate points generated in the handwriting process to form a closed polygonal area;
the filling unit is used for filling the polygonal area to form a pen point.
The system for applying the original handwriting stroke generation method also comprises an editing unit, wherein the editing unit is connected with the main control unit and is used for modifying the set stroke width value, the stroke parameter and the effect coefficient stored in the storage unit.
It will be apparent to those skilled in the art that several similar modifications and improvements can be made without departing from the inventive concept, and these should also be considered as being within the scope of the invention.

Claims (6)

1. The method for generating the original handwriting stroke is characterized by comprising the following steps of:
setting a penpoint effect coefficient parameter;
the handwriting trigger element is contacted with the screen to carry out handwriting so as to generate an array;
acquiring the point position, acquiring the position information of the current point position, and putting the position information into an array;
recording continuous three-point judgment assignment, generating a circle by using each point in the array as a circle center and applying a stroke effect coefficient parameter, and respectively marking the continuous three points as a point p2, a point p1 and a point cp according to the time sequence of the continuous three points from first to last;
obtaining the diameter of a connecting line perpendicular to the circle centers of two circles and the intersection point of the straight line where the diameter is located and the circle, wherein the radius of the circle generated by taking each point as the circle center is calculated according to the density value among the collected points,
let I0 be the straight line passing through the center cp (x 0, y 0) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0), and I1 be the straight line passing through the center p1 (x 1, y 1) and perpendicular to the connecting line of p1 (x 1, y 1) and cp (x 0, y 0) A straight line passing through the center p1 (x 1, y 1) and perpendicular to the connecting lines of p1 (x 1, y 1) and p2 (x 2, y 2) is I1, a straight line passing through the center p2 (x 2, y 2) and perpendicular to the connecting lines of p1 (x 1, y 1) and p2 (x 2, y 2) is I2, coordinates of two intersections of the straight line I2 and a circle having the center p2 (x 2, y 2) are respectively denoted as a2_1 (x2_1,y2_1), a2_2 (x2_2, y2_2); coordinates of two intersections of the straight line I1 and a circle with a center of p1 (x 1, y 1) are respectively denoted as a1_1 (x1_1, y1_1) and a1_2 (x1_2, y1_2); straight line I1 The coordinates of two points of intersection with a circle with the center of p1 (x 1, y 1) are respectively denoted as A1_3 (x1_3, y1_3) and A1_4 (x1_4, y1_4); coordinates of two intersections of the straight line I0 and a circle with a center of cp (x 0, y 0) are respectively denoted as a0_1 (x0_1, y0_1), a0_2 (x0_2, y0_2);
obtaining intermediate points between intersection points of two adjacent circles on the same side of the connecting line, accordingly obtaining all intermediate points generated in the handwriting process, marking the intermediate point of the connecting line between A2_1 and A1_1 as Mid1_1, marking the intermediate point of the connecting line between A1_3 and A0_1 as Mid0_1, marking the intermediate point of the connecting line between A2_2 and A1_2 as Mid1_2, and marking the intermediate point of the connecting line between A1_4 and A0_2 as Mid0_2;
the specific process of connecting all intermediate points generated in the handwriting process by adopting Bezier curves to form a closed polygonal area is as follows:
starting from point mid 1-1, taking a Bezier curve from point mid 0-1, taking A1_1 (x1_1, y1_1) as the control point of the Bezier curve, taking a Bezier curve from point mid 1-2 to mid 0-2, taking A1_2 (x1_2, y1_2) as the control point of the Bezier curve,
according to the method, bezier curves are made on all intermediate points generated in the handwriting process to form a closed polygonal area;
filling the polygonal area to form a pen point and storing.
2. The method for generating an original handwriting stroke according to claim 1, wherein,
the screen adopts a capacitive screen;
resetting the stroke effect coefficient parameters when the contact between the handwriting trigger unit and the screen is released, wherein the stroke effect coefficient parameters comprise colors, stroke widths and stroke parameters and effect coefficients;
the position information includes x-axis coordinates and y-axis coordinates.
3. The method for generating an original handwriting stroke according to claim 1, wherein the obtained current point is marked as a point p, and the process of judging assignment is as follows:
the length of the array is equal to 1, the point p is the first point position, and the position information of the point p is simultaneously assigned to the point p2, the point p1 and the point cp;
the length of the array is greater than 1, the position information of the point p is assigned to the point cp, the position information of the origin cp is assigned to the point p1, and the position information of the origin p1 is assigned to the point p2.
4. The method for generating an original handwriting stroke according to claim 2, wherein the effect coefficient comprises an initial effect coefficient and a process effect coefficient, the set stroke width value, the stroke edge parameter, the initial effect coefficient and the process effect coefficient are w, pressure, d1 and d2 respectively, an actual stroke width value w1 is set, w1=w×compression is set, a maximum stroke width value is set to be max_w, max_w=w1, and a minimum stroke width value is set to be min_w;
the calculation process for calculating the radius of the circle generated by taking each point in the array as the circle center according to the collected density values between the points comprises the following steps:
the length of the array is equal to 1, the density value of the first point is 0, and the radius is equal to the minimum radius value: min_r=w1/d 1;
traversing the points in the array from the second point, wherein the distance between the current point and the previous point is marked as I, I is smaller than w, the density value of the current point is marked as I x d2, performing cyclic traversal, obtaining the sum of the density values of the current point and all the previous points, marking as sum, dividing the sum by the number of the points to obtain an average density value, and calculating r, wherein r is equal to w1 minus (the square of the absolute value of the difference between the average density value of the current point and the average density value of the previous point);
comparing r with min_w, and if r is smaller than min_w, taking the radius of the circle taking the current point as the circle center as min_w; whereas the radius of a circle centered on the current point is r.
5. The method for generating an original handwriting stroke according to claim 4, wherein d1 has a value range of 1-w1, d2 has a value range of 5-10, min_w is 2, and the unit of the stroke width and the unit of the radius of the circle are pixels.
6. The method of claim 4, wherein the radii of three circles with center coordinates p2 (x 2, y 2), p1 (x 1, y 1), and cp (x 0, y 0) are r2, r1, and r0, respectively, and the formula of the circle is (x-x 0) taking p0 (x 0, y 0) as an example 2 +(y-y0) 2 =r0 2 ,
The process of obtaining the diameter of a connecting line perpendicular to the centers of two circles or the intersection point of the straight line where the diameter is located and the circle on two adjacent circles is as follows:
calculating the slope k1 of a connecting line of the centers of two adjacent circles, wherein k1= (y 2-y 1)/(x 2-x 1);
judging whether k1 exists or not, wherein if k1 exists and is not 0, the slope k= -1/k1 of a line perpendicular to the connecting line;
according to the slope k and the circle center coordinates p1 (x 1, y 1) and p2 (x 2, y 2) of the two circles, respectively obtaining equations of straight lines I1 and I2 which pass through the two circle centers and are perpendicular to the connecting line, wherein the equation of I1 is as follows: y-y1=k (x-x 1), and the equation of I2 is y-y2=k (x-x 2);
solving a first equation set to obtain values of x and y, and obtaining an intersection point coordinate of a straight line I1 and a circle with a circle center of p1 (x 1, y 1), wherein the first equation set comprises y-y1= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 1) and (x-x 1) 2 +(y-y1) 2 =r1 2
Solving a second equation set to obtain values of x and y, so as to obtain an intersection point coordinate of the straight line I2 and a circle with the center of p2 (x 2, y 2), wherein the second equation set comprises y-y2= [ - (x 2-x 1)/(y 2-y 1)]* (x-x 2) and (x-x 2) 2 +(y-y2) 2 =r2 2
If k1 is absent, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are y=y1, y=y2, respectively, and y=y1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of x to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting y=y2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of x to obtain a straight line I2 and a circle with the center of p2 (x 2, y 2)Intersection point coordinates;
if k1 is 0, equations of straight lines I1 and I2 passing through two centers and perpendicular to the connecting line are x=x1, x=x2, respectively, and x=x1 is substituted into (x-x 1) 2 +(y-y1) 2 =r1 2 Solving the value of y to obtain the intersection point coordinate of the straight line I1 and the circle with the center of p1 (x 1, y 1); substituting x=x2 into (x-x 2) 2 +(y-y2) 2 =r2 2 Solving the value of y to obtain the intersection point coordinate of the straight line I2 and the circle with the center of p2 (x 2, y 2).
CN202310388630.XA 2023-04-13 2023-04-13 Original handwriting stroke form generation method Active CN116092095B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310388630.XA CN116092095B (en) 2023-04-13 2023-04-13 Original handwriting stroke form generation method
TW112127230A TW202347265A (en) 2023-04-13 2023-07-20 Method for generating handwriting strokes based on original handwriting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310388630.XA CN116092095B (en) 2023-04-13 2023-04-13 Original handwriting stroke form generation method

Publications (2)

Publication Number Publication Date
CN116092095A CN116092095A (en) 2023-05-09
CN116092095B true CN116092095B (en) 2023-07-28

Family

ID=86212460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310388630.XA Active CN116092095B (en) 2023-04-13 2023-04-13 Original handwriting stroke form generation method

Country Status (2)

Country Link
CN (1) CN116092095B (en)
TW (1) TW202347265A (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5294313B2 (en) * 2008-11-07 2013-09-18 Necシステムテクノロジー株式会社 Bezier curve drawing device, Bezier curve drawing method and program
CN106293232A (en) * 2016-08-11 2017-01-04 江苏中威科技软件系统有限公司 A kind of hand-written inputting method realizing vigour of style in writing effect and system
CN107526526B (en) * 2017-09-19 2020-05-05 广州视源电子科技股份有限公司 Method and device for determining pressure-sensitive handwriting area

Also Published As

Publication number Publication date
TW202347265A (en) 2023-12-01
CN116092095A (en) 2023-05-09

Similar Documents

Publication Publication Date Title
KR900002948B1 (en) Image input device of hand write
US20110199297A1 (en) Method and apparatus for drawing and erasing calligraphic ink objects on a display surface
CA1220582A (en) Method and apparatus for continuously updating a display of the coordinates of a light pen
CN107943365A (en) Rendering method, device, electronic equipment and the storage medium of lines person's handwriting
CN104571604A (en) Information processing apparatus and method
CN102799271A (en) Method and system for identifying interactive commands based on human hand gestures
US6785418B1 (en) Image identification apparatus and method of identifying images
JPS63123165A (en) Correlation of cursor and display entity
CN116092095B (en) Original handwriting stroke form generation method
EP0714057A1 (en) Method and apparatus for displaying a cursor along a two dimensional representation of a computer generated three dimensional surface
US4852024A (en) Picture processing apparatus
CN110490961B (en) Hair brush tool and hair drawing method
JP5245444B2 (en) Information display device and program
JPH0547863B2 (en)
CN107679219B (en) Matching method and device, interactive intelligent panel and storage medium
JPH0812668B2 (en) Handwriting proofreading method
CN113296616B (en) Pen point selection method and device and intelligent terminal
US4875033A (en) Graphics input apparatus
CN109977740B (en) Depth map-based hand tracking method
CN114546174B (en) Handwriting processing method, display device and readable storage medium
JP2768331B2 (en) Curve linear approximation device
JP2856243B2 (en) Checkered pattern automatic creation apparatus and method
JPS6325784A (en) Computer graphics method and apparatus
JP2614111B2 (en) A method for detecting the correlation between a straight line display element and a rectangular window
JPH0650518B2 (en) Region of interest recognizer

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40086487

Country of ref document: HK