A Chinese character skeleton inflection point detection method and system based on eight-neighborhood direction coding

Through the method based on eight-neighborhood direction coding, the unique direction coding chain of Chinese characters strokes is used to solve the flexibility and accuracy of Chinese characters in the prior art detection, and the accuracy of handwritten Chinese characters recognition is improved.

CN113902704BActive Publication Date: 2024-11-01HUAZHONG NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111176770.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-09
Publication Date
2024-11-01
Estimated Expiration
2041-10-09

AI Technical Summary

Technical Problem

The existing methods of inflection point detection of Chinese characters are easily disturbed by noise points, lack flexibility, and fail to effectively use the directional coding chains of different strokes of Chinese characters, resulting in confusing detection results and low accuracy.

Method used

Using the eight-neighborhood direction coding method, Chinese character skeleton is obtained through preprocessing and segmentation, and the direction coding chain of the pen segment is constructed. The inflection point is determined using unique direction coding rules, and illegal direction coding for different strokes is provided as the basis for judgment. .

Benefits of technology

The accuracy of handwritten Chinese characters recognition is improved, the efficiency and accuracy of inflection point detection is enhanced, and the limitations of threshold dependence in the prior art are overcome.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113902704B_ABST
    Figure CN113902704B_ABST
Patent Text Reader

Abstract

The invention discloses two methods and systems for detecting inflection points of Chinese character skeletons based on eight-neighborhood direction coding, wherein the first measurement method comprises a preprocessing step, a stroke segmentation step, a stroke segment coding step and an inflection point detection step; the second measurement method comprises a preprocessing step, a stroke segmentation step, a stroke segment coding step, an inflection point judgment step and an inflection point detection step; the invention fully considers the unique rules of direction coding chains of different strokes of Chinese characters, studies and summarizes this based on eight-neighborhood direction coding, gives main direction coding, legal direction coding and illegal direction coding of different types of strokes, judges a stroke segment corresponding to a direction coding chain containing more than three different direction codes as a stroke segment containing an inflection point; and judges a handwriting pixel point corresponding to an illegal direction coding in the direction coding chain as an inflection point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of information processing of Chinese character writing, and more specifically, relates to a method and system for detecting inflection points of Chinese character skeletons based on eight-neighborhood directional coding. Background Art

[0002] There are many types of Chinese characters, and different people write differently. These factors affect the accuracy of machine recognition and evaluation of handwritten Chinese characters. However, we can use information such as the number and position of inflection points to confirm the stroke type and stroke structure of the current stroke, effectively improving the accuracy of handwritten Chinese character recognition and evaluation.

[0003] The existing inflection point detection methods include those based on edge pixel curvature and those based on changes in pixel multi-neighborhoods. These methods are easily interfered by noise points and do not consider the differences between different stroke types. The calculation methods of these methods generally use a certain threshold as the basis for judgment, lack flexibility, and do not consider the basic rules of different strokes of Chinese characters. This will lead to confusing detection results and low accuracy.

[0004] The Chinese character skeleton extraction operation is an important step in handwritten Chinese character recognition. Performing skeleton extraction on handwritten Chinese characters can obtain the Chinese character skeleton, which can correctly reflect the topological structure of the Chinese character without unnecessary burrs or side branches.

[0005] Any pixel P in an image has 4 adjacent pixels, located above, below, left and right of it respectively. These 4 pixels are the 4-neighborhood of pixel P; the D-neighborhood of pixel P is the points corresponding to the four vertices of pixel p; the 4-neighborhood and D-neighborhood of pixel P constitute the 8-neighborhood of pixel P; the direction encoding of the 8-neighborhood is: starting from the neighborhood point on the left of pixel P, the 8-neighborhood is marked as P0, P1, P2, P3, P4, P5, P6, and P7 counterclockwise; the direction from P to P0 is encoded as 0, the direction from P to P1 is encoded as 1, the direction from P to P2 is encoded as 2, the direction from P to P3 is encoded as 3, the direction from P to P4 is encoded as 4, the direction from P to P5 is encoded as 5, the direction from P to P6 is encoded as 6, and the direction from P to P7 is encoded as 7.

[0006] The pixels that make up the handwritten Chinese characters in an image are handwriting pixels. Deleting the intersections in the Chinese character skeleton can get multiple segments, each of which is composed of multiple handwriting pixels. When all the handwriting pixels in a segment are traversed, the direction coding of a handwriting pixel Q is recorded as follows:

[0007] (1) Determine the previous pixel point Q0 of Q in the traversal operation;

[0008] (2) Find the position of Q in the eight neighborhoods of Q0 and the direction code W from Q0 to Q;

[0009] (3) The direction code of Q is recorded as W, that is, the handwriting pixel point corresponding to W is Q.

[0010] Therefore, the first handwriting pixel point accessed by the traversal operation has no direction code, and the direction codes of other handwriting pixels in the segment are combined into a set, which is the direction code chain of the segment.

[0011] The directional coding chains of different strokes of Chinese characters have their own unique rules, which can be used to detect the turning points of handwritten Chinese characters, thereby effectively assisting the recognition and evaluation of handwritten Chinese characters. Summary of the invention

[0012] In view of the defects of the prior art, the purpose of the present invention is to provide a Chinese character skeleton inflection point detection method and system based on eight-neighborhood directional coding, aiming to solve the problem of detecting inflection points of handwritten Chinese characters by utilizing the unique rules of directional coding chains of different strokes of Chinese characters.

[0013] To achieve the above object, the present invention provides a Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding, comprising the following steps:

[0014] (1) Preprocessing step: performing a Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods;

[0015] (2) a stroke segmentation step: performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments;

[0016] Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points;

[0017] The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods;

[0018] (3) Segment coding step: starting from the starting pixel or the ending pixel, traversing each of the stroke segments, and obtaining the direction code of each stroke pixel except the starting point according to the eight-neighborhood direction coding, wherein each direction code constitutes the direction code chain of the stroke segment;

[0019] (4) Inflection point detection step: checking whether the direction code chain of each stroke segment contains an illegal direction code of the stroke segment. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point;

[0020] The illegal direction code is a direction code other than the legal direction code of each of the segments, and the rule of the legal direction code is:

[0021] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0022] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0023] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0024] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0025] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0026] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0027] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0028] If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7;

[0029] The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

[0030] The present invention provides a method for detecting inflection points of Chinese character skeletons based on eight-neighborhood direction coding, which is characterized by comprising the following steps:

[0031] (1) Preprocessing step: performing a Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods;

[0032] (2) a stroke segmentation step: performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments;

[0033] Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points;

[0034] The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods;

[0035] (3) Segment coding step: starting from the starting pixel or the ending pixel, traversing each of the stroke segments, and obtaining the direction code of each stroke pixel except the starting point according to the eight-neighborhood direction coding, wherein each direction code constitutes the direction code chain of the stroke segment;

[0036] (4) Inflection point determination step: Check the direction code chain of each of the segments. If three or more different direction codes appear in the direction code chain, the segment is determined to contain an inflection point, and the inflection point detection step is performed on the segment. Otherwise, the segment is determined not to contain an inflection point, and the inflection point determination step is performed on the next segment.

[0037] (5) Inflection point detection step: checking whether the direction code chain of the stroke segment contains an illegal direction code of the stroke segment. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point;

[0038] The illegal direction code is a direction code other than the legal direction code of the segment, and the rule of the legal direction code is:

[0039] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0040] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0041] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0042] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0043] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0044] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0045] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0046] If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7;

[0047] The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

[0048] Preferably, the size of the Chinese character skeleton image in the preprocessing step is 500×500 pixels.

[0049] Preferably, while the segmentation operation in the stroke segmentation step is being executed, an operation of deleting noise points in the Chinese character skeleton image is executed; the method for determining the noise points is: if the number of handwriting pixel points contained in the eight-neighborhood area of ​​a certain handwriting pixel point is equal to 0, then the handwriting pixel point is determined to be a noise point.

[0050] The present invention provides a Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding, which is characterized by comprising:

[0051] Preprocessing module: used to perform Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods;

[0052] A stroke segmentation module: used for performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments;

[0053] Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points;

[0054] The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods;

[0055] Segment coding module: used to perform traversal operation on each of the stroke segments starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding, and each direction code constitutes the direction code chain of the stroke segment;

[0056] Inflection point detection module: used to check whether the direction code chain of each stroke segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point;

[0057] The illegal direction code is a direction code other than the legal direction code of each of the segments, and the rule of the legal direction code is:

[0058] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0059] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0060] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0061] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0062] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0063] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0064] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0065] If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7;

[0066] The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

[0067] The present invention provides a Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding, which is characterized by comprising:

[0068] Preprocessing module: used to perform Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods;

[0069] A stroke segmentation module: used for performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments;

[0070] Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points;

[0071] The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods;

[0072] Segment coding module: used to perform traversal operation on each of the stroke segments starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding, and each direction code constitutes the direction code chain of the stroke segment;

[0073] Inflection point judgment module: used to check the direction code chain of each of the stroke segments. If more than three different direction codes appear in the direction code chain, the stroke segment is judged to contain an inflection point, and the operation in the inflection point detection module is performed on the stroke segment; otherwise, the stroke segment is judged not to contain an inflection point, and the operation in the inflection point judgment module is continued to be performed on the next stroke segment;

[0074] Inflection point detection module: used to check whether the direction code chain of the pen segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point;

[0075] The illegal direction code is a direction code other than the legal direction code of the segment, and the rule of the legal direction code is:

[0076] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0077] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0078] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0079] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0080] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0081] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0082] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0083] If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7;

[0084] The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

[0085] Preferably, the size of the Chinese character skeleton image in the preprocessing module is 500×500 pixels.

[0086] Preferably, while the segmentation operation in the stroke segmentation module is being executed, an operation of deleting noise points in the Chinese character skeleton image is executed; the method for determining the noise points is: if the number of handwriting pixel points contained in the eight-neighborhood area of ​​a certain handwriting pixel point is equal to 0, then the handwriting pixel point is determined to be a noise point.

[0087] The present invention provides a Chinese character skeleton inflection point detection device based on eight-neighborhood directional coding, characterized in that it includes a memory and a processor; the memory is used to store a computer program; the processor is used to implement the above-mentioned Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding when executing the computer program.

[0088] The present invention provides a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the above-mentioned Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding is implemented.

[0089] Through the above technical scheme conceived by the present invention, since the present invention fully considers the unique rules of the direction coding chain of different strokes of Chinese characters, and studies and summarizes this based on the eight-neighborhood direction coding, the main direction coding, legal direction coding and illegal direction coding of different types of strokes are given, and the strokes corresponding to the direction coding chain containing more than 3 different direction codes are judged as the strokes containing the inflection point; the handwriting pixel points corresponding to the illegal direction coding in the direction coding chain are judged as the inflection point. Compared with the prior art that uses a certain threshold as the basis for inflection point determination, the present invention provides different illegal direction codes for different types of Chinese character strokes as the basis for inflection point determination. Therefore, the inflection point determination method of the present invention is more detailed and comprehensive, and can achieve the beneficial effect of high inflection point detection efficiency; the inflection point detection method provided by the present invention can effectively improve the accuracy of handwritten Chinese character recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 is a flow chart of a Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided by Example 1 of the present invention;

[0091] Figure 2 is a flow chart of a Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided by Embodiment 2 of the present invention;

[0092] Figure 3 is the original Chinese character image in the Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided in Example 1 of the present invention;

[0093] Figure 4 It is the Chinese character skeleton image in the Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided in Example 1 of the present invention;

[0094] Figure 5 Schematic diagram of a stroke segment of a Chinese character skeleton in a Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding provided in Example 1 of the present invention;

[0095] Figure 6 It is a schematic diagram of the starting pixel points and the ending pixel points of the stroke segment of the Chinese character skeleton in the Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding provided in Example 1 of the present invention;

[0096] Figure 7 Schematic diagram of eight-neighborhood directional coding in the Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding provided in Example 1 of the present invention;

[0097] Figure 8 It is a schematic diagram of the inflection points of the Chinese character skeleton in the Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0098] 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.

[0099] like Figure 1 As shown, the Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided by Example 1 of the present invention first performs a Chinese character skeleton extraction operation on the original handwritten Chinese character image to obtain a Chinese character skeleton image. The Chinese character skeleton extraction operation includes the following steps:

[0100] A0: Original Chinese character image Figure 3 As shown, the original Chinese character image is grayed, binarized and normalized in turn to obtain a Chinese character image.

[0101] Since the original Chinese character image may be a color image, each pixel in the image can have a range of more than 16 million colors, while the range of a pixel in a grayscale image is 255. In order to reduce the amount of calculation in subsequent algorithm judgment, the original Chinese character image needs to be grayscaled first. Each pixel in the image is represented by a brightness value from 0 to 255 to generate a corresponding grayscale image.

[0102] In order to distinguish the background part and the handwriting part in the grayscale image, it is also necessary to perform binarization processing on the grayscale image to make the entire image appear in black and white.

[0103] Since the size of the handwritten Chinese characters varies each time, the size of the original handwritten Chinese character images will also be different, which will cause errors in the judgment results of the subsequent algorithms. Therefore, it is necessary to scale the binarized image and normalize it to an image of 500×500 pixels.

[0104] A1: Use the Zhang-Suen thinning algorithm to process the Chinese character image to obtain a preliminary thinned Chinese character skeleton; then use the index table thinning algorithm to process the preliminary thinned Chinese character skeleton again to obtain the final Chinese character skeleton image. Figure 4 As shown, the final Chinese character skeleton image has been refined to the point where any handwriting pixel has only 4 or less adjacent handwriting pixels in its eight neighborhoods. In addition, other methods provided by the embodiments of the present invention can also be used to obtain a Chinese character skeleton image with only 4 or less adjacent handwriting pixels.

[0105] like Figure 5As shown, by deleting the intersection points in the Chinese character skeleton image and performing a segmentation operation on the Chinese character skeleton, 11 stroke segments can be obtained, which are marked as A~K respectively; while performing the segmentation operation, the operation of deleting the noise points in the Chinese character skeleton image is performed to make the turning point detection more accurate.

[0106] Among them, the method for judging the noise point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point X is equal to 0, then X is judged to be a noise point isolated outside the range of the Chinese character skeleton; the method for judging the intersection point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point Y is greater than or equal to 3, then Y is judged to be an intersection point.

[0107] Each stroke segment has a starting pixel and an ending pixel. Since any stroke pixel in the Chinese character skeleton has only 1, 2, 3 or 4 adjacent stroke pixels in its eight neighborhoods, and the intersections in the Chinese character skeleton are deleted, the starting pixel and the ending pixel have only 1 adjacent stroke pixel in their eight neighborhoods, and the other stroke pixels in each stroke segment have only 2 adjacent stroke pixels in their eight neighborhoods. Figure 6 As shown, the handwriting pixel point marked with L is the starting pixel point, and the handwriting pixel point marked with M is the ending pixel point.

[0108] Take the starting pixel or the ending pixel as the starting point to traverse each segment, as follows Figure 7 The eight-neighborhood direction coding shown in the figure obtains the direction coding of each handwriting pixel point, and each direction coding constitutes the direction coding chain of the stroke segment; the direction code that appears most times in the direction coding chain is the main direction code of the stroke segment.

[0109] The legal direction code can be obtained according to the main direction code. The rule for the legal direction code of each segment is:

[0110] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0111] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0112] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0113] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0114] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0115] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0116] If the main direction code of this pen segment is 6, the legal direction codes are 5, 6, and 7;

[0117] If the main direction code of this pen segment is 7, the legal direction codes are 0, 6, and 7.

[0118] The direction codes other than the legal direction codes of each pen segment are the illegal direction codes of this pen segment; for example, for the "horizontal stroke" in a stroke, the main direction code of this stroke should be 4. Since there may be tremors, bends, etc. in handwritten strokes, direction codes 3 or 5 may also appear in the stroke. Therefore, the legal direction codes of the "horizontal stroke" are 3, 4, and 5, and the other direction codes outside the legal direction codes are determined as the illegal direction codes of the "horizontal stroke".

[0119] Check whether the direction code chain of each pen segment contains the illegal direction code of this pen segment. If it contains, determine the handwriting pixel points corresponding to this illegal direction code as inflection points; if it does not contain, it is not an inflection point. As Figure 8 shown, there are a total of 5 inflection points in the Chinese character skeleton, which are respectively marked as N~R.

[0120] As Figure 2 shown, the Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding provided in Embodiment 2 of the present invention first needs to perform a Chinese character skeleton extraction operation on the original handwritten Chinese character image to obtain a Chinese character skeleton image. The Chinese character skeleton extraction operation includes the following steps:

[0121] C0: Sequentially perform grayscale conversion, binarization, and normalization processing on the original Chinese character image to obtain a Chinese character image.

[0122] First, perform grayscale conversion processing on the original Chinese character image. Each pixel in the image is represented by a brightness value from 0 to 255 to generate a corresponding grayscale image.

[0123] Then, perform binarization processing on the grayscale image to present the entire image in black and white.

[0124] Therefore, finally, it is also necessary to scale the image after binarization processing and normalize it into an image with a size of 500×500 pixels.

[0125] C1: Use the Zhang-Suen thinning algorithm to process the Chinese character image to obtain a preliminary thinned Chinese character skeleton; then use the index table thinning algorithm to process the preliminary thinned Chinese character skeleton again to obtain the final Chinese character skeleton image, and the final Chinese character skeleton image is thinned so that any handwriting pixel point has less than 4 adjacent handwriting pixel points in its eight-neighborhood.

[0126] By deleting the intersection points in the Chinese character skeleton image and performing a segmentation operation on the Chinese character skeleton, multiple stroke segments can be obtained; while performing the segmentation operation, the operation of deleting the noise points in the Chinese character skeleton image is performed to make the inflection point detection more accurate.

[0127] Among them, the method for judging the noise point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point X is equal to 0, then X is judged to be a noise point isolated outside the range of the Chinese character skeleton; the method for judging the intersection point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point Y is greater than or equal to 3, then Y is judged to be an intersection point.

[0128] Each stroke segment has a starting pixel and an ending pixel; the starting pixel and the ending pixel have only one adjacent handwriting pixel in their eight neighborhoods, and the other handwriting pixels of each stroke segment have only two adjacent handwriting pixels in their eight neighborhoods.

[0129] Each stroke segment is traversed starting from the starting pixel or the ending pixel, and the direction code of each stroke pixel except the starting point is obtained according to the eight-neighborhood direction coding. Each direction code constitutes the direction code chain of the stroke segment; the direction code that appears most times in the direction code chain is the main direction code of the stroke segment.

[0130] Performing an inflection point judgment operation on each pen segment includes the following steps: checking the direction code chain of each pen segment, if more than three different direction codes appear in the direction code chain, it is determined that the pen segment contains an inflection point, and an inflection point detection operation is performed on the pen segment; otherwise, it is determined that the pen segment does not contain an inflection point, and the inflection point judgment operation is continued to be performed on the next pen segment;

[0131] The legal direction coding can be obtained according to the main direction coding. The legal direction coding rules of the pen segment are:

[0132] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0133] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0134] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0135] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0136] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0137] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0138] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0139] If the main direction code of the segment is 7, then the legal direction codes are 0, 6 and 7.

[0140] The direction codes other than the legal direction codes of the stroke segment are illegal direction codes of the stroke segment; the turning point judgment operation includes the following steps: checking whether the direction code chain of the stroke segment contains the illegal direction code of the stroke segment; if it does, then the handwriting pixel point corresponding to the illegal direction code is judged as the turning point; if it does not contain it, then it is not a turning point.

[0141] The Chinese character skeleton inflection point detection system based on eight-neighborhood directional coding provided in Example 3 of the present invention includes a preprocessing module, a stroke segmentation module, a stroke segment coding module and an inflection point detection module.

[0142] The preprocessing module is used to perform Chinese character skeleton extraction on the original Chinese character image to obtain a Chinese character skeleton image. The preprocessing operation includes the following steps:

[0143] B0: The original Chinese character image is gray-scaled, binarized and normalized in sequence to obtain a Chinese character image.

[0144] First, the original Chinese character image is grayed out, and each pixel in the image is represented by a brightness value from 0 to 255 to generate the corresponding grayed-out image.

[0145] The grayscale image is then binarized to make the entire image appear black and white.

[0146] Therefore, we need to scale the binary image and normalize it to a 500×500 pixel image.

[0147] B1: Use the Zhang-Suen thinning algorithm to process the Chinese character image to obtain a preliminary thinned Chinese character skeleton; then use the index table thinning algorithm to process the preliminary thinned Chinese character skeleton again to obtain the final Chinese character skeleton image, and any handwriting pixel point in the final Chinese character skeleton image has no more than 4 adjacent handwriting pixels in its eight neighborhoods.

[0148] The stroke segmentation module is used to segment the Chinese character skeleton by deleting the intersection points in the Chinese character skeleton image to obtain multiple stroke segments; while performing the segmentation operation, the noise points in the Chinese character skeleton image are deleted to make the inflection point detection more accurate.

[0149] Among them, the method for judging the noise point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point X is equal to 0, then X is judged to be a noise point isolated outside the range of the Chinese character skeleton; the method for judging the intersection point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point Y is greater than or equal to 3, then Y is judged to be an intersection point.

[0150] Each stroke segment has a starting pixel and an ending pixel; the starting pixel and the ending pixel have only one adjacent handwriting pixel in their eight neighborhoods, and the other handwriting pixels of each stroke segment have only two adjacent handwriting pixels in their eight neighborhoods.

[0151] The stroke segment encoding module is used to traverse each stroke segment starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding. The various direction codes constitute the direction code chain of the stroke segment; the direction code that appears the most times in the direction code chain is the main direction code of the stroke segment.

[0152] The inflection point detection module is used to check whether the direction code chain of each stroke segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point.

[0153] The direction codes other than the legal direction codes of each segment are illegal direction codes of the segment; the rules for legal direction codes are:

[0154] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0155] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0156] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0157] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0158] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0159] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0160] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0161] If the main direction code of the segment is 7, then the legal direction codes are 0, 6 and 7.

[0162] The Chinese character skeleton inflection point detection system based on eight-neighborhood directional coding provided by Example 4 of the present invention includes a preprocessing module, a stroke segmentation module, a stroke segment coding module, an inflection point judgment module and an inflection point detection module.

[0163] The preprocessing module is used to perform Chinese character skeleton extraction on the original Chinese character image to obtain a Chinese character skeleton image. The preprocessing operation includes the following steps:

[0164] D0: The original Chinese character image is grayscaled, binarized and normalized in sequence to obtain a Chinese character image.

[0165] First, the original Chinese character image is grayed out, and each pixel in the image is represented by a brightness value from 0 to 255 to generate the corresponding grayed-out image.

[0166] The grayscale image is then binarized to make the entire image appear black and white.

[0167] Therefore, we need to scale the binary image and normalize it to a 500×500 pixel image.

[0168] D1: Use the Zhang-Suen thinning algorithm to process the Chinese character image to obtain a preliminary thinned Chinese character skeleton; then use the index table thinning algorithm to process the preliminary thinned Chinese character skeleton again to obtain the final Chinese character skeleton image, and any handwriting pixel point in the final Chinese character skeleton image has no more than 4 adjacent handwriting pixels in its eight neighborhoods.

[0169] The stroke segmentation module is used to segment the Chinese character skeleton by deleting the intersection points in the Chinese character skeleton image to obtain multiple stroke segments; while performing the segmentation operation, the noise points in the Chinese character skeleton image are deleted to make the inflection point detection more accurate.

[0170] Among them, the method for judging the noise point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point X is equal to 0, then X is judged to be a noise point isolated outside the range of the Chinese character skeleton; the method for judging the intersection point is: if the number of handwriting pixel points contained in the eight neighborhoods of a handwriting pixel point Y is greater than or equal to 3, then Y is judged to be an intersection point.

[0171] Each stroke segment has a starting pixel and an ending pixel; the starting pixel and the ending pixel have only one adjacent handwriting pixel in their eight neighborhoods, and the other handwriting pixels of each stroke segment have only two adjacent handwriting pixels in their eight neighborhoods.

[0172] The stroke segment encoding module is used to traverse each stroke segment starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding. The various direction codes constitute the direction code chain of the stroke segment; the direction code that appears the most times in the direction code chain is the main direction code of the stroke segment.

[0173] The inflection point judgment module is used to check the direction coding chain of each stroke segment. If more than three different direction codes appear in the direction coding chain, the stroke segment is judged to contain an inflection point, and the operation in the inflection point detection module is performed on the stroke segment; otherwise, the stroke segment is judged to not contain an inflection point, and the operation in the inflection point judgment module is continued for the next stroke segment.

[0174] The inflection point detection module is used to check whether the direction code chain of the pen segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point.

[0175] Direction codes other than the legal direction codes of a segment are illegal direction codes of the segment; the rules for legal direction codes are:

[0176] If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7;

[0177] If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2;

[0178] If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3;

[0179] If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4;

[0180] If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5;

[0181] If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6;

[0182] If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7;

[0183] If the main direction code of the segment is 7, then the legal direction codes are 0, 6 and 7.

[0184] It will be easily understood by those skilled in the art that 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 and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding, It is characterized in that The following steps are involved: (1) Preprocessing step: performing a Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods; (2) a stroke segmentation step: performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments; Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points; The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods; (3) Segment coding step: starting from the starting pixel or the ending pixel, traversing each of the stroke segments, and obtaining the direction code of each stroke pixel except the starting point according to the eight-neighborhood direction coding, wherein each direction code constitutes the direction code chain of the stroke segment; (4) Inflection point detection step: checking whether the direction code chain of each stroke segment contains an illegal direction code of the stroke segment. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point; The illegal direction code is a direction code other than the legal direction code of each of the segments, and the rule of the legal direction code is: If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7; If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2; If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3; If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4; If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5; If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6; If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7; If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7; The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

2. A Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding, It is characterized in that The following steps are involved: (1) Preprocessing step: performing a Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods; (2) a stroke segmentation step: performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments; Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points; The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods; (3) Segment coding step: starting from the starting pixel or the ending pixel, traversing each of the stroke segments, and obtaining the direction code of each stroke pixel except the starting point according to the eight-neighborhood direction coding, wherein each direction code constitutes the direction code chain of the stroke segment; (4) Inflection point determination step: Check the direction code chain of each of the segments. If three or more different direction codes appear in the direction code chain, the segment is determined to contain an inflection point, and the inflection point detection step is performed on the segment. Otherwise, the segment is determined not to contain an inflection point, and the inflection point determination step is performed on the next segment. (5) Inflection point detection step: checking whether the direction code chain of the stroke segment contains an illegal direction code of the stroke segment. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point; The illegal direction code is a direction code other than the legal direction code of the segment, and the rule of the legal direction code is: If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7; If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2; If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3; If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4; If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5; If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6; If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7; If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7; The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

3. The Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding according to claim 1 or 2, It is characterized in that The size of the Chinese character skeleton image in the preprocessing step is 500×500 pixels.

4. The Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding according to claim 1 or 2, It is characterized in that While the segmentation operation in the stroke segmentation step is being executed, an operation of deleting noise points in the Chinese character skeleton image is executed; the method for determining the noise points is: if the number of handwriting pixel points contained in the eight neighborhoods of a certain handwriting pixel point is equal to 0, then the handwriting pixel point is determined to be a noise point.

5. A Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding, It is characterized in that include: Preprocessing module: used to perform Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; Any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods; A stroke segmentation module: used for performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments; Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points; The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods; Segment coding module: used to perform traversal operation on each of the stroke segments starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding, and each direction code constitutes the direction code chain of the stroke segment; Inflection point detection module: used to check whether the direction code chain of each stroke segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point; The illegal direction code is a direction code other than the legal direction code of each of the segments, and the rule of the legal direction code is: If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7; If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2; If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3; If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4; If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5; If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6; If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7; If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7; The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

6. A Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding, It is characterized in that include: Preprocessing module: used to perform Chinese character skeleton extraction operation on the original Chinese character image to obtain a Chinese character skeleton image; Any handwriting pixel point in the Chinese character skeleton image has no more than 4 adjacent handwriting pixel points in its eight neighborhoods; A stroke segmentation module: used for performing a segmentation operation on the Chinese character skeleton by deleting the intersection points of the Chinese character skeleton in the Chinese character skeleton image to obtain a plurality of stroke segments; Among the handwriting pixel points constituting the stroke segment, the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is greater than or equal to 3 are intersection points; the handwriting pixel points whose number of handwriting pixel points contained in the eight neighborhoods is 1 are starting pixel points or ending pixel points; The other handwriting pixel points of the said stroke segment have only two adjacent handwriting pixel points in its eight neighborhoods; Segment coding module: used to perform traversal operation on each of the stroke segments starting from the starting pixel point or the ending pixel point, and obtain the direction code of each stroke pixel point except the starting point according to the eight-neighborhood direction coding, and each direction code constitutes the direction code chain of the stroke segment; Inflection point judgment module: used to check the direction code chain of each of the stroke segments. If more than three different direction codes appear in the direction code chain, the stroke segment is judged to contain an inflection point, and the operation in the inflection point detection module is performed on the stroke segment; otherwise, the stroke segment is judged not to contain an inflection point, and the operation in the inflection point judgment module is continued to be performed on the next stroke segment; Inflection point detection module: used to check whether the direction code chain of the pen segment contains an illegal direction code. If so, the handwriting pixel point corresponding to the illegal direction code is determined as an inflection point; if not, it is not an inflection point; The illegal direction code is a direction code other than the legal direction code of the segment, and the rule of the legal direction code is: If the main direction of the segment is coded as 0, then the legal direction codes are 0, 1, and 7; If the main direction of the segment is coded as 1, then the legal directions are coded as 0, 1, and 2; If the main direction of the segment is coded as 2, then the legal directions are coded as 1, 2, and 3; If the main direction of the segment is coded as 3, then the legal directions are coded as 2, 3, and 4; If the main direction of the segment is coded as 4, then the legal directions are coded as 3, 4, and 5; If the main direction of the segment is coded as 5, then the legal direction codes are 4, 5, and 6; If the main direction of the segment is coded as 6, then the legal direction codes are 5, 6, and 7; If the main direction code of the segment is 7, then the legal direction codes are 0, 6, and 7; The main direction code is the direction code that appears most frequently in the direction code chain of the stroke segment.

7. The Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding according to claim 5 or 6, It is characterized in that The size of the Chinese character skeleton image in the preprocessing module is 500×500 pixels.

8. The Chinese character skeleton inflection point detection system based on eight-neighborhood direction coding according to claim 5 or 6, It is characterized in that While the segmentation operation in the stroke segmentation module is being executed, an operation of deleting noise points in the Chinese character skeleton image is executed; the method for determining the noise points is: if the number of handwriting pixel points contained in the eight neighborhoods of a certain handwriting pixel point is equal to 0, then the handwriting pixel point is determined to be a noise point.

9. A Chinese character skeleton inflection point detection device based on eight-neighborhood direction coding, It is characterized in that It comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement the Chinese character skeleton inflection point detection method based on eight-neighborhood direction coding as described in any one of claims 1-4 when executing the computer program.

10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and when the computer program is executed by the processor, the Chinese character skeleton inflection point detection method based on eight-neighborhood directional coding as described in any one of claims 1-4 is implemented.