Method for automatically rolling electronic ink during handwriting input
Technical Field
The invention belongs to the technical field of handwriting input, relates to an input method, and particularly relates to a method for automatically rolling electronic ink during handwriting input.
Background
In recent years, handwritten character input has been widely used as an important character input method for mobile devices such as mobile phones with touch screens. In daily life, people often use to continuously write down a line of characters from left to right, but on mobile equipment, due to the limitation of the size of a touch screen, when handwriting input is carried out, people need to repeatedly and overlappingly write down characters originally connected from left to right in a designated area (an area limited by a rectangular frame in the touch screen or the whole touch screen). In this way, different characters are generally distinguished by a certain time delay, or after a user finishes writing a character, the user pauses for a certain time and starts writing the next character, so that the system can distinguish strokes of the front character and the rear character. Another way to distinguish the strokes of the preceding and following two words is to provide two or more handwriting areas in the touch screen, writing different words in different areas. Either way is not in accordance with the habit of people to write continuously from left to right in daily use.
Here, the "stroke" means a track that the stylus has moved on the touch screen from the time when the user touches the touch screen with the stylus until the stylus is out of contact with the touch screen. A stroke may represent a word, a portion of a word, or multiple words written in a single stroke. Fig. 1 shows an example in which one stroke represents one character, fig. 2 shows an example in which one stroke represents one character, and fig. 2(a) to (d) show the process in which the recognition engine finally recognizes a character as a result of one-to-one input of a plurality of strokes of the character. As FIG. 3 illustrates an example of multiple characters with strokes representing a continuous stroke, the recognition engine will automatically perform segmentation and recognition of the characters.
To solve this problem, US6661509B2, "automatic handwriting having a hand-held user interface for personal digital assistants and the like" proposes a method for allowing a designated handwriting area in a touch screen to move continuously to the left along with the movement of a user's writing stroke when the user writes, and to bring the user's writing stroke to move continuously to the left like an automatic transmission belt moving to the left, thereby providing a continuous writing space for the user in a writing area with a limited size. This method of continuously moving strokes tends to create several problems: 1. when the user stops writing, if the pen is not lifted up, and the stroke continues to move, an unsightly drag mark is generated; 2. when a user lifts a pen to want a question, the stroke moves until the question disappears, and the user is inconvenient to continue to modify the previous stroke; 3. although the strokes written by the user are automatically moved to the left as they are placed on the automatic conveyor belt, when the user finishes writing the strokes representing one or more characters and then starts writing the next stroke representing one or more characters, the next stroke must be written to the right of the previous stroke in order to distinguish between strokes of different characters, as highlighted in US6661509B2, and two different words before and after the interval must be distinguished by a specific vertical line, a space represented at a certain distance, or a specific symbol. In either way, inconvenience is brought to the writing process of the user.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: the method for automatically rolling the electronic ink during the handwriting input is provided, so that the user can input conveniently, and the input efficiency is improved.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method for automatically scrolling electronic ink during handwriting input, said method comprising the steps of:
step 110, inputting strokes on a touch screen through a handwriting input unit;
step 120, the handwriting input unit moves on the touch screen, and records and displays a moving track, namely electronic ink, in a handwriting area on the touch screen; meanwhile, the moving track of the handwriting input unit automatically moves to the first direction so as to provide space for the user to continuously write;
step 130, the handwriting input unit leaves the touch screen, and the input of the current stroke is finished;
step 140, continuing to scroll the electronic ink, and gradually slowing down when the electronic ink is scrolled to be close to the edge of the screen, so that the electronic ink still occupies the set width of the screen after staying, but does not disappear from the screen, and a user can conveniently continue to modify the previously written strokes;
step 150, judging whether the electronic ink has moved out of the predetermined area; if the answer is yes, go to step 170 to stop scrolling; if the answer is no, go to step 160;
step 160, judging whether the handwriting input unit contacts the touch screen; if yes, go to step 110 to input the next stroke; if the answer is no, go to step 140 to continue scrolling until the scrolling speed is 0 and stop scrolling;
and step 170, ending.
As a preferable scheme of the present invention, the movement track of the handwriting input unit automatically moves to the left;
in the step 120, the electronic ink is scrolled in a manner that if the abscissa of the rightmost point of the electronic ink exceeds a preset threshold, the electronic ink starts to scroll, otherwise, the electronic ink does not scroll; in addition, when rolling, the rolling speed is different according to different writing directions of the handwriting input unit, the rolling speed is slow when the handwriting input unit is written to the left, the rolling speed is fast when the handwriting input unit is written to the right, and the slow speed is adopted when the handwriting input unit is written in the vertical direction; the scrolling speed S of the electronic ink is calculated according to the following formula:
<math><mrow><mi>S</mi><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>T</mi><mo>,</mo><mo>|</mo><mi>Vx</mi><mo>|</mo><mo>×</mo><mi>α</mi><mo>+</mo><mo>|</mo><mi>Vy</mi><mo>|</mo><mo>×</mo><mi>ω</mi><mo>)</mo></mrow></mtd><mtd><mrow><mo>(</mo><mi>Vx</mi><mo><</mo><mn>0</mn><mo>,</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>T</mi><mo>,</mo><mo>|</mo><mi>Vx</mi><mo>|</mo><mo>×</mo><mi>β</mi><mo>+</mo><mo>|</mo><mi>Vy</mi><mo>|</mo><mo>×</mo><mi>ω</mi><mo>)</mo></mrow></mtd><mtd><mrow><mo>(</mo><mi>Vx</mi><mo>≥</mo><mn>0</mn><mo>,</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr></mtable></mfenced></mrow></math>
wherein, Tα, β, ω, K are set constants, Vx and Vy are components of writing speed in horizontal and vertical directions, respectively, PmaxThe abscissa of the rightmost point of the electronic ink.
In a preferred embodiment of the present invention, in the step 120, the moving speed in the first direction is uniform at a predetermined speed, or the moving speed is adaptive with reference to a moving speed of the handwriting input unit of the user.
In a preferred embodiment of the present invention, in the step 140, the electronic ink rolling speed S is calculated according to the following formula:
<math><mrow><mi>S</mi><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mi>min</mi><mrow><mo>(</mo><msup><mi>T</mi><mo>′</mo></msup><mo>,</mo><mrow><mo>(</mo><mi>t</mi><mo>-</mo><msub><mi>t</mi><mi>up</mi></msub><mo>)</mo></mrow><mo>×</mo><mi>μ</mi><mo>)</mo></mrow><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>+</mo><mi>σ</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>min</mi><mrow><mo>(</mo><msup><mi>T</mi><mo>′</mo></msup><mo>,</mo><mrow><mo>(</mo><mi>t</mi><mo>-</mo><msub><mi>t</mi><mi>up</mi></msub><mo>)</mo></mrow><mo>×</mo><mi>μ</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>-</mo><mi>K</mi><mo>)</mo></mrow><mo>×</mo><mi>τ</mi><mo>)</mo></mrow><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>∩</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>+</mo><mi>σ</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mn>0</mn><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr></mtable></mfenced></mrow></math>
where t is the current time, tupFor the time of pen-up, T', mu, sigma, tau, K are all set constants, PmaxThe abscissa of the rightmost point of the electronic ink.
As a preferable scheme of the present invention, the movement track of the handwriting input unit automatically moves to the left; or, the moving track of the handwriting input unit automatically moves to the right; or the moving track of the handwriting input unit automatically moves upwards; or, the moving track of the handwriting input unit automatically moves downwards.
As a preferred embodiment of the present invention, the step 140 is: and continuously rolling the electronic ink to ensure that the rolling speed of the electronic ink gradually becomes faster, and the electronic ink gradually becomes slower when the electronic ink is rolled to be close to the edge of the screen, so that the electronic ink still occupies the set width of the screen after staying, but does not disappear from the screen, and a user can continuously modify the previously written strokes.
As a preferred scheme of the invention, the method comprises a handwriting moving direction selecting step, and the moving direction of the input handwriting is selected through a handwriting moving direction selecting module.
The invention has the beneficial effects that: the method for automatically rolling the electronic ink during the handwriting input enables the written electronic ink to automatically move to the left along with the writing of the user as if the electronic ink is placed on an automatic transmission belt when the user continuously writes on the touch screen by using a handwriting pen or fingers, thereby continuously providing a space for the user to write with a continuous pen in a limited writing area. Compared with the traditional rolling method, the method can provide better writing experience and a more natural writing mode for the user.
Meanwhile, when the user writes strokes, the speed of the leftward rolling of the strokes depends on the writing direction of the strokes, if the user writes to the left, the rolling is slowed, and the moving distance is shorter when the user writes to the left strokes; writing to the right then rolls faster, which is to quickly make more space for the user, since strokes to the right will quickly reduce the writing space; when writing in the vertical direction, the scrolling speed is reduced, so that the vertical line written by a user cannot be too inclined due to the scrolling; after the user finishes writing the current stroke and lifts up, the stroke rolls to the left from slow to fast, and space is made for writing the next character.
Additionally, scrolling is stopped whenever the abscissa of the rightmost point of electronic ink is less than a threshold, thus providing the user with an opportunity to modify the stroke and contextual information for the underlying writing.
Drawings
FIG. 1 is a diagram of a stroke representing a character.
FIG. 2 is a diagram of a plurality of strokes representing a word; fig. 2(a) to (d) illustrate a process in which a recognition engine finally recognizes a character as a plurality of strokes of the character are input one by one.
FIG. 3 is a diagram of a plurality of characters written with one stroke representing a continuous stroke.
FIG. 4 is a flow chart of the method of the present invention.
Fig. 5(a) and 5(b) are schematic diagrams illustrating a process of moving the stylus on the touch screen and moving the writing trace.
Detailed Description
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Example one
Referring to fig. 4, the present invention discloses a method for automatically scrolling electronic ink during handwriting input, the method comprising the following steps:
inputting strokes on the touch screen through a handwriting input unit (step 110); the handwriting input unit may be a stylus, a finger, or the like.
Step 120, the handwriting input unit moves on the touch screen, records and displays a moving track, namely electronic ink, in a handwriting area on the touch screen; meanwhile, the moving track of the handwriting input unit automatically moves to the first direction so as to provide space for the user to continuously write; such as automatically moving to the left to provide room for the user to write to the right. The moving track of the stylus is automatically moved to the left as if it is placed on the automatic conveyor belt to provide a space for the user to write to the right. The moving speed to the left side can be constant according to a preset speed, or can be self-adaptive according to the moving speed of the user stylus.
As a preferable scheme, the electronic ink is scrolled in a manner that if the abscissa of the rightmost point of the electronic ink exceeds a preset threshold, the electronic ink starts to scroll, otherwise, the electronic ink does not scroll; in addition, when the handwriting pen is rolled, the rolling speed is different according to different writing directions of the handwriting pen, the rolling speed is slow when the handwriting pen is used for writing left, the rolling speed is fast when the handwriting pen is used for writing right, and the rolling speed is slow when the handwriting pen is used for writing in the vertical direction. The scrolling speed S of the electronic ink may be calculated as follows:
<math><mrow><mi>S</mi><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>T</mi><mo>,</mo><mo>|</mo><mi>Vx</mi><mo>|</mo><mo>×</mo><mi>α</mi><mo>+</mo><mo>|</mo><mi>Vy</mi><mo>|</mo><mo>×</mo><mi>ω</mi><mo>)</mo></mrow></mtd><mtd><mrow><mo>(</mo><mi>Vx</mi><mo><</mo><mn>0</mn><mo>,</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>T</mi><mo>,</mo><mo>|</mo><mi>Vx</mi><mo>|</mo><mo>×</mo><mi>β</mi><mo>+</mo><mo>|</mo><mi>Vy</mi><mo>|</mo><mo>×</mo><mi>ω</mi><mo>)</mo></mrow></mtd><mtd><mrow><mo>(</mo><mi>Vx</mi><mo>≥</mo><mn>0</mn><mo>,</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr></mtable></mfenced></mrow></math>
t, α, β, ω, and K are all preset constants, and may be set as needed, and if T is 0.25 cm/sec, α, β, and ω are all set coefficients. Vx and Vy are the horizontal and vertical components of writing speed, PmaxIs the abscissa of the rightmost point of the electronic ink, and K is a set threshold value PmaxMove when > K. Wherein, T represents the moving speed of the handwriting under the general condition, but if the user inputs too fast, for example, the speed | Vx | × α + | Vy | × ω ≧ T input to the left, then S ═ T is taken; otherwise, take S ═ Vx | × α + | Vy | × ω.
An example of the process of the stylus moving on the touch screen and the writing trace moving is shown in fig. 5. Fig. 5(a) shows the user starting writing, and fig. 5(b) shows that the already written stroke automatically moves to the left as the user writes.
The handwriting input unit leaves the touch screen, and the input of the current stroke is finished [ step 130 ].
Continuing to scroll the electronic ink, at this point, the electronic ink may be scrolled at a constant speed, or may start with a gradually increasing scrolling speed, or may be irregular in speed. When the user scrolls to the position close to the edge of the screen, the speed is gradually reduced, so that the electronic ink still occupies the set width of the screen after staying, but does not disappear from the screen, and the user can conveniently continue to modify the previously written strokes.
The electronic ink scrolling speed S may now be calculated according to the following formula:
<math><mrow><mi>S</mi><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mi>min</mi><mrow><mo>(</mo><msup><mi>T</mi><mo>′</mo></msup><mo>,</mo><mrow><mo>(</mo><mi>t</mi><mo>-</mo><msub><mi>t</mi><mi>up</mi></msub><mo>)</mo></mrow><mo>×</mo><mi>μ</mi><mo>)</mo></mrow><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>+</mo><mi>σ</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mi>min</mi><mrow><mo>(</mo><mi>min</mi><mrow><mo>(</mo><msup><mi>T</mi><mo>′</mo></msup><mo>,</mo><mrow><mo>(</mo><mi>t</mi><mo>-</mo><msub><mi>t</mi><mi>up</mi></msub><mo>)</mo></mrow><mo>×</mo><mi>μ</mi><mo>)</mo></mrow><mo>,</mo><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>-</mo><mi>K</mi><mo>)</mo></mrow><mo>×</mo><mi>τ</mi><mo>)</mo></mrow><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>></mo><mi>K</mi><mo>∩</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>+</mo><mi>σ</mi><mo>)</mo></mrow></mtd></mtr><mtr><mtd><mn>0</mn><mo>,</mo></mtd><mtd><mrow><mo>(</mo><msub><mi>P</mi><mi>max</mi></msub><mo>≤</mo><mi>K</mi><mo>)</mo></mrow></mtd></mtr></mtable></mfenced></mrow></math>
where t is the current time, tupThe time for lifting the pen, T', mu, sigma, tau, K are all preset constants which can be set according to requirements, PmaxThe abscissa of the rightmost point of the electronic ink.
Step 150, judging whether the electronic ink is moved out of the predetermined area; if the answer is yes, go to step 170 to stop scrolling; if the answer is no, go to step 160;
step 160, judging whether the handwriting input unit contacts the touch screen; if yes, go to step 110 to input the next stroke; if the answer is no, go to step 140 to continue scrolling until the scrolling speed is 0 and stop scrolling;
step 170 is ended.
In summary, the method for automatically scrolling electronic ink in handwriting input provided by the invention enables the written electronic ink to automatically move to the left along with the writing of the user as if the electronic ink is placed on an automatic transmission belt when the user continuously writes on the touch screen by using a stylus or a finger, thereby continuously providing the user with a space for continuous writing in a limited writing area. Compared with the traditional rolling method, the method can provide better writing experience and a more natural writing mode for the user.
Meanwhile, when the user writes strokes, the speed of the leftward rolling of the strokes depends on the writing direction of the strokes, if the user writes to the left, the rolling is slowed, and the moving distance is shorter when the user writes to the left strokes; writing to the right then rolls faster, which is to quickly make more space for the user, since strokes to the right will quickly reduce the writing space; when writing in the vertical direction, the scrolling speed is reduced, so that the vertical line written by a user cannot be too inclined due to the scrolling; after the user finishes writing the current stroke and lifts up, the stroke rolls to the left from slow to fast, and space is made for writing the next character.
Additionally, scrolling is stopped whenever the abscissa of the rightmost point of electronic ink is less than a threshold, thus providing the user with an opportunity to modify the stroke and contextual information for the underlying writing.
Example two
In the first embodiment, the moving track of the handwriting input unit automatically moves to the left so as to provide a space for the user to write to the right. In this embodiment, the movement trajectory of the handwriting input unit automatically moves to the right, thereby providing a space for the user to write to the left. Or, the moving track of the handwriting input unit automatically moves upwards to provide a space for the user to write. Alternatively, the movement trace of the handwriting input unit automatically moves downward to provide a space for the user to write.
EXAMPLE III
The method of the invention can also comprise: and a handwriting moving direction selecting step, namely selecting the moving direction of the input handwriting through a handwriting moving direction selecting module, so that the user can select the handwriting conveniently.
The description and applications of the invention herein are illustrative and are not intended to limit the scope of the invention to the embodiments described above. Variations and modifications of the embodiments disclosed herein are possible, and alternative and equivalent various components of the embodiments will be apparent to those skilled in the art. It will be clear to those skilled in the art that the present invention may be embodied in other forms, structures, arrangements, proportions, and with other components, materials, and parts, without departing from the spirit or essential characteristics thereof. Other variations and modifications of the embodiments disclosed herein may be made without departing from the scope and spirit of the invention.