An arrow processing method and device, a storage medium and a computer device

By calculating the curvature and inflection points of the arrow handwriting, and using segmentation and fitting techniques, the problem of non-standard arrows in handwriting input systems has been solved, achieving both aesthetic appeal and easy recognition of the arrows.

CN116263975BActive Publication Date: 2026-04-07GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

The existing handwriting input system has poor arrow drawing performance, resulting in non-standard arrows that are difficult to identify, especially in flowcharts or trend diagrams where they may produce unclear or incorrect directions.

Method used

By calculating the curvature of each trajectory point in the arrow handwriting, candidate inflection points are determined, a bounding box is constructed, a target inflection point is selected, the arrow handwriting is segmented, the head handwriting and axis handwriting are determined, and the arrow direction is determined and fitted based on these handwritings.

Benefits of technology

It achieves standardized presentation of arrow handwriting and improves recognizability, making the arrows displayed on the screen aesthetically pleasing and compliant with standards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263975B_ABST
    Figure CN116263975B_ABST
Patent Text Reader

Abstract

This application discloses an arrow processing method, apparatus, storage medium, and computer device. The method includes: calculating the curvature of each trajectory point in the arrow handwriting and its adjacent trajectory points; determining several candidate inflection points of the arrow handwriting based on the curvature; constructing a first bounding box corresponding to each candidate inflection point based on each candidate inflection point and at least one adjacent candidate inflection point; selecting a target inflection point from the several candidate inflection points based on the long and short sides of the first bounding box; segmenting the arrow handwriting according to the target inflection point to obtain several handwriting segments; determining the head stroke and axis stroke of the arrow handwriting based on the several handwriting segments; determining the arrow direction of the arrow handwriting based on the head stroke and axis stroke; and performing fitting processing on the several handwriting segments. Through the above method, after a user inputs arrow handwriting on the input screen, the corresponding arrow handwriting displayed on the screen is aesthetically pleasing, conforms to standards, and has improved recognizability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of trajectory recognition, and in particular to an arrow processing method and device, a storage medium and computer equipment. BACKGROUND

[0002] In recent years, with the popularization of touch screen technology, handwriting input systems (such as touchpads, touch screens, etc.) have been widely used in tablet computers, wireless terminals and other devices. Handwriting input systems integrate various high-tech means such as cutting-edge electronic technology and software technology, and can realize paperless office or teaching by combining with computers and other devices. Users can directly input handwriting through the handwriting input system.

[0003] In the handwriting input system, drawing arrows is a basic and important content. Arrows and the drawing of arrows are used in many different application fields, such as flowcharts and trend charts.

[0004] At present, the processing effect of drawing arrows in the handwriting input system is not good, which makes the presented arrows not standard and difficult to identify, resulting in unclear or incorrect directions in flowcharts or trend charts. SUMMARY

[0005] The present application provides an arrow processing method, device, storage medium and computer equipment. A special processing method is used for the drawn arrow to make the presented arrow standardized and improve the recognition degree.

[0006] In a first aspect, the present application provides an arrow processing method, which comprises:

[0007] Based on each trajectory point and adjacent trajectory point in the arrow handwriting to be processed, the curvature of each trajectory point is calculated;

[0008] Based on the curvature, a plurality of candidate inflection points of the arrow handwriting are determined;

[0009] Based on each candidate inflection point and at least one candidate inflection point adjacent to the inflection point, a first bounding box corresponding to the candidate inflection point is constructed;

[0010] Based on the long and short sides of the first bounding box, a target inflection point is selected from the plurality of candidate inflection points;

[0011] According to the target inflection point, the arrow handwriting is segmented and processed to obtain a plurality of handwriting segments;

[0012] According to a plurality of handwriting segments, the head handwriting and the axis handwriting of the arrow handwriting are determined;

[0013] The head of the arrow is determined according to the head of the pen trail and the axis of the pen trail, and the pen trail is fitted for the plurality of pen trail segments.

[0014] In a second aspect, the embodiments of the present application provide an arrow processing device, the device comprising:

[0015] A curvature calculation unit is configured to calculate the curvature of each trajectory point in the arrow pen trail based on the trajectory point and adjacent trajectory points.

[0016] A turning point determination unit is configured to determine a plurality of candidate turning points of the arrow pen trail based on the curvature.

[0017] A construction unit is configured to construct a first bounding box corresponding to each candidate turning point based on the candidate turning point and at least one candidate turning point adjacent to the candidate turning point.

[0018] A target turning point selection unit is configured to select a target turning point from the plurality of candidate turning points based on the length and the short side of the first bounding box.

[0019] A segmentation processing unit is configured to segment the arrow pen trail according to the target turning point to obtain a plurality of pen trail segments.

[0020] A pen trail determination unit is configured to determine the head of the arrow and the axis of the arrow based on the plurality of pen trail segments.

[0021] A direction determination and fitting unit is configured to determine the arrow direction of the arrow pen trail based on the head of the arrow and the axis of the arrow, and fit the pen trail for the plurality of pen trail segments.

[0022] In a third aspect, the embodiments of the present application further provide a storage medium, the storage medium storing a plurality of instructions, the instructions being adapted to be loaded by a processor to execute the arrow processing method described above.

[0023] In a fourth aspect, the embodiments of the present application further provide a computer device, comprising a memory, a display and a processor, the memory being configured to store a computer program, when the computer program is executed by the processor, the processor is caused to implement the steps of the arrow processing method described above.

[0024] In this embodiment, after the user inputs the arrow handwriting to be processed on the input screen, the curvature of each trajectory point and its adjacent points in the arrow handwriting is calculated. Based on the curvature, several candidate inflection points of the arrow handwriting are determined. A first bounding box corresponding to each candidate inflection point is constructed based on each candidate inflection point and at least one adjacent candidate inflection point. Based on the long and short sides of the first bounding box, a target inflection point is selected from the several candidate inflection points. The arrow handwriting is segmented according to the target inflection point to obtain several handwriting segments. The head stroke and axis stroke of the arrow handwriting are determined based on the several handwriting segments. The arrow direction of the arrow handwriting is determined based on the head stroke and axis stroke. The several handwriting segments are then fitted. Through the above method, after the user inputs the arrow handwriting on the input screen, the corresponding arrow handwriting displayed on the screen is made aesthetically pleasing, conforms to standards, and has improved recognizability. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a flowchart of an arrow processing method provided in an embodiment of this application.

[0027] Figure 2 This is another flowchart of an arrow processing method provided in an embodiment of this application.

[0028] Figure 3 This is another flowchart of an arrow processing method provided in the embodiments of this application.

[0029] Figure 4 This is a schematic diagram illustrating an example of an arrow processing method provided in an embodiment of this application.

[0030] Figure 5 This is another example schematic diagram of an arrow gear method provided in the embodiments of this application.

[0031] Figure 6 This is a schematic diagram of the structure of an arrow processing device provided in an embodiment of this application. Detailed Implementation

[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] This application provides an arrow processing method, apparatus, storage medium, and computer device, mainly used to solve the problem that the arrow processing effect is not good in existing handwriting input systems, resulting in non-standard arrows.

[0034] The arrow processing method, apparatus, storage medium, and computer equipment will be described in detail below.

[0035] Please see Figure 1 , Figure 1 A flowchart of an arrow processing method provided in this application embodiment is shown. The corresponding arrow processing method includes the following steps:

[0036] 101. Based on each trajectory point and adjacent trajectory points in the arrow handwriting to be processed, calculate the curvature of each trajectory point.

[0037] When a user inputs the arrow strokes to be processed on the input screen, the input arrow strokes may contain several stroke points due to factors such as hand tremors, the smoothness of the input screen itself, and the curvature of the arrow strokes.

[0038] By calculating the curvature of each trajectory point, optimal handwriting points are obtained as segmentation points, thus making the final arrow handwriting more accurate after subsequent processing.

[0039] Optionally, before calculating the curvature of each trajectory point, the method further includes receiving the arrow handwriting input by the user, resampling the arrow handwriting, and performing second-order Bezier smoothing. The use of second-order Bezier smoothing to process the arrow handwriting can better prevent interference caused by jitter during user input.

[0040] Please see Figure 2 , Figure 2 Another flowchart of an arrow processing method provided in an embodiment of this application further includes the following steps in step 101:

[0041] 1011. For each of the aforementioned trajectory points, a selection window is set with the trajectory point as the first center point, the non-center trajectory points within the selection window are the adjacent trajectory points of the first center point, and the radius of the selection window is a preset window radius.

[0042] When calculating the curvature of each trajectory point, a selection window is made with that trajectory point as the center, and the radius of the selection window is a preset window radius.

[0043] For example, when calculating a certain trajectory point, if the trajectory point is set as the first center point and the preset window radius is R, then the other trajectory points contained within the radius R are all adjacent trajectory points of the trajectory point.

[0044] 1012. Among the adjacent trajectory points, select a number of first reference points and a number of second reference points located before and after the first center point in the arrow stroke, respectively, wherein the distances of the first reference points and the second reference points to the first center point are equal.

[0045] In this application, a selection window is defined first, and then reference points are defined. Several first reference points and several second reference points located before and after the first center point are defined according to a preset window radius r.

[0046] 1013. Based on the first plane vector between the first center point and the first reference point, and the second plane vector between the first center point and the second reference point, calculate several candidate curvatures of the first center point.

[0047] Since the selection window has a certain range, there will be multiple first reference points and multiple second reference points when selecting the first reference point and the second reference point.

[0048] By using the planar vectors between the first center point, the first reference point, and the second reference point, the calculated results will be several, that is, several candidate curvatures will be calculated for each trajectory point.

[0049] 1014. Select a reference curvature from the candidate curvatures.

[0050] In the embodiments of this application, after calculating several candidate curvatures for each trajectory point, the several candidate curvatures for each trajectory point are sorted from largest to smallest, and half of the candidate curvatures located at the beginning of the sequence are selected as reference curvatures. Thus, there are several reference curvatures for each trajectory point.

[0051] 1015. Based on the reference curvature, determine the curvature of the trajectory point.

[0052] In the embodiments of this application, after determining several reference curvatures for each trajectory point, all reference curvatures for each trajectory point are added together and the average curvature is calculated. The average curvature is the curvature of the trajectory point.

[0053] For example, when calculating a certain trajectory point, the candidate curvature of the trajectory point is K = f(vector[nr], vector[n+r]), where the preset window radius is R, R = [0, r], vector[nr] is the first plane vector, vector[n+r] is the second plane vector, and f is the formula for the angle between the plane vectors.

[0054] Optionally, when coordinates a = (x1, y1) and b = (x2, y2), a * b = x1x2 + y1y2. Then f = cos<a,b> .

[0055] Several candidate curvatures are obtained through calculation, and these candidate curvatures are sorted from largest to smallest according to their numerical values. For example, the candidate curvatures for this trajectory point are sorted as K. i ={K1,...,K n / 2 ,...K n}, add up half of the candidate curvatures located in front to obtain K. p =K1+K2+...+K n / 2 Solve for the curvature mean K q =2K p / n, then K q Let be the curvature of this trajectory point.

[0056] Please refer to the following: Figure 1 After completing step 101, an arrow processing method further includes:

[0057] 102. Determine several candidate inflection points of the arrow handwriting based on the curvature.

[0058] After calculating the curvature of each trajectory point, based on the position and curvature value of each trajectory point, some of the better trajectory points are selected as candidate inflection points. These candidate inflection points are then used as a benchmark for subsequent processing steps.

[0059] Specifically, after calculating the curvature of each trajectory point, the curvature of each trajectory point is compared with that of its adjacent trajectory points. Based on the comparison results, candidate inflection points are selected from the trajectory points, and the curvature of the candidate inflection point is greater than the curvature of the two trajectory points before and after it.

[0060] For example, the curvature of each trajectory point is calculated according to a preset order, and each curvature is sorted according to the calculation order to obtain a curvature set. Candidate inflection points are selected from the curvature set. The curvature of a candidate inflection point must be greater than the curvature of its preceding trajectory point and the curvature of its following trajectory point at the same time.

[0061] 103. Based on each candidate inflection point and at least one candidate inflection point adjacent to the candidate inflection point, construct a first bounding box corresponding to the candidate inflection point.

[0062] An inflection point is the point where the direction of the arrow's stroke changes, and it is also the point on the trajectory of the arrow's stroke.

[0063] In an embodiment of this application, for example, a candidate inflection point is set as q, and an adjacent candidate inflection point is set as q-1. The candidate inflection point q-1 is located in the adjacent position before the candidate inflection point q. There are several handwriting points between the candidate inflection point q and the candidate inflection point q-1. A connecting line is formed by connecting the candidate inflection point q, the candidate inflection point q-1 and the handwriting points between them, and the first bounding box is constructed with the connecting line.

[0064] 104. Based on the long and short sides of the first bounding box, select the target inflection point from a plurality of candidate inflection points.

[0065] After constructing the first bounding box using the connecting lines of candidate inflection points, their adjacent candidate inflection points, and the intermediate handwriting points, the final target inflection point is selected based on the long and short sides of the first bounding box.

[0066] In the embodiments of this application, a candidate inflection point is set as q, and an adjacent candidate inflection point is set as q-1. The candidate inflection point q-1 is located in the adjacent position before the candidate inflection point q. There are several other handwriting points between the candidate inflection point q and the candidate inflection point q-1. A first bounding box is constructed by connecting the candidate inflection point q, the candidate inflection point q-1 and the handwriting points in between. The first bounding box includes the longest side and the shortest side. The distance ratio between the longest side and the shortest side of the first bounding box and the path distance of the connecting line are calculated. The distance ratio is compared with a preset distance ratio and the path distance is compared with a preset path distance. When the comparison result meets the preset condition, the candidate inflection point q is retained.

[0067] Optionally, if the distance ratio of a candidate inflection point q is greater than a preset distance ratio, and the path distance is greater than a preset path distance, then the candidate inflection point q satisfies the preset condition and is retained.

[0068] In the embodiments of this application, the significance of selecting the target inflection point through this step is to filter out some candidate inflection points that are too close together. For example, when two candidate inflection points are too close together, one of the candidate inflection points is removed by filtering, and the other candidate inflection point is taken as the target inflection point.

[0069] 105. The arrow handwriting is segmented according to the target inflection point to obtain several handwriting segments.

[0070] After selecting the target inflection point from several candidate inflection points, the target inflection point is the final determined inflection point. The arrow handwriting is segmented through the target inflection point to obtain several handwriting segments. These handwriting segments are then used as a basis for subsequent processing.

[0071] For example, if three target inflection points are selected from the candidate inflection points, then all three target inflection points are located on the arrow handwriting and belong to the inflection points on the arrow handwriting. When performing segmentation processing, the arrow handwriting is segmented based on the positions of the three target inflection points to obtain four handwriting segments.

[0072] 106. Determine the head stroke and axis stroke of the arrow stroke based on the several stroke segments described.

[0073] Even if the arrow strokes are subsequently segmented into several segments after the user inputs them on the input screen, the arrow strokes are still composed of those segments.

[0074] Arrow handwriting is divided into head handwriting and axis handwriting. In the embodiments of this application, the head handwriting of the arrow handwriting is considered to be the line part that forms the angle, and the other line part that connects the angle is the axis handwriting.

[0075] For example, if an arrow handwriting consists of two strokes, including a first stroke and a second stroke, where the first stroke has an angle and forms the arrowhead part of the arrow handwriting, then the first stroke is considered the head stroke of the arrow handwriting. If the second stroke is a straight line or a curve, with one end connected to the angle, then the second stroke is considered the axis stroke of the arrow handwriting.

[0076] Please see Figure 3 , Figure 3 Another flowchart of an arrow processing method provided in this application embodiment further includes step 106:

[0077] 1061. Recombining several segments of the handwriting to obtain several arrow shapes.

[0078] In the embodiments of this application, several handwriting segments can be reconstructed by iterative traversal.

[0079] 1062. Calculate the shape score of each of the arrow shapes according to preset conditions, the preset conditions including proportional coefficient, curvature coefficient and symmetry relationship.

[0080] In the embodiments of this application, the preset conditions include conditions such as proportionality coefficient, curvature coefficient and symmetry relationship. Of course, other conditions may also be added to the preset conditions. Here, there is no limitation on the content included in the preset conditions.

[0081] 1063. Compare the numerical values ​​of the morphological scores.

[0082] Each arrow shape has a corresponding shape score after calculation, which reflects whether the arrow shape meets the standard.

[0083] 1064. Determine the shape of the arrow based on the comparison results.

[0084] Optionally, the arrow score calculated based on preset conditions is defined as follows: the higher the value of the shape score, the more standard the corresponding arrow shape; conversely, the lower the value of the shape score, the less standard the corresponding arrow shape.

[0085] The final arrow shape is confirmed by comparing the shape score of each arrow shape. The final arrow shape corresponds to the arrow handwriting entered by the user and meets the standard.

[0086] For example, if the handwriting is divided into five segments (first, second, third, fourth, and fifth), in the first recombination, the first segment is used as the head stroke, and the remaining four segments are used as the axis strokes. These segments are then recombined and connected to form the first arrow shape. Based on preset conditions, the first shape score is calculated to be 3. In the second recombination, the first and second segments are used as the head strokes, and the remaining three segments are used as the axis strokes. These segments are then recombined and connected to form the second arrow shape. Based on preset conditions, the second shape score is calculated to be 4. This process continues until the third shape score is 6 and the fourth shape score is 8. Comparing the scores of the first, second, third, and fourth shapes, the fourth shape score is the highest. The fourth arrow shape corresponding to the fourth shape score is selected as the final arrow shape. The head stroke and axis stroke are then determined based on the fourth arrow shape.

[0087] 1065. Determine the head stroke and axis stroke of the arrow handwriting based on the determined arrow shape.

[0088] After confirming the final arrow shape, the head strokes and axis strokes can be obtained by analyzing the arrow shape.

[0089] Please refer to the following: Figure 1 After completing step 106, an arrow processing method further includes:

[0090] 107. Determine the arrow direction of the arrow stroke based on the head stroke and the axis stroke, and perform fitting processing on several segments of the stroke.

[0091] This step includes four aspects: First, determining the head stroke of the arrow's axis; second, determining the curvature of the arrow's axis; third, determining the orientation of the arrowhead portion; and fourth, fitting the image. Each of these four aspects will be explained below.

[0092] Firstly, determining the head stroke segment of the arrow stroke's axis stroke includes: constructing a second bounding box based on the head stroke; using the second center point of the second bounding box as a reference, calculating the distance value between each stroke segment contained in the axis stroke and the second center point; comparing the numerical relationship of each distance value; and determining the head stroke segment of the axis stroke based on the comparison result.

[0093] An arrow handwriting is composed of several handwriting segments. The axis of the arrow handwriting may be composed of one handwriting segment or multiple handwriting segments. The head and tail handwriting segments of the axis handwriting are located at the two ends of the axis handwriting, and the head handwriting segment is connected to the head handwriting at an angle.

[0094] After determining the head stroke and axis stroke of the arrow stroke, a second bounding box is constructed based on the head stroke. Taking the second center point of the bounding box as a reference, the stroke segments of the axis stroke are calculated. In fact, the distance between each stroke segment on the axis stroke and the head stroke is calculated to determine the head of the axis stroke.

[0095] For example, if the axis of an arrow is a straight line, including the first axis, the second axis, and the third axis, and the distance between the first axis and the second center point is calculated to be 3, the distance between the second axis and the second center point is 2, and the distance between the third axis and the second center point is 5, then the second axis is determined to be the head segment of the arrow.

[0096] Optionally, in some embodiments, the final head and tail strokes are calculated by combining the curvature of the stroke segments with the endpoints of each stroke segment of the axis stroke.

[0097] The second aspect involves determining the curvature of the arrow's axis stroke, including: creating a coordinate axis with the second center point as the origin coordinate; determining the coordinates of each stroke segment contained in the axis stroke based on the coordinate axis; comparing each coordinate with the origin coordinate in the x-axis direction; and determining the curvature of the axis stroke based on the comparison results.

[0098] Please see Figure 4 , Figure 4 This is an example diagram illustrating an arrow processing method provided in an embodiment of this application. The second aspect described above will be explained using this diagram as an example.

[0099] For example, after constructing a second bounding box based on the first stroke, the second center point of the second bounding box is point O. Then, coordinate axes are created using the origin coordinates of point O. The axis stroke of the arrow stroke includes a stroke segment with endpoints A(x1,y1) and B(x2,y2) at its two ends. Comparing x1 and x2, if the comparison shows x1 > x2, it means that the stroke segment is to the left; conversely, if the comparison shows x1 < x2, it means that the stroke segment is to the right.

[0100] Furthermore, based on the coordinate axes, the coordinates of each stroke segment contained in the axis stroke are determined. Each coordinate is compared with the origin coordinate in the y-axis direction. Combining the comparison results in the x-axis and y-axis directions, the curvature of the axis stroke is determined.

[0101] For example, after constructing a second bounding box based on the first stroke, with the second center point of the second bounding box being point O, a coordinate axis is created using the origin coordinates of point O. The axis stroke of the arrow stroke includes a stroke segment with endpoints A(x1,y1) and B(x2,y2) at its two ends. Comparing x1 and x2, and comparing y1 and y2, if x1 < x2 and y1 > y2, it means that the stroke segment bends to the right, and point A is above point B. If x1 > x2 and y1 > y2, it means that the stroke segment bends to the left, and point A is above point B.

[0102] Thirdly, determining the orientation of the arrow portion of the arrow handwriting includes: constructing a corresponding second bounding box based on the first stroke; using the second center point and the center point of each side of the second bounding box as a reference, calculating the distance between the endpoints of each stroke segment contained in the first stroke and the center point of each side; comparing the numerical relationship of each distance value; selecting the first endpoint, the second endpoint, and the third endpoint based on the comparison results; creating a coordinate axis with the second center point as the origin coordinate; determining the coordinates of the first endpoint, the second endpoint, and the third endpoint based on the coordinates of the first endpoint, the second endpoint, and the third endpoint; and determining the arrow direction of the arrow handwriting based on the coordinates of the first endpoint, the second endpoint, and the third endpoint.

[0103] Please see Figure 5 , Figure 5 This is another example diagram illustrating an arrow processing method provided in an embodiment of this application. The third aspect described above will be explained using this diagram as an example.

[0104] For example, after constructing a second bounding box based on the initial stroke, with point O as the second center point of the second bounding box, and the second bounding box being a rectangle comprising sequentially connected first, second, third, and fourth sides, the center points of the four sides are selected as the center points of the first, second, third, and fourth sides, respectively. The distance values ​​between the endpoints of each stroke segment contained in the initial stroke and the center points of each side are calculated. By comparing the values ​​of each distance, it is found that point E is closest to the center point of the first side, point F is closest to the center point of the third side, and point H is closest to the center point of the fourth side. If we are close, we select point E as the first endpoint, point H as the second endpoint, and point H as the third endpoint. We create a coordinate axis with point O as the origin. Based on the coordinate axis, we determine the coordinates of the three endpoints as E(x1,y1), F(x2,y2), and H(x3,y3). Based on the origin coordinates, we compare the first endpoint E(x1,y1) and the second endpoint F(x2,y2). Based on the comparison result, we can know whether the arrow is pointing to the left or to the right. Based on the origin coordinates, we compare the third endpoint H(x3,y3) with the endpoint of the tail segment of the axis stroke. Based on the comparison result, we can know whether the arrow is pointing upward or downward.

[0105] For example, if |x1| < |x2| and |y1| > |y2|, it means that the arrowhead of the first stroke of the arrowhead points to the right; conversely, it means that the arrowhead of the first stroke of the arrowhead points to the left.

[0106] Fourthly, fitting processing includes: fitting several segments of handwriting.

[0107] Optionally, in the embodiments of this application, the least squares method is used to fit several handwriting segments.

[0108] This application provides an arrow processing method. After a user inputs an arrow stroke to be processed on an input screen, the curvature of each trajectory point and its adjacent points in the arrow stroke is calculated. Based on the curvature, several candidate inflection points of the arrow stroke are determined. A first bounding box corresponding to each candidate inflection point is constructed based on each candidate inflection point and at least one adjacent candidate inflection point. Based on the long and short sides of the first bounding box, a target inflection point is selected from the several candidate inflection points. The arrow stroke is segmented according to the target inflection point to obtain several stroke segments. The head stroke and axis stroke of the arrow stroke are determined based on the several stroke segments. The arrow direction of the arrow stroke is determined based on the head stroke and axis stroke. The several stroke segments are then fitted. Through the above method, after the user inputs an arrow stroke on the input screen, the processed arrow stroke is made aesthetically pleasing, conforms to standards, and has improved recognizability.

[0109] Please see Figure 6 ,Figure 6 This is a schematic diagram of an arrow processing device provided in an embodiment of this application. The device includes:

[0110] The curvature calculation unit is used to calculate the curvature of each trajectory point based on each trajectory point in the arrow handwriting to be processed and its adjacent trajectory points.

[0111] The inflection point determination unit is used to determine several candidate inflection points of the arrow handwriting based on curvature;

[0112] A construction unit is used to construct a first bounding box corresponding to each candidate inflection point based on each candidate inflection point and at least one candidate inflection point adjacent to the candidate inflection point.

[0113] The target inflection point selection unit is used to select a target inflection point from several candidate inflection points based on the length and shortness of the first bounding box.

[0114] The segmentation processing unit is used to segment the arrow handwriting according to the target inflection point to obtain several handwriting segments.

[0115] The handwriting determination unit is used to determine the head and axis of the arrow handwriting based on several handwriting segments.

[0116] The direction determination and fitting unit is used to determine the arrow direction of the arrow handwriting based on the head handwriting and the axis handwriting, and to perform fitting processing on several handwriting segments.

[0117] Optionally, the arrow processing device in this application embodiment may also include other functional units, which will not be described in detail here.

[0118] The arrow processing device of this application embodiment, after the user inputs the arrow handwriting to be processed on the input screen, calculates the curvature of each trajectory point in the arrow handwriting and adjacent trajectory points, determines several candidate inflection points of the arrow handwriting based on the curvature, constructs a first bounding box corresponding to each candidate inflection point and at least one adjacent candidate inflection point, selects a target inflection point from the several candidate inflection points based on the long and short sides of the first bounding box, segments the arrow handwriting according to the target inflection point to obtain several handwriting segments, determines the head stroke and axis stroke of the arrow handwriting based on the several handwriting segments, determines the arrow direction of the arrow handwriting based on the head stroke and axis stroke, and performs fitting processing on the several handwriting segments. Through the above method, after the user inputs the arrow handwriting on the input screen, the corresponding arrow handwriting displayed on the screen is made beautiful, conforms to standards, and has improved recognizability.

[0119] In some embodiments, a computer-readable storage medium is also provided, which stores a plurality of instructions adapted to be loaded by a processor to perform any of the arrow processing methods described above.

[0120] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0121] In some embodiments, a computer device is also provided, the computer device including a memory, a display, and a processor, the memory being used to store a computer program, which, when executed by the processor, causes the processor to implement the steps of any of the above-described arrow processing methods.

[0122] The arrow processing method, apparatus, storage medium, and computer device provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An arrow processing method, characterized in that, The method includes: Based on each trajectory point and adjacent trajectory points in the arrow handwriting to be processed, calculate the curvature of each trajectory point; Based on the curvature, several candidate inflection points of the arrow handwriting are determined; Based on each candidate inflection point and at least one candidate inflection point adjacent to the candidate inflection point, a first bounding box corresponding to the candidate inflection point is constructed. Based on the long and short sides of the first bounding box, a target inflection point is selected from several candidate inflection points; The arrow handwriting is segmented according to the target inflection point to obtain several handwriting segments; The head stroke and axis stroke of the arrow stroke are determined based on several stroke segments described above; The arrow direction of the arrow stroke is determined based on the head stroke and the axis stroke, and several segments of the stroke are fitted.

2. The arrow processing method according to claim 1, characterized in that, Before calculating the curvature of each trajectory point and its adjacent points in the arrow handwriting to be processed, the following steps are included: Receive user input of arrow handwriting to be processed; The arrow handwriting to be processed is resampled and subjected to second-order Bezier smoothing.

3. The arrow processing method according to claim 1, characterized in that, The calculation of the curvature of each trajectory point based on the trajectory points and adjacent trajectory points in the arrow handwriting to be processed includes: For each trajectory point, a selection window is set with the trajectory point as the first center point. The non-center trajectory points within the selection window are the adjacent trajectory points of the first center point. The radius of the selection window is a preset window radius. Among the adjacent trajectory points, several first reference points and several second reference points are selected in the arrow handwriting, located before and after the first center point, respectively, and the distances of the first reference points and the second reference points to the first center point are equal. Based on the first plane vector between the first center point and the first reference point, and the second plane vector between the first center point and the second reference point, calculate several candidate curvatures of the first center point; A reference curvature is selected from the candidate curvatures; The curvature of the trajectory points is determined based on the reference curvature.

4. The arrow processing method according to claim 1, characterized in that, The determination of several candidate inflection points for the arrow handwriting based on the curvature includes: Compare the curvature of each trajectory point with that of its adjacent trajectory points; The candidate inflection point is selected from the trajectory points based on the comparison results, and the curvature of the candidate inflection point is greater than the curvature of the two trajectory points before and after it.

5. The arrow processing method according to claim 1, characterized in that, The step of determining the head and axis strokes of the arrow strokes based on several stroke segments includes: Several segments of the handwriting were recombined to obtain several arrow shapes; The shape score of each arrow shape is calculated according to preset conditions, including a proportional coefficient, a curvature coefficient, and a symmetry relationship. Compare the numerical values ​​of the various morphological scores; The arrow shape is determined based on the comparison results; The head stroke and axis stroke of the arrow handwriting are determined based on the determined arrow shape.

6. The arrow processing method according to claim 1, characterized in that, The step of determining the arrow direction of the arrow handwriting based on the head stroke and the axis stroke, and performing fitting processing on several segments of the handwriting, includes: Construct a corresponding second bounding box based on the handwriting; Using the second center point of the second bounding box as a reference, calculate the distance between each stroke segment contained in the axial stroke and the second center point; Compare the numerical values ​​of each distance. The head stroke segment of the axial stroke is determined based on the comparison results.

7. The arrow processing method according to claim 6, characterized in that, The step of determining the arrow direction of the arrow stroke based on the head stroke and the axis stroke, and performing fitting processing on several segments of the stroke, further includes: Create coordinate axes with the second center point as the origin; Based on the coordinate axes, determine the coordinates of each stroke segment contained in the axis strokes; Compare each of the given coordinates with the origin coordinates along the x-axis; The curvature of the axial strokes is determined based on the comparison results.

8. The arrow processing method according to claim 1, characterized in that, The step of determining the arrow direction of the arrow stroke based on the head stroke and the axis stroke, and performing fitting processing on several segments of the stroke, further includes: Construct a corresponding second bounding box based on the handwriting; Using the second center point and the center point of each side of the second bounding box as a reference, calculate the distance between the endpoint of each stroke segment contained in the head stroke and the center point of each side stroke; Compare the numerical values ​​of each distance. The first endpoint, the second endpoint, and the third endpoint were selected based on the comparison results.

9. The arrow processing method according to claim 8, characterized in that, The step of determining the arrow direction of the arrow stroke based on the head stroke and the axis stroke, and performing fitting processing on several segments of the stroke, further includes: Create coordinate axes with the second center point as the origin; Based on the coordinate axes, determine the coordinates of the first endpoint, the second endpoint, and the third endpoint; The arrow direction of the arrow handwriting is determined based on the coordinates of the first endpoint, the second endpoint, and the third endpoint.

10. An arrow processing device, characterized in that, The device includes: The curvature calculation unit is used to calculate the curvature of each trajectory point based on each trajectory point in the arrow handwriting to be processed and adjacent trajectory points; An inflection point determination unit is used to determine several candidate inflection points of the arrow handwriting based on the curvature; A construction unit is configured to construct a first bounding box corresponding to each candidate inflection point based on each candidate inflection point and at least one candidate inflection point adjacent to the candidate inflection point. The target inflection point selection unit is used to select a target inflection point from a plurality of candidate inflection points based on the long and short sides of the first bounding box. The segmentation processing unit is used to segment the arrow handwriting according to the target inflection point to obtain several handwriting segments. The handwriting determination unit is used to determine the head stroke and axis stroke of the arrow handwriting based on several handwriting segments. The direction determination and fitting unit is used to determine the arrow direction of the arrow handwriting based on the head handwriting and the axis handwriting, and to perform fitting processing on several segments of the handwriting.

11. A storage medium, characterized in that, The storage medium stores a plurality of instructions, which are adapted to be loaded by a processor to execute the arrow processing method according to any one of claims 1 to 9.

12. A computer device comprising a memory, a display, and a processor, wherein the memory is used to store computer programs, characterized in that, When the computer program is executed by the processor, the processor performs the steps of the arrow processing method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method and device for drawing arrow mark

    CN102568304A

  • Intelligent pen and stroke recognition processing method thereof

    CN104714666A