Handwritten Chinese character stroke splitting method and device, equipment, medium and product

By identifying and extracting the stroke molds of the target Chinese characters, performing extraction operations in the order of strokes and performing orientation correction, the problem of inaccurate splitting of handwritten Chinese characters in the prior art is solved, and a higher split accuracy is achieved.

CN120411991APending Publication Date: 2025-08-01BEIJING SHUANGYOU YUNQIAO EDUCATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510473585.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing handwritten Chinese characters stroke splitting methods have more interference when there are more strokes, resulting in low split accuracy and poor effect.

Method used

By identifying the target Chinese characters and obtaining their strokes, performing stroke extraction operations in sequence in order of strokes, and performing orientation switching and conflict detection when necessary, and combining XOR operations to supplement strokes to ensure the accuracy of splitting.

Benefits of technology

It improves the accuracy of handwritten Chinese characters' stroke splitting, improves the effect of stroke splitting, and solves the problem of poor splitting in existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411991A_ABST
    Figure CN120411991A_ABST
Patent Text Reader

Abstract

The invention discloses a handwritten Chinese character stroke splitting method and device, equipment, a medium and a product, and relates to the technical field of image processing, and the method comprises the steps: carrying out the recognition and extraction of a handwritten Chinese character in an obtained target image, and obtaining a target Chinese character and a recognition result of the target Chinese character; according to the recognition result of the target Chinese character, obtaining and temporarily storing a target stroke matrix of the target Chinese character from a Chinese character stroke order library; according to the stroke sequence of each target stroke matrix of the target Chinese character, sequentially executing stroke extraction operation on each target stroke matrix of the target Chinese character, extracting target strokes, and obtaining a stroke splitting result of the target Chinese character; after executing the stroke extraction operation each time, if the stroke sequence of the current target stroke matrix is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with the orientation of the target historical stroke in the current stroke splitting result, performing orientation exchange on the current target stroke and the target historical stroke; the stroke splitting effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technologies, and particularly to a method, device, equipment, medium and product for splitting strokes of handwritten Chinese characters. Background Art

[0002] In recent years, with the development of information technology, the demand for digital processing of handwritten Chinese characters has been increasing. Especially in the field of online education platforms, in order to improve students' Chinese character writing ability, researchers have developed a variety of handwritten Chinese character evaluation technologies to give specific and standardized evaluation information on the Chinese characters written by students, so as to achieve one-on-one tutoring for each student's Chinese character writing. In handwritten Chinese character evaluation technologies, the segmentation of handwritten Chinese character strokes, as a key technology, plays a crucial role in improving the evaluation accuracy.

[0003] The existing method for splitting strokes of handwritten Chinese characters based on iterative adaptation and matching algorithms disassembles and reconnects strokes according to stroke connection points. When there are many strokes in handwritten Chinese characters, there are more interferences, resulting in low accuracy of stroke splitting and poor effect of splitting strokes of handwritten Chinese characters. Summary of the Invention

[0004] The purpose of the present application is to provide a method, device, equipment, medium and product for splitting strokes of handwritten Chinese characters to solve the problem that the existing method for splitting strokes of handwritten Chinese characters has a poor effect on splitting strokes of handwritten Chinese characters.

[0005] To achieve the above purpose, the present application provides the following solutions:

[0006] In a first aspect, the present application provides a method for splitting strokes of handwritten Chinese characters, including:

[0007] Identifying and extracting the handwritten Chinese characters in the obtained target image to obtain the target Chinese characters and their recognition results; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and there are handwritten Chinese characters in at least one writing grid;

[0008] According to the recognition result of the target Chinese character, obtaining and temporarily storing the target stroke font models of the target Chinese character from the Chinese character stroke order library; wherein, each target stroke font model of the target Chinese character is the standard font model of each stroke of the target Chinese character;

[0009] Performing a stroke extraction operation on each target stroke font model of the target Chinese character in sequence according to the stroke order of each target stroke font model of the target Chinese character to extract the target strokes, and obtaining the stroke splitting result of the target Chinese character; wherein, the target stroke refers to the stroke in the target Chinese character that has the same shape as the current target stroke font model and the coincidence degree is greater than a preset first threshold;

[0010] After each execution of the stroke extraction operation, if the stroke order of the current target stroke font is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with its orientation in the current stroke splitting result, the current target stroke and the target historical stroke are swapped in orientation; wherein, the target historical stroke is the target stroke in the current stroke splitting result whose overlap with the current target stroke is greater than the second threshold.

[0011] Optionally, the method for splitting the strokes of a handwritten Chinese character further includes:

[0012] After each execution of the stroke extraction operation, if the stroke order of the current target stroke font is greater than 1, perform a stroke conflict detection operation:

[0013] If the current target stroke overlaps with the historical target stroke in the current stroke splitting result and the overlap is less than the third threshold, clear the overlapping part of the current target stroke and the historical target stroke; wherein, the historical target stroke is the target stroke that has been extracted in the current stroke splitting result.

[0014] Optionally, the method for splitting the strokes of a handwritten Chinese character further includes:

[0015] After all the target strokes of the target Chinese character are extracted, perform a stroke supplement operation:

[0016] Perform an exclusive OR operation on all the target strokes of the extracted target Chinese character and the target Chinese character to obtain the remaining contour;

[0017] If there is a target contour in the remaining contour, where the target contour refers to a contour that is connected to one of the target strokes in the stroke splitting result of the target Chinese character and the direction of the target contour is consistent with the direction of the target stroke it is connected to, supplement the target contour to the target stroke it is connected to.

[0018] Optionally, the stroke extraction operation includes:

[0019] Perform contour detection on the current target stroke font to obtain the stroke endpoints of the current target stroke font;

[0020] Based on the current target stroke font and its stroke endpoints, search for and extract, in the target Chinese character by means of window pane movement, a stroke that is consistent in shape with the current target stroke font and whose overlap is greater than the first threshold to obtain the current target stroke.

[0021] Optionally, the method for splitting the strokes of a handwritten Chinese character further includes:

[0022] After each execution of the stroke extraction operation, according to the stroke name of the current target stroke, other endpoint information except the stroke start point, end point, and turning point in the current target stroke is deleted.

[0023] Optionally, the recognition and extraction of each handwritten Chinese character in the obtained target image to obtain the target Chinese character and its recognition result include:

[0024] Recognize the two-dimensional code in the target image, and perform direction correction on the target image based on the two-dimensional code;

[0025] Perform grayscale conversion, binarization, and denoising processing on the target image in sequence to obtain a binary image;

[0026] Perform contour detection on the binary image to obtain the outer border of the target copybook;

[0027] Perform perspective correction on the binary image according to the outer border of the target copybook to obtain a corrected image;

[0028] Crop the corrected image according to the image information in the two-dimensional code to obtain a text block area; wherein, the image information includes a unique ID, and according to the unique ID, the size of the target copybook in the target image and the position of the text block area can be retrieved from the database;

[0029] Search for and crop each writing grid in the text block area to obtain a writing grid image;

[0030] Recognize the handwritten Chinese characters in each writing grid image through the constructed handwritten Chinese character recognition model to obtain the recognition results of the handwritten Chinese characters;

[0031] Remove the writing grid auxiliary lines in the writing grid image, and extract the handwritten Chinese characters in the writing grid image based on the recognition result to obtain the target Chinese character.

[0032] In a second aspect, the present application provides a device for splitting strokes of handwritten Chinese characters, including:

[0033] A recognition and extraction module, configured to recognize and extract handwritten Chinese characters in the obtained target image to obtain the target Chinese character and its recognition result; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and there are handwritten Chinese characters in at least one writing grid;

[0034] A font model acquisition module, configured to obtain and temporarily store the target stroke font models of each target Chinese character from the Chinese character stroke order library according to the recognition result of each target Chinese character; wherein, each target stroke font model of each target Chinese character is the standard font model of each stroke of each target Chinese character;

[0035] A stroke extraction module, configured to perform stroke extraction operations on each target stroke font of the target Chinese character in sequence according to the stroke order of each target stroke font of the target Chinese character, so as to extract target strokes and obtain a stroke splitting result of the target Chinese character; wherein, the target stroke refers to a stroke in the target Chinese character that has the same shape as the current target stroke font and a coincidence degree greater than a preset first threshold.

[0036] An orientation correction module, configured to, after each execution of the stroke extraction operation, if the stroke order of the current target stroke font is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, swap the orientations of the current target stroke and the target historical stroke; wherein, the target historical stroke is a target stroke in the current stroke splitting result whose coincidence degree with the current target stroke is greater than a second threshold.

[0037] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the steps of the handwritten Chinese character stroke splitting method described in any one of the above.

[0038] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the handwritten Chinese character stroke splitting method described in any one of the above are implemented.

[0039] In a fifth aspect, the present application provides a computer program product, including a computer program, characterized in that when the computer program is executed by a processor, the steps of the handwritten Chinese character stroke splitting method described in any one of the above are implemented.

[0040] According to the specific embodiments provided by the present application, the following technical effects are disclosed in the present application:

[0041] The present application provides a method, apparatus, device, medium and product for splitting strokes of handwritten Chinese characters. By recognizing and extracting each handwritten Chinese character in the obtained target image, the target Chinese character and its recognition result are obtained, realizing the recognition and extraction of handwritten Chinese characters in the obtained target image; according to the recognition result of the target Chinese character, the target stroke font model of the target Chinese character is obtained from the Chinese character stroke order library and temporarily stored, so as to facilitate splitting the strokes of the target Chinese character according to the target stroke font model of the target Chinese character; by sequentially performing stroke extraction operations on each target stroke font model of the target Chinese character according to the stroke order of each target stroke font model of the target Chinese character, the target stroke (the stroke in the target Chinese character that has the same shape as the target stroke font model currently performing the stroke extraction operation and the overlap degree is greater than a preset first threshold) is extracted, realizing the stroke splitting of handwritten Chinese characters in the target image. Compared with the existing method for splitting strokes of handwritten Chinese characters based on iterative adaptation and matching algorithms, the target stroke can be accurately obtained with the same shape and the same / similar size as the target stroke font model through the target stroke font model and the first threshold, ensuring the accuracy of each target stroke split; when the stroke order of the current target stroke font model is greater than 1 and the orientation of the target historical stroke (the target stroke in the current stroke splitting result with an overlap degree greater than a second threshold with the currently extracted target stroke) in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, the current target stroke and the target historical stroke are swapped in orientation to achieve orientation correction, further ensuring the accuracy of each target stroke split; in summary, the present application effectively improves the accuracy of stroke splitting, enhances the effect of splitting strokes of handwritten Chinese characters, and solves the problem that the existing method for splitting strokes of handwritten Chinese characters has a poor effect on splitting strokes of handwritten Chinese characters. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.

[0043] Figure 1 It is a flowchart showing a method for splitting strokes of handwritten Chinese characters provided by an embodiment of the present application;

[0044] Figure 2 It is a schematic diagram of a target stroke font model;

[0045] Figure 3 It is a schematic diagram of functional modules of a device for splitting strokes of handwritten Chinese characters provided by an embodiment of the present application;

[0046] Figure 4 It is a schematic diagram of the structure of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0049] In an exemplary embodiment, Figure 1 As shown, a method for splitting the strokes of handwritten Chinese characters is provided, comprising the following steps 101 to 104. In which:

[0050] Step 101: Recognize and extract handwritten Chinese characters in the acquired target image to obtain target Chinese characters and recognition results; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and at least one writing grid contains handwritten Chinese characters.

[0051] In the embodiment of the present application, the target image can be obtained by the user directly taking a photo of the handwritten Chinese characters on the terminal device, or by the user uploading a photo of the handwritten Chinese characters on the terminal device. The writing grid includes but is not limited to a Tianzi grid, a Jiugong grid, a Mi grid, a square grid, a horizontal grid, or a vertical grid. The target Chinese characters are each handwritten Chinese character extracted from the target image.

[0052] Step 102 , according to the recognition result of the target Chinese character, obtain and temporarily store the target stroke font of the target Chinese character from the Chinese character stroke order library; wherein each target stroke font of the target Chinese character is a standard font of each stroke of the target Chinese character.

[0053] For example, Figure 2 Shown are the standard fonts for each stroke of the Chinese character "乐".

[0054] Step 103, according to the stroke order of each target stroke font of the target Chinese character, perform a stroke extraction operation on each target stroke font of the target Chinese character in sequence, extract the target strokes, and obtain the stroke splitting result of the target Chinese character; wherein, the target stroke refers to the stroke in the target Chinese character that has the same shape as the current target stroke font (the target stroke font currently performing the stroke extraction operation) and the overlap degree is greater than a preset first threshold.

[0055] In the embodiments of the present application, the overlap ratio refers to the length ratio of the portion of the current target stroke model that overlaps with any stroke in the target Chinese character to the length of the target stroke model, or refers to the length ratio of the number of pixels of the portion of the current target stroke model that overlaps with any stroke in the target Chinese character to the length of the target stroke model. There is no specific limit on the first threshold value, which can be obtained through debugging. The first threshold value needs to ensure that target strokes of the same or similar size as the target stroke model currently being subjected to the stroke extraction operation can be identified from the target Chinese character to ensure the accuracy of stroke segmentation.

[0056] Step 104, after each execution of the stroke extraction operation, if the stroke order of the current target stroke font is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, then the current target stroke (the currently extracted target stroke) and the target historical stroke are swapped in orientation; wherein, the target historical stroke is a target stroke in the current stroke splitting result whose degree of overlap with the current target stroke is greater than a second threshold.

[0057] In the embodiment of the present application, the current stroke splitting result refers to the stroke splitting result formed by the currently extracted target stroke and the target strokes that have been extracted. There is no specific limitation on the second threshold value, which can be obtained through debugging. The second threshold value needs to ensure that the target stroke with the same / similar shape as the current target stroke can be identified from the current stroke splitting result. The orientation correction is mainly aimed at the target Chinese characters containing at least two identical or similar strokes, to avoid the orientation (position) error of the target strokes with the same or similar strokes extracted from the target Chinese characters.

[0058] For example, for the Chinese character "手", if the length of the second stroke in the target Chinese character is greater than the third stroke (that is, the student wrote it wrong), if the strokes are searched from top to bottom and from left to right, when the target stroke with a stroke order of 2 is extracted, it is possible that the extracted target stroke is actually a stroke with a stroke order of 3, and when the target stroke with a stroke order of 3 is extracted, the extracted target stroke is actually a stroke with a stroke order of 2. After extracting the target stroke with a stroke order of 3, it will be found that the position of the extracted target stroke with a stroke order of 2 in the current extraction result is inconsistent with the position in the target Chinese character. Then, the target stroke with a stroke order of 3 currently extracted in the current stroke splitting result and the target stroke with a stroke order of 2 already extracted are swapped, so that the positions of the currently extracted target stroke with a stroke order of 3 and the extracted target stroke with a stroke order of 2 in the current stroke splitting result are consistent with their positions in the target Chinese character, thereby achieving position correction.

[0059] For example, for the Chinese character "叠", if the strokes are searched from top to bottom and from left to right due to improper handwriting, when extracting the target stroke with a stroke order of 1, the extracted target stroke is actually the stroke with a stroke order of 3, and when extracting the target stroke with a stroke order of 3, the extracted target stroke is actually the stroke with a stroke order of 5. When extracting the target stroke with a stroke order of 5, the extracted target stroke is actually the stroke with a stroke order of 1. After extracting the target stroke with a stroke order of 3, it will be found that the position of the target stroke with a stroke order of 1 in the current splitting result is inconsistent with the position in the target Chinese character. Then the target stroke with a stroke order of 3 currently extracted in the current stroke splitting result and the target stroke with a stroke order of 1 that has been extracted will be swapped. After extracting the target stroke with a stroke order of 5, it will be found that the position of the target stroke with a stroke order of 1 in the current splitting result is inconsistent with the position in the target Chinese character. In this way, the target stroke with a stroke order of 5 currently extracted in the current stroke splitting result and the target stroke with a stroke order of 1 that has been extracted will be swapped to achieve position correction.

[0060] For another example, for the Chinese character "叠", if the strokes are searched from top to bottom and from left to right due to improper handwriting, when extracting the target stroke with a stroke order of 1, the extracted target stroke is actually the stroke with a stroke order of 5, and when extracting the target stroke with a stroke order of 3, the extracted target stroke is actually the stroke with a stroke order of 1, and when extracting the target stroke with a stroke order of 5, the extracted target stroke is actually the stroke with a stroke order of 3. After extracting the target stroke with a stroke order of 3, it will be found that the position of the target stroke with a stroke order of 1 in the current splitting result is inconsistent with the position in the target Chinese character. Then the target stroke with a stroke order of 3 currently extracted in the current stroke splitting result and the target stroke with a stroke order of 1 that has been extracted will be swapped. After extracting the target stroke with a stroke order of 5, it will be found that the position of the target stroke with a stroke order of 3 in the current splitting result is inconsistent with the position in the target Chinese character. In this way, the target stroke with a stroke order of 5 currently extracted in the current stroke splitting result and the target stroke with a stroke order of 3 that has been extracted will be swapped to achieve position correction.

[0061] By implementing the above steps 101 to 104, by recognizing and extracting each handwritten Chinese character in the obtained target image, the target Chinese character and its recognition result are obtained, realizing the recognition and extraction of the handwritten Chinese characters in the obtained target image; according to the recognition result of the target Chinese character, the target stroke font model of the target Chinese character is obtained and temporarily stored from the Chinese character stroke order library, so as to facilitate the stroke splitting of the target Chinese character according to the target stroke font model of the target Chinese character; by sequentially performing a stroke extraction operation on each target stroke font model of the target Chinese character according to the stroke order of each target stroke font model of the target Chinese character, the target stroke (the stroke in the target Chinese character that is consistent in shape with the target stroke font model for which the current stroke extraction operation is performed and the overlap degree is greater than a preset first threshold) is extracted, realizing the stroke splitting of the handwritten Chinese characters in the target image. Compared with the existing handwritten Chinese character stroke splitting method based on the iterative adaptation and matching algorithm, the target stroke can be accurately obtained with the same shape and the same / similar size as the target stroke font model through the target stroke font model and the first threshold, ensuring the accuracy of each target stroke in the splitting; when the stroke order of the current target stroke font model is greater than 1 and the orientation of the target historical stroke (the target stroke in the current stroke splitting result with an overlap degree greater than the second threshold with the currently extracted target stroke) in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, the orientation of the current target stroke and the target historical stroke is swapped to achieve orientation correction, further ensuring the accuracy of each target stroke in the splitting; in summary, this application effectively improves the accuracy of stroke splitting, enhances the stroke splitting effect of handwritten Chinese characters, and solves the problem that the existing handwritten Chinese character stroke splitting method has a poor stroke splitting effect on handwritten Chinese characters.

[0062] Optionally, in other embodiments of the present application, the above stroke extraction operation includes the following steps 201 to 202. Among them:

[0063] Step 201, perform contour detection on the current target stroke font model to obtain the stroke endpoints of the current target stroke font model.

[0064] In the embodiment of the present application, if the stroke of the current target stroke font model has no turning points, the stroke endpoints include the stroke start point and the stroke end point. If the stroke of the current target stroke font model has turning points, the stroke endpoints include the stroke start point, the stroke turning point, and the stroke end point.

[0065] Step 202, according to the current target stroke font model and its stroke endpoints, search for and extract the stroke in the target Chinese character that is consistent in shape with the current target stroke font model and has an overlap degree greater than the first threshold by means of window movement to obtain the current target stroke.

[0066] In the embodiment of the present application, the direction of window pane movement is preferably limited to from top to bottom and from left to right. The specific method of extracting the strokes of the target Chinese character by window pane movement is as follows: by moving the target stroke font in the X and Y directions on the plane coordinate system, the target stroke font and the target Chinese character are compared.

[0067] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting method further includes:

[0068] After each stroke extraction operation, if the stroke order of the current target stroke font is greater than 1, a stroke conflict detection operation is performed:

[0069] If the currently extracted target stroke overlaps with the historical target stroke in the current stroke segmentation result and the degree of overlap is less than a third threshold, the overlapping portion of the currently extracted target stroke and the historical target stroke is cleared.

[0070] For example, for the Chinese character "人", when there is an overlapping part between the stroke "撇" and the stroke "捺", it is necessary to clean up the part of the stroke "捺" that overlaps with the stroke "撇".

[0071] In the embodiment of the present application, the third threshold is not specifically limited and can be set according to needs, but it is necessary to ensure that the overlapping part between two overlapping target strokes can be identified.

[0072] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting method further includes:

[0073] After all target strokes of the target Chinese character are extracted, a stroke supplement operation is performed.

[0074] The above stroke supplementation operation includes the following steps 301 to 302. Among them:

[0075] Step 301: Perform an XOR operation on all target strokes of the extracted target Chinese character and the target Chinese character to obtain a remaining contour.

[0076] Step 302: If there is a target contour in the remaining contours, the target contour refers to a contour connected to a target stroke in the stroke splitting result of the target Chinese character, and the direction of the target contour is consistent with that of the target stroke connected to it, the target contour is added to the target stroke connected to it.

[0077] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting method further includes:

[0078] After each stroke extraction operation is performed, other endpoint information except the stroke start point, end point and turning point of the current target stroke is deleted according to the stroke name of the current target stroke.

[0079] In the embodiments of the present application, the width of the target template stroke may be greater than the width of the strokes in the target Chinese character. If the target stroke is extracted according to the target template stroke, there may be points on other strokes in the extracted target stroke. To avoid the interference of these points, after each stroke extraction operation, according to the stroke name of the current target stroke, other endpoint information of the current target stroke except for the stroke start point, end point, and turning point is deleted.

[0080] Optionally, in other embodiments of the present application, step 101 described above includes the following steps 401 to 408. Among them:

[0081] Step 401, identify the two-dimensional code in the target image, and perform direction correction on the target image based on this two-dimensional code.

[0082] For example, if it is defined that the direction of the target image is positive when the two-dimensional code is located in the upper left corner, if it is not in the upper left corner, it is necessary to perform direction correction on the target image based on the orientation of the two-dimensional code to make the target image in the positive direction.

[0083] Step 402, perform grayscale conversion, binarization, and denoising processing on the target image in sequence to obtain a binary image.

[0084] In the embodiments of the present application, grayscale conversion refers to converting a color image into a grayscale image. Binarization refers to selecting an appropriate threshold to convert the grayscale image into a black and white image, highlighting the strokes of the handwritten Chinese character, the writing grid, and the background. For example, in the binary image, the strokes of the handwritten Chinese character and the writing grid are black, and the background is white. Denoising refers to removing the noise points in the black and white image to improve the image quality.

[0085] Step 403, perform contour detection on the binary image to obtain the outer border of the target copybook.

[0086] Step 404, perform perspective correction on the binary image according to the outer border of the target copybook to obtain a corrected image.

[0087] Step 405, perform cropping on the corrected image according to the image information in the two-dimensional code to obtain the text block area.

[0088] In the embodiments of the present application, the image information in the two-dimensional code includes a unique ID. According to this unique ID, the size of the target copybook in the target image and the position of the text block area (the position of the text block area in the target copybook) can be retrieved from the database. Cropping is performed according to the size of the target copybook in the target image and the position of the text block area to obtain the text block area.

[0089] Step 406, search for and crop each writing grid within the text block area to obtain a writing grid image.

[0090] In the embodiments of the present application, the writing grid image is the image of each writing grid in the copybook.

[0091] Step 407: Recognize the handwritten Chinese characters in each writing grid image through the constructed handwritten Chinese character recognition model to obtain the recognition result.

[0092] Step 408: Remove the writing grid auxiliary lines in the writing grid image, and extract the handwritten Chinese characters in the writing grid image based on the recognition result to obtain the target Chinese characters.

[0093] Based on the same inventive concept, the embodiments of the present application also provide a handwritten Chinese character stroke splitting device for implementing the above-mentioned handwritten Chinese character stroke splitting method. The implementation solutions provided by this device to solve problems are similar to the implementation solutions described in the above method. Therefore, the specific limitations in one or more embodiments of the following handwritten Chinese character stroke splitting device can refer to the limitations on the handwritten Chinese character stroke splitting method in the above text, and will not be repeated here.

[0094] In an exemplary embodiment, as Figure 3 shown, a handwritten Chinese character stroke splitting device 50 is provided, including:

[0095] A recognition and extraction module 501, configured to recognize and extract the handwritten Chinese characters in the acquired target image to obtain the target Chinese characters and their recognition results; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and there are handwritten Chinese characters in at least one writing grid;

[0096] A font model acquisition module 502, configured to obtain and temporarily store the target stroke font models of each target Chinese character from the Chinese character stroke order library according to the recognition result of each target Chinese character; wherein, each target stroke font model of the target Chinese character is the standard font model of each stroke of the target Chinese character;

[0097] A stroke extraction module 503, configured to sequentially perform stroke extraction operations on each target stroke font model of the target Chinese character according to the stroke order of each target stroke font model of the target Chinese character to extract the target strokes and obtain the stroke splitting result of the target Chinese character; wherein, the target stroke refers to the stroke in the target Chinese character that is consistent in shape with the current target stroke font model (the target stroke font model for which the stroke extraction operation is currently performed) and has a coincidence degree greater than a preset first threshold;

[0098] An orientation correction module 504, configured to, after each stroke extraction operation, if the stroke order of the current target stroke font model is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, swap the orientation of the current target stroke (the currently extracted target stroke) and the target historical stroke; wherein, the target historical stroke is the target stroke in the current stroke splitting result that has a coincidence degree greater than a second threshold with the current target stroke.

[0099] Optionally, in other embodiments of the present application, the above-mentioned stroke extraction module 603 is further configured to:

[0100] Perform contour detection on the current target stroke font pattern to obtain the stroke endpoints of the current target stroke font pattern;

[0101] According to the current target stroke font pattern and its stroke endpoints, search for and extract strokes in the target Chinese character that are consistent in shape with the current target stroke font pattern and have a coincidence degree greater than the first threshold by means of pane movement, so as to obtain the current target stroke.

[0102] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting device 60 further includes:

[0103] A conflict detection module 505, configured to perform a stroke conflict detection operation after each execution of the stroke extraction operation: if the stroke order of the current target stroke font pattern is greater than 1

[0104] If the currently extracted target stroke overlaps with the historical target stroke in the current stroke splitting result and the overlap degree is less than the third threshold, clear the overlapping part of the currently extracted target stroke and the historical target stroke.

[0105] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting device 60 further includes:

[0106] A stroke supplement module 506, configured to perform a stroke supplement operation after all target strokes of the target Chinese character are extracted.

[0107] The above-mentioned stroke supplement operation includes:

[0108] Perform an exclusive OR operation on all the target strokes of each extracted target Chinese character and the target Chinese character to obtain the remaining contour;

[0109] If there is a target contour in the remaining contour, where the target contour refers to a contour connected to one of the target strokes in the stroke splitting result of the target Chinese character and the direction of the target contour is the same as that of the target stroke it is connected to, supplement the target contour to the target stroke it is connected to.

[0110] Optionally, in other embodiments of the present application, the above-mentioned handwritten Chinese character stroke splitting device 60 further includes:

[0111] An endpoint elimination module 507, configured to delete other endpoint information in the current target stroke except for the stroke start point, end point, and turning point according to the stroke name of the current target stroke after each execution of the stroke extraction operation.

[0112] Optionally, in other embodiments of the present application, the above recognition and extraction module 601 is further configured to:

[0113] Recognize the two-dimensional code in the target image, and perform orientation correction on the target image based on the two-dimensional code;

[0114] Perform grayscale conversion, binarization, and denoising processing on the target image in sequence to obtain a binary image;

[0115] Perform contour detection on the binary image to obtain the outer border of the target copybook;

[0116] Perform perspective correction on the binary image according to the outer border of the target copybook to obtain a corrected image;

[0117] Perform cropping on the corrected image according to the image information in the two-dimensional code to obtain a text block area;

[0118] Search for and crop each writing grid within the text block area to obtain a writing grid image;

[0119] Recognize the handwritten Chinese characters in each writing grid image through the constructed handwritten Chinese character recognition model to obtain a recognition result;

[0120] Remove the writing grid auxiliary lines in the writing grid image, and extract the handwritten Chinese characters within the writing grid image based on the recognition result to obtain the target Chinese characters.

[0121] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 4 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data in the handwritten Chinese character stroke splitting method. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements a handwritten Chinese character stroke splitting method.

[0122] Those skilled in the art can understand, Figure 4The structure shown is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0123] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0124] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0125] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.

[0126] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0127] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0128] The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.

[0129] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0130] Specific examples are used in this article to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A method for splitting strokes of handwritten Chinese characters, characterized in that, The method for splitting strokes of handwritten Chinese characters includes: Identifying and extracting the handwritten Chinese characters in the acquired target image to obtain the target Chinese characters and their recognition results; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and there are handwritten Chinese characters in at least one writing grid; According to the recognition result of the target Chinese character, obtaining and temporarily storing the target stroke font models of the target Chinese character from the Chinese character stroke order library; wherein, each of the target stroke font models of the target Chinese character is the standard font model of each stroke of the target Chinese character; According to the stroke order of each target stroke font model of the target Chinese character, performing a stroke extraction operation on each target stroke font model of the target Chinese character in sequence to extract the target strokes, and obtaining the stroke splitting result of the target Chinese character; wherein, the target stroke refers to the stroke in the target Chinese character that is consistent in shape with the current target stroke font model and has a coincidence degree greater than a preset first threshold; After each execution of the stroke extraction operation, if the stroke order of the current target stroke font model is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with its orientation in the current stroke splitting result, then swap the orientation of the current target stroke and the target historical stroke; wherein, the target historical stroke is the target stroke in the current stroke splitting result whose coincidence degree with the current target stroke is greater than a second threshold.

2. The method for splitting strokes of handwritten Chinese characters according to claim 1, wherein It further includes: After each execution of the stroke extraction operation, if the stroke order of the current target stroke font model is greater than 1, perform a stroke conflict detection operation: If the current target stroke coincides with the historical target stroke in the current stroke splitting result and the coincidence degree is less than a third threshold, clear the overlapping part of the current target stroke and the historical target stroke; wherein, the historical target stroke is the target stroke that has been extracted in the current stroke splitting result.

3. The method for splitting strokes of handwritten Chinese characters according to claim 1, wherein, It further includes: After all the target strokes of the target Chinese character are extracted, perform a stroke supplement operation: Perform an exclusive OR operation on all the extracted target strokes of the target Chinese character and the target Chinese character to obtain the remaining contour; If there is a target contour in the remaining contour, the target contour refers to the contour that is connected to one of the target strokes in the stroke splitting result of the target Chinese character, and the direction of the target contour is the same as that of the target stroke it is connected to, supplement the target contour to the target stroke it is connected to.

4. The method for splitting strokes of handwritten Chinese characters according to claim 1, wherein The stroke extraction operation includes: Performing contour detection on the current target stroke font model to obtain the stroke endpoints of the current target stroke font model; According to the current target stroke font model and its stroke endpoints, searching for and extracting in the target Chinese character a stroke that is consistent in shape with the current target stroke font model and has a coincidence degree greater than the first threshold by means of window movement to obtain the current target stroke.

5. The method for splitting strokes of handwritten Chinese characters according to claim 1, wherein It further includes: After each execution of the stroke extraction operation, according to the stroke name of the current target stroke, delete the other endpoint information of the current target stroke except for the stroke start point, end point, and turning point.

6. The method for splitting strokes of handwritten Chinese characters according to claim 1, wherein The identifying and extracting each handwritten Chinese character in the acquired target image to obtain the target Chinese character and its recognition result includes: Identify the QR code in the target image, and perform orientation correction on the target image based on the QR code; Perform grayscale conversion, binarization, and denoising processing on the target image in sequence to obtain a binary image; Perform contour detection on the binary image to obtain the outer border of the target copybook; Perform perspective correction on the binary image according to the outer border of the target copybook to obtain a corrected image; Crop the corrected image according to the image information in the QR code to obtain a text block area; wherein, the image information includes a unique ID, and the size of the target copybook in the target image and the position of the text block area can be retrieved from the database according to the unique ID; Search for and crop each writing grid within the text block area to obtain a writing grid image; Identify the handwritten Chinese characters in each writing grid image through the constructed handwritten Chinese character recognition model to obtain the recognition results of the handwritten Chinese characters; Remove the writing grid auxiliary lines in the writing grid image, and extract the handwritten Chinese characters within the writing grid image based on the recognition results to obtain the target Chinese characters.

7. A device for splitting strokes of handwritten Chinese characters, characterized in that, The handwritten Chinese character stroke splitting device includes: An identification and extraction module, configured to identify and extract the handwritten Chinese characters in the acquired target image to obtain the target Chinese characters and their recognition results; wherein, the target image includes a target copybook, the target copybook includes at least one writing grid, and there are handwritten Chinese characters in at least one writing grid; A font model acquisition module, configured to acquire and temporarily store the target stroke font models of each target Chinese character from the Chinese character stroke order library according to the recognition results of each target Chinese character; wherein, each target stroke font model of each target Chinese character is the standard font model of each stroke of each target Chinese character; A stroke extraction module, configured to perform stroke extraction operations on each target stroke font model of the target Chinese character in sequence according to the stroke order of each target stroke font model of the target Chinese character to extract target strokes and obtain the stroke splitting result of the target Chinese character; wherein, the target stroke refers to the stroke in the target Chinese character that is consistent with the current target stroke font model in shape and has a coincidence degree greater than a preset first threshold; An orientation correction module, configured to, after each execution of the stroke extraction operation, if the stroke order of the current target stroke font model is greater than 1 and the orientation of the target historical stroke in the target Chinese character is inconsistent with the orientation in the current stroke splitting result, swap the orientation of the current target stroke and the target historical stroke; wherein, the target historical stroke is the target stroke in the current stroke splitting result that has a coincidence degree greater than a second threshold with the current target stroke.

8. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the handwritten Chinese character stroke splitting method according to any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the handwritten Chinese character stroke splitting method according to any one of claims 1-6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the handwritten Chinese character stroke splitting method according to any one of claims 1-6.