The content of the invention
In view of this, it is an object of the invention to propose a kind of smart pen and its stroke recognition processing method.The smart pen
Using special person's handwriting identifying processing method, standard figure attractive in appearance can be easily drawn out.
The stroke information identifying processing method provided based on the above-mentioned purpose present invention, is receiving the stroke letter of user's input
During breath, whether be one stroke, in the case where being judged as NO if judging stroke, performs following step:
Each stroke segmentation is obtained to the paragraph of stroke;Judge in all paragraphs to be at least other paragraphs with the presence or absence of length
Twice of advantage paragraph;If so, then entering next step;Judge all non-advantage paragraphs parameter whether setting arrow threshold
In the range of value parameter, if so, then entering next step;Whether be approximately line segment, if so, then entering next step if judging advantage paragraph
Suddenly;Advantage paragraph is fitted to a line segment;If judging to be judged as in the step of whether advantage paragraph is approximately line segment above-mentioned
Whether no, then it is approximately camber line to determine whether advantage paragraph;If so, then entering next step;Advantage paragraph is fitted to one
Bar camber line;It is above-mentioned advantage paragraph is fitted to a line segment or advantage paragraph is fitted to a camber line the step of after the completion of,
Non-advantage paragraph is fitted to arrowhead, is connected with advantage paragraph end points nearby.
Optionally, each stroke segmentation is being obtained to the paragraph of stroke, according to key point and stroke information discontinuous point to pen
Draw and be segmented, the key point search procedure comprises the following steps:
Two end points of one stroke section are subjected to line;It is described if being performed to a stroke and searching key point first
Stroke section refers to stroke;If non-to a stroke end execution search key point first, the stroke section refers to obtained by last search
The primary paragraph arrived;Calculate the distance for removing remaining point beyond two-end-point to above-mentioned line;Judge whether to exceed paragraph
The point of distance threshold;If so, then entering next step;Find out the maximum point of distance, and using the point as this section of stroke key
Point;At above-mentioned key point, stroke section is further divided into the primary paragraph of two parts;Using primary paragraph as new stroke section,
Return to the step of two end points of a stroke section are subjected to line;If in the step for judging whether the point more than paragraph threshold value
In rapid, it is judged as NO, then regard current stroke section as paragraph.
Optionally, judge in the step of whether advantage paragraph is approximately line segment, be by the linearity judgement of advantage paragraph
No is approximately line segment;If the linearity judges that advantage paragraph can be fitted to line in the line segment linearity threshold range of setting
Section;The linearity can be by calculating ultimate range D and bout length L of remaining point with end points line in addition to end points is crossed
Ratio be worth to.
Optionally, the bout length for paragraph end points line length or will be superimposed what is calculated on paragraph a little
Length.
Optionally, in the step of advantage paragraph is fitted into a line segment, by generating a connection advantage paragraph two
The line segment of individual end points completes line segment fitting.
Optionally, whether judge advantage paragraph as follows is approximately camber line:
Choose m point at equal intervals on advantage paragraph;m≥5;For 0≤i≤m, judge whether
Constant x0、y0, θ, a, b so thatFor minimum, if so, then entering next step;Whereinxi、yiRespectively above-mentioned m
The coordinate of individual point;A and b ratio is judged whether in the circular radius ratio threshold range of setting, if then judging advantage paragraph
It is approximately circular arc line;If it is not, then judging that advantage paragraph is approximately oval camber line.
Optionally, the step of advantage paragraph being fitted into a camber line further comprises following steps:
By advantage paragraph end points line;The length in judgement advantage paragraph envelope region line direction described in previous step
Whether the length of above-mentioned line is less than, if so, the advantage paragraph then is fitted into a minor arc;If it is not, then by the advantage paragraph
It is fitted to a major arc.
Optionally, if judging, advantage paragraph, for oval camber line, is fitted to an oval minor arc, this is ellipse by the advantage paragraph
One of the abscissa or ordinate of circle minor arc end points are identical with the abscissa or ordinate of corresponding advantage paragraph, and institute on camber line
Meet a littleIf judging the advantage
Paragraph is circular arc line, then calculates radius r according to a, b and setting rule, and advantage paragraph is fitted into a round minor arc, the circle
The minor arc center of circle is x0、y0, radius is r, one of its end points abscissa or ordinate and corresponding advantage paragraph end points abscissa or vertical
Coordinate is identical.
Optionally, judge that the step of parameter of all non-advantage paragraphs is whether in the range of the arrow threshold parameter of setting enters
One step comprises the following steps:
It whether there is one or two non-advantage paragraph in the setting range of judgement advantage paragraph end points;If in the presence of entering
Enter next step;The angle of non-advantage paragraph and advantage paragraph is judged whether in the range of given threshold, if so, then judging non-optimum
Gesture paragraph parameter is in the range of the arrow threshold parameter of setting.
Optionally, following steps are further comprised:
Judge whether that the paragraph of line segment can be fitted to comprising four altogether, if so, then entering next step;Judge each section
Fall the distance between terminal and adjacent paragraph starting point whether in the range of setting quadrangle adjacent side distance threshold, if so, then entering
Next step;Judge whether stroke is similar to rectangle by the angle of each paragraph, if so, then entering next step;By stroke
It is fitted to rectangle;If judging that stroke is not similar to rectangle by the angle of each paragraph in above-mentioned steps, pass through each section
Length between falling judges whether that by paragraph be approximately rhombus, if so, then entering next step;Stroke is fitted to rhombus.
Optionally, in the step of whether stroke is similar to rectangle is judged by the angle of each paragraph, following are passed through
Part judges that stroke is similar to rectangle:
In the presence of two paragraphs and x-axis angle in the range of setting rectangular horizontal angle threshold value, there are two paragraphs and pressed from both sides with y-axis
Angle is in the range of the vertical angle threshold value of rectangle of setting.
Optionally, the step of stroke being fitted into rectangle further comprises following steps:
Obtain the lenth ratio of first paragraph and remaining paragraph that input in chronological order;Judging the lenth ratio is
It is no in the range of the square length of side ratio of setting, if so, then enter next step;Stroke is fitted to square;It is described just
Square side is equal to the distance between described first paragraph end points parallel to x-axis or y-axis, the length of side;If sentencing in above-mentioned steps
The lenth ratio that breaks is in the range of the square length of side ratio not reset, then stroke to be fitted into rectangle;It is described rectangular
The long side of shape is equal to the distance between described first paragraph two-end-point, width or length parallel to x-axis or y-axis, length or width
Degree is equal to the distance between second paragraph two-end-point inputted in chronological order.
Optionally, by the length between each paragraph judge whether paragraph be approximately rhombus the step of in, with four
Paragraph in the range of the allowable error of setting whether it is equal for judge whether be approximately rhombus condition, if so, being then judged as water chestnut
Shape.
Optionally, in the step of four paragraphs being fitted into rhombus, the rhombus fitted will be inputted sequentially in time
First paragraph is used as a line.
Optionally, when receiving the stroke information of user's input, if judging, stroke, for one stroke, performs following steps
Suddenly:
Stroke segmentation is obtained to the paragraph of stroke;Whether be all approximately line segment, if so, then entering next if judging all paragraphs
Step;Stroke paragraph is fitted to line segment;Judge whether comprising four paragraphs, if so, then entering next step;According to four sections of plans
The angle of zygonema section judges whether that rectangle can be fitted to;If so, into next step;Four sections of matching line segments are further fitted to
Rectangle;If being judged as NO in the step of according to the angle of four sections of matching line segments judging whether that rectangle can be fitted to, further
Judge whether to be approximately rhombus according to the length of four sections of matching line segments;If so, then entering next step;Four sections of matching line segments are entered
One step is fitted to rhombus.
Optionally, if in the step of judging whether to include four paragraphs, being judged as NO, then determining whether stroke
Comprising three paragraphs, then following steps are performed:
Judge whether to be approximately triangle according to the distance between beginning and end;If so, then three paragraphs are fitted to
Triangle.
Optionally, following steps are further comprised:
Whether be approximately oval, if so, then entering next step if judging stroke;Obtain oval major axis, short axle, inclination angle
Degree, centre coordinate;Judge whether the ratio between major axis calculated in previous step, short axle compare threshold range in setting circular radius
It is interior;If so, then entering next step;Transverse, short axle, angle of inclination, centre coordinate, ellipse is fitted to by stroke if not;
Stroke can be fitted to circle by judgement;According to the major axis, minor axis length calculated, the circular radius to be fitted is calculated;Will
Stroke is fitted to circle;The radius that the circle is calculated using the centre coordinate as the center of circle, using previous step is radius.
Optionally, the step of obtaining oval major axis, short axle, angle of inclination, centre coordinate further comprises following steps:
Choose m point at equal intervals in stroke;For 0≤i≤m, judge whether often
Number x0、y0, θ, a, b so thatFor minimum, if so, then entering next step;Whereinxi、yiIt is respectively above-mentioned
The coordinate of m point;CalculateX when minimum0、y0, θ, a, b, by x0、y0Abscissa respectively as center,
Ordinate, θ is as angle of inclination, a, b respectively as oval major axis, short axle.
Optionally, following steps are further comprised:
Advantage paragraph is judged whether, if so, then entering next step;Whether judge advantage paragraph is approximately line segment,
If so, advantage paragraph then is fitted into straight line;If it is not, into next step;Whether judge advantage paragraph is approximately camber line, if
It is that advantage paragraph is then fitted to camber line;Advantage paragraph will be fitted to after straight line or camber line in above-mentioned steps, judges non-optimum
Whether the parameter of gesture paragraph is within the scope of the arrow threshold parameter of setting, if so, then entering next step;By non-advantage paragraph
It is fitted to the head of arrow;The arrowhead is connected with advantage paragraph matching line segment.
Optionally, non-advantage paragraph is fitted to arrowhead referred to and non-advantage paragraph is fitted to the arrowhead figure of setting
Shape.
Further, the present invention provides a kind of smart pen, and the stroke information provided using any one embodiment of the invention is known
Other processing method, processing is identified to the stroke information that user inputs.
From the above it can be seen that the stroke information identifying processing method that provides of the present invention, it can be applied to a variety of have
The electronic equipment of touch-screen, particularly electronic whiteboard, can be identified processing, and be fitted to the stroke of user's handwriting input
Geometric figure.The stroke recognition processing method of the embodiment of the present invention, can recognize the multistage stroke of user's handwriting input and single
Stroke, and the figure of user's freehand is changed into test pattern, a variety of occasions such as teaching, meeting are can apply to, with very
Strong practicality so that user just can draw out the figure of arbitrary size by arbitrary region on the touchscreen without instrument,
Call conveniently, using simple, meet the hand-written drafting custom of user, so as to be easy to user's grasp.In addition, the embodiment of the present invention is adopted
The arrow of the hand-written drafting of user is identified with effective method, also there is higher accuracy when being fitted other figures.
The smart pen that the present invention is provided, it is hand-written to user defeated using the stroke recognition processing method of any embodiment of the present invention
The stroke entered is identified, and a variety of electronic equipments with touch-screen is may be provided at, particularly in electronic whiteboard so that user is not
The geometric figure of standard can be just drawn out by instrument, meets the use habit of user, is called conveniently, it is easy to grasp, can answer
With with a variety of occasions such as teaching, meeting and with the higher degree of accuracy.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with specific embodiment, and reference
Accompanying drawing, the present invention is described in more detail.
When user inputs stroke information by hand-written input system to touch-screen, the smart pen pair of embodiments of the invention
Processing is identified in the stroke information of user's input, and the stroke of user is fitted into standard lines.
If user is once left after touch-screen, touch-screen is not contacted again within the time of setting, then judge this
Stroke end of input;And next according to the pen of the stroke recognition process flow figure identifying processing user input shown in Figure 1A
Draw, the flow comprises the following steps:
Step 1:Whether be one stroke, if it is not, then entering step 2 if judging stroke;If so, then entering step 16.Specifically,
If user inputs one stroke, then exist in input process and once start contact touch-screen and once leave touch-screen, i.e.,
The input of user is continuous input;If user inputs Multi strokes, then exist in input process and repeatedly start to contact touch-screen
And it is interruption input repeatedly to leave the input of touch-screen, i.e. user.In the present embodiment, can be according to the stroke information of input
Whether the no continuous stroke to judge user's input is one stroke.
Step 2:Each stroke segmentation is obtained to the paragraph of stroke.In certain embodiments, can be according to turning and stroke
Information discontinuous point is by stroke segmentation;In further embodiments, also it can such as be believed using other modes according to key point and stroke
Cease discontinuous point segmentation.
Step 3:Judge to whether there is advantage paragraph in all paragraphs;If so, then entering next step;If it is not, after
The step 10 of continuous description.In the present embodiment, advantage paragraph refers to that length is at least twice of paragraph of other all paragraphs.
Length herein can be the distance between value paragraph end points or according to the length for having a sum to calculate on paragraph
Degree.
Step 4:The parameter of all non-advantage paragraphs is judged whether in the range of the arrow threshold parameter of setting, if so, then
Into next step.
Step 5:Whether be approximately line segment, if so, then entering next step if judging advantage paragraph;If it is not, into step 7.
Specifically, can judge whether to be approximately line segment by the linearity of advantage paragraph, if the linearity is in the line segment linearity of setting
In threshold range, then judge that advantage paragraph can be fitted to line segment.Further, the linearity can be by calculating in addition to end points is crossed
Remaining point and the ultimate range D and bout length L of end points line ratio be worth to.
Step 6:Advantage paragraph is fitted to a line segment, into step 9., can be by generating a company in this step
The line segment for connecing two end points of advantage paragraph completes line segment fitting.
Step 7:Whether be approximately camber line, if so, then entering next step if judging advantage paragraph.
Step 8:Advantage paragraph is fitted to a camber line.
Step 9:Stroke is fitted to arrow.In this step, non-advantage paragraph is fitted to arrowhead, and nearby
Advantage paragraph end points is connected.In a particular embodiment, an arrowhead figure can be preset, so as in this step will
Non-advantage paragraph is fitted to the arrowhead figure of setting.In addition, in a particular embodiment, according to arrowhead set in advance
Specific figure, arrowhead tip can be overlapped, the two is turned into arrow with advantage paragraph end points nearby;Can also be by arrow
Head end is overlapped with advantage paragraph end points nearby, the two is turned into arrow.
By above-mentioned steps, arrow that can be by the handwriting input of user institute on touch panel device is identified.It is of the invention real
The stroke information identifying processing method of example is applied, after above-mentioned steps 2, if judging advantage paragraph is not present, can be carried out as follows
Step:
Step 10:Judge whether that the paragraph of line segment can be fitted to comprising four altogether, if so, then entering next step.Tool
Body, it can first judge whether to include four paragraphs, then judge whether the paragraph can be fitted to by the linearity of each paragraph
Straight line.In the present embodiment, the linearity can be by calculating ultimate range D of remaining point with end points line in addition to end points is crossed
It is worth to end points wire length L ratio.
Step 11:Judge the distance between each paragraph terminal and adjacent paragraph starting point whether setting quadrangle adjacent side away from
From in threshold range, if so, then entering next step.
Step 12:Judge whether stroke is similar to rectangle by the angle of each paragraph, if so, then entering next step;
If it is not, then entering step 14.Specifically, judging whether two paragraphs with x-axis angle in setting rectangular horizontal angle threshold value
In the range of, and judge whether two paragraphs with y-axis angle in the range of the vertical angle threshold value of rectangle of setting.
Step 13:Stroke is fitted to rectangle.
Step 14:Judge whether that by paragraph be approximately rhombus by the length between each paragraph, if so, then entering next
Step.Specifically, can with four paragraphs in the range of the allowable error of setting it is whether equal to judge whether to be approximately rhombus
Condition.
Step 15:Stroke is fitted to rhombus.In the present embodiment, first paragraph that can be inputted sequentially in time
Length and angle on the basis of, stroke is fitted to rhombus;That is, the rhombus that fits will be inputted sequentially in time
First paragraph is used as a line.
By said process, user in the stroke that touch screen hand-writing is inputted can be fitted to rectangle and rhombus.In some feelings
Under condition, the stroke of user's input is single stroke, i.e. stroke input process since user's contact touch-screen, to leaving touch-screen
Terminate, one stroke is judged as by step 1, in these cases, stroke information identification can be carried out by following processes and is judged.
In identifying processing one stroke, it can determine whether whether stroke can be fitted to the figure of a closure.Specifically, can lead to
Cross and judge whether the distance of stroke beginning and end is in the range of given threshold to judge whether the one stroke is approximately closure
Figure.Due to length reason, describe to be judged as in step 1 using Figure 1B in the present embodiment performed in the case of one stroke
Flow, is comprised the following steps that:
Step 16:Stroke segmentation is obtained to the paragraph of stroke.In certain embodiments, stroke can be divided according to turning
Section;In further embodiments, also it can be such as segmented using other modes according to key point.
Step 17:Whether be all approximately line segment, if so, then entering next step if judging all paragraphs;If it is not, after then entering
Continuous step 25.In this step, it can judge whether paragraph is approximately line segment by judging the linearity of paragraph respectively.Enter
One step, the linearity can be long by calculating the ultimate range D and stroke paragraph of remaining point and end points line in addition to end points is crossed
Degree L ratio is worth to.The stroke bout length can be the distance between stroke end points or by by stroke paragraph
The length that upper each point superposition calculation is obtained.
Step 18:Stroke paragraph is fitted to line segment.
Step 19:Judge whether comprising four line segments, if so, then enter next step, if it is not, into step 24.At this
In step, paragraph is fitted to line segment by the line segment that paragraph two-end-point can be connected by generating.
Step 20:Judged whether that rectangle can be fitted to according to the angle of four sections of matching line segments;If so, into next step;
If it is not, then entering step 22.Specifically, judging whether two paragraphs with x-axis angle in setting rectangular horizontal angle threshold value
In the range of, and judge whether two paragraphs with y-axis angle in the range of the vertical angle threshold value of rectangle of setting.
Step 21:Four sections of matching line segments are further fitted to rectangle.
Step 22:Judge whether to be approximately rhombus according to the length of four sections of matching line segments;If so, then entering next step;
If it is not, then entering step.In the present embodiment, can with the length of four sections of fitting a straight lines in the range of the allowable error of setting whether
Equal is Rule of judgment.
Step 23:Four sections of matching line segments are further fitted to rhombus.In the present embodiment, with input in sequence
On the basis of the length and angle of one section of line segment, four sections of matching line segments are further fitted to rhombus.
Step 24:Judge whether comprising three paragraphs.
Step 25:Judge whether to be approximately triangle according to the distance between beginning and end;If so, then entering step
26;If it is not, into step 27.In certain embodiments, it can be set by judging whether the distance between beginning and end exceedes
Determine triangle stroke end-point distances threshold value to judge whether to be approximately triangle.
Step 26:Line segment is further fitted to triangle.Can be by the first paragraph paragraph end inputted sequentially in time
Point is defined as two summits of triangle, and end points of the second segment paragraph away from first paragraph paragraph inputted sequentially in time is true
It is set to the 3rd summit of triangle, generates a triangle.
By above-mentioned flow, the touch-screen stroke information identifying processing method of the embodiment of the present invention can be by user's handwriting input
Single stroke recognition be rectangle, rhombus, triangle.
In certain embodiments, user justified by handwriting input, the stroke of oval or circular arc, after above-mentioned steps 16,
Processing is identified in circle, the ellipse that can be inputted by following processes to user with single stroke form.
Step 27:Whether be approximately oval, if so, then entering next step if judging stroke.In this step, it can pass through
The linearity of each paragraph is first obtained, a paragraph linearity is judged whether beyond setting elliptical threshold, if in the presence of sentencing
Disconnected stroke is approximately oval.
Step 28:Obtain major axis, short axle, angle of inclination, the centre coordinate of ellipse.
Step 29:Judge whether to be approximately circular.Judge in this step in previous step calculated major axis, short axle it
Than whether setting circular radius than in threshold range;If so, then entering next step;If it is not, then entering step 33.
Step 30:It regard centre coordinate calculated in step 28 as central coordinate of circle.
Step 31:According to the major axis, minor axis length calculated, the circular radius to be fitted is calculated.Described circular half
Footpath can be calculated according to the half of major axis, short axle sum;The circular radius can also use the length of major axis, can also adopt
With the length of short axle.
Step 32:Stroke is fitted to circle according to central coordinate of circle and radius.
Step 33:According to the transverse calculated in step 28, short axle, angle of inclination, centre coordinate, stroke is fitted
For ellipse.
By performing said process, the smart pen of the embodiment of the present invention can be by oval, circle the stroke of user's handwriting input
Recognize and judge.
Further, when user is with handwriting input arrow in the form of one stroke, the embodiment of the present invention can also be by following
Processing is identified in flow.
After stroke is segmented in step 16, if process judgement is not rectangle, line segment, rhombus, ellipse, subsequently
Continue through following step and processing is identified, due to length reason, the present embodiment is using Fig. 1 C displaying steps 34-39.
Step 34:Advantage paragraph is judged whether, if so, then entering next step.Advantage paragraph can be that length surpasses
Cross the paragraph of non-advantage paragraph at least twice.Length herein can be the distance between value paragraph end points or according to
There is the length that a sum is calculated on paragraph.
Step 35:Whether be approximately line segment, if so, into step 36 if judging advantage paragraph;If it is not, into step 37.Tool
Body, can calculate the linearity of advantage paragraph, and judge the maximum linear degree that calculates whether setting the line segment linearity
In threshold range.
Step 36:Advantage paragraph is fitted to line segment.
Step 37:Whether be approximately camber line, if so, into step 38 if judging advantage paragraph.
Step 38:Advantage paragraph is fitted to camber line.
Step 39:The parameter of non-advantage paragraph is judged whether within the scope of the arrow threshold parameter of setting, if so, then entering
Enter next step.
Step 40:Non-advantage paragraph is fitted to the head of arrow.In this step, one can be preset in smart pen
Individual arrowhead figure, in the case where non-advantage paragraph meets the condition of step 35, by non-advantage paragraph according to setting
Arrowhead figure is fitted.
Step 41:Stroke is fitted to arrow.By arrowhead and the end of advantage paragraph matching line segment nearby in this step
Point connection.In the present embodiment, head tip can be connected with advantage paragraph matching line segment end points nearby, the two is turned into arrow
Head.In other embodiments, head end can be also connected with advantage paragraph matching line segment end points nearby, the two is turned into arrow
Head.
In further embodiments, stroke segmentation can be carried out according to key point in above-mentioned steps 2.Comprise the following steps that:
Step 201:Two end points of one stroke section are subjected to line;If being performed to a stroke and searching key first
Point, then stroke section refer to stroke;If non-to a stroke end execution search key point first, the stroke section refers to the last time
Primary paragraph obtained by searching.
Step 202:Calculate the distance for removing remaining point beyond two-end-point to above-mentioned line.
Step 203:Judge whether the point more than paragraph distance threshold;If so, then entering next step;If it is not, then
Into step 207.
Step 204:Find out the maximum point of distance, and using the point as this section of stroke key point.
Step 205:At above-mentioned key point, stroke section is further divided into the primary paragraph of two parts.
Step 206:Count and regard primary paragraph as new stroke section, return to step 201.
Step 207:It regard current stroke section as paragraph.
In addition to step 2, step 16 can also be realized by said process.
In certain embodiments, above-mentioned steps 4 may further include following process:
Step 401:It whether there is one or two non-advantage paragraph in the setting range of judgement advantage paragraph end points;If depositing
Then into next step;If it is not, then judging in the range of the arrow threshold parameter that the parameter of non-advantage paragraph is not reset.Tool
Body, in this step, using advantage paragraph end points as the center of circle, judge to whether there is one or two non-advantage section in setting range
Fall.Because advantage paragraph has two end points, the circle using setpoint distance r as radius can be judged using an end points as the center of circle
It whether there is one or two non-advantage paragraph in the range of domain;Then using another end points as the center of circle, judge using setpoint distance r as
It whether there is one or two non-advantage paragraph in the range of the border circular areas of radius.
Step 402:The angle of non-advantage paragraph and advantage paragraph is judged whether in the range of given threshold, if so, then sentencing
Non-advantage paragraph parameter of breaking is in the range of the arrow threshold parameter of setting.
In certain embodiments, step 36 can also be realized by above-mentioned steps 401-402.
In certain embodiments, step 7 can be realized by following process:
Step 701:Choose the point of certain amount at equal intervals on advantage paragraph, in the present embodiment, 20 points can be chosen.
Step 702:For m=20,0≤i≤m, constant x is judged whether0、y0, θ, a, b so that
For minimum, if so, then entering next step;Wherein
xi、yiThe coordinate of respectively above-mentioned 20 points.
Step 703:A and b ratio is judged whether in the circular radius ratio threshold range of setting, if then entering next
Step;If it is not, into step 705.
Step 704:Judgement advantage paragraph is approximately circular arc line.
Step 705:Judgement advantage paragraph is approximately oval camber line.
In certain embodiments, judge whether advantage paragraph is camber line described in step 38, above-mentioned step can also be passed through
Rapid 701-705 is realized.
Further, step 8 can be realized by following process:
Step 801:By advantage paragraph end points line.
Step 802:Judge the length in advantage paragraph envelope region line direction described in previous step whether less than upper
The length of line is stated, if so, then entering next step;If it is not, then entering step 805.
Step 803:Judge that the advantage paragraph is fitted to minor arc.
Step 804:Advantage paragraph is fitted to a minor arc.If specifically, judging the advantage paragraph to be ellipse in step 7
Circular arc line, then be fitted to an oval minor arc, the abscissa of the oval minor arc end points and the horizontal seat of advantage paragraph by advantage paragraph
Mark is identical, and is met a little on camber line
In other embodiments, the ordinate of the oval minor arc end points is identical with the ordinate of advantage paragraph.Should if judging in step 7
Advantage paragraph is circular arc line, then calculates radius r according to a, b and setting rule, advantage paragraph is fitted into a round minor arc,
The circle minor arc center of circle is x0、y0, radius is r, and its end points abscissa is identical with advantage paragraph end points abscissa;In other embodiments
In, the ordinate of the circle minor arc end points is identical with the ordinate of advantage paragraph.
Step 805:Judge that the advantage paragraph is fitted to major arc.
Step 806:Advantage paragraph is fitted to a major arc.If judging the advantage paragraph in step 7 for oval camber line,
Advantage paragraph is then fitted to an oval major arc, the abscissa of the oval major arc end points is identical with the abscissa of advantage paragraph,
And met a little on camber line
In other embodiments, the ordinate of the oval major arc end points is identical with the ordinate of advantage paragraph.If judging in step 7, this is excellent
Gesture paragraph is circular arc line, then calculates radius r according to a, b and setting rule, advantage paragraph is fitted into a round major arc, should
The circle minor arc center of circle is x0、y0, radius is r, and its end points abscissa is identical with advantage paragraph end points abscissa;In other embodiments,
The ordinate of the circle major arc end points is identical with the ordinate of advantage paragraph.
In certain embodiments, advantage paragraph is fitted to camber line described in step 37, above-mentioned steps can also be passed through
801-806 is realized.
In certain embodiments, above-mentioned steps 13 can be realized by by lower process:
Step 1301:Obtain the lenth ratio of first paragraph and remaining paragraph that input in chronological order.In this step
Described length can be the distance between paragraph end points.
Step 1302:The lenth ratio is judged whether in the range of the square length of side ratio of setting, if so, then entering
Next step;If it is not, then entering step 1304.
Step 1303:Stroke is fitted to square, the square side is parallel to x-axis or y-axis, and the length of side is equal to described the
The distance between one paragraph end points.
Step 1304:Stroke is fitted to rectangle, the rectangular long side is parallel to x-axis or y-axis, length or width etc.
In the distance between described first paragraph two-end-point, width or length are equal to the second paragraph two ends inputted in chronological order
The distance between point.
In other embodiments, step 13 can also by another way, with first section inputted in chronological order
On the basis of falling, square or rectangular at dislocation fitting.
In other embodiments, above-mentioned steps 1301-1303 can be used for realizing step 21.
In certain embodiments, step 28 can be realized by following processes.
Step 2801:Choose the point of certain amount at equal intervals in stroke, in the present embodiment, 20 points can be chosen.
Step 2802:For m=20,0≤i≤m, judge whether often
Number x0、y0, θ, a, b so thatFor minimum, if so, then entering next step;Whereinxi、yiIt is respectively above-mentioned
The coordinate of 20 points.
Step 2803:CalculateX when minimum0、y0, θ, a, b, x0、y0Respectively centered on abscissa,
Ordinate, θ is angle of inclination, a, b are respectively oval major axis, short axle.
In other embodiments, ellipse can be fitted using least square method.
Further, the present invention provides a kind of smart pen, and the method provided using any one above-mentioned embodiment is to user
Processing, including one stroke identification module, Multi strokes identification module are identified by the stroke information of handwriting input.
From the above it can be seen that the stroke information identifying processing method that provides of the present invention, it can be applied to a variety of have
The electronic equipment of touch-screen, particularly electronic whiteboard, can be identified processing, and be fitted to the stroke of user's handwriting input
Geometric figure.The stroke recognition processing method of the embodiment of the present invention, can recognize the multistage stroke of user's handwriting input and single
Stroke, and the figure of user's freehand is changed into test pattern, a variety of occasions such as teaching, meeting are can apply to, with very
Strong practicality so that user just can draw out the figure of arbitrary size by arbitrary region on the touchscreen without instrument,
Call conveniently, using simple, meet the hand-written drafting custom of user, so as to be easy to user's grasp.In addition, the embodiment of the present invention is adopted
The arrow of the hand-written drafting of user is identified with effective method, also there is higher accuracy when being fitted other figures.
The smart pen that the present invention is provided, it is hand-written to user defeated using the stroke recognition processing method of any embodiment of the present invention
The stroke entered is identified, and a variety of electronic equipments with touch-screen is may be provided at, particularly in electronic whiteboard so that user is not
The geometric figure of standard can be just drawn out by instrument, meets the use habit of user, is called conveniently, it is easy to grasp, can answer
With with a variety of occasions such as teaching, meeting and with the higher degree of accuracy.
Those of ordinary skills in the art should understand that:The specific embodiment of the present invention is the foregoing is only, and
The limitation present invention is not used in, within the spirit and principles of the invention, any modification, equivalent substitution and improvements done etc.,
It should be included within protection scope of the present invention.