A method for extracting strokes from handwritten Chinese characters
By using the method of combining the inflection point group processing based on the direction point angle characteristics and the stroke skeleton contour in handwriting text processing, the stroke extraction error problem caused by the deformation of continuous writing and writing in handwriting text is solved, and more accurate stroke extraction and Higher downstream task performance.
Patent Information
- Application Number
- CN202210137230.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-15
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-02-15
AI Technical Summary
When dealing with general handwritten characters, the prior art has problems such as continuous writing and writing deformation, resulting in large errors in stroke extraction and affecting downstream tasks.
A stroke extraction method for handwritten Chinese characters is adopted, including character image preprocessing, pixel direction point angle feature calculation, direction point angle feature calculation of inflection point clusters, and stroke extraction based on stroke skeleton and outline. This method splits and merges the inflection point clusters through the direction point angle characteristics, and combines the stroke skeleton and outline information to achieve more accurate stroke extraction.
It improves the accuracy of stroke extraction of offline handwritten Chinese characters, and enhances the interpretability and accuracy of downstream tasks such as Chinese character handwritten recognition and writer identity recognition.
Smart Images

Figure CN114495117B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a text processing technology, and in particular to a method for extracting strokes of handwritten Chinese characters. Background Art
[0002] The invention of writing is an important driving force for the development of human civilization. After entering the information age, how to process writing has always been the focus of research in related disciplines, such as the recognition of various types of online / offline handwritten texts, identity verification based on writing styles, automated processing of various documents, intelligent education, etc., especially with the rapid development of deep learning technology, various types of text processing technologies have been widely used. However, in the above process, due to the black box characteristics of deep neural networks, the final model is not very interpretable, and it is difficult to intuitively associate it with existing knowledge, which is not conducive to further deepening of application.
[0003] Chinese characters are the cultural treasure of the Chinese nation. They have inherited the cultural spirit of generations of Chinese people, and their shapes are very distinctive. According to the Chinese calligraphy pen-holding rules, namely the "Eight Methods of Yong", all Chinese characters can be divided into eight basic strokes: dot, horizontal, vertical, hook, lift, left stroke, short left stroke, and right stroke. Different types and numbers of basic strokes are orderly distributed in the character space according to a certain word-building logic, forming a concise and beautiful square Chinese character. For human perception, the above process is clear and intuitive, and is easy for people to accept and understand.
[0004] In the skeleton-based method, the skeleton of the character needs to be obtained first, which is usually implemented based on various refinement algorithms; then the intersections in the skeleton are detected, and the skeleton is split into multiple skeleton segments based on the intersections; finally, the split skeleton segments are combined based on certain rules to restore a single stroke skeleton, and the strokes are restored from the stroke skeleton. In the above process, the key issues that need to be solved are: the processing of strokes of different widths, the hairline and bifurcation problems of the skeleton, the deformation of the strokes, etc. The process of this type of method is shown in the attached figure. Figure 1 shown.
[0005] In the contour-based method, you first need to obtain the contour of the character, which is usually implemented based on various edge detection algorithms; secondly, detect the directional attributes of the points on the contour line, find the corresponding stroke inflection points, combine the inflection points belonging to the same stroke intersection, determine the exact position of the intersection in the stroke, and use the intersection to split the stroke into multiple non-intersecting contour segments; finally, combine the split contour segments based on certain rules to obtain a single stroke contour, and fill the stroke contour to obtain the stroke. In the above process, the focus is on finding and judging the inflection points and the relative position relationship between the inflection points. The process of this method is shown in the attached figure. Figure 2 shown.
[0006] The processes of the above two methods are similar, that is, first extract the high-level information (skeleton, outline) of the original character image, then use this information to obtain the intersection and split the character into stroke segments, and finally combine the stroke segments based on certain rules to obtain the final stroke. How to effectively describe the high-level information and the combination rules of the stroke segments are the key points of the technology.
[0007] It can be seen from the relevant literature that the existing technology is mainly aimed at printed text or handwritten text with relatively standardized writing, and it works better for this type of regular text. However, when processing general handwritten text, due to the existence of problems such as connected writing and writing deformation, the stroke extraction error is large, which seriously affects the performance of downstream tasks. There are two reasons for this. First, most of the existing technologies only use one of the contour or skeleton information, and do not make comprehensive use of the high-level information of these two types of characters; second, the existing technology lacks an effective description and expression of the skeleton and contour, resulting in the character structure characteristics contained therein not being fully utilized. Summary of the invention
[0008] The main purpose of the present invention is to provide a method for extracting strokes of handwritten Chinese characters.
[0009] The technical solution adopted by the present invention is: a method for extracting strokes of Chinese handwritten characters, comprising:
[0010] Character image preprocessing;
[0011] Calculation of pixel direction point angle features;
[0012] Calculation of the angle characteristics of the direction points of the inflection point cluster;
[0013] Stroke extraction based on stroke skeleton and contour.
[0014] Furthermore, the character image preprocessing includes:
[0015] The original image is recorded as I, the input original image is binarized, and the binarized character image is recorded as Ibw;
[0016] Use the Canny algorithm to extract the edge of the characters in the binary image Ibw, and record the edge image as Iedge;
[0017] The Rosenfeld algorithm is used to extract the skeleton of the character in the binary image Ibw, and the skeleton image is recorded as Isk.
[0018] Furthermore, the direction point angle feature calculation of the pixel includes:
[0019] The square area with the current pixel as the center and the neighborhood radius N is the area to be calculated, localRect, and only the pixels in the area that are connected to the current pixel are retained;
[0020] The value of N is related to the size of the character image. For a character image of about 100*100, N is usually 3.
[0021] Delete the points within the N-1 radius in localRect, and the remaining part is the direction point of the current pixel; if multiple direction points are adjacent to each other, only the point farthest from the current pixel is retained;
[0022] Taking the current pixel as the coordinate origin, calculate the angle θ between the line connecting the current pixel and the direction point and the x-axis. The calculation formula of θ is shown in formula (1):
[0023] θ=atan2(x-x0,y-y0) (1)
[0024] Where (x0, y0) is the coordinate of the current pixel, (x, y) is the coordinate of the current direction point, the possible value range of θ is [-180, 180), and the value of angle θ is the first-order direction point angle feature of the current pixel; one pixel may correspond to multiple direction points;
[0025] If the number of direction points of a pixel is greater than or equal to 2, the relative angle difference δ between any two direction points can be calculated. The calculation formula of δ is shown in formula (2):
[0026]
[0027] The subscripts a and b represent any two direction points of the same pixel, and θ is the angle of the direction point corresponding to the point. Since this value is a relative position, it needs to be normalized to the angle range of [0,180). If a pixel has m direction points, then it can be calculated. These δ values constitute the second-order direction point angle features of the current pixel.
[0028] Furthermore, according to the stroke extraction method for Chinese handwritten characters according to claim 1, it is characterized in that:
[0029] The direction point angle feature calculation of the inflection point group includes:
[0030] Inflection point and skeleton segment extraction
[0031] Calculate the first-order and second-order direction point angle features of all pixels on the skeleton graph Isk, and delete the pixels whose number of first-order direction points is 0 to obtain a new Isk;
[0032] Extract all inflection points in Isk. There are two conditions to determine whether a pixel is an inflection point. One is that the number of direction points of the pixel is 2 and its second-order direction point angle is less than 145, and the other is that the number of direction points of the pixel is greater than 2. A pixel that meets one of the above two conditions can be determined as an inflection point. All inflection points constitute the inflection point graph Isk-i of the skeleton. Solve the connected areas in the inflection point graph. Each connected area is an inflection point cluster.
[0033] Subtract Isk-i from Isk to obtain the skeleton line segment graph Isk-l, where the number of direction points of all pixels is less than 3 and the second-order direction point angle is greater than 135; solve the connected areas in Isk-l, each connected area is a skeleton line segment; calculate the direction angle φ of each skeleton line segment, whose value is the angle between the major axis of the current skeleton line segment area and the x-axis;
[0034] Calculation of the angle characteristics of the direction points of the inflection point cluster
[0035] For each inflection point cluster, calculate its geometric center, and take the pixel on the inflection point cluster closest to the geometric center as the center of the inflection point cluster; calculate the distance between all pixels in the inflection point cluster and the central pixel, and construct a square area to be calculated localRect with the farthest distance as the radius N;
[0036] Delete the points within the N-1 radius in localRect, and the remaining part is the direction point of the current inflection point group, such as Fig. 9 (b) As shown; if multiple direction points are adjacent to each other, only the point farthest from the center of the current inflection point cluster is retained;
[0037] For each direction point, calculate the angle θ between the direction point and the center line of the current inflection point cluster, and find the skeleton line segment connected to it; if there is no skeleton line segment connected to the direction point, the value of angle θ is the first-order direction point angle feature of the current inflection point cluster; if there is a skeleton line segment connected to the direction point, the value of the skeleton line segment direction angle φ is the first-order direction point angle feature of the current inflection point cluster; since the value range of φ is [-90,90), it is also necessary to normalize it to the range of [-180,180) according to the value of angle θ. The normalization method is shown in formula (3):
[0038]
[0039] Calculate the relative angle difference δ between any two direction points in the inflection point cluster. The calculation formula of δ is the same as formula (2). If an inflection point cluster has m direction points, then it can be calculated These δ values constitute the second-order direction point angle characteristics of the current inflection point group.
[0040] Furthermore, the stroke extraction based on the stroke skeleton and outline includes:
[0041] For all inflection point clusters with more than three direction points, find the two direction points DP with the largest second-order direction point angle. a and DP b , based on the original center point and DP a and DP b Construct a new inflection point cluster and remove the two direction points from the original inflection point cluster; iterate the above steps until the number of direction points of the inflection point cluster is less than or equal to 2; after executing this step, all multi-directional point inflection point clusters are split, and the number of second-order direction point angle features of all inflection point clusters is 1;
[0042] For all inflection point clusters with three direction points, if the angle variance of the three second-order direction points of the inflection point cluster is small, it is considered to be a Y-shaped intersection. At this time, the inflection point cluster is split into three new inflection point clusters, each of which has only one direction point of the original inflection point cluster; otherwise, it is considered to be a T-shaped intersection, and the original inflection point cluster is split into two new inflection point clusters, one of which contains two direction points with the largest second-order direction point angles, and the other inflection point cluster has only one direction point;
[0043] Determine the second-order direction point angle feature of the inflection point cluster. If it is greater than 135, merge the skeleton line segments corresponding to the two direction points on the inflection point cluster. Otherwise, keep the relative relationship of the skeleton line segments unchanged. Iterate this step until all inflection point clusters are processed and the stroke skeleton is obtained.
[0044] Find the nearest edge parallel to the stroke skeleton in Iedge, fill the blank area between the edge and the stroke skeleton, fill the corresponding skeleton intersection area, and get the split strokes.
[0045] Advantages of the present invention:
[0046] The method of the present invention can convert offline handwritten Chinese characters into corresponding strokes, and then carry out downstream tasks such as Chinese character handwriting recognition and writer identity recognition based on the strokes, which can greatly improve the interpretability of the entire processing flow and facilitate people to have an in-depth understanding and further research on the Chinese character information processing process.
[0047] By using the method of the present invention, offline handwritten Chinese characters can be more accurately converted into corresponding strokes, thereby improving the accuracy of subsequent downstream tasks such as Chinese character handwriting recognition and writer identity recognition.
[0048] In addition to the above-described purposes, features and advantages, the present invention has other purposes, features and advantages. The present invention will be further described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings constituting a part of this application are used to provide a further understanding of the present invention. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0050] Figure 1 It is a flowchart of the skeleton-based method;
[0051] Figure 2 is a flow chart of the contour-based approach;
[0052] Figure 3 It is a sample image of the text image that needs to be processed;
[0053] Figure 4 is a flow chart of the method of the present invention;
[0054] Figure 5 is the current pixel map of the present invention;
[0055] Figure 6 It is a graph with the current pixel as the coordinate origin;
[0056] Figure 7 It is to calculate the first-order and second-order direction point angle feature maps of all pixels on the skeleton map Isk (where (a) is the new Isk obtained, (b) is the inflection point cluster, and (c) is the skeleton line segment map Isk-1);
[0057] Figure 8 It is to calculate the orientation angle map of each skeleton segment;
[0058] Fig. 9 The area to be calculated is a square map with the longest distance as radius N;
[0059] (where (a) is the localRect area to be calculated for constructing a square, and (b) is the direction point of the current inflection point group);
[0060] Fig.10 This step is iterated until all inflection point clusters are processed and a stroke skeleton graph is obtained;
[0061] Fig.11 This is the stroke diagram after splitting. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0063] The object processed by this invention is a single Chinese character image. The previous work of document image denoising, layout analysis, line segmentation, normalization, etc. is not included in the discussion. Figure 3 shown.
[0064] The present invention is a computer program algorithm, the steps of which are as follows: Figure 4 As shown, it is generally divided into four steps: image preprocessing, pixel direction point angle feature calculation, inflection point group direction point angle feature calculation and stroke extraction.
[0065] 1. Character Image Preprocessing
[0066] 1.1 The original image is denoted as I, the input original image is binarized, and the binarized character image is denoted as Ibw.
[0067] 1.2 Use the Canny algorithm to extract the edges of the characters in the binary image Ibw, and record the edge image as Iedge.
[0068] 1.3 Use the Rosenfeld algorithm to extract the skeleton of the character in the binary image Ibw, and record the skeleton image as Isk.
[0069] The technical methods involved in the binarization, edge extraction and skeleton extraction of the above-mentioned single character image are basic methods in the field of digital image processing, and are provided in various image processing tool libraries. Therefore, the specific technical details of the above process will not be separately described in the present invention.
[0070] 2. Pixel direction point angle characteristics
[0071] In order to describe the character structure information more accurately, the present invention proposes a type of description feature, which is named as the direction point angle feature. For a single pixel on the skeleton image Isk, the calculation process of its direction point angle feature is as follows:
[0072] 2.1 The square area with the current pixel as the center and the neighborhood radius N is the area to be calculated, localRect, and only the pixels in the area that are connected to the current pixel are retained, such as Figure 5 (a) shows that the value of N is related to the size of the character image. For a character image of about 100*100, N is usually 3.
[0073] 2.2 Delete the points within the N-1 radius in localRect, and the remaining part is the direction point of the current pixel, such as Figure 5 (b) If multiple direction points are adjacent to each other, only the point farthest from the current pixel is retained.
[0074] 2.3 Take the current pixel as the coordinate origin and calculate the angle θ between the line connecting it and the direction point and the x-axis, as Figure 6 As shown, the calculation formula of θ is shown in formula 1:
[0075] θ=atan2(x-x0,y-y0) Formula (1)
[0076] Where (x0, y0) is the coordinate of the current pixel, (x, y) is the coordinate of the current direction point, the possible value range of θ is [-180, 180), and the value of angle θ is the first-order direction point angle feature of the current pixel. A pixel may correspond to multiple direction points. Figure 5 Five cases where the number of direction points is 1, 2, 3, 3, and 4 are illustrated, corresponding to the five most common cases in structural information, namely, endpoints, no intersection, Y-shaped intersection, T-shaped intersection, and X-shaped intersection.
[0077] 2.4 If the number of direction points of a pixel is greater than or equal to 2, the relative angle difference δ between any two direction points can be calculated, such as Figure 6 As shown, the calculation formula of δ is shown in formula 2:
[0078]
[0079] The subscripts a and b represent any two direction points of the same pixel, and θ is the angle of the direction point corresponding to the point. Since this value is a relative position, it needs to be normalized to the angle range of [0,180). If a pixel has m direction points, then it can be calculated These δ values constitute the second-order direction point angle features of the current pixel.
[0080] 3. Angle characteristics of the direction points of the inflection point group
[0081] The direction point angle feature of the skeleton pixel reflects the extension change trend of the skeleton in a certain range of neighborhoods. It is a type of local description feature. Based on this feature, the character skeleton can be further split and processed. The process is as follows:
[0082] 3.1 Inflection point and skeleton segment extraction
[0083] 3.1.1 Calculate the first-order and second-order direction point angle features of all pixels on the skeleton graph Isk, and delete the pixels whose first-order direction points are 0 (isolated noise) to obtain the new Isk, as shown in Figure 7 (a) shown.
[0084] 3.1.2 Extract all inflection points in Isk. There are two conditions to determine whether a pixel is an inflection point. One is that the number of direction points of the pixel is 2 and its second-order direction point angle is less than 145, and the other is that the number of direction points of the pixel is greater than 2. A pixel that meets one of the above two conditions can be determined as an inflection point. All inflection points constitute the inflection point graph Isk-i of the skeleton. Solve the connected areas in the inflection point graph. Each connected area is an inflection point group, such as Figure 7 (b) as shown.
[0085] 3.1.3 Subtract Isk-i from Isk to obtain the skeleton line segment graph Isk-l, as shown in Figure 7 As shown in (c), the number of direction points of all pixels in this image is less than 3 and the second-order direction point angle is greater than 135. Solve the connected area in Isk-l, each connected area is a skeleton line segment. Calculate the direction angle φ of each skeleton line segment, which is the angle between the major axis of the current skeleton line segment area and the x-axis, as shown in Figure 8 shown.
[0086] 3.2 Angle characteristics of the direction points of the inflection point cluster
[0087] 3.2.1 For each inflection point cluster, calculate its geometric center, and take the pixel closest to the geometric center on the inflection point cluster as the center of the inflection point cluster. Calculate the distance between all pixels in the inflection point cluster and the central pixel, and construct a square area to be calculated localRect with the farthest distance as the radius N, such as Fig. 9 (a) shown.
[0088] 3.2.2 Delete the points within the N-1 radius in localRect, and the remaining part is the direction point of the current inflection point group, such as Fig. 9 (b) If multiple direction points are adjacent to each other, only the point farthest from the center of the current inflection point cluster is retained.
[0089] 3.2.3 For each direction point, calculate the angle θ between the direction point and the center line of the current inflection point cluster (the calculation method is the same as 2.3), and find the skeleton line segment connected to it. If there is no skeleton line segment connected to the direction point, the value of the angle θ is the first-order direction point angle feature of the current inflection point cluster; if there is a skeleton line segment connected to the direction point, the value of the skeleton line segment direction angle φ is the first-order direction point angle feature of the current inflection point cluster. Since the value range of φ is [-90,90), it is also necessary to normalize it to the range of [-180,180) according to the value of the angle θ. The normalization method is shown in Formula 3:
[0090]
[0091] When normalizing, it should be noted that since the y-axis in the image coordinate system is downward and the y-axis in the universal coordinate system is upward, the angle θ calculated based on the pixel coordinates and the angle φ calculated based on the shape of the connected area are opposite in the y direction, so a negative sign needs to be added to the φ value.
[0092] 3.2.4 Calculate the relative angle difference δ between any two direction points in the inflection point cluster. The calculation formula of δ is the same as formula 2. If an inflection point cluster has m direction points, then it can be calculated These δ values constitute the second-order direction point angle characteristics of the current inflection point group.
[0093] 4. Stroke Extraction Based on Stroke Skeleton and Contour
[0094] The direction point angle feature of the inflection point cluster reflects the relative position relationship of the skeleton line segments on the inflection point. It is a type of global structure description feature. Based on this feature, the skeleton line segments can be merged and the strokes can be extracted. The specific steps are as follows:
[0095] 4.1 For all inflection point clusters with more than three direction points, find the two direction points DP with the largest second-order direction point angle a and DP b , based on the original center point and DP a and DP b Construct a new inflection point cluster and remove the two direction points from the original inflection point cluster. Iterate the above steps until the number of direction points in the inflection point cluster is less than or equal to 2. After executing this step, all multi-directional point inflection point clusters are split, and the number of second-order direction point angle features of all inflection point clusters is 1.
[0096] 4.2 For all inflection point clusters with three direction points, if the angle variance of the three second-order direction points of the inflection point cluster is small, it is judged to be a Y-shaped intersection. At this time, the inflection point cluster is split into three new inflection point clusters, each of which has only one direction point of the original inflection point cluster; otherwise, it is considered to be a T-shaped intersection, and the original inflection point cluster is split into two new inflection point clusters, one of which contains the direction points with the largest angles of the two second-order direction points, and the other inflection point cluster has only one direction point.
[0097] 4.3 Determine the second-order direction point angle feature of the inflection point cluster. If it is greater than 135, merge the skeleton line segments corresponding to the two direction points on the inflection point cluster. Otherwise, keep the relative relationship of the skeleton line segments unchanged. Iterate this step until all inflection point clusters are processed and the stroke skeleton is obtained, such as Fig.10 shown.
[0098] 4.4 Find the nearest edge parallel to the stroke skeleton in Iedge, fill the blank area between the edge and the stroke skeleton, fill the corresponding skeleton intersection area, and get the split strokes, such as Fig.11 shown.
[0099] In view of the shortcomings of the prior art, the present invention mainly solves two technical problems:
[0100] 1. How to describe the structural information of characters more effectively.
[0101] 2. How to integrate different types of character structure information to accurately extract handwritten Chinese character strokes.
[0102] The image binarization, edge detection and skeletonization algorithms can all be replaced with other similar algorithms, which can be selected and matched according to the characteristics of the actual input image.
[0103] The replacement can be made according to the specific downstream task. For example, if the downstream task only requires horizontal strokes, the first-order and second-order direction point angles of the inflection point group can be comprehensively screened, and finally only the strokes that meet the "horizontal" feature are retained.
[0104] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for extracting strokes of Chinese handwritten characters, characterized in that: include: Character image preprocessing; Calculation of pixel direction point angle features; Calculation of the angle characteristics of the direction points of the inflection point cluster; Stroke extraction based on stroke skeleton and outline; The character image preprocessing comprises: The original image is recorded as I, the input original image is binarized, and the binarized character image is recorded as Ibw; Use the Canny algorithm to extract the edges of the characters in the binary image Ibw, and record the edge image as Iedge; Use the Rosenfeld algorithm to extract the skeleton of the character in the binary image Ibw, and record the skeleton image as Isk; The direction point angle feature calculation of the pixel includes: The square area with the current pixel as the center and the neighborhood radius N is the area to be calculated, localRect, and only the pixels in the area that are connected to the current pixel are retained; The value of N is related to the size of the character image. For a character image of about 100*100, N is usually 3. Delete the points within the N-1 radius in localRect, and the remaining part is the direction point of the current pixel; if multiple direction points are adjacent to each other, only the point farthest from the current pixel is retained; Taking the current pixel as the coordinate origin, calculate the angle θ between the line connecting the current pixel and the direction point and the x-axis. The calculation formula of θ is shown in formula (1): θ=atan2(x-x0,y-y0) (1) Where (x0, y0) is the coordinate of the current pixel, (x, y) is the coordinate of the current direction point, the possible value range of θ is [-180, 180), and the value of angle θ is the first-order direction point angle feature of the current pixel; one pixel may correspond to multiple direction points; If the number of direction points of a pixel is greater than or equal to 2, the relative angle difference δ between any two direction points can be calculated. The calculation formula of δ is shown in formula (2): The subscripts a and b represent any two direction points of the same pixel, and θ is the angle of the direction point corresponding to the point. Since the relative angle difference δ is a relative value, it needs to be normalized to the angle range of [0,180). If a pixel has m direction points, then it can be calculated. δ values, which constitute the second-order direction point angle features of the current pixel; The direction point angle feature calculation of the inflection point group includes: Inflection point and skeleton segment extraction: Calculate the first-order and second-order direction point angle features of all pixels on the skeleton graph Isk, and delete the pixels whose number of first-order direction points is 0 to obtain a new Isk; Extract all inflection points in Isk. There are two conditions to determine whether a pixel is an inflection point. One is that the number of direction points of the pixel is 2 and its second-order direction point angle is less than 145, and the other is that the number of direction points of the pixel is greater than 2. A pixel that meets one of the above two conditions can be determined as an inflection point. All inflection points constitute the inflection point graph Isk-i of the skeleton. Solve the connected areas in the inflection point graph. Each connected area is an inflection point cluster. Subtract Isk-i from Isk to obtain the skeleton line segment graph Isk-l, where the number of direction points of all pixels is less than 3 and the second-order direction point angle is greater than 135; solve the connected areas in Isk-l, each connected area is a skeleton line segment; calculate the direction angle φ of each skeleton line segment, whose value is the angle between the major axis of the current skeleton line segment area and the x-axis; Calculation of the angle feature of the direction point of the inflection point group: For each inflection point cluster, calculate its geometric center, and take the pixel on the inflection point cluster closest to the geometric center as the inflection point cluster center; calculate the distance between all pixels in the inflection point cluster and the central pixel, and construct a square area to be calculated localRect with the farthest distance as the radius N; Delete the points within the N-1 radius in localRect, and the remaining points are the direction points of the current inflection point group; if multiple direction points are adjacent to each other, only the point farthest from the center of the current inflection point group is retained; For each direction point, calculate the angle θ between the direction point and the center line of the current inflection point cluster, and find the skeleton line segment connected to it; if there is no skeleton line segment connected to the direction point, the value of angle θ is the first-order direction point angle feature of the current inflection point cluster; if there is a skeleton line segment connected to the direction point, the value of the skeleton line segment direction angle φ is the first-order direction point angle feature of the current inflection point cluster; since the value range of φ is [-90,90), it is also necessary to normalize it to the range of [-180,180) according to the value of angle θ. The normalization method is shown in formula (3): Calculate the relative angle difference δ between any two direction points in the inflection point cluster. The calculation formula of δ is the same as formula (2). If an inflection point cluster has m direction points, then it can be calculated δ values, which constitute the second-order direction point angle characteristics of the current inflection point group; The stroke extraction based on the stroke skeleton and the outline comprises: For all inflection point clusters with more than three direction points, find the two direction points DP with the largest second-order direction point angle. a and DP b , based on the original center point and DP a and DP b Construct a new inflection point cluster and remove the two direction points from the original inflection point cluster; iterate the above steps until the number of direction points of the inflection point cluster is less than or equal to 2; after executing this step, all multi-directional point inflection point clusters are split, and the number of second-order direction point angle features of all inflection point clusters is 1; For all inflection point clusters with three direction points, if the angle variance of the three second-order direction points of the inflection point cluster is small, it is considered to be a Y-shaped intersection. At this time, the inflection point cluster is split into three new inflection point clusters, each of which has only one direction point of the original inflection point cluster; otherwise, it is considered to be a T-shaped intersection, and the original inflection point cluster is split into two new inflection point clusters, one of which contains two direction points with the largest second-order direction point angles, and the other inflection point cluster has only one direction point; Determine the second-order direction point angle feature of the inflection point cluster. If it is greater than 135, merge the skeleton line segments corresponding to the two direction points on the inflection point cluster. Otherwise, keep the relative relationship of the skeleton line segments unchanged. Iterate this step until all inflection point clusters are processed and the stroke skeleton is obtained. Find the nearest edge parallel to the stroke skeleton in Iedge, fill the blank area between the edge and the stroke skeleton, fill the corresponding skeleton intersection area, and get the split stroke.
Citation Information
Patent Citations
Chinese character stroke feature extraction method used for on-line handwritten Chinese character recognition
CN101604393A
Method and device for automatically evaluating right and wrong of Chinese character writing on basis of digital handwriting equipment
CN102542264A