Display device, handwriting display method and method for determining handwriting contours
The display device and method address the challenge of simulating realistic semi-dry strokes by dividing and selectively filling sub-contours, enhancing the handwriting experience on electronic ink screens and smart display devices.
Patent Information
- Application Number
- DE112022007977
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-08-14
AI Technical Summary
Existing electronic ink screens and large format smart display devices struggle to simulate a highly realistic handwriting function, particularly in achieving a semi-dry stroke effect that mimics the appearance of twisted filaments, as they lack effective methods for dividing and filling stroke contours.
A display device and method that divides a stroke contour into sub-contours, selectively performs pixel filling on a portion of these sub-contours, and controls the display to achieve a semi-dry stroke effect by alternating fill manners, adjusting fill density based on writing speed and pressure, and determining stroke contours using trace point information.
The method enhances the realism of handwriting simulation by producing a semi-dry stroke effect that resembles twisted filaments, improving user experience on electronic ink screens and smart display devices.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
FIELD OF TECHNOLOGY
[0001] The present disclosure relates to the field of data display technology, and more particularly to a display device, a handwriting display method, and a method for determining handwriting contours. STATE OF THE ART
[0002] An electronic ink screen, also called an electronic paper screen, consists of two substrates coated with electronic ink containing numerous tiny transparent particles. The particles consist of many black and white particles with positive and negative electricity, respectively. Because the charged particles of different colors move in different directions due to an applied electric field, a black or white effect appears on the surface of the screen.
[0003] To meet users' writing needs, the electronic ink screen is equipped with a handwriting function. Large-format smart display devices are also equipped with a handwriting function, with the popularization of smart conferences. Handwritten traces can be displayed on the electronic ink screen or smart display device through the handwriting function. With the expansion of the ink screen market and the diverse requirements of large-format smart display devices, the need for a highly simulated handwriting function is increasing. SUMMARY
[0004] The present disclosure provides a display device, a handwriting display method, and a handwriting contour determination method used for dividing a writing trace and achieving a semi-dry stroke writing effect by filling a part of the divided sub-contours and not filling other divided sub-contours.
[0005] In a first aspect, an embodiment of the present disclosure provides a display device comprising a display screen and a controller, wherein the display screen is configured to display content; and the controller is configured to acquire trace point information of trace points in a writing trace of a user; determine a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour; divide the stroke contour into K sub-contours, select a part of the sub-contours from the K sub-contours to perform pixel filling on the part of the sub-contours, wherein an extending direction in which the stroke contour extends is the same as an extending direction in which the sub-contours extend, and K is an integer greater than 1; and control the display screen to display the stroke.
[0006] In a second aspect, an embodiment of the present disclosure provides a handwriting display method comprising: acquiring trace point information of trace points in a user's writing trace; determining a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke including a stroke contour; dividing the stroke contour into K sub-contours and selecting a part of the sub-contours from the K sub-contours to perform pixel filling on the part of the sub-contours, wherein an extending direction in which the stroke contour extends is the same as an extending direction in which the sub-contours extend, and K is an integer greater than 1; and controlling the display screen to display the stroke.
[0007] In some embodiments, there is at least one subcontour on which no pixel fill is to be performed between at least two subcontours on which the pixel fill is to be performed.
[0008] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: randomly selecting the portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontour.
[0009] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: selecting the portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours according to the generated K random numbers and a corresponding relationship between the random numbers and the subcontours.
[0010] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours according to the generated K random numbers and a corresponding relationship between the random numbers and the subcontours comprises: calculating a product value of an average value of the K random numbers and a semi-dry stroke parameter, wherein the semi-dry stroke parameter is configured to control a total number of the subcontours on which the pixel fill is to be performed; in a case where any random number is greater than the product value, determining that the pixel fill is to be performed on the subcontour corresponding to the random number; and in a case where any random number is less than or equal to the product value, determining that no pixel fill is to be performed on the subcontour corresponding to the random number.
[0011] In some embodiments, the semi-dry stroke parameter is determined as a function of a writing speed, and the semi-dry stroke parameter is increased with an increase in the writing speed; and / or the semi-dry stroke parameter is determined as a function of a writing pressure, and the semi-dry stroke parameter is increased with a decrease in the writing pressure.
[0012] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: performing the pixel fill on the portion of the subcontours in different fill ways.
[0013] In some embodiments, performing the pixel fill on the portion of the subcontours in different fill ways comprises performing the pixel fill on the portion of the subcontours in different fill ways alternately.
[0014] In some embodiments, performing the pixel fill on the portion of the subcontours in different fill ways alternately comprises performing the pixel fill on the portion of the subcontours in a first fill way and a second fill way alternately.
[0015] In some embodiments, the method further comprises: dividing consecutive subcontours in the selected portion of the subcontours into a contour group to perform the pixel filling on the subcontours in the contour group at once in a same filling manner.
[0016] In some embodiments, performing the pixel fill on the subcontours in the contour group at once in a same fill style comprises: randomly selecting a fill style from among different fill styles to perform the pixel fill on the subcontours in the contour group at once in the selected fill style.
[0017] In some embodiments, randomly selecting a fill style from among different fill styles to perform the pixel fill on the sub-contours in the contour group at once in the selected fill style comprises: randomly selecting the fill style from the fill styles with the same probability to perform the pixel fill on the sub-contours in the contour group at once in the selected fill style; or randomly selecting the fill style from the fill styles with different probabilities to perform the pixel fill on the sub-contours in the contour group at once in the selected fill style, wherein the fill styles are in one-to-one correspondence with the probabilities.
[0018] In some embodiments, the stroke contour of the stroke corresponding to the trace points is to be determined by: fitting coordinate information of the trace points to obtain a fitting curve; selecting a plurality of fitting trace points from the fitting curve, wherein the plurality of fitting trace points includes at least three first fitting trace points corresponding to the trace points; determining a stroke contour of the plurality of fitting trace points according to coordinate information of the fitting trace points and a writing speed and a writing pressure at the trace points corresponding to the first fitting trace points; and using the stroke contour of the plurality of fitting trace points as the stroke contour corresponding to the trace points.
[0019] In some embodiments, determining a stroke contour of the plurality of fit track points according to coordinate information of the fit track points and a writing speed and a writing pressure at the track points corresponding to the first fit track points comprises: determining a position of the stroke contour according to the coordinate information of the plurality of fit track points; and determining a width of the stroke contour according to the writing speed and the writing pressure at the track points corresponding to the first fit track points.
[0020] In some embodiments, determining a width of the stroke contour according to the writing speed and the writing pressure at the trace points corresponding to the first fit trace points comprises: determining line widths at the first fit trace points according to a preset maximum line width, a preset minimum line width, a preset weighting factor, and the writing speed and the writing pressure at the trace points corresponding to the first fit trace points, wherein the preset weighting factor indicates a sensitivity parameter of a response adjustment of the line width for various factors; determining line widths at fit trace points based on an interpolation operation according to the line widths at at least three first fit trace points; and determining the width of the stroke contour according to the line widths at the fit trace points.
[0021] In some embodiments, after determining the line widths at the fit trace points based on an interpolation operation according to the line widths at at least three first fit trace points, the method further comprises: smoothing the line widths at the fit trace points according to first line widths of historical fit trace points corresponding to historical trace points of the trace points to obtain smoothed line widths at the fit trace points; the historical trace points of the trace points are a plurality of trace points consecutively received before receiving the trace points; and the historical fit trace points corresponding to the historical trace points are coordinate points on a fit curve obtained by fitting the historical trace points.
[0022] In some embodiments, smoothing the line widths at the fit trace points according to first line widths of historical fit trace points corresponding to historical trace points of the trace points to obtain smoothed line widths at the fit trace points comprises: determining the smoothed line widths at the fit trace points according to the first line widths at the historical fit trace points, the line widths at the fit trace points, and a preset total number of the historical fit trace points.
[0023] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: dividing consecutive subcontours in the portion of the subcontours into a contour group to perform the pixel fill on the subcontours in the contour group at once in a same fill manner.
[0024] In some embodiments, in the selected portion of the subcontours, a total number of subcontours on which the pixel fill is to be performed consecutively is less than a numerical threshold; or in the selected portion of the subcontours, a total number of subcontours on which the pixel fill is to be performed consecutively in a same filling manner is less than a numerical threshold.
[0025] In some embodiments, a ratio of a total width of the subcontours on which the pixel fill is to be performed to a width of the stroke contour is decreased with an increase in the writing speed at the track points; or a ratio of a total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is increased with an increase in the writing speed at the track points.
[0026] In some embodiments, a ratio of a total width of the subcontours on which the pixel fill is to be performed to a width of the stroke contour is increased with an increase in the writing pressure at the trace point; or a ratio of a total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is decreased with the increase in the writing pressure at the trace point.
[0027] In some embodiments, a total number of subcontours on which pixel filling is to be performed is decreased with an increase in the writing speed at the track point; or a total number of subcontours on which pixel filling is not to be performed is increased with an increase in the writing speed at the track point.
[0028] In some embodiments, a total number of subcontours on which pixel filling is to be performed is increased with an increase in writing pressure at the track point; or a total number of subcontours on which pixel filling is not to be performed is decreased with the increase in writing pressure at the track point.
[0029] In some embodiments, a density of pixel fill in the stroke contour is decreased with an increase in the writing speed at the track point; or a density without pixel fill in the stroke contour is increased with the increase in the writing speed at the track point; the density of the pixel fill indicates a ratio of a total number of filled subcontours to K.
[0030] In some embodiments, a density of pixel fill in the stroke contour is increased with an increase in writing pressure at the trace point; or a density without pixel fill in the stroke contour is decreased with the increase in writing pressure at the trace point; the density of the pixel fill indicates a ratio of a total number of filled subcontours to K.
[0031] In some embodiments, in a case where the filling manner for the sub-contour includes a scatter fill, a probability corresponding to the scatter fill is configured to control a total number of the sub-contours on which the pixel fill is to be performed in the scatter fill; the probability corresponding to the scatter fill is increased with an increase in the writing speed at the track point; and / or the probability corresponding to the scatter fill is decreased with an increase in the writing pressure at the track point.
[0032] In some embodiments, in a case where the fill method for the sub-contour includes a scattered fill, a scattering density corresponding to the scattered fill is decreased with an increase in the writing speed at the track point; and / or the scattering density corresponding to the scattered fill is increased with an increase in the writing pressure at the track point.
[0033] In some embodiments, in a case where the stroke is a left-falling stroke, the further a position of the subcontour is to the left in the stroke contour, the lower the probability of performing the pixel fill on the subcontour; or the further the position of the subcontour is to the right in the stroke contour, the higher the probability of performing the pixel fill on the subcontour.
[0034] In some embodiments, in a case where the fill style for the subcontour is a scattered fill and the stroke is a left-falling stroke, the further a position of the subcontour is to the left in the stroke contour, the lower the scattering density of the scattered fill in the subcontour; or, the further the position of the subcontour is to the right in the stroke contour, the greater the scattering density of the scattered fill in the subcontour.
[0035] In some embodiments, in a case where the stroke is a right-sloping stroke, the further a position of the subcontour is to the right in the stroke contour, the lower the probability of performing the pixel fill on the subcontour; or the further the position of the subcontour is to the left in the stroke contour, the higher the probability of performing the pixel fill on the subcontour.
[0036] In some embodiments, in a case where the fill style for the subcontour is a scatter fill and the stroke is a right-falling stroke, the further a position of the subcontour is to the right in the stroke contour, the lower the scatter density of the scatter fill in the subcontour; or the further the position of the subcontour is to the left in the stroke contour, the greater the scatter density of the scatter fill in the subcontour.
[0037] In some embodiments, dividing the stroke contour into K subcontours comprises: in a case where a writing speed at the track points is greater than a speed threshold and / or a writing pressure at the track points is less than a pressure threshold, dividing the stroke contour into the K subcontours.
[0038] In some embodiments, the method further comprises: when a total number of track points exceeds a preset threshold for the number of track points, adjusting a position of the sub-contour on which the pixel fill is to be performed.
[0039] In some embodiments, adjusting a position of the subcontour on which the pixel fill is to be performed comprises: adjusting positions of a preset number of subcontours at an edge of the stroke contour in the subcontours on which the pixel fill is to be performed.
[0040] In a third aspect, an embodiment of the present disclosure further provides a display device comprising a display screen and a controller, wherein the display screen is configured to display content; and the controller is configured to acquire trace point information of trace points in a writing trace of a user, determine a writing speed and a writing pressure corresponding to the trace points and coordinates of the trace points according to the track point information of the trace points, determine line widths corresponding to the trace points according to the writing speed and the writing pressure corresponding to the trace points, and determine a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0041] In a fourth aspect, an embodiment of the present disclosure further provides a method for determining handwriting contours, comprising: acquiring trace point information of trace points in a writing trace of a user; determining a writing speed corresponding to the trace points, a writing pressure corresponding to the trace points, and coordinates of the trace points according to the trace point information of the trace points; determining line widths corresponding to the trace points according to the writing speed corresponding to the trace points and the writing pressure corresponding to the trace points; and determining a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0042] In a fifth aspect, an embodiment of the present disclosure further provides a handwriting display device comprising: a trace acquisition unit configured to acquire trace point information from trace points in a user's writing trace; a contour determination unit configured to determine a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour; a partial filling unit configured to divide the stroke contour into K sub-contours and select a part of the sub-contours from the K sub-contours to perform pixel filling on the part of the sub-contours, wherein an extension direction in which the stroke contour extends is the same as an extension direction in which the sub-contours extend, and K is an integer greater than 1;and a stroke display unit configured to control a display screen to display the stroke.;
[0043] In a sixth aspect, an embodiment of the present disclosure further provides a handwriting contour determination device comprising: a trace acquisition unit configured to acquire trace point information from trace points in a user's writing trace; an information determination unit configured to determine a writing speed, a writing pressure corresponding to the trace points, and coordinates of the trace points according to the trace point information of the trace points; a line width determination unit configured to determine line widths corresponding to the trace points according to the writing speed and the writing pressure corresponding to the trace points; and a contour determination unit configured to determine a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0044] In a seventh aspect, an embodiment of the present disclosure further provides a computer-readable storage medium having stored thereon a computer program, wherein the computer program, executed by a processor, causes the processor to perform steps of the method in the second or fourth aspect.
[0045] These and other aspects of the present disclosure will become more apparent in the following description of the embodiments. SHORT DESCRIPTION OF THE CHARACTERS
[0046] To more clearly explain the technical solutions in the embodiments of the present disclosure, the drawings described in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description only illustrate some embodiments of the present disclosure, and other drawings can be derived from these drawings by those skilled in the art without creative work. Fig. 1 is a schematic diagram showing a display device according to an embodiment of the present disclosure. Fig. 2 is a schematic diagram illustrating drawing a stroke contour according to an embodiment of the present disclosure. Fig. 3 is a schematic diagram showing split subcontours according to an embodiment of the present disclosure. Fig. 4 is a schematic diagram showing a comparison between a semi-dry stroke effect according to an embodiment of the present disclosure and a conventional trace indication effect. Fig. 5 is a schematic diagram illustrating a semi-dry stroke effect of a left-falling stroke according to an embodiment of the present disclosure. Fig. 6 is a schematic diagram illustrating a semi-dry stroke effect of a right-falling stroke according to an embodiment of the present disclosure. Fig. 7 is a schematic diagram showing subcontours obtained by dividing a stroke contour according to an embodiment of the present disclosure. Fig. 8 is a schematic diagram showing a display effect of a handwritten script after being embellished into a semi-dry stroke according to an embodiment of the present disclosure. Fig. 9 is a flowchart of a handwriting display method according to an embodiment of the present disclosure. Fig. 10 is a schematic diagram showing a display device according to an embodiment of the present disclosure. Fig. 11 is a flowchart of a method for determining handwriting contours according to an embodiment of the present disclosure. Fig. 12 is a schematic diagram showing a handwriting display device according to an embodiment of the present disclosure. Fig. 13 is a schematic diagram showing an apparatus for determining handwriting contours according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF REVELATION
[0047] To further clarify the objectives, technical solutions, and advantages of the present disclosure, the present disclosure will be described in more detail below with reference to the drawings. Obviously, the described embodiments are only some, but not all, embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure described herein without creative effort are considered to be within the scope of the present disclosure.
[0048] The term "and / or" in the embodiments of the present disclosure describes an association relationship between related objects and indicates that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone. The " / " symbol generally indicates that the related objects before and after the " / " symbol are in an "or" relationship.
[0049] The application scenarios described in the embodiments of the present disclosure serve to better illustrate the technical solutions of the embodiments of the present disclosure and do not represent a limitation of the technical solutions according to the embodiments of the present disclosure. As is known to those skilled in the art, the technical solutions according to the embodiments of the present disclosure may also be applicable to similar technical problems as new application scenarios arise. In the description of the present disclosure, the meaning of "a plurality" is two or more unless otherwise specified.
[0050] An electronic ink screen, also called an electronic paper screen, consists of two substrates coated with electronic ink containing numerous tiny transparent particles. The particles consist of many black and white particles with positive and negative electricity, respectively. As the charged particles of different colors move in different directions due to an applied electric field, a black or white effect appears on the surface of the screen. To meet users' writing needs, the electronic ink screen is equipped with a handwriting function. Large-format smart displays are also equipped with the handwriting function, with the popularization of smart conferences. Handwritten traces can be displayed on the electronic ink screen or smart display device through the handwriting function.With the expansion of the ink screen market and the various requirements of large-format intelligent display devices, the need for a highly simulated handwriting function is increasing.
[0051] It should be noted that in each embodiment of the present disclosure, the display device includes a smart interactive display device with a touch and handwriting function. The smart display device is installed with a writing program such as a whiteboard, and the user can write on the display device with a finger, an active stylus, a passive stylus, or the like. The smart display device may include a display module such as a liquid crystal display (LCD) module, an organic light-emitting display (OLED) module, an electronic ink display module, or the like, and may be an ink screen and can display handwriting in real time.
[0052] In the embodiments of the present disclosure, a semi-dry stroke writing effect is achieved by dividing a stroke contour formed by a writing trace, filling in part of the divided sub-contours, and leaving other sub-contours unfilled. The semi-dry stroke is a special stroke in calligraphy in which some parts of the stroke resemble withered threads parallel to each other. Therefore, the stroke in calligraphy with semi-dry parts is generally called a semi-dry stroke, and the stroke shows a hint of white as written by a semi-dry writing brush.
[0053] As in Fig. 1, one embodiment of the present disclosure provides a display device including a display screen 100 and a controller 101.
[0054] The display screen 100 is configured to display content.
[0055] The controller 101 is configured to perform the following steps 1 to 4.
[0056] In step 1, acquiring trace point information from trace points in a user's writing trace.
[0057] In embodiments, the trace written by the user is received, the received trace is sampled, and the trace point information of a sampled trace point at a time t is obtained.
[0058] The track point information may include, among other things, track point coordinates, a sampling time, a track point pressure value, a track point flag, a current track point velocity, and the like. The track point flag is configured to indicate a position of the track point in the sampled points. For example, the track point flag indicates that the track point is located at a position in the sampled points that includes at least one of the following: a writing start position, a writing in progress position, or a writing stop position. The current track point velocity can be obtained by calculation according to the sampling times and the track point coordinates corresponding to adjacent track points, respectively.
[0059] In the embodiment of the present disclosure, a stroke written by a user can be determined according to an operation of the user starting to write, an operation of the user currently writing, and an operation of the user finishing writing. For the stroke written by the user, by applying the handwriting display method according to the embodiment of the present disclosure, the stroke with the semi-dry writing effect is displayed.
[0060] It should be noted that in the embodiment of the present disclosure, the stroke is displayed after being filled or rendered, and the writing trace in the embodiment of the present disclosure refers to touch point information (i.e., trace point information) generated in response to the user directly writing with a finger or stylus on a display screen configured with a touch function. After detecting the writing trace, the hardware transmits the writing trace to a simulation algorithm to process the writing trace and determine the stroke according to the writing trace, thereby displaying the stroke.
[0061] In embodiments, a trace of a stroke written by a user is received, trace point information of trace points in the trace of the stroke is acquired, the trace of the stroke is divided to obtain divided traces of the stroke, and a part of the divided sub-contours is selected from K divided sub-contours and filled, so that a trace having the effect of the semi-dry stroke is obtained.
[0062] In some embodiments, the user may use an electromagnetic pen to write on a screen, and the display device hardware captures trace point information of the stroke and transmits the trace point information to a simulation algorithm that processes it. An information field of the sampled trace point point_t obtained at time t is denoted as [x t , y t , pre t , t, flagt], where xt , y t represent track point coordinates, pret indicates the track point pressure value, t indicates the sampling time and flagt indicates the track point flag.
[0063] In step 2, determining a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour.
[0064] The stroke may further include a pixel fill color and a fill style for the pixel fill, and the fill style includes, but is not limited to, at least one of solid black fill and diffuse fill.
[0065] In some embodiments, before determining the stroke contour corresponding to the trace points, a moving distance of the writing trace may be determined according to the trace point information of the trace points, and if the moving distance is greater than a distance threshold, the writing trace shall be displayed.
[0066] In embodiments, the movement distance may be calculated for a preset number of consecutive track points in the writing track. For example, for a set of three consecutive track points, including point t-1 , point t and point +1 , the movement distance D of the three track points of point t-1 to point t+1 , ie the movement distance of the trace, can be calculated. During the calculation, a distance D1 between point t-1 and point t and a distance D2 between point t and point t+1 calculated, and then D = D1 + D2. If D is less than the distance threshold (e.g., 2), the track points are not displayed on the screen, that is, no rendering operation is performed for drawing. Until a time t + n at which the movement distance D of three track points, including point t-1 , point t+n and pointt+n+1 , is greater than the distance threshold, the three trace points are taken as a group, and a first trace point A, a second trace point B, and a third trace point C in the group are rendered and drawn, that is, rendered and displayed. In embodiments, the trace points may be sparsely sampled, thus saving the computational overhead. In a case where the user writes slowly, the naked eye may not perceive a change on the screen, and therefore, by processing / sampling in this way, a redundant amount of calculations and drawings can be saved, making it easier to reduce the delay of handwriting.
[0067] It should be noted that in the embodiment of the present disclosure, to calculate the movement distance of the writing trace, when a preset number of trace points are obtained by sampling, a movement distance of the trace points is calculated. For example, after three trace points (point1, point2, point3) are obtained by sampling, the movement distance of the three trace points is calculated, and when the fourth trace point is obtained by sampling, the movement distance of the last trace points (point2, point3, point4) is calculated. That is, the movement distance of the preset number of the last trace points obtained by sampling is calculated, and if the movement distance is greater than the distance threshold, the rendering operation is performed on the preset number of the last trace points obtained by sampling.
[0068] In some embodiments, the stroke contour of the stroke may be determined directly from the trace points or determined from the trace points obtained by sparse sampling. A position of the stroke contour is determined according to the coordinate information of the trace points, and a width of the stroke contour is determined according to the writing speed and writing pressure at the trace points, so that the stroke contour of the stroke corresponding to the trace points is determined. The width of the stroke contour may also be determined according to a fixed line width, and the position of the stroke contour is determined according to the coordinate information of the trace points, so that the stroke contour of the stroke corresponding to the trace points is determined.
[0069] In some embodiments, the stroke contour of the stroke corresponding to the trace points may also be determined by the following steps (1) to (4).
[0070] In step (1), the coordinate information of the track points is fitted to obtain a fit curve.
[0071]
[0084] The trace points can be fitted with a Bezier curve to obtain the fit curve. It should be noted that alternatively, other fitting methods can be used to fit the trace points, which is not limited in the embodiment of the present disclosure.
[0072] If a second-order Bezier curve is selected for the fitting method, three trace points can be used for fitting to obtain the fitting curve. If a third-order Bezier curve is selected for the fitting method, four trace points can be used for fitting to obtain the fitting curve, and so on. If other methods are selected for the fitting method, the number of trace points can be selected as needed to perform the fitting, and how the fitting curve is obtained is not limited to the embodiment of the present disclosure.
[0073] In embodiments, the first trace point A, the second trace point B, and the third trace point C are taken as the trace points, a second-order Bezier curve is fitted to the three points, and nine fitting trace points are acquired, wherein a first of the fitting trace points corresponds to point A, a fifth of the fitting trace points corresponds to point B, and a ninth of the fitting trace points corresponds to point C. It should be noted that the first trace point A and the third trace point C may lie on the second-order Bezier curve, that point B does not lie on the Bezier curve after fitting, and that point B is replaced by the fifth of the fitting trace points to perform the subsequent rendering process.
[0074] In step (2), selecting a plurality of fit trace points from the fit curve, wherein the plurality of fit trace points includes at least three first fit trace points corresponding to the trace points.
[0075] The first, fifth, and ninth of the fit trace points on the fit curve can be selected as the first fit trace points, corresponding to the first trace point A, the second trace point B, and the third trace point C, respectively.
[0076] In step (3), determining a stroke contour of the plurality of fit trace points according to the coordinate information of the plurality of fit trace points and the writing speed and writing pressure at the trace points corresponding to the first fit trace points.
[0077] In some embodiments, the stroke contour of the plurality of fit track points is determined by: determining a position of the stroke contour according to the coordinate information of the plurality of fit track points; and determining a width of the stroke contour according to the writing speed and the writing pressure at the track points corresponding to the first fit track points.
[0078] In embodiments, first, the position of the stroke contour is determined according to the coordinate information of the fit track points, and then the width of the stroke contour is determined, wherein the width of the stroke contour is related to the writing speed and the writing pressure at the track points corresponding to the first fit track points.In the embodiment of the present disclosure, during the determination of the position of the stroke contour, the coordinate information of the fitting trace points is desired as much as possible, and during the determination of the width of the stroke contour, since most of the fitting trace points on the fitting curve are not true trace points included in the user's writing trace, and thus do not have corresponding writing speed and writing pressure, so that the line widths at the first fitting trace points corresponding to the true trace points can be determined first, and then the line widths at the rest of the fitting trace points can be calculated based on an interpolation operation.
[0079] The width of the line contour can be determined depending on the writing speed and the writing pressure at the track points corresponding to the first fit track points by the following steps 3a) to 3c).
[0080] In step 3a) determining line widths at the first fit track points according to a preset maximum line width, a preset minimum line width, a preset weighting factor and the writing speed and the writing pressure at the track points corresponding to the first fit track points, wherein the preset weighting factor indicates a sensitivity parameter of a response adjustment of the line width for various factors.
[0081] In embodiments wherein the second-order Bezier curve serves as the fit curve as an example, a first of the first fit trace points corresponds to point A, a fifth of the first fit trace points corresponds to point B, a ninth of the first fit trace points corresponds to point C, the line width at the first of the first fit trace points is determined as a function of the writing speed and the writing pressure at point A, the line width at the fifth of the first fit trace points is determined as a function of the writing speed and the writing pressure at point B, and the line width at the ninth of the first fit trace points is determined as a function of the writing speed and the writing pressure at point C.
[0082] In embodiments, the writing speed and the writing pressure may be determined by: determining the writing speed corresponding to the first fit track point according to the track point coordinates and the sampling time in the track point information of the track point corresponding to the first fit track point; and determining the writing pressure corresponding to the first fit track point according to the track point pressure in the track point information of the track point corresponding to the first fit track point.
[0083] In step 3b), determining line widths at the fit trace points based on an interpolation operation according to the line widths at at least three first fit trace points.
[0084] The line widths corresponding to the other fit trace points on the fit curve except the first fit trace points are determined based on a linear interpolation method according to the line widths corresponding to the first fit trace points.
[0085] The line widths corresponding to the other six fit trace points are calculated based on a linear interpolation method according to the line widths corresponding to the first of the first fit trace points, the fifth of the first fit trace points, and the ninth of the first fit trace points, respectively.
[0086] In embodiments, the following formula may be used to determine the line width corresponding to the first fit trace point: lineWidth=maxLW−αspeed×(speedβspeed)γspeed−αpressure×(maxLW−minLW)γpressure1+eβpressure×(0.5−pressure)
[0087] In the formula (1), maxLW is the preset maximum line width, minLW is the preset minimum line width, speed is the writing speed at the trace point corresponding to the first fit trace point, pressure is a writing pressure normalization value at the trace point corresponding to the first fit trace point, and is a value in a range from 0 to 1.
[0088] α speed , β speed , γ speed , α pressure , β pressure and γ pressure are preset weighting factors that specify the sensitivity parameters of a line width response adjustment for different factors, and the preset weighting factors can be changed by the user moving a numeric bar on a front end, thus supporting self-defined setting of the writing effect.
[0089] In step 3c) Determine the width of the stroke contour according to the line widths at the fit trace points.
[0090] In embodiments, after the line widths corresponding to the fit trace points are determined, the width of the stroke contour is determined, the width of the stroke contour thus determined is changed with the writing speed and the writing pressure at the trace point, and compared with the stroke contour having a fixed width, the display effect is more real.
[0091] In some embodiments, after the line widths corresponding to the fit trace points are determined, the line widths at the fit trace points may be smoothed according to first line widths at historical fit trace points corresponding to the historical trace points of the trace points to obtain smoothed line widths.
[0092] The line widths at the fit trace points determined based on an interpolation operation according to the line widths at at least the first three fit trace points may be smoothed by: smoothing the line widths at the fit trace points according to first line widths at historical fit trace points corresponding to historical trace points of the trace points to obtain the line widths at the fit trace points.
[0093] The historical trace points of the trace points are a plurality of trace points consecutively received before the trace points were received; and the historical fitting trace points corresponding to the historical trace points are coordinate points on a fitting curve obtained by fitting the historical trace points.
[0094] The smoothed line widths at the fit trace points can be determined according to the first line widths at the historical fit trace points, the line widths at the fit trace points, and a preset number of historical fit trace points.
[0095] In the embodiment of the present disclosure, to ensure that a sawtooth effect is not generated due to a drastic change in the line width during writing, the line widths at the fit trace points can be determined and then smoothed according to the following formula: lineWidth¯t=∑i=0wLen2×(wLen−i)×lineWidtht−iwLen×(wLen+1)
[0096] In formula (2), wLen is a window length fixed for a moving average, ie the number of preset historical fit trace points, lineWidtht¯ specifies the smoothed line width at the fit trace point corresponding to a sampling time t, lineWidth t-ispecifies the line width at the fit trace point corresponding to a sampling time ti, and i is an integer. For example, wLen is equal to 5, meaning that the line widths at the current fit trace point and at the historical fit trace points corresponding to the four historical trace points before the current trace point are used to determine the smoothed line width at the current fit trace point.
[0097] The smoothed line widths at the first of the first fit trace points, the fifth of the first fit trace points, and the ninth of the first fit trace points are obtained by the formula (2), and then the line widths at the other six fit trace points are calculated based on a linear interpolation method according to the smoothed line widths of the first of the first fit trace points, the fifth of the first fit trace points, and the ninth of the first fit trace points.
[0098] In step (4), one stroke contour of the plurality of fit trace points is taken as the stroke contour corresponding to the trace points.
[0099] For each trace point, a preset graph can be drawn according to the line width corresponding to the trace point, taking the trace point as the center to obtain the preset graph corresponding to the trace point. The stroke contour corresponding to the trace points is determined according to the preset graphs corresponding to the trace points.
[0100] In some embodiments, the preset graph is a circle. In the present embodiment, the stroke contour corresponding to the fit trace points is determined according to the line widths corresponding to the fit trace points and the coordinates of the fit trace points through the following steps: i) for each fit trace point, a circle is drawn by taking the coordinates of the fit trace point as the center of the circle and taking the line width corresponding to the fit trace point as the diameter of the circle to obtain the circle corresponding to the fit trace point; ii) determining outer common tangent points of adjacent circles in the circles corresponding to the fit trace points; and iii) sequentially connecting the outer common tangent points clockwise or counterclockwise to obtain the stroke contour corresponding to the fit trace points.
[0101] As in Fig. 2, a schematic diagram illustrating the drawing of a stroke contour according to the embodiment of the present disclosure is shown. Taking nine fit trace points as an example, a circle is drawn for each fit trace point by taking the coordinates of the fit trace point as the center of a circle and taking the line width corresponding to the fit trace point as the diameter of the circle, thereby obtaining nine circles. Four outer common tangent points between adjacent circles are calculated, and the outer common tangent points are sequentially connected clockwise or counterclockwise to obtain the stroke contour corresponding to the fit trace points.Currently, to draw the track, the four outer common tangent points between adjacent circles are calculated and form a connecting quadrilateral to be drawn. Therefore, there is a relatively large overlap area between each circle and the connecting quadrilateral, resulting in excessive drawing and slowing down the system's response speed. To solve this problem, drawing is performed at the positions of the first circle and the last circle, and the vertices of eight connecting quadrilaterals are arranged clockwise to draw a polygon formed by 32 points.
[0102] In step 3, the stroke contour is divided into K subcontours, and a part of the subcontours is selected from the K subcontours to perform pixel filling on the part of the subcontours, where an extension direction in which the stroke contour extends is the same as an extension direction in which the subcontours extend, and K is an integer greater than 1.
[0103] In step 4, control a screen to display the stroke.
[0104] It should be noted that in the embodiment of the present disclosure, the extension direction in which the stroke contour extends coincides with the user's actual writing direction. For example, when the user writes a Chinese character "⇀" from left to right, the extension direction of the stroke is the left-to-right direction; and when the user writes an Arabic numeral "1" from top to bottom, the extension direction of the stroke is the top-to-bottom direction, and so on. In the present embodiment, the extension directions of the stroke contour and the sub-contour are determined based on the user's writing direction during the stroke writing.
[0105] In some embodiments, when the writing speed is greater than a speed threshold and the writing pressure is less than a pressure threshold, the stroke contour is divided into K sub-contours, the writing speed and the writing pressure are determined according to the track point information of the track points.
[0106] The current track point velocity at a center track point among the track points can be selected as the writing speed, and the track point pressure at the center track point can be selected as the writing pressure. Alternatively, an average speed of the current track point velocities at the track points can be selected as the writing speed, and an average pressure of the track point pressures at the track points can be selected as the writing pressure. In the embodiment of the present disclosure, the manner of determining the writing speed and writing pressure is not limited.
[0107] In embodiments, the stroke contour is divided into K subcontours, and the coordinates of a division point obtained by subdividing a circular contour corresponding to each track point are determined by the following formulas: xi=circlex−consine(90−180×iK+angle)×radius yi=circley−sine(90−180×iK+angle)×radius
[0108] In the formulas, x i and y i the horizontal or vertical coordinates of a division point of an i-th subcontour obtained by subdividing the circular contour of the first of the first fit trace points, circle x and circle xare the horizontal and vertical coordinates of the first of the first fit-track points, respectively, and angle is a counterclockwise included angle between a line connecting the fifth and first of the first fit-track points in each group of track points and a horizontal direction; and radius is half the line width corresponding to the first of the first fit-track points.
[0109] In the present embodiment, the coordinates of the division point may be on or within the circle corresponding to the fit trace point, which is not limited in the present embodiment. Note that, for the convenience of calculation, the coordinates of the division point calculated according to the above formulas (3) and (4) lie on a line segment formed by common tangent points on the circle, and two common tangent points forming the line segment are common tangent points of the same circle.Except for the first and ninth of the first fitting trace points, each of the circles corresponding to other fitting trace points has four common tangent points, and two common tangent points constituting the line segment are the common tangent points of the same circle, so that two line segments can be formed, and the dividing point can be the point on any of the line segments, which is not limited in the embodiment of the present disclosure.
[0110] Similarly, the horizontal and vertical coordinates of the division point of the i-th subcontour obtained by subdividing the circular contour of the ninth of the first fit trace points are calculated according to formulas (3) and (4).
[0111] A set of division points of the i-th subcontour is calculated according to the following formulas: xp2=(K−(i−1))×xp1+(i−1)×xp4K xp2=(K−(i−1))×yp1+(i−1)×yp4K xp3=(K−i)×xp1+i×xp4K yp3=(K−i)×yp1+i×yp4K
[0112] In the above formula, the calculation method for other division points on the sub-contour is given using the circular contour of the second of the first fit-track points as an example, and points P1 and P4 are the common tangent points of the circular contour of the second of the first fit-track points and the circular contour of the third of the first fit-track points, the coordinates of point P1 are (x p1 , y p1 , and the coordinates of point P4 are (x p4 , y p4 ); the coordinates of point P2 are (x p2 , y p2 ), and the coordinates of point P3 are (x p3 , y p3 ); K is the number of subcontours, and i is a value in a range from 0 to K.
[0113] As in Fig. 3, a schematic representation of the divided subcontours is shown. Points A and B are the (i-1)th and i-th division points on the first circle, respectively, and points C and D are the (i-1)th and i-th division points on the last circle, respectively. Points P1 and P4 are the common tangent points of the second and third circles, and points P2 and P3 are calculated according to formulas (5) to (8). Similarly, the coordinates of other division points arranged counterclockwise from point A are calculated to form the divided subcontour.
[0114] In some embodiments, between at least two subcontours that are to be pixel filled, there is at least one subcontour that is not to be pixel filled. The semi-dry stroke effect can be created by filled and unfilled subcontours.
[0115] Alternatively, in some embodiments, a portion of the subcontours may be randomly selected from the K subcontours to perform the pixel fill on the portion of the subcontours; or a portion of the subcontours may be randomly selected from the K subcontours to perform the pixel fill on the portion of the subcontours.
[0116] In some embodiments, the pixel filling on the subcontour may be performed by selecting a part of the subcontours from the K subcontours to perform the pixel filling on the part of the subcontours according to the generated K random numbers and a corresponding relationship between the random numbers and the subcontours.
[0117] In particular, the number and positions of the subcontours on which the pixel filling is to be performed can be calculated as follows: (1) calculating a product value from an average of the K random numbers and a semi-dry stroke parameter, wherein the semi-dry stroke parameter is configured to control the number of sub-contours on which the pixel fill is to be performed; (2) if any random number is greater than the product value, determining that the pixel fill is performed on the subcontour corresponding to the random number; and (3) if any random number is less than or equal to the product value, determining that no pixel filling is performed on the subcontour corresponding to the random number.
[0118] In embodiments, a random number array with a length of K in a range of [0, 100] may be generated, and an average value of the array is calculated as rand. For an i-th subcontour obtained by subdividing, the interior of the subcontour is filled if an i-th value in the random number array is greater than α × rand; otherwise, the subcontour is not filled. α is the semi-dry stroke parameter for controlling a density of a semi-dry stroke area, and the larger the value of α, the sparser a density of black in the generated semi-dry stroke area; the smaller the value of α, the denser the density of black in the generated semi-dry stroke area. The value of α can be changed by the user sliding a numeric bar at the front end, thus supporting self-defined setting of the writing effect.
[0119] As in Fig. 4, a diagram illustrating a comparison between the semi-dry stroke effect according to the embodiment of the present disclosure and a conventional trace display effect is shown, where the left side is the original handwriting without semi-dry stroke embellishment and the right side is the handwriting with semi-dry stroke embellishment.
[0120] In some embodiments, the semi-dry stroke parameter is related to the following content.
[0121] In a first type, the semi-dry stroke parameter is determined according to the writing speed, and the semi-dry stroke parameter is increased with an increase in the writing speed.
[0122] In a second type, the semi-dry stroke parameter is determined according to the writing pressure, and the semi-dry stroke parameter is increased with a decrease in writing pressure.
[0123] In a third type, the parameter for the semi-dry stroke is determined depending on the writing speed and the writing pressure and increases with an increase in the writing speed and increases with a decrease in the writing pressure.
[0124] In embodiments, the semi-dry stroke parameter can be determined by the following formula: α=param1×speedparam2−param31+eparam4×(0.5−pressure)
[0125] In the above formula, param1, param2, param3 and param4 are control parameters; speed is the writing speed, pressure is the writing pressure and α is the parameter for the semi-dry stroke; α is increased with the increase of speed to increase the number of sub-contours that should not be filled; α is increased with the decrease of pressure to increase the number of sub-contours that should not be filled.
[0126] In some embodiments, the portion of the subcontours selected from the K subcontours is filled by: performing pixel filling on the selected portion of the subcontours in different fill ways.
[0127] The pixel filling can be done alternately using different filling methods on the selected part of the subcontours.
[0128] It should be noted that in the embodiment of the present disclosure, the filling ways are performed alternately, e.g., solid black fill, scattered fill, solid black fill, scattered fill ......, and a total number of consecutive sub-contours to be filled in the same filling way may be one or more, which is not limited in the embodiment of the present disclosure.
[0129] The pixel fill can be performed by: performing the pixel fill on the selected part of the subcontours alternately in a first fill mode and a second fill mode.
[0130] When the first fill method is black fill and the second fill method is scatter fill, all sub-contours on which pixel filling is to be performed can be filled with scatter fill first, and then the sub-contours filled with scatter fill are covered and filled with black fill according to an alternative fill method, so that the scatter fill and black fill are performed alternately, the filling times can be reduced, and the calculation amount can be reduced.
[0131] In embodiments, a difference between the first fill style and the second fill style in the embodiment of the present disclosure lies in at least one of the differences in a filled pixel value, a filled pixel brightness, a filled pixel color, and a filled pixel position. The fill style in the embodiment of the present disclosure includes, but is not limited to, solid black fill, scattered fill, striped fill, pattern fill, color fill, or the like, and the first fill style and the second fill style in the embodiment of the present disclosure may be two different fill styles selected from the above-mentioned fill styles, which is not limited in the embodiment of the present disclosure.
[0132] The first fill type in the embodiment of the present disclosure may be a solid black fill, and the second fill type may be a random scatter fill, or the second fill type may be a solid black fill and the first fill type may be a random scatter fill, which is not limited in the embodiment of the present disclosure. It should be noted that the solid black fill and the random scatter fill in the embodiment of the present disclosure are only examples, and other types of fills are also within the scope of the present disclosure.
[0133] The filling method includes, but is not limited to, filling with different colors, scatter filling, line filling, curve filling, pattern filling, or the like.
[0134] To further simulate the texture effect of ink in the semi-dry stroke of a writing brush, the split subcontours can be partially filled with solid black fill and partially filled with random scattered fill within the subcontour, thus achieving a richer texture effect. In embodiments, solid black fill and random scattered fill can be used alternately, with random scattered fill being performed first on the selected subcontours, and then black fill is covered on a portion of the subcontours subject to scattered fill based on the alternative fill method, thus reducing the computational overhead.
[0135] In some embodiments, consecutive subcontours in the selected portion of the subcontours may be further divided into a contour group, and the pixel fill is performed on the subcontours in the contour group at once in the same fill manner.
[0136] The pixel fill can be applied to the subcontours in the contour group at once in the same fill style by: randomly selecting a fill style from different fill styles to apply the pixel fill to the subcontours in the contour group at once in the fill style.
[0137] In embodiments, consecutive subcontours in the subcontour group are divided into a contour group, and a fill style is randomly selected to perform the pixel fill on the subcontours in the contour group at once. In particular, a generated random number array can be used to determine which subcontours should be filled as non-white areas. For these subcontours, either a solid black fill or a random scattered fill is selected and performed on the subcontours.
[0138] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises, in particular: dividing consecutive subcontours in the selected portion of the subcontours into a contour group and performing the pixel fill on the subcontours in the contour group at once in the same fill manner.
[0139] During the actual filling, the selected sub-contours to be filled can be grouped, the consecutive sub-contours are grouped into the same group, and then the pixel filling is performed on the sub-contours in the same group at once, so that the filling times are reduced.
[0140] In some embodiments, the number of subcontours on which the pixel fill is to be performed consecutively can be further limited. In the selected portion of the subcontours, the number of subcontours on which the pixel fill is to be performed consecutively is less than a numerical threshold.
[0141] Alternatively, in the selected part of the subcontours, the number of subcontours on which the pixel filling is to be performed consecutively in the same filling manner is less than a numerical threshold.
[0142] In embodiments, by limiting the number of consecutive sub-contours to be filled, when pixel filling is performed on a plurality of consecutive sub-contours in the same filling manner, a relatively large area is prevented from being generated after filling the sub-contours and the semi-dry stroke effect is improved.
[0143] The fill style is randomly selected to perform pixel filling of sub-contours in the contour group by the following steps: if the number of sub-contours in the contour group is less than a numerical threshold, randomly selecting a fill style to perform pixel filling on the sub-contours in the contour group; if the number of sub-contours in the contour group is greater than or equal to the numerical threshold, further subdividing the contour group such that the number of sub-contours in each divided first contour group is less than the numerical threshold, and randomly selecting a fill style to perform filling on the sub-contours in the first contour group.
[0144] In some embodiments, the pixel filling on the sub-contours in the contour group is performed at once by randomly selecting a fill style from different fill styles in one or more of the following ways: randomly selecting a fill style from a plurality of fill styles with an equal probability to perform the pixel filling on the sub-contours in the contour group at once in the fill style; or randomly selecting a fill style from a plurality of fill styles with different probabilities to perform the pixel filling on the sub-contours in the contour group at once in the fill style, and the fill styles correspond one-to-one to the probabilities.
[0145] In embodiments assuming a case where the fill style is randomly selected from the plurality of fill styles with the same probability and the sub-contours in the contour group are filled with the selected fill style, the step of selecting the fill style is, for example, the following steps a to c.
[0146] In step a, a plurality of consecutive subcontours to be filled are divided into a group, for example, the third, fourth and fifth subcontours are divided into a first group, the seventh, eighth, ninth, tenth, eleventh, twelfth and thirteenth subcontours are divided into a second group and the fifteenth, sixteenth, seventeenth, eighteenth and nineteenth subcontours are divided into a third group.
[0147] In step b, for the groups divided in step a, if the number of subcontours in the contour group is not greater than 3, a filling method is randomly and equally selected and all subcontours in the group are filled in this way.
[0148] In step c, for the groups divided in step a, if the number of subcontours in the group exceeds three, the group of subcontours is continuously subdivided so that the number of each subdivided group of subcontours does not exceed three. As in step a, the seventh, eighth, ninth, tenth, eleventh, twelfth, and thirteenth subcontours can be subdivided into a group of seventh, eighth, and ninth subcontours, a group of tenth and eleventh subcontours, and a group of twelfth and thirteenth subcontours. For each subdivided first contour group, a fill method is randomly and equally selected, and all subcontours in the first contour group are filled in this way.
[0149] In some embodiments, the ratio of the total width of the subcontours on which the pixel fill is to be performed to the width of the stroke contour is decreased as the writing speed at the track points increases; or the ratio of the total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is increased as the writing speed at the track points increases.
[0150] In some embodiments, the ratio of the total width of the subcontours on which the pixel fill is to be performed to the width of the stroke contour is increased with increasing writing pressure at the trace points; or the ratio of the total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is decreased with increasing writing pressure at the trace points.
[0151] In the embodiment of the present disclosure, the ratio of the total width of the sub-contours on which pixel filling is to be performed to the width of the stroke contour is decreased with increasing the writing speed at the track points and increased with increasing the writing pressure at the track points; and the ratio of the total width of the sub-contours on which pixel filling is not to be performed to the width of the stroke contour is increased with increasing the writing speed at the track points and decreased with increasing the writing pressure at the track points.
[0152] In some embodiments, the number of subcontours on which pixel filling is to be performed is decreased as the writing speed at the track points increases; or the number of subcontours on which pixel filling is not to be performed is increased as the writing speed at the track points increases.
[0153] In some embodiments, the number of subcontours on which pixel filling is to be performed is increased with increasing writing pressure at the track points; or the number of subcontours on which pixel filling is not to be performed is decreased with increasing writing pressure at the track points.
[0154] In some embodiments, the number of subcontours on which pixel filling is to be performed is decreased with increasing the writing speed at the track points and increased with increasing the writing pressure at the track points; and the number of subcontours on which pixel filling is not to be performed is increased with increasing the writing speed at the track points and decreased with increasing the writing pressure at the track points.
[0155] In some embodiments, a density of pixel fill in the stroke contour is decreased with increasing writing speed at the trace points; or a density without pixel fill in the stroke contour is increased with increasing writing speed at the trace points; the density of the pixel fill indicates a ratio of the number of filled subcontours to K.
[0156] In some embodiments, the density of the pixel fill in the stroke contour is increased with increasing writing pressure at the trace points; or the density without pixel fill in the stroke contour is decreased with increasing writing pressure at the trace points; the density of the pixel fill indicates a ratio of the number of filled subcontours to K.
[0157] In some embodiments, the density of the pixel fill in the stroke contour is decreased with increasing writing speed at the track points and increased with increasing writing pressure at the track points; and the density without pixel fill in the stroke contour is increased with increasing writing speed at the track points and decreased with increasing writing pressure at the track points.
[0158] In some embodiments, in a case where the filling manner of the sub-contour comprises scattered filling, the probability corresponding to the scattered filling is configured to control the number of sub-contours to be filled by the scattered filling; the probability corresponding to the scattered filling is increased with increasing the writing speed at the track points; and / or the probability corresponding to the scattered filling is decreased with increasing the writing pressure at the track points.
[0159] In some embodiments, in a case where the filling method of the sub-contour comprises a scattered fill, a scattering density corresponding to the scattered fill is decreased with increasing the writing speed at the track points; and / or the scattering density corresponding to the scattered fill is increased with increasing the writing pressure at the track points.
[0160] In some embodiments, in a case where the fill type is a scatter fill, the probability corresponding to the scatter fill is configured to control the number of subcontours to be filled by the scatter fill. In the embodiment of the present disclosure, the probability of the scatter fill is determined by one of the following methods 1 to 3.
[0161] In method 1, the probability corresponding to the scatter filling is determined depending on the writing speed, and the probability is increased with an increase in the writing speed.
[0162] In method 2, the probability corresponding to the scattered filling is determined depending on the writing pressure, and the probability is increased with a reduction of the writing pressure.
[0163] In method 3, the probability corresponding to the scattered filling is determined depending on the writing speed and the writing pressure, and the probability is increased with an increase in the writing speed and increased with a decrease in the writing pressure.
[0164] The random scattered fill can be chosen to be used with a probability P, and the solid black fill is chosen to be used with a probability 1-P. The formula for the probability P of the random scattered fill is related to the writing speed and writing pressure as follows: P=speedparam1−pressureparam2,st P∈(0,1)
[0165] Param1 and param2 are control parameters: speed is the writing speed, pressure is the writing pressure, and P is the probability of random scatter filling. P increases with an increase in writing speed and controls the number of subcontours to be filled by random scatter filling; P increases with a decrease in writing pressure and controls the number of subcontours to be filled by random scatter filling.
[0166] In some embodiments, the stroke contour is divided into K subcontours if the writing speed at the track points is greater than a speed threshold and / or the writing pressure at the track points is less than a pressure threshold.
[0167] In some embodiments, in a case where the stroke is a left-sloping stroke, the probability of performing the pixel fill on the subcontour is lower the further a position of the subcontour is to the left in the stroke contour; or, the further the position of the subcontour is to the right in the stroke contour, the greater the probability of performing the pixel fill on the subcontour. As in Fig. 5, a schematic diagram illustrating a semi-dry stroke display effect of a "left-falling" stroke is shown, and when the user writes the "left-falling" stroke, the semi-dry stroke areas on the upper left side of the "left-falling" stroke are more than the semi-dry stroke areas on the lower right side, so that the semi-dry stroke effect of the writing brush can be simulated more truly.
[0168] In some embodiments, in a case where the fill type of the subcontour is a scatter fill and the stroke is a left-falling stroke, the further the position of the subcontour is to the left in the stroke contour, the lower the scatter density of the scatter fill performed on the subcontour; or, the further the position of the subcontour is to the right in the stroke contour, the greater the scatter density of the scatter fill performed on the subcontour.
[0169] In some embodiments, in a case where the stroke is a right-falling stroke, the further a position of the subcontour is to the right in the stroke contour, the lower the probability of performing the pixel fill on the subcontour; or the further the position of the subcontour is to the left in the stroke contour, the greater the probability of performing the pixel fill on the subcontour. As in Fig. 6, a schematic diagram illustrating a semi-dry stroke display effect of a right-falling stroke is shown, and when the user writes the "left-falling" stroke, the semi-dry stroke areas at the upper right of the "left-falling" stroke are more than the semi-dry stroke areas at the lower left, so that the semi-dry stroke effect of the writing brush can be simulated more truly.
[0170] In some embodiments, in a case where the fill type of the subcontour is a diffuse fill and the stroke is a right-falling stroke, the further the position of the subcontour is to the right in the stroke contour, the lower the diffuse density of the diffuse fill performed on the subcontour; or, the further the position of the subcontour is to the left in the stroke contour, the greater the diffuse density of the diffuse fill performed on the subcontour.
[0171] In embodiments, an influence of the stroke direction on the filling of the K subcontours is constructed. Taking the example of the left-falling stroke, the number of subcontours on which a scatter fill should be performed or a pixel fill should not be performed on the left side of the stroke is greater than the number of subcontours on which a scatter fill should be performed or a pixel fill should not be performed on the right side of the stroke, and the probability of pixel fill is specifically calculated as follows.
[0172] A counterclockwise included angle between a direction of movement defined by two adjacent points and the horizontal direction is calculated, and if the included angle is in a range of 90 degrees to 180 degrees, this indicates that the stroke is a left-descending stroke. As in Fig. Figure 7 shows the subcontours obtained by subdividing the stroke contour, and the subcontours are arranged in order from top left to bottom right. Whether the subcontour should not be filled is determined with a probability P1, and whether a random scatter fill is selected for the subcontour is determined with a probability P2. The probability is calculated as follows: P1=1−(idx / K)param1, P2=1−(idx / K)param2
[0173] K is the number of subcontours, param1 and param2 are control parameters, and idx is the index number of the subcontour. The smaller the index number, the greater the probability that the subcontour will not be filled or will be filled by random scattering, allowing the writing brush effect to be simulated more realistically.
[0174] In some embodiments, after the stroke contour has been divided into K subcontours and a portion of the subcontours from the K subcontours has been selected for filling, the remainder of the subcontours may be filled in a different filling manner.
[0175] When the solid black fill is performed on the part of the subcontours, the diffuse fill is performed on the subcontours except the part of the subcontours in the K subcontours.
[0176] Alternatively, when the diffuse fill is performed on the part of the subcontours, the solid black fill is performed on the subcontours except the part of the subcontours in the K subcontours.
[0177] In embodiments, after the stroke contour is divided into the K sub-contours, a part of the sub-contours may be selected for the solid black fill, and the diffuse fill is performed on the rest of the sub-contours, or a part of the sub-contours may be selected for the diffuse fill, and the solid black fill is performed on the rest of the sub-contours, which may also produce the semi-dry stroke effect.
[0178] In some embodiments, after determining the stroke contour corresponding to the trace points, according to the trace point information of the trace points, the positions of the sub-contours to be filled may be reset after each acquisition of a preset number of trace points in the following manner: if the number of acquired trace points exceeds a preset threshold for the number of trace points, the position of the sub-contour on which the pixel filling is to be performed is adjusted. In embodiments for a product such as a handwriting tablet with high writing latency requirements, the hardware typically performs display interaction in the form of dense acquisition of trace points and local refresh, so that the movement distance between adjacent sampling points acquired by the algorithm is relatively small.To avoid the problem of unnaturally drawn textures due to frequently changing textures to be filled during the generation of random fill effects, in the present disclosure, for a device such as a handwriting tablet, the position of the sub-contour to be filled is changed every a preset number of track points, for example, the position of the sub-contour is changed every ten track points.
[0179] In some embodiments, when the number of detected trace points exceeds the preset threshold for the number of trace points, the positions of a preset number of subcontours at the edge of the stroke contour are adjusted in the subcontours to be pixel-filled. By adjusting the position of the subcontour at the edge of the stroke contour, the texture change at the edge of the stroke contour may be smoother after two adjacent adjustments are performed.
[0180] For example, when changing the position of the sub-contour to be filled, in order to avoid the problem of an "abrupt change" of the texture caused by a relatively large difference between the settings of two adjacent black fill areas, the following rules for texture filling can be applied: When the position of the sub-contour to be filled is first generated, a black fill area is set by generating a random number array, and after the black fill area is obtained, a current random scattered fill area is set using the above rule; when the position of the sub-contour to be filled is to be changed next time, for the previous black fill area, randomly change the settings of one to two sub-contours at the edge part if the third, fourth, and fifth sub-contours are set for solid black fill at the previous time.It is a reasonable drawing setting at the current time that the second, third, and fourth sub-contours are set for a solid black fill. After the black fill area is obtained, the random scatter fill area is set at the current time according to the above rule, so that there is an overlap between the stroke contours corresponding to the positions of the various sub-contours to be filled, and so on. For an ordinary handwriting tablet, the width of the coarsest drawing line of a writing pen does not exceed 20 pixels, and for the twenty divided sub-contours specified in the present disclosure, the maximum width of each sub-contour does not exceed 1 pixel, so that the drawing settings of one to two sub-contours being changed can ensure a smooth texture change in the visual. As shown in [the text]. Fig. 8, a display effect of a handwritten font with the semi-dry stroke embellishment according to the present disclosure is illustrated.
[0181] In some embodiments, a method for improving the smooth transition effect of the semi-dry stroke is provided, which method is particularly as follows: after acquiring the trace point information of trace points in the user's writing trace and before dividing the stroke contour into the K sub-contours, performing a full-color fill on a stroke contour of a stroke corresponding to first trace points in the writing trace and performing a diffuse fill on a stroke contour of a stroke corresponding to second trace points in the writing trace; and determining the stroke contour of the stroke corresponding to the trace points according to trace point information of third trace points in the writing trace; dividing the stroke contour into the K sub-contours and selecting a part of the sub-contours from the K sub-contours to perform the pixel fill on the part of the sub-contours; and controlling the display screen to display the stroke.The first track points, the second track points, and the third track points are each a preset number of track points in the writing track. The second track points are acquired after the first track points are acquired, and the third track points are acquired after the second track points are acquired. The number of first track points, the number of second track points, and the number of third track points can be the same or different from each other.
[0182] In the embodiment of the present disclosure, before determining to perform the pixel fill on the part of the sub-contours in the stroke contour, in order to make the transition from the full-color fill effect to the semi-dry stroke effect more natural, a transition from the full-color fill to the diffuse fill to the semi-dry stroke fill (ie, in the pixel fill performed on the part of the sub-contours) may be performed before the pixel fill with the semi-dry stroke effect is performed, so that the transition from the full-color fill to the semi-dry stroke fill is more natural.
[0183] The solid color fill in the embodiment of the present disclosure includes, but is not limited to, a solid black fill or other color fill, which is not limited in the embodiment of the present disclosure.
[0184] The embodiment of the present disclosure can be applied to an ink-based tablet and can contribute to reducing the delay of handwriting in the interaction process through a rapid drawing method between sampled writing points. The trace points and the writing pressures written by the user are detected with an electromagnetic pen. A mapping formula for the line width at the writing trace point is established depending on the writing pressure and writing speed. While the user uses the device, the thickness of a written line that changes naturally without generating sawtooths can be ensured by the method of smoothing the line width. According to the present disclosure, a basic diagram is drawn for each sampled point and a connection diagram is drawn between adjacent basic diagrams.After the writing speed and writing pressure reach preset conditions by the user, the drawn curve is split, so that the “semi-dry stroke” effect of the writing brush is realized and a more natural texture change can be realized during the user’s writing.
[0185] Based on the same inventive concept as above, an embodiment of the present disclosure further provides a handwriting display method that can be applied to a display device, and specific implementation steps of the method may refer to the method in the display device described above, and repeated parts will not be described again.
[0186] As in Fig. 9, the specific implementation flow of the method includes the following steps 900 to 903.
[0187] In step 900, acquiring track point information from track points in a user's writing track.
[0188] In step 901, determining a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour.
[0189] At step 902, dividing the stroke contour into K sub-contours and selecting a part of the sub-contours from the K sub-contours to perform the pixel filling on the part of the sub-contours, wherein an extension direction in which the stroke contour extends is the same as an extension direction in which the sub-contours extend, and K is an integer greater than 1.
[0190] In step 903, controlling a display screen to display the stroke.
[0191] In some embodiments, at least one subcontour on which no pixel fill is to be performed is located between at least two subcontours on which pixel fill is to be performed.
[0192] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: randomly selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours.
[0193] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours according to the generated K random numbers and a corresponding relationship between the random numbers and the subcontours.
[0194] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours according to the generated K random numbers and a corresponding relationship between the random numbers and the subcontours comprises: calculating a product value of an average value of the K random numbers and a semi-dry stroke parameter, wherein the semi-dry stroke parameter is configured to control the number of subcontours on which pixel fill is to be performed; if any random number is greater than the product value, determining that the pixel fill is to be performed on the subcontour corresponding to the random number; and if any random number is less than or equal to the product value, determining that no pixel fill is to be performed on the subcontour corresponding to the random number.
[0195] In some embodiments, the semi-dry stroke parameter is determined as a function of a writing speed, and the semi-dry stroke parameter is increased with an increase in the writing speed; and / or the semi-dry stroke parameter is determined as a function of a writing pressure, and the semi-dry stroke parameter is increased with a decrease in the writing pressure.
[0196] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform pixel filling on the portion of the subcontours comprises: performing pixel filling on the portion of the subcontours in different filling ways.
[0197] In some embodiments, performing the pixel fill on the portion of the subcontours in different fill ways comprises performing the pixel fill on the portion of the subcontours in different fill ways alternately.
[0198] In some embodiments, performing the pixel fill on the portion of the subcontours in different fill ways alternately comprises performing the pixel fill on the portion of the subcontours in a first fill way and a second fill way alternately.
[0199] In some embodiments, the method further comprises: dividing consecutive subcontours in the selected portion of the subcontours into a contour group to perform the pixel filling on the subcontours in the contour group at once in the same manner.
[0200] In some embodiments, performing the pixel fill on the subcontours in the contour group at once in a same fill style comprises: randomly selecting a fill style from among different fill styles to perform the pixel fill on the subcontours in the contour group in the selected fill style.
[0201] In some embodiments, randomly selecting a fill style from among different fill styles to perform the pixel fill on the sub-contours in the contour group in the selected fill style comprises: randomly selecting a fill style from among a plurality of fill styles having an equal probability to perform the pixel fill on the sub-contours in the contour group at once in the selected fill style; or randomly selecting a fill style from among a plurality of fill styles having different probabilities to perform the pixel fill on the sub-contours in the contour group at once in the selected fill style, wherein the fill styles are in one-to-one correspondence with the probabilities.
[0202] In some embodiments, determining the stroke contour of the stroke corresponding to the trace points comprises: fitting coordinate information of the trace points to obtain a fitting curve; selecting a plurality of fitting trace points from the fitting curve, wherein the plurality of fitting trace points includes at least three first fitting trace points corresponding to the trace points; determining a stroke contour of the plurality of fitting trace points according to coordinate information of the fitting trace points and a writing speed and a writing pressure at the trace points corresponding to the first fitting trace points; and using the stroke contour of the plurality of fitting trace points as the stroke contour corresponding to the trace points.
[0203] In some embodiments, determining a stroke contour of the plurality of fit track points according to coordinate information of the fit track points and a writing speed and a writing pressure at the track points corresponding to the first fit track points comprises: determining a position of the stroke contour according to the coordinate information of the plurality of fit track points; and determining a width of the stroke contour according to the writing speed and the writing pressure at the track points corresponding to the first fit track points.
[0204] In some embodiments, determining a width of the stroke contour according to the writing speed and the writing pressure at the trace points corresponding to the first fit trace points comprises: determining a line width at the first fit trace point according to a preset maximum line width, a preset minimum line width, a preset weighting factor, and the writing speed and the writing pressure at the trace point corresponding to the first fit trace point, wherein the preset weighting factor indicates a sensitivity parameter of a response adjustment of the line width for various factors; determining line widths at the fit trace points based on an interpolation operation according to the line widths at at least three first fit trace points; and determining the width of the stroke contour according to the line widths at the fit trace points.
[0205] In some embodiments, after determining the line widths at the fit trace points based on an interpolation operation according to the line widths at at least three first fit trace points, the method further comprises: smoothing the line widths at the fit trace points according to first line widths of historical fit trace points corresponding to historical trace points of the trace points to obtain smoothed line widths at the fit trace points; the historical trace points of the trace points are a plurality of trace points consecutively received before receiving the trace points; and the historical fit trace points corresponding to the historical trace points are coordinate points on a fit curve obtained by fitting the historical trace points.
[0206] In some embodiments, smoothing the line widths at the fit trace points according to first line widths of historical fit trace points corresponding to historical trace points of the trace points to obtain smoothed line widths at the fit trace points comprises: determining the smoothed line widths at the fit trace points according to the first line widths at the historical fit trace points, the line widths at the fit trace points, and a preset number of the historical fit trace points.
[0207] In some embodiments, selecting a portion of the subcontours from the K subcontours to perform the pixel fill on the portion of the subcontours comprises: dividing consecutive subcontours in the portion of the subcontours into a contour group to perform the pixel fill on the subcontours in the contour group at once in a same fill manner.
[0208] In some embodiments, in the selected portion of the subcontours, the number of subcontours on which the pixel fill is to be performed consecutively is less than a numerical threshold; or in the selected portion of the subcontours, the number of subcontours on which the pixel fill is to be performed consecutively in a same filling manner is less than a numerical threshold.
[0209] In some embodiments, a ratio of a total width of the subcontours on which the pixel fill is to be performed to a width of the stroke contour is decreased with an increase in the writing speed at the track points; or a ratio of a total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is increased with an increase in the writing speed at the track points.
[0210] In some embodiments, a ratio of a total width of the subcontours on which the pixel fill is to be performed to a width of the stroke contour is increased with an increase in writing pressure at the trace points; or a ratio of a total width of the subcontours on which the pixel fill is not to be performed to the width of the stroke contour is decreased with an increase in writing pressure at the trace points.
[0211] In some embodiments, the number of subcontours on which pixel filling is to be performed is decreased with an increase in the writing speed at the track points; or the number of subcontours on which pixel filling is not to be performed is increased with an increase in the writing speed at the track points.
[0212] In some embodiments, the number of subcontours on which pixel filling is to be performed is increased with an increase in the writing pressure at the track points; or the number of subcontours on which pixel filling is not to be performed is decreased with an increase in the writing pressure at the track points.
[0213] In some embodiments, a density of the pixel fill in the stroke contour is decreased with an increase in the writing speed at the trace points; or a density without pixel fill in the stroke contour is increased with an increase in the writing speed at the trace points; the density of the pixel fill indicates a ratio of the number of subcontours to be filled to K.
[0214] In some embodiments, a density of the pixel fill in the stroke contour is increased with an increase in the writing pressure at the trace points; or a density without pixel fill in the stroke contour is decreased with the increase in the writing pressure at the trace points; wherein the density of the pixel fill indicates a ratio of the number of subcontours to be filled to K.
[0215] In some embodiments, when the filling method of the sub-contour includes a scatter fill, a probability corresponding to the scatter fill is configured to control the number of the sub-contour to be filled by the scatter fill; the probability corresponding to the scatter fill is increased with an increase in the writing speed at the track points; and / or the probability corresponding to the scatter fill is decreased with an increase in the writing pressure at the track points.
[0216] In some embodiments, when the filling method of the subcontour comprises a scattered fill, a scattering density corresponding to the scattered fill is decreased with an increase in the writing speed at the track points; and / or the scattering density corresponding to the scattered fill is increased with an increase in the writing pressure at the track points.
[0217] In some embodiments, when the stroke is a left-sloping stroke, the further a position of the subcontour is to the left in the stroke contour, the lower the probability of performing the pixel fill on the subcontour; or the further the position of the subcontour is to the right in the stroke contour, the greater the probability of performing the pixel fill on the subcontour.
[0218] In some embodiments, when the fill type of the subcontour is a scatter fill and the stroke is a left-falling stroke, the further a position of the subcontour is to the left in the stroke contour, the lower the scatter density of the scatter fill performed on the subcontour; or the further the position of the subcontour is to the right in the stroke contour, the greater the scatter density of the scatter fill performed on the subcontour.
[0219] In some embodiments, when the stroke is a right-sloping stroke, the further the position of the subcontour is to the right in the stroke contour, the lower the probability of performing a pixel fill on the subcontour; or the further the position of the subcontour is to the left in the stroke contour, the greater the probability of performing a pixel fill on the subcontour.
[0220] In some embodiments, when the fill type of the subcontour is a scatter fill and the stroke is a right-falling stroke, the further a position of the subcontour is to the right in the stroke contour, the lower the scatter density of the scatter fill performed on the subcontour; or the further the position of the subcontour is to the left in the stroke contour, the greater the scatter density of the scatter fill performed on the subcontour.
[0221] In some embodiments, dividing the stroke contour into K subcontours comprises: if a writing speed at the track points is greater than a speed threshold and / or a writing pressure at the track points is less than a pressure threshold, dividing the stroke contour into the K subcontours.
[0222] In some embodiments, the method further comprises: if the number of detected trace points exceeds a preset threshold for the number of trace points, adjusting a position of the sub-contour on which the pixel fill is to be performed.
[0223] In some embodiments, adjusting a position of the subcontour on which the pixel fill is to be performed comprises: adjusting positions of a preset number of subcontours at an edge of the stroke contour in the subcontours on which the pixel fill is to be performed.
[0224] Based on the same inventive concept as above, as in Fig. 10, an embodiment of the present disclosure further provides a display device including a display screen 1000 and a controller 1001.
[0225] The display screen 1000 is configured to display content.
[0226] The controller 1001 is configured to: acquire trace point information of trace points in a user's writing trace; determine a writing speed, a writing pressure corresponding to the trace points, and coordinates of the trace points according to the trace point information of the trace points; determine line widths corresponding to the trace points according to the writing speed and the writing pressure corresponding to the trace points; and determine a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0227] Based on the same inventive concept as above, as in Fig. 11, an embodiment of the present disclosure further provides a method for determining handwriting contours, and the specific implementation flow of the method includes the following steps 1100 to 1103.
[0228] In step 1100, acquiring track point information from track points in a user's writing track.
[0229] In step 1101, determining a writing speed corresponding to the track points, a writing pressure corresponding to the track points, and coordinates of the track points according to the track point information of the track points.
[0230] In step 1102, determining line widths corresponding to the track points according to the writing speed corresponding to the track points and the writing pressure corresponding to the track points.
[0231] In step 1103, determining a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0232] Based on the same inventive concept as above, an embodiment of the present disclosure further provides a handwriting display device, and specific implementation steps of the device may refer to the display device described above, and repeated parts will not be described again.
[0233] As in Fig. 12, the apparatus includes: a trace acquisition unit 1200 configured to acquire trace point information from trace points in a user's writing trace; a contour determination unit 1201 configured to determine a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke including a stroke contour; a partial filling unit 1202 configured to divide the stroke contour into K sub-contours and select a part of the sub-contours from the K sub-contours to perform pixel filling on the part of the sub-contours, wherein an extension direction in which the stroke contour extends is the same as an extension direction in which the sub-contours extend, and K is an integer greater than 1; and a stroke display unit 1203 configured to control a display screen to display the stroke.
[0234] Based on the same inventive concept as above, an embodiment of the present disclosure further provides an apparatus for determining handwriting contours. As in Fig.13, the apparatus includes: a trace acquisition unit 1300 configured to acquire trace point information from trace points in a user's writing trace; an information determination unit 1301 configured to determine a writing speed, a writing pressure corresponding to the trace points, and coordinates of the trace points according to the trace point information of the trace points; a line width determination unit 1302 configured to determine line widths corresponding to the trace points according to the writing speed and the writing pressure corresponding to the trace point; and a contour determination unit 1303 configured to determine a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points.
[0235] Based on the same inventive concept as above, one embodiment of the present disclosure provides a computer-readable storage medium storing computer program codes, wherein the computer program codes, when executed by a computer, cause the computer to perform either the handwriting display method or the handwriting contour determination method, as discussed above. Since the principle of solving the problem of the computer-readable storage medium is similar to that of the handwriting display method or the handwriting contour determination method, the implementation of the computer-readable storage medium may refer to the implementation of the method, and repeated parts will not be described again.
[0236] In particular embodiments, the computer-readable storage medium may comprise a Universal Serial Bus Flash Drive (USB), a removable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other storage medium capable of storing program code.
[0237] Based on the same inventive concept as above, an embodiment of the present disclosure further provides a computer program product comprising computer program codes, wherein the computer program codes, when executed by a computer, cause the computer to perform either the handwriting display method or the handwriting contour determination method, as discussed above. Since the problem-solving principle of the computer program product is similar to the handwriting display method or the handwriting contour determination method, the implementation of the computer program product may refer to the implementation of the method, and repeated parts will not be described again.
[0238] The computer program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing.More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0239] As will be appreciated by those skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a pure hardware implementation, a pure software implementation, or an implementation combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
[0240] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present disclosure. It is understood that each flow and / or block of the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams, may be implemented by computer program instructions.These computer program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine instruction such that the instructions, executing via the processor of the computer or other programmable data processing device, provide a means for implementing the functions specified in a flow or flows in the flowchart and / or in a block or blocks in the block diagram.
[0241] These computer program instructions may also be stored in a computer-readable memory that can instruct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture that includes an instruction device that implements the function specified in a flow or flows in the flowchart and / or a block or blocks in the block diagram.
[0242] These computer program instructions may also be loaded onto a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, such that the instructions executing on the computer or other programmable device provide steps for implementing the functions specified in a flow or flows in the flowchart and / or a block or blocks in the block diagram.
[0243] It will be apparent to those skilled in the art that various changes and variations may be made to the present disclosure without departing from the spirit and scope of the present disclosure. Therefore, if such changes and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to encompass such changes and variations.
Claims
[1] A display device comprising a display screen and a controller, wherein the display screen is configured to display content; and the controller is configured to: Captures trace point information from trace points in a user's writing trace; determines a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour; divides the stroke contour into K subcontours and selects a part of the subcontours from the K subcontours to perform pixel filling on the part of the subcontours, wherein an extension direction in which the stroke contour extends is the same as an extension direction in which the subcontours extend, and K is an integer greater than 1; and controls the display screen to show the stroke. [2] Device according to claim 1, wherein between at least two sub-contours on which a pixel fill is to be performed, there is at least one sub-contour on which no pixel fill is to be performed. [3] The apparatus of claim 1, wherein the controller is configured to: randomly selects a portion of the subcontours from the K subcontours to perform the pixel filling on the portion of the subcontours; or selects a part of the subcontours from the K subcontours to randomly perform the pixel filling on the part of the subcontours. [4] The apparatus of claim 1, wherein the controller is configured to: selects a part of the subcontours from the K subcontours to perform pixel filling on the part of the subcontours according to generated K random numbers and a corresponding relationship between the random numbers and the subcontours. [5] The apparatus of claim 4, wherein the controller is configured to: calculates a product value from an average of the K random numbers and a semi-dry stroke parameter, where the semi-dry stroke parameter is configured to control a total number of sub-contours on which the pixel fill is to be performed; in response to any random number being greater than the product value, determines that the pixel fill is performed on the subcontour corresponding to the random number; and in response to any random number being less than or equal to the product value, determines that no pixel fill is performed on the subcontour corresponding to the random number. [6] The device according to claim 5, wherein the parameter for the semi-dry stroke is determined as a function of a writing speed, wherein the parameter for the semi-dry stroke is increased with an increase in the writing speed; and / or the parameter for the semi-dry stroke is determined as a function of a writing pressure, and the parameter for the semi-dry stroke is increased with a reduction in the writing pressure. [7] The apparatus of claim 1, wherein the controller is configured to: performs pixel filling on the selected part of the subcontours in different filling methods. [8] The apparatus of claim 7, wherein the controller is configured to: performs pixel filling on the selected part of the subcontours alternately in different filling methods. [9] The apparatus of claim 7, wherein the controller is configured to: to perform the pixel filling on the selected part of the subcontours alternately in a first filling method and a second filling method. [10] The apparatus of claim 7, wherein the controller is further configured to: consecutive subcontours in the selected part of the subcontours are divided into a contour group in order to perform the pixel filling on the subcontours in the contour group at once in a similar filling manner. [11] The apparatus of claim 10, wherein the controller is configured to: randomly selects a fill style from various fill styles to perform the pixel filling on the sub-contours in the contour group at once in the fill style. [12] The apparatus of claim 11, wherein the controller is configured to: randomly selects a fill style from a plurality of fill styles with equal probability to perform the pixel filling on the sub-contours in the contour group at once in the fill style; or randomly selects a fill mode from a plurality of fill modes with different probabilities to perform the pixel filling on the sub-contours in the contour group at once in the fill mode, wherein the fill modes are in one-to-one correspondence with the probabilities. [13] The apparatus of claim 1, wherein the controller is configured to determine the stroke contour of the stroke corresponding to the trace points by: Coordinate information of the track points is fitted to obtain a fit curve; a plurality of fit trace points are selected from the fit curve, wherein the plurality of fit trace points comprise at least three first fit trace points corresponding to the trace points; a stroke contour of the plurality of fit trace points is determined depending on coordinate information of the fit trace points and a writing speed and a writing pressure at the trace points corresponding to the first fit trace points; and the stroke contour of the plurality of fit trace points is used as the stroke contour corresponding to the trace points. [14] The apparatus of claim 13, wherein the controller is configured to, depending on the coordinate information of the plurality of fit track points and the writing speed and the writing pressure at the track points corresponding to the first fit track points: a position of the stroke contour is determined according to the coordinate information of the plurality of fit trace points; and a width of the line contour is determined according to the writing speed and the writing pressure at the track points corresponding to the first fit track points. [15] The apparatus of claim 14, wherein the controller is configured to: determines a line width at a first fit track point according to a preset maximum line width, a preset minimum line width, a preset weighting factor, and the writing speed and the writing pressure at the track point corresponding to the first fit track point, wherein the preset weighting factor indicates a sensitivity parameter of a response adjustment of the line width for various factors; Line widths at the fit trace points are determined based on an interpolation operation according to line widths at at least three first fit trace points; and the width of the stroke contour is determined according to the line widths at the fit trace points. [16] The apparatus of claim 15, wherein after determining the line widths at the fit track points based on the interpolation operation according to the line widths at at least three first fit track points, the controller is further configured to: smoothes the line widths at the fit trace points according to first line widths of historical fit trace points corresponding to historical trace points of the trace points to obtain smoothed line widths at the fit trace points, wherein the historical trace points of the trace points are a plurality of trace points consecutively received before receiving the trace points, and the historical fit trace points corresponding to the historical trace points are coordinate points on a fit curve obtained by fitting the historical trace points. [17] The apparatus of claim 16, wherein the controller is configured to: the smoothed line widths at the fit trace points are determined according to the first line widths at the historical fit trace points, the line widths at the fit trace points and a preset number of historical fit trace points. [18] Apparatus according to any one of claims 1 to 17, wherein the controller is configured to: consecutive subcontours in the selected part of the subcontours are divided into a contour group in order to perform the pixel filling on the subcontours in the contour group at once in a similar filling manner. [19] Device according to one of claims 1 to 17, wherein, in the selected part of the subcontours, the total number of subcontours on which the pixel filling is to be performed consecutively is less than a numerical threshold; or in the selected part of the subcontours, a total number of subcontours on which the pixel filling is to be carried out consecutively in a same filling manner is less than a numerical threshold. [20] The apparatus according to any one of claims 1 to 17, wherein a ratio of a total width of the sub-contours on which pixel filling is to be performed to a width of the stroke contour is reduced with an increase in the writing speed at the track points; or a ratio of a total width of the sub-contours on which pixel filling is not to be performed to the width of the stroke contour is increased with an increase in the writing speed at the track points. [21] The apparatus according to any one of claims 1 to 17, wherein a ratio of a total width of the sub-contours on which pixel filling is to be performed to a width of the line contour is increased with an increase in the writing pressure at the track points; or a ratio of a total width of the sub-contours on which pixel filling is not to be performed to the width of the line contour is decreased with the increase in the writing pressure at the track points. [22] The apparatus according to any one of claims 1 to 17, wherein a total number of sub-contours on which pixel filling is to be performed is decreased with an increase in the writing speed at the track points; or a total number of sub-contours on which pixel filling is not to be performed is increased with the increase in the writing speed at the track points. [23] The apparatus according to any one of claims 1 to 17, wherein a total number of sub-contours on which pixel filling is to be performed is increased with an increase in the writing pressure at the track points; or a total number of sub-contours on which pixel filling is not to be performed is decreased with the increase in the writing pressure at the track points. [24] Apparatus according to any one of claims 1 to 17, wherein a density of the pixel fill in the line contour is reduced with an increase in the writing speed at the track points; or a density without pixel filling in the stroke contour is increased with the increase of the writing speed at the track points; where the density of the pixel fill indicates a ratio of a total number of subcontours to be filled to K. [25] Device according to one of claims 1 to 17, wherein a density of the pixel filling in the line contour is increased with an increase in the writing pressure at the track points; or a density without pixel filling in the line contour is reduced with increasing writing pressure at the track points; where the density of the pixel fill indicates a ratio of a total number of subcontours to be filled to K. [26] The apparatus of any one of claims 1 to 17, wherein, in response to a filling manner of the sub-contour comprising a scatter fill, a probability corresponding to the scatter fill is configured to control a total number of the sub-contour to be filled by the scatter fill; and the probability corresponding to the scatter filling is increased with an increase in the writing speed at the track points; and / or the probability corresponding to the scatter filling is reduced with increasing writing pressure at the track points. [27] Apparatus according to any one of claims 1 to 17, wherein in response to a filling method of the sub-contour comprising a scattering fill, a scattering density corresponding to the scattering filling is reduced with an increase in the writing speed at the track points; and / or the scattering density corresponding to the scattering filling is increased with the increase of the writing pressure at the track points. [28] Apparatus according to any one of claims 1 to 17, wherein in response to the stroke being a left-falling stroke, the further a position of the sub-contour in the stroke contour is to the left, the lower the probability of performing a pixel fill on the sub-contour; or The further the position of the sub-contour in the stroke contour is to the right, the greater the probability of performing a pixel fill on the sub-contour. [29] Apparatus according to any one of claims 1 to 17, wherein in response to a fill type of the sub-contour being a scatter fill and the stroke being a left-falling stroke, the further a position of the sub-contour in the line contour is to the left, the lower the scattering density of the scatter filling performed on the sub-contour; or, The further the position of the sub-contour in the line contour is to the right, the greater the scattering density of the scatter filling performed on the sub-contour. [30] Apparatus according to any one of claims 1 to 17, wherein in response to the stroke being a right-falling stroke, the further a position of the sub-contour in the stroke contour is to the right, the probability of performing a pixel fill on the sub-contour is lower; or The further the position of the sub-contour in the stroke contour is to the left, the greater the probability of performing a fill on the sub-contour. [31] Apparatus according to any one of claims 1 to 17, wherein in response to a fill type of the sub-contour being a scatter fill and the stroke being a right-falling stroke, the further a position of the sub-contour in the line contour is to the right, the lower the scattering density of the scatter filling carried out on the sub-contour; or The further the position of the sub-contour in the line contour is to the left, the greater the scattering density of the scatter filling performed on the sub-contour. [32] The apparatus of any one of claims 1 to 17, wherein the controller is configured to subdivide the stroke contour into the K subcontours in response to a writing speed at the track points being greater than a speed threshold and / or a writing pressure at the track points being less than a pressure threshold. [33] The apparatus of any one of claims 1 to 17, wherein the controller is further configured to adjust a position of the sub-contour on which the pixel fill is to be performed in response to a total number of the detected track points exceeding a preset threshold for the number of track points. [34] The apparatus of claim 33, wherein the controller is configured to adjust positions of a preset number of subcontours at an edge of the stroke contour in the subcontours on which the pixel fill is to be performed. [35] A display device comprising a display screen and a controller, wherein: the display screen is configured to display content; and the controller is configured to: Captures trace point information from trace points in a user's writing trace; a writing speed, a writing pressure corresponding to the track points, and coordinates of the track points are determined according to the track point information of the track points; Line widths corresponding to the track points are determined according to the writing speed and writing pressure corresponding to the track points; and a stroke contour corresponding to the trace points is determined according to the line widths corresponding to the trace points and the coordinates of the trace points. [36] A handwriting display method comprising: Capturing trace point information from trace points in a user's writing trace; Determining a stroke corresponding to the trace points according to the trace point information of the trace points, the stroke comprising a stroke contour; Dividing the stroke contour into K subcontours and selecting a part of the subcontours from the K subcontours to perform a pixel fill on the part of the subcontours, wherein an extension direction in which the stroke contour extends is the same as an extension direction in which the subcontours extend, and K is an integer greater than 1; and Controlling a display screen to show the stroke. [37] A method for determining handwriting contours, comprising: Capturing trace point information from trace points in a user's writing trace; Determining a writing speed, a writing pressure corresponding to the track points, and coordinates of the track points according to the track point information of the track points; Determining line widths corresponding to the track points according to the writing speed and writing pressure corresponding to the track points; and Determine a stroke contour corresponding to the trace points according to the line widths corresponding to the trace points and the coordinates of the trace points. [38] A computer-readable storage medium having stored thereon a computer program, the computer program being executed by a processor causing the processor to perform steps of the method of claim 36 or 37.