Writing evaluation method, device and apparatus
By acquiring stroke data from the smart pen in real time, the system identifies the differences in strokes between the font under test and the standard font, solving the problem of not being able to identify stroke order errors in existing technologies, and enabling more comprehensive writing assessment and guidance.
Patent Information
- Application Number
- CN202110518003.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-12
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-05-12
AI Technical Summary
Existing smart pen writing systems cannot effectively identify situations where the writing is correct but the stroke order is wrong during the evaluation process, resulting in an incomplete evaluation, especially in providing correct guidance to children during the writing process.
By acquiring the stroke data of the font under test in real time, the difference between the strokes of the font under test and the standard font is determined, and the strokes under test and the standard strokes are matched according to the difference to generate stroke order evaluation results and identify stroke order errors.
It enables effective assessment of writers, especially children, when they write correctly but have incorrect stroke order, and provides more comprehensive writing guidance.
Smart Images

Figure CN115346225B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a writing assessment method, apparatus, and device. Background Technology
[0002] Traditional methods of teaching Chinese character writing suffer from numerous limitations, including insufficient teaching resources and constraints related to time and location. With advancements in technology, intelligent pen writing systems have emerged. These systems utilize electromagnetic or infrared sensors to store and display the user's writing trajectory on paper on multimedia devices. Leveraging this feature in conjunction with artificial intelligence can effectively address the limitations of traditional Chinese character writing instruction, providing students with real-time and effective guidance.
[0003] In existing smart pen writing systems, students' writing trajectories are stored in the smart pen's storage device as a dot matrix and wirelessly transmitted to the machine for artificial intelligence evaluation. Specifically, the coordinate set of all points for each stroke can be input into the smart pen writing system, and the writing results are evaluated using information such as the coordinates of points in the stroke, sensor pressure, and time. Typically, the evaluation of smart writing results includes three dimensions: the number of strokes, the correctness of strokes, and the structure of characters. The number of strokes is obtained by comparing the number of strokes transmitted by the smart pen with the total number of strokes in the standard character. The correctness of strokes is calculated by using the sum of the shortest distances from each point in the dot set of each handwritten character's strokes to the standard strokes as a loss function. When the loss function is less than a certain threshold, the stroke is considered correctly written. The structure of characters is obtained by calculating the length and centroid position of each stroke.
[0004] However, the above-mentioned assessment process for writing results has the following shortcomings: the assessment dimensions mentioned are difficult to fully reflect the problems that writers encounter during the writing process, especially when children write correctly but have incorrect stroke order, and cannot provide writers with correct assessment guidance. Summary of the Invention
[0005] In view of this, this application provides a writing evaluation method, apparatus and equipment, the main purpose of which is to solve the problem that the writing evaluation methods in the prior art are not comprehensive enough and cannot identify situations where the writing is correct but the stroke order is wrong.
[0006] According to the first aspect of this application, a writing assessment method is provided, comprising:
[0007] The stroke data of the font to be tested is acquired in real time. The stroke data is formed by dividing the sampling points of the stroke into each stroke to be tested according to the writing action.
[0008] For the pre-set stroke order evaluation dimension, based on the stroke data of the font under test and the stroke data of the standard font, the degree of difference between each stroke of the font under test and each standard stroke of the standard font is determined.
[0009] Based on the difference degree, determine the strokes in each stroke of the font to be tested that match each standard stroke of the standard font one by one, and form an index pair by the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke.
[0010] The index is used to generate the writing evaluation result of the font under test on the stroke order evaluation dimension, wherein the writing evaluation result of the font under test on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the font under test.
[0011] In another embodiment, the step of determining the degree of difference between each stroke of the font to be tested and each standard stroke of the standard font based on the stroke data of the font to be tested and the stroke data of the standard font, and determining the strokes of the font to be tested that match each standard stroke of the standard font one-to-one based on the degree of difference, specifically includes:
[0012] For each standard stroke in the standard font, iterate through all the strokes to be tested in the font to be tested, and determine the degree of difference between each stroke to be tested and each standard stroke.
[0013] When the minimum difference between all the strokes to be tested and each standard stroke is less than a first preset threshold, the stroke to be tested corresponding to the minimum value is determined as the stroke to be tested that matches each standard stroke one by one.
[0014] In another embodiment, determining the degree of difference between each of the tested strokes and each standard stroke includes:
[0015] When the stroke classification results corresponding to each stroke to be tested and each standard stroke are the same, the degree of difference between each stroke to be tested and each standard stroke is calculated based on the stroke description feature values between each stroke to be tested and each standard stroke.
[0016] When the stroke classification results corresponding to each stroke to be tested and each standard stroke are different, a preset difference degree is used as the difference degree between each stroke to be tested and each standard stroke, wherein the preset difference degree is greater than a fixed threshold.
[0017] In another embodiment, the stroke description feature values include at least one of the following: a loss function value between strokes, a stroke length ratio feature value between strokes, and a stroke position ratio feature value between strokes. The step of calculating the difference between each stroke to be tested and each standard stroke based on the stroke description feature values between each stroke to be tested and each standard stroke specifically includes:
[0018] To meet the evaluation requirements of the stroke order evaluation dimension on each stroke description feature, determine the weight ratio of each stroke description feature value mapping;
[0019] According to the weight ratio of each stroke description feature value mapping, the stroke description feature values between each stroke to be tested and each standard stroke are weighted and summed to obtain the degree of difference between each stroke to be tested and each standard stroke.
[0020] In another embodiment, after acquiring the stroke data of the font to be tested in real time, the method further includes:
[0021] Based on multiple pre-set evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, the font to be tested is evaluated according to the evaluation order, wherein the multiple evaluation dimensions include the stroke order evaluation dimension;
[0022] The method further includes, after evaluating the font to be tested according to the pre-set multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, the method further includes:
[0023] Obtain the writing evaluation results of the font under test on multiple evaluation dimensions, and determine whether the writing evaluation results of the font under test on multiple evaluation dimensions meet the corresponding evaluation conditions;
[0024] If the handwriting evaluation results of the font under test meet the evaluation conditions in multiple evaluation dimensions, then output a prompt message indicating that the font under test conforms to the handwriting standard; otherwise, generate corresponding prompt messages based on the handwriting evaluation results of the evaluation dimensions that do not meet the evaluation conditions.
[0025] In another embodiment, the plurality of assessment dimensions includes a stroke correctness assessment dimension, and the method further includes:
[0026] The stroke data of the font to be tested is processed to obtain stroke feature data;
[0027] The stroke feature data is input into a pre-built stroke classification model for recognition to obtain stroke classification results. The stroke classification results are used to characterize the standard strokes in the preset stroke library that correspond to the strokes to be tested in the font to be tested.
[0028] Based on the stroke classification results, the writing evaluation results of the font to be tested in the stroke correctness evaluation dimension are generated.
[0029] In another embodiment, generating the writing evaluation result of the font under test on the stroke correctness evaluation dimension based on the stroke classification result specifically includes: calculating, based on the stroke classification result, the cost of transforming the stroke under test in the font under test into the standard stroke represented by the stroke classification result by performing at least one of the following operations: scaling, adding, deleting, or deflecting, to obtain the loss function value between the stroke under test in the font under test and the standard stroke represented by the stroke classification result; and generating the writing evaluation result of the font under test on the stroke correctness evaluation dimension based on the loss function value between the stroke under test in the font under test and the standard stroke represented by the stroke classification result.
[0030] In another embodiment, the process of processing the stroke data of the font to be tested to obtain stroke feature data specifically includes:
[0031] Determine the spatial and temporal information of the sampling points in the stroke data of the font to be tested;
[0032] The stroke data of the font to be tested are extracted using the spatial and temporal information of the sampling points to obtain stroke feature data.
[0033] In another embodiment, after acquiring the stroke data of the font to be tested in real time, the method further includes:
[0034] The font to be tested is input as an image into a pre-built font classification model for recognition, and the font classification result is used to characterize the font category to which the font to be tested belongs.
[0035] If the font category to which the font to be tested belongs is inconsistent with the font category to which the standard font belongs, a prompt message indicating that the glyph structure of the font to be tested is incorrect will be output.
[0036] According to a second aspect of this application, a writing assessment device is provided, comprising:
[0037] The acquisition unit is used to acquire the stroke data of the font to be tested in real time. The stroke data is the data formed by dividing the sampling points of the stroke into each stroke to be tested according to the writing action.
[0038] The first determining unit is used to determine the degree of difference between each stroke of the font to be tested and each standard stroke of the standard font, based on the stroke data of the font to be tested and the stroke data of the standard font, for a pre-set stroke order evaluation dimension.
[0039] The second determining unit is used to determine, based on the difference degree, the strokes to be tested in each stroke of the font to be tested that match each standard stroke of the standard font one by one, and to form an index pair by combining the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke.
[0040] The first generation unit is used to generate a writing evaluation result of the font to be tested on the stroke order evaluation dimension according to the index, wherein the writing evaluation result of the font to be tested on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the font to be tested.
[0041] In another embodiment, the first determining unit includes:
[0042] The first determining module is used to, for each standard stroke in the standard font, traverse all the strokes to be tested in the font to be tested, and determine the degree of difference between each stroke to be tested and each standard stroke.
[0043] The second determining module is used to determine the stroke to be tested corresponding to the minimum value as a stroke to be tested that matches each of the standard strokes when the minimum value of the difference between all the strokes to be tested and each standard stroke is less than a first preset threshold.
[0044] In another embodiment, the first determining module includes:
[0045] The calculation submodule is used to calculate the degree of difference between each stroke to be tested and each standard stroke when the stroke classification results corresponding to each stroke to be tested and each standard stroke are the same.
[0046] A submodule is selected to use a preset difference degree as the difference degree between each stroke to be tested and each standard stroke when the stroke classification results corresponding to each stroke to be tested and each standard stroke are different, wherein the preset difference degree is greater than a fixed threshold.
[0047] In another embodiment, each stroke description feature value includes at least one of the following: loss function value between strokes, stroke length ratio feature value between strokes, stroke position ratio feature value between strokes, and the calculation submodule is specifically used to determine the weight ratio mapped to each stroke description feature value based on the evaluation requirements of the stroke order evaluation dimension on each stroke description feature.
[0048] The calculation submodule is further configured to perform a weighted summation calculation on the stroke description feature values between each stroke to be tested and each standard stroke according to the weight ratio mapped by each stroke description feature value, so as to obtain the degree of difference between each stroke to be tested and each standard stroke.
[0049] In another embodiment, the device further includes:
[0050] The evaluation unit is used to evaluate the font under test according to the evaluation order after the stroke data of the font under test is acquired in real time, based on the multiple evaluation dimensions preset and the evaluation order corresponding to the multiple evaluation dimensions. The multiple evaluation dimensions include the stroke order evaluation dimension.
[0051] The judgment unit is used to, after evaluating the font to be tested according to the multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions in a pre-set order, obtain the writing evaluation results of the font to be tested on the multiple evaluation dimensions respectively, and determine whether the writing evaluation results of the font to be tested on the multiple evaluation dimensions respectively meet the corresponding evaluation conditions.
[0052] The first output unit is used to output a prompt message indicating that the font under test conforms to the writing standard if the writing evaluation results of the font under test meet the evaluation conditions in multiple evaluation dimensions; otherwise, it generates a corresponding prompt message based on the writing evaluation results of the evaluation dimensions that do not meet the evaluation conditions.
[0053] In another embodiment, the plurality of assessment dimensions includes a stroke correctness assessment dimension, and the device further includes:
[0054] The processing unit is used to process the stroke data of the font to be tested to obtain stroke feature data;
[0055] The first recognition unit is used to input the stroke feature data into a pre-constructed stroke classification model for recognition and obtain stroke classification results. The stroke classification results are used to characterize the standard strokes in the preset stroke library that correspond to the strokes to be tested in the font to be tested.
[0056] The second generation unit is used to generate the writing evaluation results of the font to be tested in the stroke correctness evaluation dimension based on the stroke classification results.
[0057] In another embodiment, the second generation unit includes:
[0058] The calculation module is used to calculate, based on the stroke classification result, the cost of transforming the stroke to be tested in the font under test into the standard stroke represented by the stroke classification result by performing at least one of the following operations: scaling, adding, deleting, or deflecting, to obtain the loss function value between the stroke to be tested in the font under test and the standard stroke represented by the stroke classification result; and to generate the writing evaluation result of the font under test on the stroke correctness evaluation dimension based on the loss function value between the stroke to be tested in the font under test and the standard stroke represented by the stroke classification result.
[0059] In another embodiment, the processing unit includes:
[0060] The determination module is used to determine the spatial and temporal information of the sampling points in the stroke data of the font to be tested;
[0061] The extraction module is used to extract features from the stroke data of the font to be tested using the spatial and temporal information of the sampling points, so as to obtain stroke feature data.
[0062] In another embodiment, the device further includes:
[0063] The second recognition unit is used to input the font to be tested as an image into a pre-built font classification model for recognition after the stroke data of the font to be tested is acquired in real time, and to obtain the font classification result. The font classification result is used to characterize the font category to which the font to be tested belongs.
[0064] The second output unit is used to output a prompt message indicating that the glyph structure of the font under test is incorrect if the font category to which the font under test belongs is inconsistent with the font category to which the standard font belongs.
[0065] According to a third aspect of this application, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in the first aspect above.
[0066] According to a fourth aspect of this application, a readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect above.
[0067] By employing the above technical solution, the writing evaluation method, apparatus, and equipment provided in this application, compared with the existing methods that only use three evaluation dimensions for writing evaluation, this application acquires the stroke data of the font to be tested in real time. This stroke data is formed by dividing the sampling points of the strokes according to the writing action into each stroke to be tested. Then, for the pre-set stroke order evaluation dimensions, based on the stroke data of the font to be tested and the stroke data of the standard font, the difference between each stroke of the font to be tested and each standard stroke of the standard font is determined. Based on the difference, the difference between each stroke of the font to be tested and each standard stroke of the standard font is determined. The test characters are matched one-to-one with the standard strokes. The first stroke order index of each standard stroke and the second stroke order index of the test characters that match each standard stroke are combined into an index pair. Based on the index pair, the writing evaluation result of the test characters on the stroke order evaluation dimension is generated. The writing evaluation result of the test characters on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the test characters. It can effectively evaluate the situation where writers, especially children, write correctly but have incorrect stroke order, thus providing a more comprehensive writing evaluation method and giving writers correct evaluation guidance.
[0068] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0069] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0070] Figure 1 A flowchart illustrating a writing assessment method provided in an embodiment of this application is shown;
[0071] Figure 2 A flowchart illustrating another writing assessment method provided in an embodiment of this application is shown;
[0072] Figure 3 This application provides examples of writing techniques.
[0073] Figure 4 A schematic diagram of the structure of the recurrent neural network model provided in the embodiments of this application is shown;
[0074] Figure 5 A schematic diagram of the encoder-decoder structure provided in an embodiment of this application is shown;
[0075] Figure 6 An example diagram is shown below, illustrating the angle deviation mapping process provided in an embodiment of this application.
[0076] Figure 7 An example diagram of the cost calculation process provided in an embodiment of this application is shown;
[0077] Figure 8 A flowchart illustrating the entire handwriting assessment method provided in the embodiments of this application is shown;
[0078] Figure 9 This illustration shows a structural schematic diagram of a writing assessment device provided in an embodiment of this application;
[0079] Figure 10 This invention provides a schematic diagram of the structure of another writing assessment device according to an embodiment of the present application.
[0080] Figure 11 A schematic diagram of the device structure of a computer device provided in an embodiment of the present invention is shown. Detailed Implementation
[0081] The invention will now be discussed with reference to several exemplary embodiments. It should be understood that these embodiments are described merely to enable those skilled in the art to better understand and thus implement the invention, and are not intended to imply any limitation on the scope of the invention.
[0082] As used herein, the term "comprising" and its variations are to be interpreted as open-ended terms meaning "including but not limited to". The term "based on" is to be interpreted as "at least partially based on". The terms "one embodiment" and "an embodiment" are to be interpreted as "at least one embodiment". The term "another embodiment" is to be interpreted as "at least one other embodiment".
[0083] Typically, the evaluation of intelligent writing results includes three dimensions: stroke count, stroke accuracy, and character structure. Stroke count is determined by comparing the number of strokes transmitted by the intelligent pen with the total number of strokes in the standard character. Stroke accuracy is calculated using the shortest distance from each point in the point set of each handwritten character's strokes to the standard stroke as a loss function; if the loss function is less than a certain threshold, the strokes are considered correctly written. Character structure is determined by calculating the length and centroid position of each stroke. However, this evaluation process has the following shortcomings: the mentioned dimensions are insufficient to comprehensively reflect the problems encountered by the writer during the writing process. Especially for children, errors in writing can manifest in various ways, and relying solely on these three dimensions cannot provide accurate evaluation guidance.
[0084] To address this problem, this embodiment provides a writing assessment method, such as... Figure 1 As shown, this method is applied to the server side of a writing assessment system and includes the following steps:
[0085] 101. Real-time acquisition of stroke data of the font to be tested.
[0086] The stroke data of the font to be tested is formed by dividing the sampling points of the stroke into each stroke according to the writing action. The stroke data includes multiple strokes, and each stroke has multiple sampling points. The sampling points can be represented as coordinate points (x, y). Each stroke is a set of coordinate points (x, y).
[0087] Specifically, a stylus can be used to collect stroke data of the font to be tested at a fixed frequency. The stylus can be a smart dot matrix pen or a smart writing pen equipped with a pressure sensor. When the writer writes, the stylus can use the pressure sensor to capture the movement trajectory of the pen tip and form stroke data.
[0088] The execution subject in this embodiment can be a writing evaluation device or equipment, which can be configured on the server side of the writing evaluation device or equipment. When the writer is writing, the stylus will acquire the coordinate set of all points of each stroke of the font to be tested in real time, and form the stroke data of the font to be tested by the coordinate set of all points of each stroke of the font to be tested, and input it to the server side. Then the server side performs writing evaluation on the stroke data of the font to be tested.
[0089] 102. Based on the pre-set stroke order evaluation dimension, and according to the stroke data of the font to be tested and the stroke data of the standard font, determine the degree of difference between each stroke of the font to be tested and each standard stroke of the standard font.
[0090] The standard font can be a reference font that is pre-set for the font under test. Writers usually write according to the standard font and use the standard font to evaluate the writing of the font under test. Here, the stroke data of the font under test corresponds to the strokes of the font under test, and the stroke data of the standard font corresponds to the standard strokes of the standard font.
[0091] In this embodiment of the invention, the degree of difference between each stroke of the tested font and each standard stroke of the standard font can reflect the degree of matching between the tested stroke and the standard stroke of the standard font. The smaller the difference, the higher the probability that the tested stroke corresponds to the standard stroke, that is, it is a correctly written stroke. Conversely, it indicates that the tested stroke does not correspond to the standard stroke, that is, it is a written error or a missing stroke. Specifically, for example, the stroke order of the font to be tested can be shuffled with the standard strokes of the standard font to form stroke sequence pairs. Here, the stroke order of both the font to be tested and the standard font is known. For example, the stroke order of the font to be tested is i1-i4 (the four stroke order indices i1, i2, i3, i4 correspond to one of the strokes to be tested in the font to be tested), and the stroke order of the standard font is j1-j4 (the four stroke order indices j1, j2, j3, j4 correspond to one of the standard strokes in the standard font). The stroke sequence pairs formed after shuffling the stroke order can be formed by randomly matching any two of the font to be tested and the standard font, such as (i1, j1), (i2, j2), (i3, j4), etc. The stroke order is further determined by using a matching-first search for the most similar strokes. This process calculates the difference between each stroke to be tested in the font to be tested and each standard stroke in the standard font for each stroke sequence pair.
[0092] 103. Based on the difference degree, determine the strokes in each stroke of the font to be tested that match each standard stroke of the standard font one by one, and form an index pair by combining the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke.
[0093] It is understandable that in step 102, the difference between the two strokes is calculated for each stroke sequence pair. The smaller the difference, the more similar the stroke to be tested is to the standard stroke. Otherwise, it means that the stroke to be tested is not the standard stroke. The stroke to be tested that matches each standard stroke of the standard font is the stroke sequence pair with the smallest difference and the smallest difference is less than the first preset threshold. The first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke are combined into an index pair. For example, if the retained stroke sequence pair is (i1, j2), then the index pair (i1, j2) is obtained. That is, the first stroke order index of the standard font is i1 and the second stroke order index of the stroke to be tested is j2, which means that the first stroke order of the standard font matches the second stroke order of the stroke to be tested.
[0094] In this embodiment of the invention, the stroke order evaluation dimension usually does not affect the writing result of the font under test. That is to say, even if the writer writes correctly, there may still be a problem of incorrect stroke order. Here, the stroke order evaluation dimension is used to evaluate the font. This can promptly detect the problem of the writer writing correctly but with incorrect stroke order, and effectively provide the writer with guidance on the correct stroke order, thus ensuring the comprehensiveness of the writing evaluation.
[0095] 104. Generate the writing evaluation results of the font to be tested on the stroke order evaluation dimension according to the index.
[0096] In this embodiment of the invention, the index pair is the stroke sequence pair that retains the smallest difference between the font to be tested and the standard font. Since there are multiple standard strokes in the standard font, after determining the test stroke in the font to be tested that matches the standard stroke for each standard stroke, multiple index pairs can be obtained. These multiple index pairs between the font to be tested and the standard font are placed in a matching set C. Further, the stroke order information of the standard font can be formed based on the first stroke order index of the standard strokes in each index pair in the matching set C, and the stroke order information of the font to be tested compared with the standard font can be formed according to the second stroke order index of the test strokes in each index pair containing the first stroke order index. This generates the writing evaluation result of the font to be tested in the stroke order evaluation dimension. For example, the multiple index pairs between the font to be tested and the standard font are (i2, j1), (i1, j2), (i3, j3), (i4, j4), (i... 5, j5), yielding the stroke order corresponding to the standard font: j1, j2, j3, j4, j5. The stroke order of the font under test compared to the standard font is i2, i1, i3, i4, i5. That is, in the font under test, the first stroke j1 in the standard font matches the second stroke under test in the font under test (i.e., the stroke under test represented by stroke order index i2), the second stroke j2 in the standard font matches the first stroke under test i1, the third stroke j3 in the standard font matches the third stroke under test i3, and so on. Since there are index pairs where the first stroke order index is different from the second stroke order index, for example, for the index pair (i1, j2), it can be determined that the first stroke under test i1 in the font under test is written correctly, but the stroke order is incorrect. That is, the first stroke under test i1 should be written as the second stroke.
[0097] The writing evaluation method provided in this application differs from existing methods that only use three evaluation dimensions. This application acquires stroke data of the font under test in real time. This stroke data is generated by dividing the sampling points of the strokes according to the writing action into individual strokes under test. Then, based on a pre-set stroke order evaluation dimension, and comparing the stroke data of the font under test with that of a standard font, the difference between each stroke under test and each standard stroke of the standard font is determined. Based on this difference, the method further determines the difference between each stroke under test of the font and each standard stroke of the standard font. The test characters are matched with the standard strokes, and the first stroke order index of each standard stroke and the second stroke order index of the test characters that match each standard stroke are combined into an index pair. Based on the index pair, the writing evaluation result of the test characters on the stroke order evaluation dimension is generated. The writing evaluation result of the test characters on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the test characters. It can effectively evaluate the situation where writers, especially children, write correctly but have incorrect stroke order, thus providing a more comprehensive writing evaluation method and giving writers correct evaluation guidance.
[0098] Furthermore, as a refinement and extension of the specific implementation methods of the above embodiments, in order to fully illustrate the specific implementation process of this embodiment, this embodiment provides another writing evaluation method, such as... Figure 2 As shown, the method includes:
[0099] 201. Real-time acquisition of stroke data of the font to be tested.
[0100] It is understandable that the stroke data of the font under test here is the data transmitted to the server in real time by the writer during the writing process. The stroke data contains a set of sampling points for each stroke, and each sampling point carries at least time information and position information. By using the time information and position information of the sampling points, the writer's stroke order, writing direction and other features can be determined, which is convenient for subsequent writing evaluation of the font under test.
[0101] 202. Based on the pre-set multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, evaluate the font to be tested according to the evaluation order.
[0102] The evaluation dimensions here can be the directions in which errors are likely to occur during the writing of the font under test. These can include, but are not limited to, the overall similarity of the character shape evaluation dimension, the number of strokes evaluation dimension, the correctness of strokes evaluation dimension, the position of strokes evaluation dimension, the stroke order evaluation dimension, etc., and each evaluation dimension has its corresponding writing evaluation process.
[0103] It is understandable that during the writing evaluation process, due to the correlation between various evaluation dimensions and the sequential order of evaluation for each dimension, some evaluation dimensions need to start the evaluation process after the previous evaluation dimension meets the evaluation conditions. For example, the stroke quantity evaluation dimension needs to meet the evaluation conditions before evaluating the stroke correctness evaluation dimension.
[0104] In the example of the present invention, a simple description is given of the specific implementation process of the overall glyph similarity evaluation dimension, stroke quantity evaluation dimension, intersection logic evaluation dimension, glyph aspect ratio evaluation dimension, and stroke direction evaluation dimension during the writing evaluation process.
[0105] For the overall glyph similarity evaluation dimension, in the specific evaluation process, after inputting the stroke data of the font to be measured, for the sampling points in the stroke data, in the preprocessing stage, the angle θ formed by each sampling point with the previous sampling point and the next sampling point is calculated separately. θ is used as a new one-dimensional feature, so that each point can be described by a vector (x, y, θ) in three-dimensional space. The distance from a certain sampling point to a specific cloud can be defined as the minimum Euclidean distance between the sampling point and all points in the specific cloud. Here, the distance from point cloud 1 to point cloud 2 can be defined as the sum of the distances from all points in point cloud 1 to point cloud 2. This point cloud distance is the standard for measuring the similarity between two glyphs. That is, by calculating the point cloud distance between the two point clouds of the font to be measured and the standard font in the above manner, the smaller the point cloud distance, the more similar the two fonts are and the higher the completion degree. This dimension can quantify the completion degree of writing in the case of irregular writing.
[0106] For the intersection logic evaluation dimension, in the specific evaluation process, after inputting the stroke data of the font to be measured, for the sampling points in the stroke data, a set of line segments formed by pairwise combinations of all sampling points is calculated. By calculating the cross product, it is judged whether the line segments intersect, and then whether two strokes intersect. Among them, after judging the intersection results of any two strokes to be measured in the font to be measured, the intersection results are compared with the intersection results of the corresponding standard strokes in the standard font, so as to determine whether the intersection situation of the strokes to be measured in the font to be measured is consistent with the intersection situation of the standard strokes in the standard font. This evaluation dimension can more precisely judge some writing detail errors that cannot be recognized in the prior art, such as the characters "田" and "由".
[0107] For the glyph aspect ratio evaluation dimension, in the specific evaluation process, the boundary of the font to be measured input is statistically analyzed and the aspect ratio of the boundary is calculated. If the difference from the aspect ratio of the standard font is too large, it is prompted that the writing is not beautiful. This evaluation dimension can enable children to have better writing layout habits for some fonts with left-right or up-down structures.
[0108] Regarding the assessment of stroke direction, the specific assessment process utilizes the temporal information of sampling points recorded in the stroke data of the font under test to determine the stroke direction, and then compares it with the stroke direction of the standard font. This assessment dimension can correct children's incorrect writing habits for some strokes.
[0109] 203. For each standard stroke in the standard font, traverse all the strokes to be tested in the font to be tested, and determine the degree of difference between each stroke to be tested and each standard stroke.
[0110] The degree of difference can be represented by a stroke difference function, which describes the difference between the strokes in the tested font and the standard strokes in the standard font. Here, the stroke difference function can be represented as S(i, j), which specifically represents the degree of difference between the i-th stroke of the tested font (e.g., a total of M strokes) and the j-th stroke of the standard font (e.g., a total of N strokes. Optionally, M = N). i and j are the stroke indices (i.e., stroke order indices) of the tested font and the standard font, respectively. For example, S(2, 3) represents the degree of difference between the second stroke of the tested font and the third stroke of the standard font.
[0111] Specifically, in determining the degree of difference between each stroke to be tested and each standard stroke among all the strokes to be tested, when the stroke classification results corresponding to each stroke to be tested and each standard stroke are the same, the degree of difference between each stroke to be tested and each standard stroke is calculated based on the stroke description feature values between each stroke to be tested and each standard stroke; when the stroke classification results corresponding to each stroke to be tested and each standard stroke are different, a preset degree of difference is used as the degree of difference between each stroke to be tested and each standard stroke, wherein the preset degree of difference is greater than a fixed threshold, and the preset degree of difference can be a limit value, i.e., +∞.
[0112] The stroke description features here are equivalent to the evaluation factors to be considered in the stroke order evaluation process, which can be the loss function between strokes, the stroke length ratio, the stroke position ratio, etc. The loss function between strokes is the basis for comparing the differences, the stroke length ratio is the difference (or the absolute value of the difference) between the lengths of two strokes divided by the standard stroke length, and the position ratio is the position distance between the centroids of two strokes. The above stroke description features can be selected in full or in part according to actual needs. Each stroke description feature value includes at least one of the following: the loss function value between strokes, the stroke length ratio feature value between strokes, the stroke position ratio feature value between strokes. Specifically, in the process of calculating the difference degree between each test stroke and each standard stroke based on each stroke description feature value, according to the evaluation requirements of each stroke description feature in the stroke order evaluation dimension, the weight ratio mapped by each stroke description feature value can be determined, and then the weight ratio mapped by each stroke description feature value is used to perform a weighted sum calculation on each stroke description feature value between each test stroke and each standard stroke, so as to calculate the difference degree between each test stroke and each standard stroke based on each stroke description feature value between each test stroke and each standard stroke.
[0113] 204. When the minimum value of the difference degree between all the test strokes and the standard stroke is less than the first preset threshold, the test stroke corresponding to the minimum value is determined as the test stroke that matches each standard stroke one by one.
[0114] When the minimum value of the difference degree between all the test strokes and the standard stroke is less than the first preset threshold, it is determined that the two strokes formed by the test stroke and the standard stroke match; otherwise, it is determined that the two strokes formed by the test stroke and the standard stroke do not match; and the test strokes and the standard strokes that match one by one are retained.
[0115] 205. Combine the first stroke order index of each standard stroke and the second stroke order index of the test stroke that matches each standard stroke to form an index pair.
[0116] Specifically, in the actual application scenario, j = 1 can be initialized, and an empty set C is used to store the matching results. By traversing all the strokes in the test font, S(i, j) (1 ≤ i ≤ M) is calculated, and the minimum value of S(i, j) is compared with the first preset threshold. If it is less than the first preset threshold, it is considered that the i-th stroke of the corresponding test font matches the j-th stroke of the standard font, and the stroke sequence pair (i, j) is stored in the set C as the matching result; if it is greater than the threshold, it means that there is a writing error or omission for the j-th stroke of the standard font, and the stroke sequence pair (i, j) does not need to be stored in the set C as the matching result. If j < N, let j = j + l, and repeat the above process.
[0117] 206. Generate the writing evaluation results of the font to be tested on the stroke order evaluation dimension according to the index.
[0118] In this embodiment of the invention, the retained index pairs can be stroke order information that compares the stroke order of the font under test with that of the standard font. For example, for stroke i in the font under test and stroke j in the standard font, the retained stroke order information can include: (i2, j1), (i1, j2), (i3, j3), (i4, j4). This stroke order information is the writing evaluation result in the stroke order dimension. At this time, the evaluation result indicates that the stroke order of the first two strokes in the font under test is opposite to that of the first two strokes in the standard font (i.e., the stroke order of the first two strokes in the font under test is written incorrectly), while the stroke order of the last two strokes is the same.
[0119] 207. Obtain the writing evaluation results of the font to be tested on multiple evaluation dimensions, and determine whether the writing evaluation results of the font to be tested on multiple evaluation dimensions meet the corresponding evaluation conditions.
[0120] 208. If the writing evaluation results of the font to be tested meet the evaluation conditions in multiple evaluation dimensions, then output a prompt message indicating that the font to be tested meets the writing standards; otherwise, generate corresponding prompt messages based on the writing evaluation results of the evaluation dimensions that do not meet the evaluation conditions.
[0121] Furthermore, the evaluation dimensions can also include stroke correctness evaluation dimensions. The stroke data of the font to be tested can be acquired in real time and transmitted to the writing evaluation system as a stroke to be tested. At this time, the writing evaluation system can evaluate the correctness of the strokes transmitted in real time. Specifically, in the writing evaluation process for the stroke correctness evaluation dimension, the stroke data of the font to be tested can be processed to obtain stroke feature data. The stroke feature data is then input into a pre-built stroke classification model for recognition according to the pre-set stroke correctness evaluation dimension to obtain the stroke classification result. The stroke classification result is used to represent the standard strokes in the preset stroke library that correspond to the strokes to be tested in the font to be tested. Alternatively, a pre-built stroke classification model incorporating an attention mechanism can be used. Stroke feature data is input into this model to obtain stroke classification results. When the output stroke classification result represents a standard stroke combination in a pre-defined stroke library corresponding to the stroke in the font being tested, it indicates that the stroke is a connected stroke. Based on this stroke classification result, a prompt message can be output to indicate that the stroke is written as a connected stroke. Furthermore, based on the stroke classification result, a writing evaluation result for the font being tested on the stroke correctness evaluation dimension can be generated. In this embodiment of the invention, either the first stroke classification model or the second stroke classification model described above can be used.
[0122] Among them, the preset stroke library collects standard strokes set for children's writing. The standard stroke can be a single stroke or a stroke combination formed by radicals. Specifically, in the actual application scenario, in order to improve the writing evaluation efficiency and the accuracy of the evaluation results of the待测字体 (to-be-tested font) written by children writers, after obtaining the stroke data of the to-be-tested font written by children writers in real time, each to-be-tested stroke of the to-be-tested font can be compared with the corrective strokes in the corrective stroke library. Specifically, the comparison can be carried out by means of similarity comparison or stroke matching. The corrective stroke library collects corrective strokes for children's writing, and each corrective stroke has a corresponding standard stroke mapped to it in the preset stroke library. Here, the corrective stroke is the stroke that children writers often write incorrectly (for example, the error probability corresponding to each corrective stroke in the corrective stroke library exceeds the preset probability threshold, where the error probability represents the probability that children writers write the standard stroke incorrectly as this corrective stroke). For example, referring to Figure 3 As shown in the writing example, children writers often write the direction of a certain point in the standard radical of three dots water incorrectly, that is, they write a corrective stroke. There is a mapping relationship between the incorrect radical of three dots water in the corrective stroke library and the correct radical of three dots water (i.e., the standard stroke) in the preset stroke library. If a corrective stroke matching the to-be-tested stroke in the to-be-tested font is found in the corrective stroke library, it means that there is an incorrect stroke in the to-be-tested font. Further, according to this corrective stroke, the standard stroke corresponding to the to-be-tested stroke in the to-be-tested font can be found in the preset stroke library. The process of pre-matching the strokes in the to-be-tested font through the corrective stroke library can identify the incorrect strokes in the to-be-tested font in advance before the writing evaluation, and use the mapping relationship between the corrective stroke library and the preset stroke library to determine the standard stroke corresponding to the incorrect stroke, which can perform stroke correction on the to-be-tested strokes in advance and improve the efficiency of stroke evaluation to a certain extent. Since children's writing habits are different from those of adults, children usually imitate images according to strokes when writing, that is, write strokes through image imitation. In the above embodiments of the present invention, for children writers, the relationship between image imitation and strokes is established through the corrective database, and targeted stroke correction is performed on the stroke data of the to-be-tested font generated when children writers write, so as to better adapt to the situation of children's writing habit of image imitation when writing. Furthermore, the final obtained writing evaluation result can more truly reflect the writing situation of children writers, and improve the accuracy of the evaluation result.
[0123] Specifically, in the process of processing the stroke data of the font to be measured to obtain the stroke feature data, the spatial information and temporal information of the sampling points in the stroke data of the font to be measured can be determined; the spatial information and temporal information of the sampling points are used to extract features from the stroke data of the font to be measured to obtain the stroke feature data. Specifically, the point set formed by the stroke data is preprocessed (for example, redundant points in the smooth part of the point set are deleted, and only the inflection points in the turning part are retained), and then the preprocessed sampling points are sampled at equal intervals in time series and encoded, so as to obtain the stroke feature data. The stroke feature data can be represented by an M (M is the number of discrete sampling points) -dimensional vector (that is, the sampling is encoded as an M -dimensional vector), and the specific form is a time series. The code value of each dimension vector is an angle of 0 - 360°. In the subsequent process of calculating the loss function value, the stroke feature data needs to be used (that is, the loss function value between two strokes (the stroke to be measured and the standard stroke) is calculated according to the stroke feature data of the two strokes). Specifically, in the process of generating the writing evaluation result of the font to be measured in the dimension of stroke correctness evaluation according to the stroke classification result, the cost of scaling, adding, deleting, and deflecting the standard stroke in the standard stroke corresponding to the stroke to be measured in the font to be measured can be calculated according to the stroke classification result to obtain the loss function value of the stroke to be measured in the font to be measured and the standard stroke in the standard font; and the writing evaluation result of the stroke to be measured in the dimension of stroke correctness evaluation is generated according to the loss function value of the stroke to be measured in the font to be measured and the standard stroke in the standard font.
[0124] In the actual application scenario, for the training of the stroke classification model in the evaluation process of the stroke correctness dimension, the stroke feature data can be formed into a time series and input into the recurrent neural network model. The specific structure of the recurrent neural network model is as Figure 4 shown. By collecting the standard samples in children's writing notes for stroke feature extraction and annotation, multiple classifications of strokes are formed according to the educational standard. The stroke feature data after feature extraction of the annotated strokes is input into the recurrent neural network for training to obtain the stroke classification model. The stroke classification model can determine the standard stroke corresponding to the stroke to be measured in the font to be measured from the preset stroke library.
[0125] Furthermore, considering the connected stroke situation that occurs when children write. For example, the character "了" is originally composed of two strokes, "horizontal stroke with a hook" and "vertical hook", but it is written as one stroke when writing. In order to accurately detect the connected stroke font, an attention mechanism can be introduced during the training of the stroke classification model, and then a stroke classification model applicable to connected stroke segmentation (that is, the stroke classification model with the attention mechanism introduced) can be trained. Specifically, the encoder - decoder structure is used in the training process. The encoder - decoder structure is as Figure 5As shown, the encoder first encodes the input data into a context vector c. The attention mechanism ensures that the current input is the context information required for the current output by inputting different context vectors c into the decoder at each time step. That is, the decoding structure uses the attention mechanism to decode the standard strokes that match the preset stroke library and the context vector c.
[0126] In practical applications, the calculation of the loss function value in the evaluation of stroke correctness mainly includes three parts: local feature extraction, angle deviation mapping, and cost calculation. For the M codes of the stroke to be tested (such as the angle code values in the stroke feature data mentioned above), local feature extraction refers to the extraction of the M codes (i.e., M local features). The code at each position reflects the overall features of all similar stroke segments within a certain range R (here R can be taken as M / 5) around that position, making the coding sequence as smooth as possible, preserving the key information of the stroke, and removing some noise. Angle deviation mapping is for the tolerance of a certain stroke deviation angle in writing. Small angle deviations are considered positive, while excessively large angle deviations are usually considered writing errors. In this step, the corresponding angle deviation mapping value (or subjective deviation) is calculated based on the angle deviation between two strokes. Cost calculation is based on the encoding of the stroke to be tested and the standard stroke after sampling, as well as the local features of the stroke to be tested and the standard stroke. It calculates the cost of transforming the stroke to be tested into the standard stroke through scaling, addition, deletion, and biasing. That is, the loss function value between the stroke to be tested and the standard stroke.
[0127] For the local feature extraction process, assume that the original sequence is represented by an array code (i.e., the array corresponding to the M encodings of the stroke to be measured), and the code value at position i is code[i] (i = 0, 1, 2,..., M - 1). The method for extracting local features at position i is as follows: Step 1, set the forward code value code_front and backward code value code_back of code[i]. Initially, code_front = code_back = code[i]. Use an empty set Ri to store the results, and save code[i] as a result to the set Ri; Step 2, perform forward encoding and backward encoding to spread forward and backward respectively. Spread: code_front = code[i - 1], code_back = code[i + 1]. When spreading to the array boundaries of i = 0 or i = M - 1, let the code value of code_front or code_back take +∞ correspondingly; Step 3, compare the sizes of code_front and code_back. If code_front < code_back, spread code_front once, otherwise spread code_back once. After spreading, save the previous smaller code value as a result to the set Ri; Step 4, repeat Step 3 until the number of elements in the set Ri reaches R, and calculate the mean Rmi of Ri. Rmi is the local feature at position i.
[0128] For the angle deviation mapping process, the tolerance of the writing evaluation result for the writing deviation angle of a certain stroke is limited. Specifically, as Figure 6 shown, for small-angle deviations (such as trajectory 1), it is subjectively considered that the writing is correct. For large-angle deviations (such as trajectory 2), it is subjectively considered that the writing is incorrect. The relationship between subjective deviation and angle deviation is not a linear relationship, but a relationship that is insensitive to small angles, sensitive to large angles, and constantly judges wrong when the angle exceeds a certain range. Based on this feature, the angle deviation is divided into three intervals according to the writing subjective deviation: approximately equal interval (0° - 25°), sensitive interval (25° - 90°), and constant wrong judgment interval (> 90°). The following mapping relationship between the angle deviation θ (i.e., the angle deviation between the stroke to be measured and the standard stroke) and the subjective deviation L(θ) is established: [[ID=⑥]] [[ID=⑦]]
[0129] [[ID=⑧]] [[ID=⑨]] [[ID=⑩]]
[0130] [[ID=⑪]]For the cost calculation process, both the stroke to be measured and the standard stroke are encoded after sampling, and the number of encodings are M and N respectively. Define the loss function value as the cost size for the stroke to be measured to become the standard stroke through scaling, adding and deleting, and deflection. Specifically, as [[ID=⑫]] Figure 7The three examples involve stroke shortening, stroke addition, and stroke offset, respectively. Based on children's writing habits, scaling has a lower cost, while adding or deleting strokes has a higher cost. The cost of adding or deleting one bit of encoding is defined as 0.8, scaling one bit of encoding has a lower cost of 0.1, and the cost of offsetting one bit of encoding is calculated using the formula for the offset angle difference. Let code_c and code_n represent the encodings of the stroke to be tested and the standard stroke, respectively; R_c and R_n represent the local features of the stroke to be tested and the standard stroke, respectively; and D(i,j) represent the cost of the first i bits of the encoding of the stroke to be tested and the first j bits of the encoding of the standard stroke. The specific iterative process is shown below.
[0131] initialization:
[0132]
[0133] Iteration equation:
[0134]
[0135] Where D(M, N) is the loss function value between the stroke to be tested and the standard stroke.
[0136] Specifically, when the stroke classification results corresponding to the stroke to be tested and the standard stroke are different, the writing evaluation result is that the stroke to be tested is written incorrectly; when the loss function value between the stroke to be tested and the standard stroke is less than or equal to the preset loss function value threshold, the writing evaluation result is that the stroke to be tested is written correctly; when the loss function value between the stroke to be tested and the standard stroke is greater than the preset loss function value threshold, the writing evaluation result is that the stroke to be tested is not written in a standard way.
[0137] In this embodiment of the invention, when evaluating the font under test based on the stroke order evaluation dimension, the loss function value between the stroke under test and the standard stroke can be calculated based on the above iterative process.
[0138] Furthermore, in order to improve the accuracy of writing evaluation, after evaluating the待测字体 (to-be-tested font) in multiple dimensions, the OCR auxiliary module can be used as an auxiliary evaluation process to evaluate the overall frame structure of the to-be-tested font. Specifically, the to-be-tested font can be input in the form of a picture into a pre-constructed font classification model for recognition, and a font classification result can be obtained. This classification result is used to represent the font classification it belongs to. If the font classification of the to-be-tested font is the same as that of the standard font, it means that the frame structure of the to-be-tested font is the same as that of the standard font and no adjustment is required. If the font classification of the to-be-tested font is different from that of the standard font, it means that the frame structure of the to-be-tested font needs to be adjusted, and a prompt message for the glyph structure error corresponding to the to-be-tested font is output. For example, both the characters "人" (person) and "八" (eight) consist of a left-falling stroke and a right-falling stroke. When the standard font is "人", if the writer inputs the to-be-tested font as "八", no writing error will be prompted. At this time, the OCR auxiliary module is needed to prompt the error in the frame structure of the to-be-tested font.
[0139] In the example of the present invention, this OCR module can assist in distinguishing fonts with the same strokes but slightly different structures (for example, the characters "人" and "八"), and correct the spelling mistakes of the writer when writing words and sentences. Here, the font classification model can be trained using a network model based on resnet-18. The specific training process can use publicly available datasets and collect the writing data of 1300 commonly used characters in kindergartens and primary schools for intensive training.
[0140] Specifically in the actual application scenario, the entire writing evaluation process can be as Figure 8As shown, the font to be tested is first input into the handwriting evaluation system. The system then acquires the stroke data of the font in real time and segments the stroke data (i.e., divides the sampling points of the strokes into individual strokes according to the writing action). It then calculates whether the number of strokes in the font to be tested matches the number of strokes in the standard font. If they do not match, the system outputs the specific evaluation details of the error. If they match, the system calculates the stroke matching result (i.e., matches the strokes to be tested in the font to be tested with the standard strokes in the standard font). Further, it checks whether there are any unmatched strokes in the standard font within the stroke matching result. If so, it outputs the specific... If the evaluation details of the character's errors are not available, the stroke order in the stroke matching results is checked for correctness. If incorrect, the evaluation details of the specific errors are output. If correct, the writing direction of all tested strokes is checked for correctness. If incorrect, the evaluation details of the specific errors are output. If correct, the position, length, intersection relationship, and aspect ratio of the tested strokes are calculated, and the tested strokes are evaluated based on these dimensions to determine if the writing is standardized. If not standardized, the evaluation details of the specific errors are output. If standardized, the writing is deemed standardized, and the writing evaluation process ends. In the final evaluation, writing errors can be divided into four levels based on severity: a) Standardized writing; b) Correct stroke order, but some strokes have issues with length, position, intersection logic, aspect ratio, etc.; c) Overall correct character shape, but incorrect writing order or writing direction; d) Errors in character shape writing, including incorrect or non-standard stroke writing and incorrect number of strokes.
[0141] Furthermore, as Figure 1 and Figure 2 To specifically implement the method, this application provides a writing assessment device, such as... Figure 9 As shown, the device includes: an acquisition unit 31, a first determination unit 32, a second determination unit 33, and a first generation unit 34.
[0142] The acquisition unit 31 can be used to acquire the stroke data of the font to be tested in real time. The stroke data is the data formed by dividing the sampling points of the stroke into each stroke to be tested according to the writing action.
[0143] The first determining unit 32 can be used to determine the degree of difference between each stroke of the font to be tested and each standard stroke of the standard font based on the stroke data of the font to be tested and the stroke data of the standard font, according to the pre-set stroke order evaluation dimension.
[0144] The second determining unit 33 can be used to determine, based on the difference degree, the strokes to be tested that match each standard stroke of the standard font one by one among the strokes to be tested of the font to be tested, and to form an index pair by combining the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke.
[0145] The first generation unit 34 can be used to generate the writing evaluation result of the font to be tested on the stroke order evaluation dimension according to the index, wherein the writing evaluation result of the font to be tested on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the font to be tested.
[0146] The writing evaluation device provided in this invention, compared with the existing methods that only use three evaluation dimensions, acquires the stroke data of the font under test in real time. This stroke data is formed by dividing the sampling points of the strokes into various strokes under test according to the writing action. Then, based on the pre-set stroke order evaluation dimensions, it determines the degree of difference between each stroke under test of the font under test and each standard stroke of the standard font, according to the stroke data of the font under test and the stroke data of the standard font. Based on the degree of difference, it determines the degree of difference between each stroke under test of the font and each standard stroke of the standard font. The test involves matching the strokes of the target font with each standard stroke, and then creating an index pair by combining the first stroke order index of each standard stroke with the second stroke order index of the target font that matches each standard stroke. Based on the index pair, a writing assessment result for the target font on the stroke order assessment dimension is generated. This writing assessment result on the stroke order assessment dimension indicates whether there are any strokes in the target font that are written in the wrong stroke order. This method can effectively assess situations where children write correctly but have incorrect stroke order, thus providing a more comprehensive writing assessment method and giving writers the correct assessment guidance.
[0147] In specific application scenarios, such as Figure 10 As shown, the first determining unit 32 includes:
[0148] The first determining module 321 can be used to, for each standard stroke in the standard font, traverse all the strokes to be tested in the font to be tested, and determine the degree of difference between each stroke to be tested and each standard stroke.
[0149] The second determining module 322 can be used to determine the stroke to be tested corresponding to the minimum value as a stroke to be tested that matches each of the standard strokes when the minimum value of the difference between all the strokes to be tested and each standard stroke is less than a first preset threshold.
[0150] In specific application scenarios, such as Figure 10 As shown, the first determining module 321 includes:
[0151] The calculation submodule 3211 can be used to calculate the degree of difference between each stroke to be tested and each standard stroke based on the stroke description feature values between each stroke to be tested and each standard stroke when the stroke classification results corresponding to each stroke to be tested and each standard stroke are the same.
[0152] The selected submodule 3212 can be used to use a preset difference degree as the difference degree between each stroke to be tested and each standard stroke when the stroke classification results corresponding to each stroke to be tested and each standard stroke are different, wherein the preset difference degree is greater than a fixed threshold.
[0153] In specific application scenarios, each stroke description feature value includes at least one of the following: loss function value between strokes, stroke length ratio feature value between strokes, stroke position ratio feature value between strokes. The calculation submodule is specifically used to determine the weight ratio mapped to each stroke description feature value based on the evaluation requirements of the stroke order evaluation dimension on each stroke description feature.
[0154] The calculation submodule is further configured to perform a weighted summation calculation on the stroke description feature values between each stroke to be tested and each standard stroke according to the weight ratio mapped by each stroke description feature value, so as to obtain the degree of difference between each stroke to be tested and each standard stroke.
[0155] In specific application scenarios, such as Figure 10 As shown, the device further includes:
[0156] The evaluation unit 35 can be used to evaluate the font under test according to the evaluation order of the multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions after the stroke data of the font under test is acquired in real time. The multiple evaluation dimensions include the stroke order evaluation dimension.
[0157] The judgment unit 36 can be used to obtain the writing evaluation results of the font to be tested on the multiple evaluation dimensions according to the multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, and to determine whether the writing evaluation results of the font to be tested on the multiple evaluation dimensions meet the corresponding evaluation conditions.
[0158] The first output unit 37 can be used to output a prompt message indicating that the font under test conforms to the writing standard if the writing evaluation results of the font under test meet the evaluation conditions in multiple evaluation dimensions; otherwise, it can generate a corresponding prompt message based on the writing evaluation results of the evaluation dimensions that do not meet the evaluation conditions.
[0159] In specific application scenarios, the multiple evaluation dimensions include stroke accuracy evaluation dimensions, and the device further includes:
[0160] The processing unit is used to process the stroke data of the font to be tested to obtain stroke feature data;
[0161] The first recognition unit is used to input the stroke feature data into a pre-constructed stroke classification model for recognition and obtain stroke classification results. The stroke classification results are used to characterize the standard strokes in the preset stroke library that correspond to the strokes to be tested in the font to be tested.
[0162] The second generation unit is used to generate the writing evaluation results of the font to be tested in the stroke correctness evaluation dimension based on the stroke classification results.
[0163] In specific application scenarios, the second generation unit includes:
[0164] The calculation module is used to calculate, based on the stroke classification result, the cost of transforming the stroke to be tested in the font to be tested into the standard stroke represented by the stroke classification result by performing at least one of the following operations: scaling, adding, deleting, or deflecting, so as to obtain the loss function value between the stroke to be tested in the font to be tested and the standard stroke represented by the stroke classification result.
[0165] Based on the loss function values of the strokes to be tested in the font under test and the standard strokes represented by the stroke classification results, the writing evaluation results of the font under test on the stroke correctness evaluation dimension are generated.
[0166] In specific application scenarios, the processing unit includes:
[0167] The determination module is used to determine the spatial and temporal information of the sampling points in the stroke data of the font to be tested;
[0168] The extraction module is used to extract features from the stroke data of the font to be tested using the spatial and temporal information of the sampling points, so as to obtain stroke feature data.
[0169] In another embodiment, the device further includes:
[0170] The second recognition unit is used to input the font to be tested as an image into a pre-built font classification model for recognition after the stroke data of the font to be tested is acquired in real time, and to obtain the font classification result. The font classification result is used to characterize the font category to which the font to be tested belongs.
[0171] The second output unit is used to output a prompt message indicating that the glyph structure of the font under test is incorrect if the font category to which the font under test belongs is inconsistent with the font category to which the standard font belongs.
[0172] It should be noted that other corresponding descriptions of the functional units involved in the writing assessment device provided in this embodiment can be found in [reference needed]. Figures 1-2 The corresponding descriptions in [the document] will not be repeated here.
[0173] Based on the above, Figures 1-2 Accordingly, this application embodiment also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method. Figures 1-2 The writing assessment method shown.
[0174] Based on this understanding, the technical solution of this application can be embodied in the form of a software product. This software product can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, or portable hard drive), and includes several instructions to cause a computer device (such as a personal computer, server, or network device) to execute the methods described in the various implementation scenarios of this application.
[0175] Based on the above, Figures 1-2 The method shown, and Figures 9-10 To achieve the above objectives, this application also provides a physical device for writing assessment, specifically a computer, smartphone, tablet, smartwatch, server, or network device, etc. This physical device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figures 1-2 The writing assessment method shown.
[0176] Optionally, the physical device may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0177] In an exemplary embodiment, see Figure 11 The aforementioned physical device includes a communication bus, a processor, a memory, and a communication interface. It may also include input / output interfaces and a display device. The various functional units can communicate with each other via the bus. The memory stores computer programs, and the processor executes the programs stored in the memory to perform the painting mounting method described in the above embodiments.
[0178] Those skilled in the art will understand that the physical device structure for writing assessment provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0179] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the physical device for processing store search information, supporting the operation of the information processing program and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software within the information processing physical device.
[0180] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented using software plus necessary general-purpose hardware platforms, or it can be implemented using hardware. By applying the technical solution of this application, compared with the existing methods, the writing evaluation results of the font under test in the stroke order evaluation dimension are used to indicate whether there are any strokes with incorrect stroke order in the font under test. This can effectively evaluate situations where children write correctly but have incorrect stroke order, thus providing a more comprehensive writing evaluation method and giving writers correct evaluation guidance.
[0181] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0182] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A method for assessing handwriting, characterized in that, include: The stroke data of the font to be tested is acquired in real time. The stroke data is formed by dividing the sampling points of the stroke into each stroke to be tested according to the writing action. For the pre-set stroke order evaluation dimension, based on the stroke data of the font under test and the stroke data of the standard font, the degree of difference between each stroke of the font under test and each standard stroke of the standard font is determined. Based on the difference degree, determine the strokes in each stroke of the font to be tested that match each standard stroke of the standard font one by one, and form an index pair by the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke. The index is used to generate the writing evaluation result of the font under test on the stroke order evaluation dimension, wherein the writing evaluation result of the font under test on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the font under test.
2. The method according to claim 1, characterized in that, The aforementioned evaluation dimension for the pre-set stroke order, based on the stroke data of the font under test and the stroke data of the standard font, determines the degree of difference between each stroke of the font under test and each standard stroke of the standard font, and determines, based on the degree of difference, the strokes of the font under test that match each standard stroke of the standard font one-to-one, specifically including: For each standard stroke in the standard font, iterate through all the strokes to be tested in the font to be tested, and determine the degree of difference between each stroke to be tested and each standard stroke. When the minimum difference between all the strokes to be tested and each standard stroke is less than a first preset threshold, the stroke to be tested corresponding to the minimum value is determined as the stroke to be tested that matches each standard stroke one by one.
3. The method according to claim 2, characterized in that, Determining the degree of difference between each of the tested strokes and each standard stroke includes: When the stroke classification results corresponding to each stroke to be tested and each standard stroke are the same, the degree of difference between each stroke to be tested and each standard stroke is calculated based on the stroke description feature values between each stroke to be tested and each standard stroke. When the stroke classification results corresponding to each stroke to be tested and each standard stroke are different, a preset difference degree is used as the difference degree between each stroke to be tested and each standard stroke, wherein the preset difference degree is greater than a fixed threshold.
4. The method according to claim 3, characterized in that, Each stroke description feature value includes at least one of the following: a loss function value between strokes, a stroke length ratio feature value between strokes, and a stroke position ratio feature value between strokes. The calculation of the difference between each stroke to be tested and each standard stroke based on each stroke description feature value between each stroke to be tested and each standard stroke specifically includes: To meet the evaluation requirements of the stroke order evaluation dimension on each stroke description feature, determine the weight ratio of each stroke description feature value mapping; According to the weight ratio of each stroke description feature value mapping, the stroke description feature values between each stroke to be tested and each standard stroke are weighted and summed to obtain the degree of difference between each stroke to be tested and each standard stroke.
5. The method according to any one of claims 1-4, characterized in that, After acquiring the stroke data of the font to be tested in real time, the method further includes: Based on multiple pre-set evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, the font to be tested is evaluated according to the evaluation order, wherein the multiple evaluation dimensions include the stroke order evaluation dimension; The method further includes, after evaluating the font to be tested according to the pre-set multiple evaluation dimensions and the evaluation order corresponding to the multiple evaluation dimensions, the method further includes: Obtain the writing evaluation results of the font under test on multiple evaluation dimensions, and determine whether the writing evaluation results of the font under test on the multiple evaluation dimensions meet the corresponding evaluation conditions; If the writing evaluation results of the font under test meet the evaluation conditions in all multiple evaluation dimensions, then output a prompt message indicating that the font under test meets the writing standards; otherwise, generate a corresponding prompt message based on the writing evaluation results of the evaluation dimensions that do not meet the evaluation conditions.
6. The method according to claim 5, characterized in that, The multiple assessment dimensions include a stroke correctness assessment dimension, and the method further includes: The stroke data of the font to be tested is processed to obtain stroke feature data; The stroke feature data is input into a pre-built stroke classification model for recognition to obtain stroke classification results. The stroke classification results are used to characterize the standard strokes in the preset stroke library that correspond to the strokes to be tested in the font to be tested. Based on the stroke classification results, the writing evaluation results of the font to be tested on the stroke correctness evaluation dimension are generated.
7. The method according to claim 6, characterized in that, The step of generating a writing evaluation result for the font under test on the stroke correctness evaluation dimension based on the stroke classification result specifically includes: Based on the stroke classification results, calculate the cost of transforming the stroke to be tested in the font to be tested into the standard stroke represented by the stroke classification results by performing at least one of the following operations: scaling, adding, deleting, or deflecting, and obtain the loss function value between the stroke to be tested in the font to be tested and the standard stroke represented by the stroke classification results. Based on the loss function values of the strokes to be tested in the font under test and the standard strokes represented by the stroke classification results, the writing evaluation results of the font under test on the stroke correctness evaluation dimension are generated.
8. The method according to claim 6, characterized in that, The process of processing the stroke data of the font to be tested to obtain stroke feature data specifically includes: Determine the spatial and temporal information of the sampling points in the stroke data of the font to be tested; The stroke data of the font to be tested are extracted using the spatial and temporal information of the sampling points to obtain stroke feature data.
9. The method according to any one of claims 1-4, characterized in that, After acquiring the stroke data of the font to be tested in real time, the method further includes: The font to be tested is input as an image into a pre-built font classification model for recognition, and the font classification result is used to characterize the font category to which the font to be tested belongs. If the font category to which the font to be tested belongs is inconsistent with the font category to which the standard font belongs, a prompt message indicating that the glyph structure of the font to be tested is incorrect will be output.
10. A writing assessment device, characterized in that, include: The acquisition unit is used to acquire the stroke data of the font to be tested in real time. The stroke data is the data formed by dividing the sampling points of the stroke into each stroke to be tested according to the writing action. The first determining unit is used to determine the degree of difference between each stroke of the font to be tested and each standard stroke of the standard font, based on the stroke data of the font to be tested and the stroke data of the standard font, for a pre-set stroke order evaluation dimension. The second determining unit is used to determine, based on the difference degree, the strokes to be tested in each stroke of the font to be tested that match each standard stroke of the standard font one by one, and to form an index pair by combining the first stroke order index of each standard stroke and the second stroke order index of the stroke to be tested that matches each standard stroke. The first generation unit is used to generate a writing evaluation result of the font to be tested on the stroke order evaluation dimension according to the index, wherein the writing evaluation result of the font to be tested on the stroke order evaluation dimension is used to indicate whether there are any strokes with incorrect stroke order in the font to be tested.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the writing assessment method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the writing assessment method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method and device for automatically evaluating right and wrong of Chinese character writing on basis of digital handwriting equipment
CN102542264A
Sequencing sequence mapping method and sequencing sequence mapping system
CN103336916A