Method and device for determining corner points of handwriting, storage medium and terminal

By calculating the writing speed and curvature of the handwriting trajectory points, and combining line segment fitting and pseudo-corner removal algorithms, the accuracy problem of handwritten handwriting corner detection is solved, achieving more accurate corner recognition and feature extraction.

CN116168402BActive Publication Date: 2026-04-10GUANGZHOU 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
GUANGZHOU SHIYUAN ELECTRONICS CO LTD
Filing Date
2021-11-24
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, corner detection of handwritten handwriting is easily affected by shaking, resulting in inaccurate corner recognition and a large number of false corners, which affects the accuracy of image feature extraction.

Method used

By calculating the writing speed and final curvature of the trajectory points, the trajectory points that meet the preset conditions are selected as the first corner points. Then, by using line segment fitting and pseudo-corner point removal algorithms, pseudo-corner points are removed, and the accurate second corner points are determined.

Benefits of technology

It effectively reduces curvature abrupt changes caused by jitter, improves the accuracy of corner detection, removes false corners, and ensures accurate extraction of handwriting features.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116168402B_ABST
    Figure CN116168402B_ABST
Patent Text Reader

Abstract

The application discloses a handwriting corner point determination method and device, a storage medium and a terminal, and relates to the technical field of computer image recognition. First, the writing speed of each trajectory point in handwriting and the final curvature of each trajectory point are calculated, and the final curvature is the average of all curvatures of vectors formed by the trajectory point and other trajectory points in a preset range. Then, a trajectory point meeting a condition is selected as a first corner point. Finally, pseudo corner points in the first corner point are removed. Since the average of all curvatures of the trajectory point in the preset range is taken as the final curvature of the trajectory point, that is, the average of the cumulative curvatures of the sliding window is taken as the curvature of the window center trajectory point, the misleading of curvature mutation to corner point selection is reduced, the curvature mutation can be effectively smoothed, more accurate corner points can be selected, line segment fitting of handwriting is performed, pseudo corner points in the first corner point are removed, the pseudo corner points in the corner points can be effectively removed, and finally, correct corner points in the handwriting are determined.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer image recognition, and particularly relates to a handwriting corner point determination method and device, a storage medium and a terminal. BACKGROUND

[0002] With the rapid development of Internet technology and mobile terminal devices, handwriting input of drawing on a display screen has gradually become popular. When analyzing image information of hand-drawn handwriting by using a computer, image corner points are usually detected to extract image features. A corner point is usually defined as the intersection of two edges. More strictly, the local neighborhood of a corner point should have two different regions with different directions of the boundary. However, in actual applications, a corner point detection method generally detects image points with specific features.

[0003] In the prior art, when a user writes, handwriting suddenly shakes. The difference between the trajectory points caused by shaking and normal trajectory points may cause the trajectory points at the shaking position to be incorrectly identified as corner points. The identified corner points are inaccurate, and the number of pseudo corner points is large. SUMMARY

[0004] The present application provides a handwriting corner point determination method and device, a storage medium and a terminal, which can solve the technical problems of inaccurate corner points and a large number of pseudo corner points when determining handwriting corner points.

[0005] In a first aspect, the present application provides a handwriting corner point determination method, which includes the following steps.

[0006] Obtaining all trajectory points in target handwriting, calculating the writing speed of each trajectory point and the final curvature of each trajectory point, and the final curvature is the average of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points within a preset range of the corresponding trajectory point.

[0007] Selecting a corresponding trajectory point with a writing speed and a final curvature satisfying a preset condition as a first corner point of the target handwriting.

[0008] Removing pseudo corner points in the first corner point of the target handwriting to obtain a second corner point of the target handwriting.

[0009] Optionally, after calculating the writing speed of each trajectory point and the final curvature of each trajectory point, the method further includes calculating the average speed of trajectory points in the target handwriting according to the writing speed of each trajectory point, and calculating the average curvature of trajectory points in the target handwriting according to the final curvature of each trajectory point; wherein the preset condition is a condition set according to the average speed and the average curvature.

[0010] Optionally, the corresponding trajectory point of the selected writing speed and the final curvature satisfying the preset condition is a first corner point of the target handwriting, and the method further comprises: calculating distances between each first corner point and a next first corner point corresponding to the first corner point in sequence according to a writing order of the first corner points in the target handwriting, and removing the first corner point with a distance less than a preset length.

[0011] Optionally, the removing of the pseudo corner point in the first corner point of the target handwriting to obtain a second corner point of the target handwriting comprises: performing line segment fitting on a stroke segment in the target handwriting to obtain a fitting result corresponding to the stroke segment, the stroke segment being a trajectory segment corresponding to each adjacent two first corner points in the target handwriting; determining the pseudo corner point in the first corner point according to the fitting result and a preset fitting condition; and removing the pseudo corner point in the first corner point to determine a remaining corner point in the first corner point as the second corner point of the target handwriting.

[0012] Optionally, the line segment fitting on the stroke segment in the target handwriting to obtain the fitting result corresponding to the stroke segment comprises: calculating lengths of the stroke segments, and calculating an average length of all stroke segments in the target handwriting according to the lengths of the stroke segments; selecting a stroke segment with a length shorter than the average length as a target stroke segment, and performing line segment fitting on the target stroke segment to obtain a self fitting error corresponding to each target stroke segment; performing line segment fitting on a left adjacent stroke segment of each target stroke segment to obtain a left fitting error of the left adjacent stroke segment according to a writing order of the target stroke segments in the target handwriting, and performing line segment fitting on a right adjacent stroke segment of each target stroke segment to obtain a right fitting error of the right adjacent stroke segment; merging each target stroke segment and a left adjacent stroke segment corresponding to the target stroke segment to obtain a left merged stroke segment, and performing line segment fitting on each left merged stroke segment to obtain a left merged fitting error of each left merged stroke segment; and merging each target stroke segment and a right adjacent stroke segment corresponding to the target stroke segment to obtain a right merged stroke segment, and performing line segment fitting on each right merged stroke segment to obtain a right merged fitting error of each right merged stroke segment.

[0013] Optionally, the determining of the pseudo corner point in the first corner point according to the fitting result and the preset fitting condition comprises: if the left merged fitting error in the target stroke segment is less than the right merged fitting error, and the left merged fitting error in the target stroke segment is less than a sum of a first preset multiple of the left fitting error and a second preset multiple of the self fitting error, determining a first corner point at a left end of the target stroke segment as the pseudo corner point; and if the right merged fitting error in the target stroke segment is less than the left merged fitting error, and the right merged fitting error in the target stroke segment is less than a sum of a third preset multiple of the right fitting error and a fourth preset multiple of the self fitting error, determining a first corner point at a right end of the target stroke segment as the pseudo corner point.

[0014] Optionally, after the pseudo corner point in the first corner point is removed, the method further comprises: re-performing line segment fitting on the stroke segment in the target handwriting, and removing the pseudo corner point in the first corner point again until the length of the stroke segment in the target handwriting is less than the average length of all stroke segments in the target handwriting.

[0015] Optionally, the preset range is a circular range with the corresponding trajectory point as a center point and a preset radius as a radius, and the circular range includes the corresponding trajectory point and at least three other trajectory points in the target handwriting.

[0016] Optionally, the writing speed and the final curvature of the starting trajectory point and the ending trajectory point in the target handwriting are both zero, and the starting trajectory point and the ending trajectory point are both first corner points.

[0017] In a second aspect, an embodiment of the present application provides a corner point determination device for handwriting, which comprises:

[0018] a speed-curvature calculation module, configured to acquire all trajectory points in target handwriting, and calculate the writing speed of each trajectory point and the final curvature of each trajectory point, the final curvature being the average of the cumulative curvatures of the vectors formed by the trajectory point and other trajectory points in a preset range of the trajectory point;

[0019] a corner point determination module, configured to select a corresponding trajectory point with the writing speed and the final curvature satisfying a preset condition as a first corner point of the target handwriting;

[0020] a pseudo corner point removal module, configured to remove a pseudo corner point in the first corner point of the target handwriting to obtain a second corner point of the target handwriting.

[0021] In a third aspect, an embodiment of the present application provides a computer storage medium, which stores a plurality of instructions, the instructions being suitable for being loaded by a processor and performing the steps of the above method.

[0022] In a fourth aspect, an embodiment of the present application provides a terminal, which comprises a memory, a processor, and a computer program stored in the memory and capable of running on the processor, the computer program being suitable for being loaded by the processor and performing the steps of the above method.

[0023] The technical scheme provided by some embodiments of the present application has at least the following beneficial effects:

[0024] The application provides a handwriting corner point determination method and device, a storage medium and a terminal. Firstly, all trajectory points in a target handwriting are acquired, the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points in a preset range of the corresponding trajectory point; then the corresponding trajectory point satisfying a preset condition in terms of the writing speed and the final curvature is selected as a first corner point of the target handwriting; and finally, a pseudo corner point in the first corner point of the target handwriting is removed to obtain a second corner point of the target handwriting. Since the mean value of all curvatures in a preset range of a trajectory point is taken as the final curvature of the trajectory point when the curvature of the trajectory point is calculated, that is, the mean value of the cumulative curvatures of the sliding window is taken as the curvature of the center trajectory point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by human normal shaking on the selection of the corner point, can effectively smooth the curvature mutation caused by shaking, and then selects a more accurate corner point, and according to the first corner point, the handwriting is subjected to line segment fitting, cyclic iteration and other calculation operations, and the pseudo corner point is removed from the first corner point, so that the pseudo corner point in the corner point can be further effectively removed, and finally the correct corner point in the handwriting is determined. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0026] Figure 1 An exemplary system architecture diagram of a handwriting corner point determination method provided by an embodiment of the present application;

[0027] Figure 2 A system interaction diagram of a handwriting corner point determination method provided by an embodiment of the present application;

[0028] Figure 3 A flowchart of a handwriting corner point determination method provided by an embodiment of the present application;

[0029] Figure 4 A schematic diagram of a target handwriting provided by an embodiment of the present application;

[0030] Figure 5 A flowchart of a handwriting corner point determination method provided by another embodiment of the present application;

[0031] Figure 6 A flowchart of a handwriting corner point determination method provided by another embodiment of the present application;

[0032] Figure 7A structural block diagram of a handwriting corner determination device provided in an embodiment of this application;

[0033] Figure 8 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application. Detailed Implementation

[0034] To make the features and advantages of this application more apparent and understandable, the technical solutions in 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.

[0035] In the following description, when referring to the accompanying drawings, the same numbers in different drawings denote the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0036] Please see Figure 1 , Figure 1 An exemplary system architecture diagram of a handwriting corner determination method provided in an embodiment of this application.

[0037] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a server 103. The network 102 serves as the medium for providing a communication link between the terminal 101 and the server 103. The network 102 may include various types of wired or wireless communication links, such as wired communication links including fiber optic cables, twisted-pair cables, or coaxial cables, and wireless communication links including Bluetooth communication links, Wireless-Fidelity (Wi-Fi) communication links, or microwave communication links, etc.

[0038] The terminal 101 can interact with the server 103 through the network 102 to receive a message from the server 103 or send a message to the server 103, or the terminal 101 can interact with the server 103 through the network 102 to receive a message or data sent by other users to the server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices including but not limited to smart watches, smart phones, tablet computers, laptop computers, desktop computers, etc. When the terminal 101 is software, it can be installed in the above-mentioned electronic devices, and can be implemented as multiple software or software modules (for example, to provide distributed services) or a single software or software module, which is not specifically limited here.

[0039] The server 103 can be a service server providing various services. It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster composed of multiple servers or as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, to provide distributed services) or a single software or software module, which is not specifically limited here.

[0040] It should be understood that Figure 1 The number of terminals, networks and servers in the above-mentioned embodiments is only illustrative, and can be any number of terminals, networks and servers according to the needs of implementation.

[0041] Please refer to Figure 2 , Figure 2 A system interaction diagram of a method for determining a corner point of a handwriting provided by an embodiment of the present application is described below in combination with Figure 1 and Figure 2 The system interaction process in a method for determining a corner point of a handwriting is introduced.

[0042] S201, the display screen receives the target handwriting input from the outside.

[0043] Optionally, when a user needs to input a hand-drawn note, the user can input the hand-drawn handwriting on the display through a finger touch, a touch pen or other ways, and the display screen can receive the hand-drawn handwriting input from the outside as the target handwriting through a sensor in the device. The sensor in the device can be various, for example, a pressure sensor, a current sensor, a voltage sensor, etc., which is not limited in the embodiments of the present application.

[0044] S202, the processor obtains the target handwriting through the display screen, and obtains all trajectory points in the target handwriting, calculates the writing speed of each trajectory point and the final curvature of each trajectory point, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points in a preset range of the corresponding trajectory point.

[0045] Optionally, the preset range is a circular range with the corresponding trajectory point as the center point and a preset radius as the radius, and the circular range includes the corresponding trajectory point and at least three other trajectory points in the target handwriting.

[0046] Optionally, after calculating the writing speed of each trajectory point and the final curvature of each trajectory point, the method further comprises: calculating the average speed of the trajectory points in the target handwriting according to the writing speed of each trajectory point, and calculating the average curvature of the trajectory points in the target handwriting according to the final curvature of each trajectory point; wherein the preset condition is a condition set according to the average speed and the average curvature.

[0047] S203, the processor selects the corresponding trajectory point with the writing speed and the final curvature satisfying the preset condition as the first corner point of the target handwriting.

[0048] Optionally, the writing speed and the final curvature of the starting trajectory point and the ending trajectory point in the target handwriting are both zero, and the starting trajectory point and the ending trajectory point are both the first corner point.

[0049] Optionally, after selecting the corresponding trajectory point with the writing speed and the final curvature satisfying the preset condition as the first corner point of the target handwriting, the method further comprises: sequentially calculating the distance between each first corner point and the next first corner point corresponding thereto in the target handwriting according to the writing order of the first corner points in the target handwriting, and removing the first corner point with a distance less than a preset length.

[0050] S204, the processor removes the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting.

[0051] Optionally, removing the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting comprises: performing line segment fitting on the stroke segment in the target handwriting to obtain a fitting result corresponding to the stroke segment, the stroke segment being a trajectory segment corresponding to each adjacent two first corner points in the target handwriting; determining the pseudo corner point in the first corner point according to the fitting result and a preset fitting condition; removing the pseudo corner point in the first corner point to determine the remaining corner point in the first corner point as the second corner point of the target handwriting.

[0052] Optionally, the line segment fitting is performed on the stroke segment in the target handwriting to obtain a fitting result corresponding to the stroke segment, including: calculating lengths of the stroke segments, and calculating an average length of all stroke segments in the target handwriting according to the lengths of the stroke segments; selecting a stroke segment with a length shorter than the average length as a target stroke segment, performing line segment fitting on the target stroke segment to obtain a self fitting error corresponding to each target stroke segment; performing line segment fitting on a left adjacent stroke segment of each target stroke segment to obtain a left fitting error of the left adjacent stroke segment according to a writing order of the target stroke segment in the target handwriting, and performing line segment fitting on a right adjacent stroke segment of each target stroke segment to obtain a right fitting error of the right adjacent stroke segment; merging each target stroke segment and the corresponding left adjacent stroke segment to obtain a left merged stroke segment, and performing line segment fitting on each left merged stroke segment to obtain a left merged fitting error of each left merged stroke segment; merging each target stroke segment and the corresponding right adjacent stroke segment to obtain a right merged stroke segment, and performing line segment fitting on each right merged stroke segment to obtain a right merged fitting error of each right merged stroke segment.

[0053] Optionally, the pseudo corner point in the first corner point is determined according to the fitting result and a preset fitting condition, including: if the left merged fitting error in the target stroke segment is smaller than the right merged fitting error, and the left merged fitting error in the target stroke segment is smaller than a sum of a first preset multiple of the left fitting error and a second preset multiple of the self fitting error, the first corner point at a left end of the target stroke segment is determined as the pseudo corner point; if the right merged fitting error in the target stroke segment is smaller than the left merged fitting error, and the right merged fitting error in the target stroke segment is smaller than a sum of a third preset multiple of the right fitting error and a fourth preset multiple of the self fitting error, the first corner point at a right end of the target stroke segment is determined as the pseudo corner point.

[0054] Optionally, after the pseudo corner point in the first corner point is removed, the method further includes: performing line segment fitting on the stroke segment in the target handwriting again, and removing the pseudo corner point in the first corner point again until lengths of the stroke segments in the target handwriting are all smaller than the average length of all stroke segments in the target handwriting.

[0055] The embodiment of the present application provides a method for determining a corner point of handwriting. Firstly, all track points in target handwriting are acquired, the writing speed of each track point and the final curvature of each track point are calculated, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding track point and other track points within a preset range of the corresponding track point. Then, the average speed of the track points in the target handwriting is calculated according to the writing speed of each track point, and the average curvature of the track points in the target handwriting is calculated according to the final curvature of each track point. Finally, the corresponding track point whose writing speed and final curvature satisfy a preset condition is selected as the first corner point of the target handwriting, and the preset condition is a condition set according to the average speed and the average curvature. Since the mean value of all curvatures of the track points within a preset range is taken as the final curvature of the track point when the curvature of the track point is calculated, that is, the mean value of the cumulative curvature of the sliding window is taken as the curvature of the center track point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by normal human shaking to the selection of the corner point, can effectively smooth the curvature mutation caused by shaking, and then selects a more accurate corner point. And according to the first corner point, the line segment fitting, the cyclic iteration and other calculation operations of the handwriting are performed, and the pseudo corner point is removed from the first corner point. In this way, the pseudo corner point in the corner point can be further effectively removed, and the correct corner point in the handwriting is finally determined.

[0056] In the prior technical solution, in the process of determining the corner point of handwriting, generally only the preprocessing of handwriting is adopted, for example, track point Gaussian smoothing, track point resampling and the like, to reduce the occurrence of the misrecognition of the corner point caused by the curvature mutation and the like. In this way, only the overall image is preprocessed to remove the easily recognizable pseudo corner point. In the curvature calculation part of the track point, only the curvature of the track point is obtained by calculating the vectors between the track point and the adjacent two track points. However, when the user shakes suddenly while writing, the current track point will be more prominent than the adjacent two track points. At this time, the curvature of the track point determined according to the vectors between the adjacent track points and the track point can be very large, which leads to the error recognition of the track point as a corner point. Moreover, after the corner point is calculated, the pseudo corner point is not screened again, which leads to the inaccuracy of the finally determined corner point and the inclusion of multiple pseudo corner points.

[0057] Therefore, the embodiment of the present application provides a method for determining a corner point of handwriting to solve the above technical problems.

[0058] Please refer to Figure 3 , Figure 3 The flowchart of the method for determining a corner point of handwriting provided by the embodiment of the present application. The execution subject of the embodiment of the present application can be a terminal or a server, can also be a processor in the terminal or the server, can also be a corner point determination system of handwriting or a handwriting corner point determination service in the terminal or the server. For the convenience of description, the specific execution process of the method for determining a corner point of handwriting is introduced below by taking the execution subject as a processor in the terminal.

[0059] As Figure 3 shown in the corner point determination method of the handwriting can at least include:

[0060] S301, get all trajectory points in the target handwriting, calculate the writing speed of each trajectory point and the final curvature of each trajectory point, and the final curvature is the mean value of all curvatures of the corresponding trajectory point and the corresponding trajectory point in the preset range of other trajectory points.

[0061] Optionally, with the development of modern technology, handwriting input on the display screen has gradually become popular. When a user wants to know the image information corresponding to the handwriting by handwriting input on the terminal, it is necessary to recognize the drawing handwriting input by the user first, and then generate the corresponding handwriting image information. In the process of inputting the drawing handwriting by the user or after the user inputs the complete drawing image (which can include multiple handwritings), the image information of the hand-drawn handwriting is analyzed by using the computer, and the corner points of the handwriting are usually detected to extract the image features. The corner point is a trajectory point with specific features in the handwriting. For example, the corner point can be a trajectory point with a large degree of curvature. Therefore, the hand-drawn handwriting input by the user can be obtained as the target handwriting, and the points in the target handwriting can be collected as all trajectory points in the target handwriting, and then the corner points representing the characteristics of the handwriting can be determined from all the trajectory points.

[0062] Optionally, the target handwriting can be the handwriting corresponding to the process of inputting the drawing handwriting by the user, and can also be the handwriting corresponding to the process after the user inputs the complete drawing image (which can include multiple handwritings). The following will take the target handwriting as an example of the handwriting corresponding to the process of inputting the drawing handwriting by the user, and the corner point determination method of other types of target handwriting is similar to the following method.

[0063] Optionally, when the target handwriting can be the corresponding handwriting in the process of user inputting the handwriting, in order to achieve uniform and stable collection effect when collecting the track points in the target handwriting, in order to determine that the subsequent angle point cannot accurately represent the handwriting characteristics due to unstable collection frequency, the points in the target handwriting can be collected according to the preset frequency as all track points of the target handwriting. When collecting the track points of the target handwriting according to the preset frequency, the preset frequency can have multiple bases, for example, a fixed track point collection frequency can be set according to the most common writing speed of most users; the track point collection frequency corresponding to each user can be personalized set according to the personal writing speed of each user; the track points can be collected according to the user-defined collection frequency. The collection function according to the preset frequency can be realized by hardware devices or corresponding programs in the hardware devices, and the preset frequency setting basis and the track point collection manner of the embodiments of the present application are not limited.

[0064] Optionally, when selecting the angle point, the track point with obvious characteristics in all track points can be selected as the angle point, and the following will be introduced by taking the track point corresponding to the target handwriting when the bending angle is greater than the preset angle as an example.

[0065] On the one hand, in most cases, the writing speed of the user when depicting the image characteristics in the writing process will change accordingly, and the state when writing the track point can be determined according to the speed of the track point, and the slower the speed of the track point, the more likely the target handwriting is bent at the track point; on the other hand, the curvature of the track point is the rotation rate of the tangent direction angle of the track point to the arc length, which indicates the degree of deviation of the track point from the target handwriting, and the state when writing the track point can also be determined according to the curvature of the track point, and the greater the curvature of the track point, the more likely the target handwriting is bent at the track point, so the speed and curvature of the corresponding track point of the target handwriting when bent can reflect the characteristics of the target handwriting when bent.

[0066] Therefore, after collecting the track points in the target handwriting, the writing speed of each track point and the curvature of each track point can be calculated, and the writing speed and the curvature are used as the judgment condition for selecting the track point, which can more comprehensively compare all track points compared with only considering the curvature of the track point. When calculating the writing speed of the current track point, the distance between the current track point and the left and right adjacent two track points and the corresponding time can be used for calculation, wherein the distance between the adjacent two track points of the current track point is divided by the time difference between the adjacent two track points to obtain the speed of the current track point, and a specific calculation method is as follows:

[0067] v=pathLength(i-1,i+1) / (t i+1 -t i-1);

[0068] wherein the writing speed of the current trajectory point is denoted as v, the time corresponding to the current trajectory point is denoted as t, the identification number of the current trajectory point is denoted as i, and the sum of distances between the current trajectory point and the two adjacent trajectory points on the left and right is denoted as pathLength.

[0069] Further, in order to more accurately select the corner point from the trajectory points, the curvature of each trajectory point needs to be calculated. It can be understood that when calculating the curvature of the trajectory point, the vector formed by the trajectory point and the other trajectory points on the left and the vector formed by the trajectory point and the other trajectory points on the right can be obtained first, and the curvature of the trajectory point is calculated through the included angle between the two vectors. In some schemes, the curvature of the trajectory point is directly calculated according to the vectors formed by the trajectory point and the two adjacent trajectory points on the left and right. However, in actual situations, if the user normally shakes when drawing the image, the hand-drawn trace will fluctuate, and at this time, the pseudo corner point with characteristics but not reflecting the original characteristics of the image will appear in the trace. Although the pseudo corner point may not be obvious to the entire trace and thus affect the overall characteristics of the image, it will be more prominent compared with the adjacent trajectory points. Therefore, the curvature of the trajectory point is determined only according to the vectors formed by the trajectory point and the two adjacent trajectory points, which cannot avoid the emergence of the pseudo corner point, and the pseudo corner point will make the characteristic analysis result of the original trace inaccurate.

[0070] Optionally, since the pseudo corner point has a relatively obvious bending degree with respect to the adjacent trajectory points, but only shows a relatively slight bending degree in the segment of the trace where the pseudo corner point is located. Therefore, in order to remove the pseudo corner point in the trajectory points, when calculating the curvature of the trajectory point, a plurality of vectors formed by the trajectory point and a plurality of other trajectory points within a preset range can be calculated, and a plurality of curvatures corresponding to the trajectory point can be calculated according to the plurality of vectors, and finally the final curvature of the trajectory point is determined according to the plurality of curvatures. In this way, the sudden change of the curvature of the trajectory point due to human shaking can be effectively smoothed, and the pseudo corner point can be effectively removed.

[0071] Please refer to Figure 4 , Figure 4 A schematic diagram of a target trace is provided for the embodiments of the present application. As shown in Figure 4As shown, in a stroke 410 on the display screen 400, there are multiple trajectory points 420. The trajectory points A, B, C, D, and E exist in the order of writing. When calculating the curvature of point C, not only is the first curvature of point C calculated based on the vectors formed by points B and C, and points D and C, but also the second curvature of point C is calculated based on the vectors formed by points A and C, and points E and C, the third curvature of point C is calculated based on the vectors formed by points B and C, and points E and C, and the fourth curvature of point C is calculated based on the vectors formed by points A and C, and points D and C. At this point, the most accurate final curvature of point C can be determined based on the first, second, third, and fourth curvatures of point C.

[0072] Optionally, in order to collect other trajectory points on the left and right sides of the current trajectory point relatively evenly, a preset range can be set as a circular range with the trajectory point as the center and a preset radius. Figure 4 (Represented by a circular window 430 in the image), and to ensure that the final curvature of each trajectory point can be calculated based on at least two curvatures, the circular range of the preset radius can be set to include not only the current trajectory point but also at least three other trajectory points on the same target handwriting as the current trajectory point. The specific radius of the circular range can be set based on this rule and the aforementioned trajectory point acquisition frequency. After setting the radius R of the circular range, the curvature curvature of the trajectory point is calculated according to the curvature solution formula f as follows:

[0073] curvature[i]=f(vector[ir],vector[i+r]),r=[0,R];

[0074] Here, the identifier of the current trajectory point is i, r is the straight-line distance between the current trajectory point and other trajectory points in the target handwriting, and vector[ir] is the vector representation formed by the two trajectory points. It's easy to understand that a circular range with a preset radius can also be considered a window, and the curvature of the center trajectory point within this range is the cumulative curvature of that window.

[0075] Optionally, after obtaining multiple curvatures of the trajectory points, in order to uniformly calculate the final curvature of all trajectory points, an average curvature can be obtained based on all curvatures within a preset range window as the final curvature of the trajectory point. In practice, to ensure the integrity of the acquired image information, the acquisition frequency of trajectory points is generally high, and the trajectory points are generally dense. There can be many trajectory points within a preset radius. Therefore, in a preferred embodiment, in order to preserve the curvature characteristics of the current trajectory point to the greatest extent, all curvatures within the preset range window can be arranged from largest to smallest, and the average value c of the top 50% of curvature values ​​can be obtained as the final curvature of the current trajectory point.

[0076] S302, select a corresponding trajectory point with a writing speed and a final curvature satisfying a preset condition as a first corner point of the target handwriting.

[0077] Optionally, after the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, all trajectory points can be screened according to preset writing speed conditions and final curvature conditions, and trajectory points satisfying the preset conditions are selected as corner points of the target handwriting. When the preset conditions are set, a fixed value can be directly set as a preset threshold condition of the writing speed and the final curvature of the trajectory point, so that the calculation steps of the conditions are reduced; or different preset conditions can be set according to different target handwriting, so that the corresponding preset conditions can be more accurately set for the target handwriting.

[0078] S303, remove the pseudo corner point in the first corner point of the target handwriting to obtain a second corner point of the target handwriting.

[0079] Optionally, when the corner point is determined according to the curvature of the trajectory point, only the corner point is selected from the level of each trajectory point, so that the pseudo corner point cannot be avoided. When the first corner point is determined according to the writing speed and the final curvature of the trajectory point, the pseudo corner point can be removed in an ideal case of each selection condition, but part of the pseudo corner point may also meet the selection condition of the first corner point, so as to be considered as the first corner point. Then, after the first corner point is determined, the first corner point can be further detected to determine the pseudo corner point in the first corner point, and the corresponding pseudo corner point can be removed to obtain the second corner point of the target handwriting.

[0080] The embodiment of the present application provides a corner point determination method of handwriting. First, all trajectory points in target handwriting are obtained, the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, and the final curvature is the average of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points in a preset range of the corresponding trajectory point; then a corresponding trajectory point with a writing speed and a final curvature satisfying a preset condition is selected as a first corner point of the target handwriting; finally, a pseudo corner point in the first corner point of the target handwriting is removed to obtain a second corner point of the target handwriting. Since the average of all curvatures in a preset range of the trajectory point is taken as the final curvature of the trajectory point when the curvature of the trajectory point is calculated, that is, the average of the cumulative curvatures of the sliding window is taken as the curvature of the center trajectory point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by human normal jitter to the corner point selection, can effectively smooth the curvature mutation caused by jitter, and then selects a more accurate corner point, and subsequently continues to remove the pseudo corner point from the first corner point, so that the pseudo corner point in the corner point can be further effectively removed, and finally the correct corner point in the handwriting is determined.

[0081] Please refer to Figure 5 , Figure 5A flowchart of a method for determining a corner point of handwriting is provided for another embodiment of the present application.

[0082] As shown in the method for determining a corner point of handwriting can at least include: Figure 5

[0083] S501, all trajectory points in the target handwriting are acquired, the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points within a preset range of the corresponding trajectory point.

[0084] For step S501, please refer to the detailed description in step S301, which will not be repeated here.

[0085] S502, the average speed of the trajectory points in the target handwriting is calculated according to the writing speed of each trajectory point, and the average curvature of the trajectory points in the target handwriting is calculated according to the final curvature of each trajectory point, wherein the preset condition is a condition set according to the average speed and the average curvature.

[0086] It can be understood that when processing data, the average value can reflect the overall characteristics of the data, so when setting the preset condition in the embodiment of the present application, the preset condition can be set according to the average speed of all trajectory points and the average curvature of all trajectory points, so it is necessary to calculate the average speed v avg of the trajectory points in the target handwriting according to the writing speed of each trajectory point, and calculate the average curvature c avg of the trajectory points in the target handwriting according to the final curvature of each trajectory point.

[0087] S503, the corresponding trajectory point whose writing speed and final curvature satisfy the preset condition is selected as the first corner point of the target handwriting.

[0088] Optionally, after calculating the writing speed and final curvature of each trajectory point, and the average speed and average curvature of all trajectory points through the introduction of the above embodiment, the preset condition can be set according to the average speed and average curvature of all trajectory points. Further, when the writing speed of the trajectory point is greater than the average speed by a preset multiple, and the final curvature is greater than the average curvature by a preset multiple, the current trajectory point can be selected as the first corner point of the target handwriting. Preferably, the preset multiple of the average speed can be set to 0.75, and the preset multiple of the average speed can be set to 1. At this time, if the writing speed or the final curvature of the trajectory point satisfies the following condition:

[0089] v>0.75v avg , and c>c avg ;

[0090] ​The trajectory point is selected as the first corner point of the target handwriting. When the preset condition is set, the multiple parameter used can be obtained according to multiple sample tests, or can be directly set according to experience. When the first corner point is selected for different handwriting, the parameter can be adaptively adjusted, and the parameter setting is not limited in the embodiments of the present application.

[0091] Optionally, when the writing speed and the final curvature of the trajectory point in the target handwriting are calculated, the starting trajectory point and the ending trajectory point of the target handwriting are regarded as two end points of the target handwriting, and the writing speed and the final curvature of the starting trajectory point and the ending trajectory point are both zero. However, the starting trajectory point and the ending trajectory point are both important to the features of the image, and thus the starting trajectory point and the ending trajectory point are both regarded as the first corner point by default.

[0092] S504, according to the writing sequence of each first corner point in the target handwriting, the distance between each first corner point and the next first corner point corresponding to the first corner point is calculated in sequence, and the first corner point with a distance less than a preset length is removed.

[0093] Optionally, in most cases, when a user draws, two image features are not usually continuously drawn in a short distance, for example, two handwriting bends appear in a segment distance. Therefore, in hand-drawn handwriting, two correct corner points usually do not appear in a very close position. Then, based on this, when two first corner points are close, it is indicated that a false corner point may exist. Therefore, a screening condition can be set based on the distance between the current first corner point and the next first corner point corresponding to the first corner point, each first corner point is traversed according to the handwriting writing sequence, the first corner point is screened according to the screening condition, and the false corner point is removed.

[0094] Further, when setting the screening condition, the distance from the current first corner point to the next first corner point corresponding thereto can be compared with the target handwriting total length multiplied by a preset multiple, and when the distance from the current first corner point to the next first corner point corresponding thereto is less than the target handwriting total length multiplied by the preset multiple, the first corner point with smaller curvature among the two first corner points is removed. The preset multiple can be set according to actual conditions, and the preset multiple parameter is not limited in the embodiments of the present application. Preferably, when the distance between the current first corner point and the next first corner point corresponding thereto is less than 0.1 times the target handwriting total length, the curvatures of the current first corner point and the next first corner point corresponding thereto are compared, the first corner point with smaller curvature among the two first corner points is removed, and all the first corner points are traversed according to the condition, and finally the remaining first corner points are selected. It should be noted that, in order to enable the traversal to be performed completely, when the pseudo corner point to be removed is screened, the pseudo corner point can be marked first to avoid affecting the screening process of the next corner point of the pseudo corner point due to direct removal after the calculation result, all the marked first corner points are removed as pseudo corner points after all the first corner points are traversed, and the remaining first corner points are selected as the first corner points of the target handwriting.

[0095] S505, removing the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting.

[0096] For step S505, refer to the detailed description in step S303, which will not be repeated here.

[0097] The embodiments of the present application provide a corner point determination method of handwriting. First, all the trajectory points in the target handwriting are acquired, the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, and the final curvature is the mean value of all the curvatures of the corresponding trajectory point and other trajectory points in a preset range of the corresponding trajectory point; then the corresponding trajectory point with the writing speed and the final curvature satisfying a preset condition is selected as the first corner point of the target handwriting; finally, the pseudo corner point in the first corner point of the target handwriting is removed to obtain the second corner point of the target handwriting. Since the mean value of all the curvatures in a preset range of a trajectory point is taken as the final curvature of the trajectory point when the curvature of the trajectory point is calculated, that is, the mean value of the cumulative curvatures of the sliding window is taken as the curvature of the center trajectory point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by human normal shaking on the selection of the corner point, can effectively smooth the curvature mutation caused by shaking, and then selects a more accurate corner point, and subsequently continues to remove the pseudo corner point from the first corner point, which can further effectively remove the pseudo corner point in the corner point, and finally determines the correct corner point in the handwriting.

[0098] For step S505, refer to the detailed description in step S303, which will not be repeated here. Figure 6 , Figure 6 A flowchart of a corner point determination method of handwriting provided by another embodiment of the present application is shown.

[0099] As Figure 6 shown, the corner point determination method of handwriting can at least include:

[0100] S601, all trajectory points in the target handwriting are acquired, the writing speed of each trajectory point and the final curvature of each trajectory point are calculated, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points within a preset range of the corresponding trajectory point.

[0101] S602, the corresponding trajectory point satisfying the preset condition in writing speed and final curvature is selected as the first corner point of the target handwriting.

[0102] For steps S601-S602, please refer to the detailed description in steps S301-S302, which will not be repeated here.

[0103] S603, line segment fitting is performed on the stroke segment in the target handwriting to obtain the fitting result corresponding to the stroke segment, and the stroke segment is the trajectory segment corresponding to each adjacent two first corner points in the target handwriting.

[0104] Alternatively, as can be known from the introduction of the above embodiments, in actual situations, after the first corner point in the target handwriting is determined, in order to determine whether there is a false corner point in the first corner point and remove the false corner point when the first corner point has a false corner point, the stroke segment in the target handwriting can be considered from the overall level of the target handwriting, and line segment fitting is performed on the stroke segment in the target handwriting to determine whether the trajectory point is a false corner point according to the stroke segment information before and after the trajectory point. The line segment fitting is to fit the stroke segment in the target handwriting and the line segment connected between the two trajectory points at the beginning and end of the stroke segment. Finally, the fitting error between the stroke segment and the corresponding line segment can be obtained. The smaller the fitting error is, the more the stroke segment and the corresponding line segment fit, that is, the stroke segment can be a complete stroke segment without feature points, which proves that the corner point in the stroke segment is a false corner point. At this time, the preset fitting condition can be set, and the preset fitting condition is compared with the fitting result of the stroke segment, so that the false corner point in the first corner point can be determined and removed.

[0105] Specifically, before performing line segment fitting on the stroke segment, it is necessary to first segment the target handwriting according to the first corner points in the target handwriting, segment the target handwriting into stroke segments according to each pair of adjacent first corner points, and perform line segment fitting on all stroke segments in the target handwriting according to a preset fitting rule. Considering the actual situation, since the user usually does not draw two image bending feature points at a close distance, when the distance between two corner points is close, the probability of having a false corner point in the two corner points is large, that is, it is more likely to occur in a shorter stroke segment, and when the target handwriting is long and the stroke segments in the target handwriting are more, if line segment fitting is performed on each stroke segment, it will cause excessive calculation and the false corner point detection result will not be significantly improved.

[0106] Alternatively, the length of each stroke segment can be calculated, and the average length of all stroke segments in the target handwriting can be calculated according to the length of each stroke segment. The stroke segment with a length shorter than the average length is selected as the target stroke segment, and only the target stroke segment is subjected to line segment fitting to determine the fitting result of the target stroke segment. In this way, the calculation pressure can be reduced, and the false corner points in the target handwriting can still be detected. For ease of description, the stroke segment can be denoted as Segment Stroke, the length of each stroke segment can be denoted as Path Length, and the average length of all stroke segments can be denoted as Seg ave_len .

[0107] Alternatively, after selecting the target stroke segment, all target stroke segments can be sorted in ascending order of length, and line segment fitting is performed from the shortest target stroke segment to facilitate subsequent traversal of each target stroke segment and line segment fitting according to the preset fitting rule. Further, the fitting result of the target stroke segment is obtained. First, line segment fitting is performed on the target stroke segment Segment Stroke s to obtain the self-fitting error FitError s of the target stroke segment corresponding thereto; then, line segment fitting is performed on the left adjacent stroke segment Segment Stroke s-1 of each target stroke segment to obtain the left fitting error FitError s-1 of the left adjacent stroke segment, and line segment fitting is performed on the right adjacent stroke segment Segment Stroke s+1 of each target stroke segment to obtain the right fitting error FitError s+1 of the right adjacent stroke segment; and each target stroke segment and the corresponding left adjacent stroke segment are combined to obtain a left combined stroke segment Segment Stroke left , and line segment fitting is performed on each left combined stroke segment to obtain the left combined fitting error FitError left, and the right-adjacent stroke segment corresponding to each target stroke segment is merged to obtain a right-merged stroke segment Segment Stroke right , a line segment fitting is performed on each right-merged stroke segment to obtain a right-merged fitting error FitError right , and a self fitting error FitError s , a left fitting error FitError s-1 , a right fitting error FitError s+1 , a left-merged fitting error FitError left , a right-merged fitting error FitError right , and the self fitting error FitError

[0108] It can be understood that when there is no adjacent stroke segment on the left or right side of the target stroke segment in the target handwriting, the target stroke segment is directly taken as a merged stroke segment during stroke segment merging. For example, if the target stroke segment is the first stroke segment in the target handwriting, there is no adjacent stroke segment on the left side of the target stroke segment, and thus the target stroke segment is taken as a left-merged stroke segment during left merging, and the self fitting error of the target stroke segment is taken as a left-merged fitting error for subsequent calculation.

[0109] S604, determining a false corner point in the first corner point according to the fitting result and a preset fitting condition.

[0110] Alternatively, according to the introduction of the above embodiments, it can be known that after the fitting result of the target stroke segment is determined according to the preset fitting rule, the preset fitting condition can be set, the preset fitting condition is compared with the fitting result of the stroke segment, and a false corner point in the first corner point can be determined to further remove the false corner point in the first corner point. Since only the first and last two trajectory points in the target stroke segment are first corner points, the two corner points can be detected according to the fitting result, wherein if the left-merged fitting error is smaller than the right-merged fitting error in the target stroke segment, it indicates that the left-merged stroke segment fits the line segment more than the right-merged stroke segment, and the probability of a real corner point appearing in the left-merged stroke segment is lower than that in the right-merged stroke segment, that is, the first corner point at the left end of the target stroke segment can be a false corner point. On this basis, the self fitting error of the target stroke segment is compared with the left fitting error to further determine whether the first corner point at the left end of the target stroke segment is a false corner point.

[0111] Specifically, the setting of the preset fitting condition can be that if the left-merged fitting error FitError left is smaller than the right-merged fitting error FitError right in the fitting result of the target stroke segment, and the left-merged fitting error FitError leftthe left fitting error FitError of the target stroke segment is less than the left merging fitting error FitError s-1 the self fitting error FitError of the second preset multiple s , and the sum of the left fitting error FitError of the target stroke segment and the self fitting error FitError of the second preset multiple is less than the sum of the right merging fitting error FitError of the target stroke segment and the self fitting error FitError of the fourth preset multiple, the first corner point at the left end of the target stroke segment is determined as a false corner point. right left the right fitting error FitError of the target stroke segment is less than the right merging fitting error FitError right s+1 the self fitting error FitError of the third preset multiple s , and the sum of the right fitting error FitError of the target stroke segment and the self fitting error FitError of the fourth preset multiple is less than the sum of the left merging fitting error FitError of the target stroke segment and the self fitting error FitError of the second preset multiple, the first corner point at the right end of the target stroke segment is determined as a false corner point. The first preset multiple, the second preset multiple, the third preset multiple, and the fourth preset multiple can be set according to actual conditions, and the four preset multiples can be the same or different, and the preset multiple parameters are not limited in the embodiments of the present application.

[0112] In the embodiments of the present application, in order to detect the false corner points in the target handwriting with the same standard, and facilitate the false corner point calculation, the first preset multiple and the third preset multiple in the preset fitting condition are set to be the same, both being 1.5, and the second preset multiple and the fourth preset multiple are set to be the same, both being 1, that is, if the fitting result of the target stroke segment satisfies:

[0113] FitError left <FitError right , and FitError left <1.5×FitError s-1 +FitError s ;

[0114] the first corner point at the left end of the target stroke segment is determined as a false corner point.

[0115] If the fitting result of the target stroke segment satisfies:

[0116] FitError right <FitError left , and FitError right <1.5×FitError s+1 +FitError s ;

[0117] the first corner point at the right end of the target stroke segment is determined as a false corner point.

[0118] S605, remove the false corner points in the first corner points.

[0119] ​​Optionally, after all target stroke segments in the target handwriting are traversed, the fitting results of each stroke segment are compared with the preset fitting condition respectively, and the pseudo corner points are determined, the pseudo corner points in the first corner points can be directly removed, and then the pseudo corner points in the target handwriting are filtered.

[0120] S606, the stroke segments in the target handwriting are re-performed line segment fitting, and the pseudo corner points in the first corner points are removed again until the lengths of the stroke segments in the target handwriting are all less than the average length of all stroke segments in the target handwriting.

[0121] Optionally, after the pseudo corner points in all target stroke segments in the target handwriting are detected, in order to more comprehensively detect the first corner points in the target handwriting, all stroke segments in the target handwriting can be iterated, so that after each traversal, it can be further determined whether the remaining first corner points contain pseudo corner points, and finally when the stroke segments in the target handwriting meet the iteration end condition, it can be determined that the corner points in the target handwriting are all real corner points.

[0122] Specifically, after removing the pseudo corner points in the first corner points each time, the stroke segments in the target handwriting can be re-segmented according to the remaining corner points in the first corner points, and the re-segmented stroke segments are subjected to line segment fitting according to the preset fitting condition, and the pseudo corner points in the first corner points are removed again until the lengths of the stroke segments in the target handwriting are all less than the average length of all stroke segments in the target handwriting Seg ave_len . It should be noted that each time the iteration is run, the average length of the stroke segments Seg ave_len can be directly multiplied by the number of loop iterations, which can speed up the calculation efficiency compared to recalculating the average length of the stroke segments each time, and will not affect the calculation result.

[0123] S607, the remaining corner points in the first corner points are determined as the second corner points of the target handwriting.

[0124] Optionally, by continuously iterating the stroke segments in the target handwriting, when all stroke segments meet the iteration end condition, the pseudo corner points in the first corner points have been removed, at this time, the remaining corner points in the first corner points can be determined as the second corner points of the target handwriting, and the second corner points are the most accurate real corner points in the final target handwriting.

[0125] The application provides a method for determining a corner point of handwriting. Firstly, all track points in target handwriting are acquired, the writing speed of each track point and the final curvature of each track point are calculated, and the final curvature is the mean value of all curvatures of vectors formed by the corresponding track point and other track points within a preset range of the corresponding track point. Then, the corresponding track point satisfying the preset condition in writing speed and final curvature is selected as the first corner point of the target handwriting. Finally, the pseudo corner point in the first corner point of the target handwriting is removed to obtain the second corner point of the target handwriting. Since the mean value of all curvatures within a preset range of a track point is taken as the final curvature of the track point when the curvature of the track point is calculated, that is, the mean value of the cumulative curvature of the sliding window is taken as the curvature of the center track point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by human normal shaking to the selection of the corner point, can effectively smooth the curvature mutation caused by shaking, and then selects a more accurate corner point. According to the first corner point, the line segment fitting, the cyclic iteration and other calculation operations are performed on the handwriting, the pseudo corner point is removed from the first corner point, so that the pseudo corner point in the corner point can be further effectively removed, and finally the correct corner point in the handwriting is determined.

[0126] Please refer to Figure 7 , Figure 7 The application provides a structure block diagram of a device for determining a corner point of handwriting. As shown in Figure 7 ,

[0127] The speed curvature calculation module 710 is used for acquiring all track points in target handwriting, calculating the writing speed of each track point and the final curvature of each track point, and the final curvature is the mean value of the cumulative curvature of vectors formed by the track point and other track points within a preset range of the track point.

[0128] The corner point determination module 720 is used for selecting the corresponding track point satisfying the preset condition in writing speed and final curvature as the first corner point of the target handwriting.

[0129] The pseudo corner point removal module 730 is used for removing the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting.

[0130] Optionally, the device for determining a corner point of handwriting 700 further comprises a mean value calculation module used for calculating the average speed of the track points in the target handwriting according to the writing speed of each track point, and calculating the average curvature of the track points in the target handwriting according to the final curvature of each track point, wherein the preset condition is a condition set according to the average speed and the average curvature.

[0131] Optionally, the device for determining a corner point of handwriting 700 further comprises a pseudo corner point determination module used for sequentially calculating the distance between each first corner point and the next first corner point corresponding to the first corner point in the target handwriting according to the writing order of each first corner point in the target handwriting, and removing the first corner point with a distance less than a preset length.

[0132] Optionally, the pseudo corner point removing module 730 is further configured to perform line segment fitting on the stroke segment in the target handwriting to obtain a fitting result corresponding to the stroke segment, the stroke segment being a trajectory segment corresponding to each two adjacent first corner points in the target handwriting; determine the pseudo corner points in the first corner points according to the fitting result and a preset fitting condition; remove the pseudo corner points in the first corner points, and determine the remaining corner points in the first corner points as second corner points of the target handwriting.

[0133] Optionally, the pseudo corner point removing module 730 is further configured to calculate lengths of the stroke segments, and calculate an average length of all the stroke segments in the target handwriting according to the lengths of the stroke segments; select a stroke segment with a length shorter than the average length as a target stroke segment, perform line segment fitting on the target stroke segment to obtain a self fitting error corresponding to each target stroke segment; perform line segment fitting on a left adjacent stroke segment of each target stroke segment to obtain a left fitting error of the left adjacent stroke segment according to a writing order of the target stroke segment in the target handwriting, and perform line segment fitting on a right adjacent stroke segment of each target stroke segment to obtain a right fitting error of the right adjacent stroke segment; merge each target stroke segment and a left adjacent stroke segment corresponding to the target stroke segment to obtain a left merged stroke segment, and perform line segment fitting on each left merged stroke segment to obtain a left merged fitting error of each left merged stroke segment; merge each target stroke segment and a right adjacent stroke segment corresponding to the target stroke segment to obtain a right merged stroke segment, and perform line segment fitting on each right merged stroke segment to obtain a right merged fitting error of each right merged stroke segment.

[0134] Optionally, the pseudo corner point removing module 730 is further configured to determine a first corner point at a left end of the target stroke segment as a pseudo corner point if the left merged fitting error in the target stroke segment is smaller than the right merged fitting error, and the left merged fitting error in the target stroke segment is smaller than a sum of a first preset multiple of the left fitting error and a second preset multiple of the self fitting error; and determine a first corner point at a right end of the target stroke segment as a pseudo corner point if the right merged fitting error in the target stroke segment is smaller than the left merged fitting error, and the right merged fitting error in the target stroke segment is smaller than a sum of a third preset multiple of the right fitting error and a fourth preset multiple of the self fitting error.

[0135] Optionally, the pseudo corner point removing module 730 is further configured to perform line segment fitting on the stroke segment in the target handwriting again, and remove the pseudo corner points in the first corner points again until lengths of the stroke segments in the target handwriting are all smaller than the average length of all the stroke segments in the target handwriting.

[0136] In the embodiment of the present application, a corner point determination device for handwriting is provided, wherein a speed curvature calculation module is configured to obtain all trajectory points in a target handwriting, calculate the writing speed of each trajectory point and the final curvature of each trajectory point, and the final curvature is the average of the cumulative curvature of the vectors formed by the trajectory point and other trajectory points within a preset range of the trajectory point; a corner point determination module is configured to select the corresponding trajectory point whose writing speed and final curvature satisfy a preset condition as the first corner point of the target handwriting; and a pseudo corner point removal module is configured to remove the pseudo corner points in the first corner point of the target handwriting to obtain the second corner point of the target handwriting. Since the average of the trajectory points in the preset range is taken as the final curvature of the trajectory point when calculating the curvature of the trajectory point, that is, the average of the cumulative curvature of the sliding window is taken as the curvature of the center trajectory point of the window, and then the first corner point in the handwriting is determined, which reduces the misleading of the curvature mutation caused by normal human shaking on the selection of the corner point, can effectively smooth the curvature mutation caused by shaking, and then selects a more accurate corner point, and according to the first corner point, performs line segment fitting, cyclic iteration and other calculation operations on the handwriting, removes the pseudo corner points from the first corner point, which can further effectively remove the pseudo corner points in the corner point, and finally determines the correct corner point in the handwriting.

[0137] The embodiment of the present application also provides a computer storage medium, which can store a plurality of instructions, and the instructions are suitable for being loaded and executed by a processor to perform the steps of the method in any one of the above embodiments.

[0138] Please refer to Figure 8 , Figure 8 A structure schematic diagram of a terminal is provided in the embodiment of the present application. As shown in Figure 8 , the terminal 800 can include at least one terminal processor 801, at least one network interface 804, a user interface 803, a memory 805, and at least one communication bus 802.

[0139] The communication bus 802 is configured to realize the connection communication between the components.

[0140] The user interface 803 can include a display screen (Display) and a camera (Camera), and the optional user interface 803 can further include a standard wired interface and a wireless interface.

[0141] The network interface 804 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0142] The terminal processor 801 can include one or more processing cores. The terminal processor 801 connects various parts within the terminal 800 through various interfaces and lines, and performs various functions of the terminal 800 and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Alternatively, the terminal processor 801 can be implemented in at least one of a hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The terminal processor 801 can be integrated with a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU is mainly responsible for processing operating systems, user interfaces, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is responsible for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the terminal processor 801, but can be implemented by a separate chip.

[0143] The memory 805 can include a random access memory (RAM) and can also include a read-only memory (ROM). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 805 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area can store data involved in the above-mentioned various method embodiments, etc. The memory 805 can also be at least one storage device located away from the aforementioned terminal processor 801. As shown in the figure, the memory 805 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a stroke corner point determination program. Figure 8 As shown in the figure, the memory 805 as a computer storage medium can include an operating system, a network communication module, a user interface module, and a stroke corner point determination program.

[0144] In Figure 8The terminal 800 shown, the user interface 803 is mainly used for providing the interface for the user to input, obtaining the data input by the user; and the terminal processor 801 can be used for calling the handwriting corner point determination program stored in the memory 805, and specifically performing the following operations:

[0145] obtaining all trajectory points in the target handwriting, calculating the writing speed of each trajectory point and the final curvature of each trajectory point, and the final curvature being the mean of all curvatures of vectors formed by the corresponding trajectory point and other trajectory points within a preset range of the corresponding trajectory point;

[0146] selecting the corresponding trajectory point satisfying the preset condition in the writing speed and the final curvature as the first corner point of the target handwriting;

[0147] removing the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting.

[0148] Optionally, the preset range is a circular range with the corresponding trajectory point as the center point and a preset radius, and the circular range includes the corresponding trajectory point and at least three other trajectory points in the target handwriting.

[0149] Optionally, the writing speed and the final curvature of the starting trajectory point and the ending trajectory point in the target handwriting are both zero, and the starting trajectory point and the ending trajectory point are both the first corner point.

[0150] In some embodiments, after the terminal processor 801 performs the steps of calculating the writing speed of each trajectory point and the final curvature of each trajectory point, the terminal processor 801 further specifically performs the following steps: calculating the average speed of the trajectory points in the target handwriting according to the writing speed of each trajectory point, and calculating the average curvature of the trajectory points in the target handwriting according to the final curvature of each trajectory point; and the preset condition is a condition set according to the average speed and the average curvature.

[0151] In some embodiments, after the terminal processor 801 performs the step of selecting the corresponding trajectory point satisfying the preset condition in the writing speed and the final curvature as the first corner point of the target handwriting, the terminal processor 801 further specifically performs the following steps: calculating the distance between each first corner point and the next first corner point corresponding to the first corner point in the target handwriting in sequence according to the writing order of the first corner points in the target handwriting, and removing the first corner point with a distance less than a preset length.

[0152] In some embodiments, when the terminal processor 801 performs the step of removing the pseudo corner point in the first corner point of the target handwriting to obtain the second corner point of the target handwriting, the terminal processor 801 specifically performs the following steps: performing line segment fitting on the stroke segment in the target handwriting to obtain a fitting result corresponding to the stroke segment, the stroke segment being a trajectory segment corresponding to each adjacent two first corner points in the target handwriting; determining the pseudo corner point in the first corner point according to the fitting result and a preset fitting condition; removing the pseudo corner point in the first corner point to determine the remaining corner point in the first corner point as the second corner point of the target handwriting.

[0153] In some embodiments, the terminal processor 801, when performing the line segment fitting on the stroke segments in the target handwriting to obtain the fitting results corresponding to the stroke segments, specifically performs the following steps: calculating the length of each stroke segment, and calculating the average length of all stroke segments in the target handwriting according to the length of each stroke segment; selecting a stroke segment with a length shorter than the average length as a target stroke segment, performing line segment fitting on the target stroke segment to obtain a self fitting error corresponding to each target stroke segment; performing line segment fitting on the left adjacent stroke segment of each target stroke segment to obtain a left fitting error of the left adjacent stroke segment according to the writing order of each target stroke segment in the target handwriting, and performing line segment fitting on the right adjacent stroke segment of each target stroke segment to obtain a right fitting error of the right adjacent stroke segment; merging each target stroke segment and its corresponding left adjacent stroke segment to obtain a left merged stroke segment, and performing line segment fitting on each left merged stroke segment to obtain a left merged fitting error of each left merged stroke segment; merging each target stroke segment and its corresponding right adjacent stroke segment to obtain a right merged stroke segment, and performing line segment fitting on each right merged stroke segment to obtain a right merged fitting error of each right merged stroke segment.

[0154] In some embodiments, the terminal processor 801, when determining the false corner point in the first corner point according to the fitting result and the preset fitting condition, specifically performs the following steps: if the left merged fitting error in the target stroke segment is less than the right merged fitting error, and the left merged fitting error in the target stroke segment is less than the sum of the first preset multiple of the left fitting error and the second preset multiple of the self fitting error, then determining the first corner point at the left end of the target stroke segment as the false corner point; if the right merged fitting error in the target stroke segment is less than the left merged fitting error, and the right merged fitting error in the target stroke segment is less than the sum of the third preset multiple of the right fitting error and the fourth preset multiple of the self fitting error, then determining the first corner point at the right end of the target stroke segment as the false corner point.

[0155] In some embodiments, the terminal processor 801, after performing the removal of the false corner point in the first corner point, specifically performs the following steps: re-performing line segment fitting on the stroke segments in the target handwriting, and removing the false corner point in the first corner point again until the length of each stroke segment in the target handwriting is less than the average length of all stroke segments in the target handwriting.

[0156] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the modules is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed modules can be indirect coupling or communication connection through some interfaces, apparatuses or modules, and can be electrical, mechanical or other forms.

[0157] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical modules, i.e., can be located in one place or distributed to a plurality of network modules. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment.

[0158] In addition, the function modules in each embodiment of the present application can be integrated in one processing module, or each module can be physically present alone, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module.

[0159] If the integrated module is realized in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that contributes to the technical solutions or all or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.

[0160] It should be noted that, for the foregoing method embodiments, in order to facilitate description, they are all expressed as a combination of a series of actions, but those skilled in the art should know that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other order or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0161] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0162] The above is the description of the method and device for determining the corner point of handwriting, the storage medium and the terminal provided by the application. For those skilled in the art, according to the idea of the embodiments of the application, the specific implementation and application range can be changed. In summary, the content of the specification should not be understood as a limitation of the application.

Claims

1. A method for determining the corner points of handwriting, characterized in that, The method includes: Obtain all trajectory points in the target handwriting, calculate the writing speed of each trajectory point and the final curvature of each trajectory point, wherein the final curvature is the mean of all curvatures of the vector formed by the corresponding trajectory point and other trajectory points within a preset range of the corresponding trajectory point; The corresponding trajectory point that satisfies the preset conditions of writing speed and final curvature is selected as the first corner point of the target handwriting; Remove the false corner points from the first corner point of the target handwriting to obtain the second corner point of the target handwriting; The step of removing false corner points from the first corner point of the target handwriting includes: Each pair of adjacent first corner points in the first corner point is defined as a stroke segment in the target handwriting; Calculate the length of each stroke segment in the target handwriting, and calculate the average length of all stroke segments in the target handwriting based on the length of each stroke segment; Select stroke segments whose length is shorter than the average length of all stroke segments as target stroke segments; For each target stroke segment, line segment fitting is performed to obtain the fitting result corresponding to the stroke segment. The fitting result includes the fitting error of each target stroke segment itself, the left fitting error of the left adjacent stroke segment, the right fitting error of the right adjacent stroke segment, the left merging fitting error after merging with the left adjacent stroke segment, and the right merging fitting error after merging with the right adjacent stroke segment. Based on the fitting result, remove the false corner points from the first corner point of the target handwriting.

2. The method according to claim 1, characterized in that, After calculating the writing speed and final curvature of each trajectory point, the method further includes: The average speed of the trajectory points in the target handwriting is calculated based on the writing speed of each trajectory point, and the average curvature of the trajectory points in the target handwriting is calculated based on the final curvature of each trajectory point. The preset conditions are conditions set based on the average velocity and the average curvature.

3. The method according to claim 1, characterized in that, After selecting the corresponding trajectory point where the writing speed and final curvature meet the preset conditions as the first corner point of the target handwriting, the method further includes: According to the writing order of each first corner point in the target handwriting, the distance between each first corner point and its corresponding next first corner point is calculated sequentially, and first corner points with a distance less than a preset length are removed.

4. The method according to any one of claims 1 to 3, characterized in that, The step of removing false corner points from the first corner point of the target handwriting based on the fitting result to obtain the second corner point of the target handwriting includes: Based on the fitting results and preset fitting conditions, determine the pseudo-corner points in the first corner point; Remove the pseudo-corner points from the first corner points, and determine the remaining corner points in the first corner points as the second corner points of the target handwriting.

5. The method according to claim 4, characterized in that, The step of performing line segment fitting on each target stroke segment to obtain the fitting result corresponding to the stroke segment includes: Perform line segment fitting on the target stroke segments to obtain the fitting error of each target stroke segment; According to the writing order of each target stroke segment in the target handwriting, the left fitting error of the left adjacent stroke segment is obtained by performing line segment fitting on the left adjacent stroke segment of each target stroke segment, and the right fitting error of the right adjacent stroke segment is obtained by performing line segment fitting on the right adjacent stroke segment of each target stroke segment. Merge each target stroke segment and its corresponding left adjacent stroke segment to obtain the left merged stroke segment. Perform line segment fitting on each left merged stroke segment to obtain the left merge fitting error of each left merged stroke segment. Merge each target stroke segment with its corresponding right adjacent stroke segment to obtain a right merged stroke segment. Perform line segment fitting on each right merged stroke segment to obtain the right merge fitting error of each right merged stroke segment.

6. The method according to claim 5, characterized in that, The step of determining the pseudo-corner point in the first corner point based on the fitting result and preset fitting conditions includes: If the left merging fitting error in the target stroke segment is less than the right merging fitting error, and the left merging fitting error in the target stroke segment is less than the sum of the left fitting error of the first preset multiple and the fitting error of the target stroke segment itself of the second preset multiple, then the first corner point at the left end of the target stroke segment is determined to be a pseudo corner point. If the right merging fitting error in the target stroke segment is less than the left merging fitting error, and the right merging fitting error in the target stroke segment is less than the sum of the right fitting error of the third preset multiple and the self-fitting error of the fourth preset multiple, then the first corner point at the right end of the target stroke segment is determined to be a pseudo-corner point.

7. The method according to claim 4, characterized in that, After removing the pseudo-corner points from the first corner point, the method further includes: Iterate through all stroke segments in the target handwriting, so that after each traversal, it can continue to determine whether there are pseudo-corner points from the remaining first corner points.

8. The method according to any one of claims 1 to 3, characterized in that, The preset range is a circular range centered on the corresponding trajectory point and with a preset radius. The circular range includes the corresponding trajectory point and at least three other trajectory points in the target handwriting.

9. The method according to any one of claims 1 to 3, characterized in that, The writing speed and final curvature of the starting and ending trajectory points in the target handwriting are both zero, and both the starting and ending trajectory points are first corner points.

10. A handwriting corner finding device, characterized in that, The device includes: The speed curvature calculation module is used to obtain all trajectory points in the target handwriting, calculate the writing speed of each trajectory point and the final curvature of each trajectory point, wherein the final curvature is the average of the cumulative curvature of the vector formed by the trajectory point and other trajectory points within a preset range of the trajectory point; The corner point determination module is used to select the corresponding trajectory point where the writing speed and final curvature meet preset conditions as the first corner point of the target handwriting; The pseudo-corner point removal module is used to remove pseudo-corner points from the first corner point of the target handwriting to obtain the second corner point of the target handwriting. The pseudo-corner point removal module is further configured to determine the trajectory segment corresponding to each two adjacent first corner points in the target handwriting as a stroke segment; Calculate the length of each stroke segment in the target handwriting, and calculate the average length of all stroke segments in the target handwriting based on the length of each stroke segment; Select stroke segments whose length is shorter than the average length as target stroke segments; For each target stroke segment, line segment fitting is performed to obtain the fitting result corresponding to the stroke segment. The fitting result includes the fitting error of each target stroke segment itself, the left fitting error of the left adjacent stroke segment, the right fitting error of the right adjacent stroke segment, the left merging fitting error after merging with the left adjacent stroke segment, and the right merging fitting error after merging with the right adjacent stroke segment. Based on the fitting result, remove the false corner points from the first corner point of the target handwriting.

11. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1 to 9.

12. A terminal, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Handwriting-based method for identity identification and terminal thereof

    CN102411712A

  • Method and device for identifying and editing freehand sketch

    CN104424473A