Chinese language and literature handwritten calligraphy style automatic identification and scoring system and method
By constructing a standard template library and feature matching module, the Chinese language and literature handwritten calligraphy styles are automatically identified and scored, and the problem of relying on manual rules and expert experience in the existing technology is solved, achieving a more objective and comprehensive evaluation of calligraphy works.
Patent Information
- Application Number
- CN202411798632.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-03-14
AI Technical Summary
The existing Chinese character scoring technology relies on manual rules and expert experience, making it difficult to comprehensively and objectively evaluate the handwritten calligraphy style of Chinese language and literature, and the rules-based method performs poorly when dealing with diversity and complexity.
A standard template library containing all samples of handwritten styles of typical Chinese language and literature is constructed. The feature extraction module extracts the macro, meso and micro level feature information from handwritten Chinese characters pictures, and matches the feature information of the standard template to automatically identify and score calligraphy styles.
It realizes a more objective evaluation of calligraphy works, reduces the dependence on the personal experience of calligraphy experts, and can more comprehensively capture the details in calligraphy works, making up for the problem of insufficient feature description in rules-based methods.
Smart Images

Figure CN119625761A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and more specifically, to a system and method for automatically identifying and scoring the handwritten calligraphy style of Chinese language and literature. Background Art
[0002] Automatic recognition and scoring of handwritten calligraphy styles in Chinese language and literature refers to an algorithm that uses a computer algorithm to give a score to the standardization of the writing of each Chinese character in a handwritten calligraphy work. The more standardized the writing, the higher the score. Existing Chinese character scoring technologies are mainly divided into three categories: rule-based methods, template-based methods, and deep learning-based methods; Rule-based method: This method uses low integer value encoding to represent the stroke features and character features of Chinese characters, and manually selects thresholds to judge the correctness of strokes. It relies on the established Chinese character feature extraction rules and stroke evaluation rules, and obtains the Chinese character writing level by judging the classification area to which the features belong. At the same time, the decision tree is used to train the microscopic features of the strokes, and the standardization of the strokes is judged from both macro and micro aspects; Template-based method: This method starts with imitation, uses a set of standardized templates as a reference, and performs similarity analysis with the Chinese characters to be scored to achieve quality scoring of students' Chinese characters. This method combines the line spacing, character spacing, and horizontal and vertical projections of calligraphy works to enrich the characteristics of the layout, so as to achieve a more accurate evaluation of the works. At the same time, this method can be divided into similarity evaluation and difference evaluation; Deep learning-based method: This method uses computers to simulate the human learning process and continuously optimizes the algorithm performance by learning a large amount of handwritten work data and corresponding scores. It has strong learning ability and adaptability and can handle complex pattern recognition tasks; However, in actual use, the rule-based method is simple to operate and easy to implement. However, due to the huge number and variety of Chinese characters, it is difficult to meet the evaluation needs of all Chinese characters by simply relying on the restrictions of rules. As the number of rules increases, conflicts between rules may arise, which will lead to the resetting of rules. In addition, the writing style of Chinese language and literature is changeable and difficult to constrain with rules, so the results of this type of method are often not ideal. Template-based methods rely on the analysis and extraction of Chinese character features. Currently, most studies mainly use calligraphy experts with many years of practical experience to determine the features of Chinese characters and the importance of the features, which lacks objectivity. Summary of the invention
[0003] To solve the above problems, the present invention provides a system and method for automatically identifying and scoring the handwritten calligraphy styles of Chinese language and literature.
[0004] The present invention provides a Chinese language and literature handwritten calligraphy style automatic recognition and scoring system, comprising a standard template construction module, wherein the standard template construction module is used to construct a template containing all typical Chinese language and literature handwritten style samples; A feature extraction module, the feature extraction module includes a collection unit and a feature extraction unit, the collection unit is used to obtain a handwritten Chinese character picture, and the feature extraction unit is used to extract feature information from the handwritten Chinese character picture; The feature information extracted by the feature extraction unit includes macroscopic features, mesoscopic features and microscopic features of the handwritten Chinese character image; The feature extraction unit is also used to extract standard feature information of each style sample template from all templates of typical Chinese language and literature handwriting style samples; A feature matching module, the feature matching module is used to match the handwritten Chinese character picture feature information extracted by the feature extraction unit with the standard feature information of each style sample template, identify which style sample template the handwritten Chinese character picture matches, and output a matching result; A scoring module receives the matching results of the feature matching module, and determines which style sample template the handwritten Chinese character picture matches based on the matching results, compares and scores the feature information of the handwritten Chinese character picture and the standard feature information of the matching style sample template, and outputs the score of the handwritten Chinese character picture.
[0005] Preferably, the feature extraction unit specifically includes a macro-level feature extraction step, a meso-level feature extraction step and a micro-level feature extraction step; The specific method of the macro-level feature extraction step includes: The overall shape features of Chinese characters, use image processing software to open the handwritten Chinese character image, convert the image into a grayscale image, and perform binarization processing; Use the findContours function to identify the contours of Chinese characters, calculate the bounding rectangle of each contour, and use the boundingRect function to record and obtain the area of the bounding rectangle; Stroke density analysis: count the number of strokes in a Chinese character, calculate the area of the character, and obtain the stroke density by dividing the number of strokes by the area of the character; Stroke distribution uniformity: Divide the Chinese character image into a nine-square grid, count the pixel distribution in each small grid, calculate the stroke pixel ratio of each grid, and obtain the stroke distribution uniformity by subtracting the minimum ratio from the maximum ratio and dividing it by the average ratio. The meso-level feature extraction step is used to extract the component spacing, component geometric features and component symmetry in the handwritten Chinese character image; The micro-level feature extraction step is used to extract the stroke texture features in the handwritten Chinese character image.
[0006] Preferably, the specific working method of the meso-level feature extraction step is as follows: Component spacing statistics, identifying the components in Chinese characters and measuring the distance between components; The geometric features of the component use the minAreaRect function to calculate the minimum enclosing rectangle of the component, and determine the angle of the component based on the angle of the minimum enclosing rectangle; The symmetry of the components, calculate the symmetry axis of the components, and use the matchTemplate function to compare the symmetry of the components.
[0007] Preferably, the specific working method of the microscopic level feature extraction step is as follows: The local binary pattern of the strokes is extracted, the LBP operator is applied to each stroke area, and the LBP histogram is counted as the texture feature of the strokes in the handwritten Chinese character image.
[0008] Preferably, the specific working mode of the feature matching module is as follows: The LBP algorithm is used to extract the feature information of the handwritten Chinese character image and the standard feature information of each style sample template, the feature information of the handwritten Chinese character image is used to generate a feature vector A, and the standard feature information of each style sample template is used to generate a feature vector B; The extracted feature vectors are normalized, and then the feature matching algorithm BFMatcher is used to match the extracted feature vectors. The cosine similarity of the feature vector A and the standard feature information of each style sample template is calculated to extract the feature vector B, and the style sample template with the highest cosine similarity is output as the matching result.
[0009] Preferably, the grayscale image is subjected to histogram equalization, and then a Gaussian smoothing filter is applied to the image; The gradient of the image is calculated using the Sobel operator, and the gradient information is fused with the original image.
[0010] Preferably, the specific working method of extracting the feature information of the handwritten Chinese character picture and the standard feature information of each style sample template includes: According to the structural characteristics of Chinese characters, the Chinese character image is decomposed into sub-patterns in four directions: horizontal, vertical, left-falling and right-falling. According to the stroke density function of the Chinese character image, the position of the grid line is determined to adapt to the writing deformation of the strokes of handwritten Chinese characters; Extract LBP features in each elastic grid and build a statistical histogram; Connect the statistical histograms of all sub-grids into a long vector as the LBP texture feature vector of the entire image; The feature vectors are normalized to fall within the range of [0, 1].
[0011] Preferably, the handwritten Chinese character image feature information extracted by the feature extraction unit is scored, and each feature has a preset scoring range; The scores of all features are accumulated to obtain the score of the handwritten Chinese character image.
[0012] The present invention also proposes a method for automatically identifying and scoring the handwritten calligraphy style of Chinese language and literature, comprising the following steps: Step 1: Create a standard template library containing all typical Chinese language and literature handwriting styles, and define macro, meso and micro features for each style; Step 2: Obtain a handwritten Chinese character image, extract macro-level features, meso-level features, and micro-level features from the handwritten Chinese character image; Extract standard feature information of each style sample from the standard template, match the features of the handwritten Chinese character image with the features of the standard template, identify the most matching style sample template, and output the matching result; Step 3: Based on the output of the feature matching module, determine which style sample template the handwritten Chinese character image matches, compare the feature information of the handwritten Chinese character image with the standard feature information of the matching style sample template, and give a score for the handwritten Chinese character image based on the comparison result, reflecting its similarity to a specific calligraphy style or writing quality.
[0013] Beneficial effects: By constructing standard templates containing typical calligraphy styles from past dynasties, these templates contain not only the visual features of calligraphy works, but also the style features. Such templates can evaluate calligraphy works more objectively and reduce the reliance on the personal experience of calligraphy experts; Through the feature matching module, the system can automatically identify which style sample template the handwritten image matches and output the matching results. The scoring module further scores the works based on the matching results. The feature matching-based method reduces the subjectivity of manual feature weight allocation and avoids the problem of repeated evaluation. The feature extraction module extracts multi-dimensional feature information including dynamic features, geometric features, texture features, structural features, morphological features and layout features. This multi-dimensional feature extraction method can capture the details of calligraphy works more comprehensively, thus making up for the problem of insufficient feature description in rule-based methods. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the method for automatic identification and scoring of the present invention. DETAILED DESCRIPTION
[0015] Application scenarios: like Figure 1 Shown: A Chinese language and literature handwritten calligraphy style automatic recognition and scoring system, including: A standard template construction module, which is used to construct a template containing all typical Chinese language and literature handwriting style samples; it should be noted that in this embodiment, all typical Chinese language and literature handwriting style samples disclosed on the Internet, or in cooperation with relevant professional calligraphy experts, can be used to collect all typical Chinese language and literature handwriting style samples that they believe are standard, and templates of all typical Chinese language and literature handwriting style samples can be constructed based on these writing samples; The template should include 25 typical calligraphy styles from past dynasties, such as ingenuity, innocence, naturalness, squareness, maturity, richness, thinness, tightness, breadth, vigor, dignity, calmness, sharpness, and sophistication. These styles reflect the aesthetic scope of individual calligraphy styles and are an important basis for constructing the template. It should also be noted that the template should contain the characteristic information of 25 calligraphy styles, including macro-level features, meso-level features, and micro-level features; A feature extraction module, the feature extraction module includes a collection unit and a feature extraction unit, the collection unit is used to obtain a handwritten Chinese character picture, and the feature extraction unit is used to extract feature information from the handwritten Chinese character picture; The feature information extracted by the feature extraction unit includes macro-level features, meso-level features and micro-level features of the handwritten Chinese character image; it should be noted that, in this embodiment, the macro-level features include the overall shape features of the Chinese character, the area of the circumscribed rectangle of the Chinese character is calculated, reflecting the overall size of the Chinese character, stroke density analysis: statistics on the density of the strokes in the Chinese character, that is, the ratio of the number of strokes to the area of the Chinese character, and stroke distribution uniformity: analysis of whether the distribution of the strokes in the Chinese character is uniform, reflecting the sense of balance of calligraphy; Meso-level features include the spatial relationship between components, the geometric characteristics of components, and the symmetry of components: Micro-level features include texture features of the strokes; The feature extraction unit is also used to extract standard feature information of each style sample template from all templates of typical Chinese language and literature handwriting style samples; It should be noted that, in this embodiment, 25 calligraphy styles are included in the macro-level features, meso-level features and micro-level features; A feature matching module, the feature matching module is used to match the handwritten Chinese character picture feature information extracted by the feature extraction unit with the standard feature information of each style sample template, identify which style sample template the handwritten Chinese character picture matches, and output a matching result; It should be noted that in this embodiment, the matching result indicates which style template the handwritten Chinese character picture matches with; A scoring module, which receives the matching result of the feature matching module, determines which style sample template the handwritten Chinese character picture matches with according to the matching result, compares and scores the feature information of the handwritten Chinese character picture and the standard feature information of the matching style sample template, and outputs the score of the handwritten Chinese character picture.
[0016] By constructing standard templates that include typical calligraphy styles of past dynasties, these templates not only contain the visual features of calligraphy works but also style features. Such templates can more objectively evaluate calligraphy works and reduce the dependence on the personal experience of calligraphy experts; Through the feature matching module, the system can automatically identify which style sample template the handwritten picture matches with and output the matching result. The scoring module further scores the work based on the matching result. The method based on feature matching reduces the subjectivity of manual feature weight assignment and avoids the problem of repeated evaluation; The feature extraction module extracts multi-dimensional feature information including dynamic features, geometric features, texture features, structural features, morphological features, and layout features. This multi-dimensional feature extraction method can capture details in calligraphy works more comprehensively, thus making up for the problem of insufficient feature description in rule-based methods; As an optional embodiment: The feature extraction unit specifically includes a macro-level feature extraction step, a meso-level feature extraction step, and a micro-level feature extraction step; The specific manner of the macro-level feature extraction step includes: The overall shape feature of the Chinese character. Open the handwritten Chinese character picture using image processing software, convert the image to a grayscale image, and perform binarization processing; Use the findContours function to identify the contour of the Chinese character, calculate the bounding rectangle of each contour, and use the boundingRect function to record and obtain the area of the bounding rectangle. It should be noted that in this embodiment, the image processing software can be OpenCV, and the area of the bounding rectangle is equal to the width multiplied by the height; Stroke density analysis. Count the number of strokes in the Chinese character, calculate the area of the Chinese character, and obtain the stroke density by dividing the number of strokes by the area of the Chinese character; Stroke distribution uniformity. Divide the Chinese character image into a nine-grid, count the pixel distribution in each small grid, calculate the proportion of stroke pixels in each grid, and obtain the stroke distribution uniformity by dividing the difference between the maximum proportion and the minimum proportion by the average proportion; For example, taking "中" as an example: Use OpenCV to open the picture of the Chinese character '中', convert it to a grayscale image, and perform binarization processing to clearly identify the outline of the Chinese character; Apply the findContours function to identify the outline of the Chinese character '中', use the boundingRect function to calculate the bounding rectangle, obtain the width and height of the Chinese character '中', and then calculate the area; Count the number of strokes in the Chinese character '中'. For example, it can be counted that the Chinese character '中' consists of four main strokes; Calculate the area of the Chinese character '中', and then calculate the stroke density = number of strokes / area of the Chinese character '中'; Divide the image of the Chinese character '中' into a nine-grid, and count the pixel distribution in each small grid.
[0017] Calculate the proportion of stroke pixels in each grid. For example, if the horizontal and vertical strokes of the Chinese character '中' are evenly distributed, the proportions of adjacent grids should be similar; By comparing the maximum proportion and the minimum proportion, as well as the average proportion, obtain the stroke distribution uniformity index; It should be noted that through the extraction of the above macroscopic-level features, we can obtain important information about the overall structure and layout of the calligraphy work. These information are crucial for the style recognition and scoring of the calligraphy work. For example, in the case of the Chinese character '中', if the area of the bounding rectangle is small, it may indicate a compact writing; a higher stroke density may indicate a more complex writing style; a higher stroke distribution uniformity indicates that the strokes are evenly distributed during writing, with good overall coordination. These features work together to provide a basis for the automatic scoring and style recognition of the calligraphy work; The above-mentioned mid-level feature extraction steps are used to extract the part spacing, geometric features of the parts, and symmetry of the parts in the handwritten Chinese character picture; The above-mentioned micro-level feature extraction steps are used to extract the stroke texture features in the handwritten Chinese character picture.
[0018] As an optional embodiment: The specific working method of the above-mentioned mid-level feature extraction steps is as follows: Part spacing statistics, identify each part in the Chinese character, and measure the distance between parts; it should be noted that in this embodiment, to identify each part in the Chinese character, it is necessary to first determine which Chinese character the handwritten Chinese character picture belongs to, and store the part distribution of each Chinese character in the database of the feature extraction unit in advance according to the parts of each Chinese character, and identify each part in the Chinese character by comparison; It should also be noted that the part spacing is the difference in the central position of each part, and the central position can be set according to the outline of the part; Geometric features of the parts, use the minAreaRect function to calculate the minimum bounding rectangle of the part, and determine the angle of the part according to the angle of the minimum bounding rectangle; For the symmetry of components, calculate the axis of symmetry of the components and use the matchTemplate function to compare the symmetry of the components. It should be noted that symmetry is equal to the number of axes of symmetry multiplied by the quality of the axis of symmetry; For example, taking the character "汉" as an example, use an image processing software (such as OpenCV) to open the picture of the handwritten Chinese character "汉"; convert the image to a grayscale image and perform binarization processing; Identify each component in the Chinese character. For example, the character "汉" can be decomposed into three components: the "氵" on the left and the "又" on the right; Measure the distance between components, which can be achieved by calculating the Euclidean distance between the centroids of the components; The component spacing is the difference in the central positions of each component, and the central position can be set according to the contour of the component; The statistics of component spacing helps to evaluate the balance and coordination of the internal structure of Chinese characters and is very important for the aesthetic and normative evaluation of calligraphy works; In the character "汉", a reasonable spacing between the "氵" and "又" components can make the whole character look more harmonious; For the geometric features of components, use the minAreaRect function to calculate the minimum bounding rectangle of each component in the character "汉", and determine the angle of the component according to the angle of the minimum bounding rectangle.
[0019] The geometric features of components can help identify and classify different writing styles because different calligraphers may have different preferences for the angles and directions of strokes; In the character "汉", by analyzing the inclination angle of the "氵" component, the fluency and strength of the writing can be evaluated; For the symmetry of components, calculate the axis of symmetry of each component in the character "汉".
[0020] Use the matchTemplate function to compare the symmetry of components and evaluate the symmetry of components through template matching; Symmetry is an important factor in calligraphy aesthetics. Symmetric or nearly symmetric components can bring a sense of balance and harmony to the viewer.
[0021] Through the extraction of the above medium-level features, we can more deeply understand and evaluate the structure and aesthetic features of calligraphy works. These features not only help in the style recognition of calligraphy works but also can serve as important references in calligraphy education and learning. For example, in the character "汉", by analyzing the component spacing, geometric features, and symmetry, we can evaluate whether the structure of the character is balanced, whether the strokes are fluent, and whether the whole character has aesthetic appeal; As an optional embodiment: The specific working method of the micro-level feature extraction step is as follows: Extract the local binary pattern of the strokes, apply the LBP operator to each stroke region, and count the LBP histogram as the texture feature of the strokes in the handwritten Chinese character image.
[0022] It should be noted that, taking the Chinese character "中" as an example: First, convert the image of the character "中" into a grayscale image and perform histogram equalization to enhance the contrast of the strokes; Apply the LBP operator to each stroke region of the character "中", which involves comparing each pixel with the pixels in its surrounding neighborhood to generate a binary number representing the LBP value of the pixel; Count the occurrence frequencies of different LBP values in the entire image of the character "中" to form a histogram, which can describe the texture feature of the character "中"; Through the above steps, we can extract the texture features of the strokes from the image of the character "中". These features can not only reflect the personal style of the writer, but also resist the changes in image quality to a certain extent, improving the accuracy and robustness of recognition; As an optional embodiment: The specific working method of the feature matching module is as follows: Use the LBP algorithm to extract the feature information of the handwritten Chinese character image and the standard feature information of each style sample template. The feature information of the handwritten Chinese character image generates a feature vector A, and the standard feature information of each style sample template is extracted to generate a feature vector B; Normalize the extracted feature vectors, and then use the feature matching algorithm BFMatcher to match the extracted feature vectors, calculate the cosine similarity between the feature vector A and the standard feature information of each style sample template to generate the feature vector B, and output the style sample template with the highest cosine similarity as the matching result.
[0023] Suppose we have sample templates of three calligraphy styles: regular script, running script, and cursive script. We extract the LBP feature vectors of the character "中" in each style and normalize them. Then, we extract the LBP feature vector of the character "中" to be recognized and normalize it. Using BFMatcher and cosine similarity calculation, we find that the cosine similarity between the character "中" to be recognized and the running script template is the highest, and we output the running script template as the matching result; Through the above steps, we can effectively identify the calligraphy style of handwritten Chinese characters and give specific matching results; As an optional embodiment: The feature matching module further includes a preprocessing unit, and the specific working steps of the preprocessing unit are as follows: Perform histogram equalization on the grayscale image, and then apply a Gaussian smoothing filter to the image; The gradient of the image is calculated by the Sobel operator, and the gradient information is fused with the original image. It should be noted that through the above steps, we can effectively preprocess the LBP algorithm to improve its robustness to lighting changes while retaining important texture features; Specifically, in order to reduce the impact of illumination changes, the grayscale image can be histogram equalized. This step can enhance the contrast of the image and make the histogram distribution of the image more uniform; To further reduce the effects of noise and uneven lighting, a Gaussian smoothing filter can be applied to the image. The Gaussian filter can smooth the image while maintaining edge features; In order to extract the edge information of the image, the gradient of the image can be calculated, which can be achieved by the Sobel operator, which calculates the gradient of the image in the horizontal and vertical directions; Fusion of gradient information with the original image to enhance texture features; As an optional embodiment: the specific working method of extracting the feature information of the handwritten Chinese character picture and the standard feature information of each style sample template includes: According to the structural characteristics of Chinese characters, the Chinese character image is decomposed into sub-patterns in four directions: horizontal, vertical, left-falling and right-falling. According to the stroke density function of the Chinese character image, the position of the grid line is determined to adapt to the writing deformation of the strokes of handwritten Chinese characters; Extract LBP features in each elastic grid and build a statistical histogram; Connect the statistical histograms of all sub-grids into a long vector as the LBP texture feature vector of the entire image; Normalize the feature vector so that it falls within the range of [0,1]. It should be noted that through the above steps, we can effectively normalize the feature vector of the handwritten Chinese character image to improve the accuracy and robustness of feature matching; As an optional embodiment: the specific working mode of the scoring module is as follows: Scoring the handwritten Chinese character image feature information extracted by the feature extraction unit, each feature having a preset scoring range; The scores of all features are accumulated to obtain the score of the handwritten Chinese character image.
[0024] It should be noted that, specifically, the macro-level scoring is: Overall shape feature: according to the similarity between the overall shape of the Chinese character and the template, a scoring range (e.g., 1 to 5 points) is set; Stroke density analysis: according to the ratio of the number of strokes to the area of the Chinese character, a scoring range (e.g. 1 to 5 points) is set; Stroke distribution uniformity: according to the uniformity of stroke distribution, set a scoring range (e.g. 1 to 5 points); Meso-level rating: Spatial relationship between components: Set a scoring range (e.g. 1 to 5 points) based on the rationality of the spatial layout between components.
[0025] Geometric features of the component: Set a scoring range (e.g. 1 to 5 points) based on the shape, size, and aspect ratio of the component; Symmetry of components: Set a scoring range (e.g. 1 to 5 points) based on the symmetry of the components; Micro-level scoring: Stroke texture features: Use texture analysis methods to set a scoring range (e.g., 1 to 5 points) based on the similarity between the stroke texture and the template; The scores of all the above features are accumulated to get the total score of the handwritten Chinese character image. For example, if the score range of each feature is 1 to 5 points, the total score range will be 18 to 45 points.
[0026] The present invention also proposes a method for automatically identifying and scoring the handwritten calligraphy style of Chinese language and literature, comprising the following steps: Step 1: Create a standard template library containing all typical Chinese language and literature handwriting styles, and define macro, meso and micro features for each style; Step 2: Obtain a handwritten Chinese character image, extract macro-level features, meso-level features, and micro-level features from the handwritten Chinese character image; Extract standard feature information of each style sample from the standard template, match the features of the handwritten Chinese character image with the features of the standard template, identify the most matching style sample template, and output the matching result; Step 3: According to the output of the feature matching module, determine which style sample template the handwritten Chinese character image matches, compare the feature information of the handwritten Chinese character image with the standard feature information of the matching style sample template, and give a score for the handwritten Chinese character image based on the comparison result, reflecting its similarity with a specific calligraphy style or writing quality. How it works By constructing standard templates that include typical calligraphy styles from past dynasties, these templates not only include the visual features of calligraphy works, but also include stylistic features. Such templates can evaluate calligraphy works more objectively and reduce reliance on the personal experience of calligraphy experts. Through the feature matching module, the system can automatically identify which style sample template the handwritten image matches and output the matching results. The scoring module further scores the works based on the matching results. The feature matching-based method reduces the subjectivity of manual feature weight allocation and avoids the problem of repeated evaluation. The feature extraction module extracts multi-dimensional feature information including dynamic features, geometric features, texture features, structural features, morphological features and layout features. This multi-dimensional feature extraction method can capture the details of calligraphy works more comprehensively, thus making up for the problem of insufficient feature description in rule-based methods.
[0027] The above are only preferred implementations of the present invention. The protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical staff in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of this template.
Claims
1. A Chinese language and literature handwritten calligraphy style automatic recognition and scoring system, characterized by: include: A standard template construction module, which is used to construct a template containing all typical Chinese language and literature handwriting style samples; A feature extraction module, the feature extraction module includes a collection unit and a feature extraction unit, the collection unit is used to obtain a handwritten Chinese character picture, and the feature extraction unit is used to extract feature information from the handwritten Chinese character picture; The feature information extracted by the feature extraction unit includes macroscopic features, mesoscopic features and microscopic features of the handwritten Chinese character image; The feature extraction unit is also used to extract standard feature information of each style sample template from all templates of typical Chinese language and literature handwriting style samples; A feature matching module, the feature matching module is used to match the handwritten Chinese character picture feature information extracted by the feature extraction unit with the standard feature information of each style sample template, identify which style sample template the handwritten Chinese character picture matches, and output a matching result; A scoring module receives the matching results of the feature matching module, and determines which style sample template the handwritten Chinese character picture matches based on the matching results, compares and scores the feature information of the handwritten Chinese character picture and the standard feature information of the matching style sample template, and outputs the score of the handwritten Chinese character picture.
2. According to claim 1, a Chinese language and literature handwritten calligraphy style automatic recognition and scoring system is characterized in that: The feature extraction unit specifically includes a macro-level feature extraction step, a meso-level feature extraction step and a micro-level feature extraction step; The specific method of the macro-level feature extraction step includes: The overall shape features of Chinese characters, use image processing software to open the handwritten Chinese character image, convert the image into a grayscale image, and perform binarization processing; Use the findContours function to identify the contours of Chinese characters, calculate the bounding rectangle of each contour, and use the boundingRect function to record and obtain the area of the bounding rectangle; Stroke density analysis: count the number of strokes in a Chinese character, calculate the area of the character, and obtain the stroke density by dividing the number of strokes by the area of the character; Stroke distribution uniformity: Divide the Chinese character image into a nine-square grid, count the pixel distribution in each small grid, calculate the stroke pixel ratio of each grid, and obtain the stroke distribution uniformity by subtracting the minimum ratio from the maximum ratio and dividing it by the average ratio. The meso-level feature extraction step is used to extract the component spacing, component geometric features and component symmetry in the handwritten Chinese character image; The micro-level feature extraction step is used to extract the stroke texture features in the handwritten Chinese character image.
3. The automatic recognition and scoring system for handwritten calligraphy styles in Chinese language and literature according to claim 2 is characterized in that: The specific working method of the meso-level feature extraction step is as follows: Component spacing statistics, identifying the components in Chinese characters and measuring the distance between components; The geometric features of the component use the minAreaRect function to calculate the minimum enclosing rectangle of the component, and determine the angle of the component based on the angle of the minimum enclosing rectangle; The symmetry of the component, calculate the symmetry axis of the component, and use the matchTemplate function to compare the symmetry of the component.
4. The automatic recognition and scoring system for handwritten calligraphy styles in Chinese language and literature according to claim 2 is characterized in that: The specific working method of the micro-level feature extraction step is as follows: The local binary pattern of the strokes is extracted, the LBP operator is applied to each stroke area, and the LBP histogram is counted as the texture feature of the strokes in the handwritten Chinese character image.
5. The automatic recognition and scoring system for handwritten calligraphy styles in Chinese language and literature according to claim 1 is characterized in that: The specific working mode of the feature matching module is as follows: The LBP algorithm is used to extract the feature information of the handwritten Chinese character image and the standard feature information of each style sample template, the feature information of the handwritten Chinese character image is used to generate a feature vector A, and the standard feature information of each style sample template is used to generate a feature vector B; The extracted feature vectors are normalized, and then the feature matching algorithm BFMatcher is used to match the extracted feature vectors. The cosine similarity of the feature vector A and the standard feature information of each style sample template is calculated to extract the feature vector B, and the style sample template with the highest cosine similarity is output as the matching result.
6. The automatic recognition and scoring system for handwritten calligraphy styles in Chinese language and literature according to claim 5 is characterized in that: Perform histogram equalization on the grayscale image and then apply a Gaussian smoothing filter to the image; The gradient of the image is calculated using the Sobel operator, and the gradient information is fused with the original image.
7. The automatic recognition and scoring system for handwritten calligraphy styles in Chinese language and literature according to claim 5 is characterized in that: The specific working method of extracting the feature information of the handwritten Chinese character image and the standard feature information of each style sample template includes: According to the structural characteristics of Chinese characters, the Chinese character image is decomposed into sub-patterns in four directions: horizontal, vertical, left-falling and right-falling. According to the stroke density function of the Chinese character image, the position of the grid line is determined to adapt to the writing deformation of the strokes of handwritten Chinese characters; Extract LBP features in each elastic grid and build a statistical histogram; Connect the statistical histograms of all sub-grids into a long vector as the LBP texture feature vector of the entire image; The feature vectors are normalized to fall within the range of [0, 1].
8. The automatic recognition and scoring system for Chinese language and literature handwritten calligraphy style according to claim 1 is characterized in that: Scoring the handwritten Chinese character image feature information extracted by the feature extraction unit, each feature having a preset scoring range; The scores of all features are accumulated to obtain the score of the handwritten Chinese character image.
9. A method for automatic recognition and scoring of handwritten calligraphy styles in Chinese language and literature, characterized in that: The following steps are involved: Step 1: Create a standard template library containing all typical Chinese language and literature handwriting styles, and define macro, meso and micro features for each style; Step 2: Obtain a handwritten Chinese character image, extract macro-level features, meso-level features, and micro-level features from the handwritten Chinese character image; Extract standard feature information of each style sample from the standard template, match the features of the handwritten Chinese character image with the features of the standard template, identify the most matching style sample template, and output the matching result; Step 3: Based on the output of the feature matching module, determine which style sample template the handwritten Chinese character image matches, compare the feature information of the handwritten Chinese character image with the standard feature information of the matching style sample template, and give a score for the handwritten Chinese character image based on the comparison result, reflecting its similarity to a specific calligraphy style or writing quality.