A handwriting recognition method and related device
By extracting and combining the physical features and texture features of the handwriting image, the problem of poor offline handwriting recognition effect is solved, and more accurate handwriting recognition results are achieved, suitable for terminal devices and servers.
Patent Information
- Application Number
- CN202111526065.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-14
AI Technical Summary
The existing offline handwriting recognition technology has poor results and it is difficult to accurately identify handwriting information.
By extracting the physical and texture features of the handwriting image to be identified, combining the similarity calculation of the sample handwriting image, the handwriting recognition results are determined, and low-rank clustering and denoising processing are used to improve image quality.
It improves the accuracy and effect of handwriting recognition, can describe handwriting information more accurately, and is suitable for handwriting recognition of terminal devices and servers.
Smart Images

Figure CN114255468B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information security technology, and in particular, to a handwriting recognition method and related devices thereof. Background Art
[0002] With the rapid development of information security technology, biometric recognition technology has received increasing attention. Among them, biometric recognition technology can be used to identify a person's identity based on the biometric features (such as gait, iris, face, handwriting, etc.) that a person has.
[0003] In addition, due to the characteristics of non-contact, convenience, high speed, and high stability of handwriting recognition technology, the handwriting recognition technology has become a commonly used biometric recognition technology. Among them, handwriting recognition technology is used to identify a person's identity based on the writing handwriting of a person (such as online handwriting or offline handwriting, etc.).
[0004] Furthermore, due to the offline characteristics of offline handwriting recognition technology (that is, real-time handwriting recognition processing is not required when the user is writing), the application scope of offline handwriting recognition technology is relatively wide. For example, offline handwriting recognition technology can be applied to identity recognition services involved in certain special units (such as judicial departments, document inspection departments, etc.).
[0005] However, due to the defects of offline handwriting recognition technology, the handwriting recognition effect is relatively poor. Summary of the Invention
[0006] The main purpose of the embodiments of this application is to provide a handwriting recognition method and related devices thereof, which can improve the handwriting recognition effect.
[0007] The embodiments of this application provide a handwriting recognition method, and the method includes:
[0008] Obtain a handwriting image to be recognized;
[0009] Extract handwriting features from the handwriting image to be recognized to obtain handwriting features to be used; wherein, the handwriting features to be used include the physical features and texture features of the handwriting image to be recognized;
[0010] Determine the handwriting recognition result of the handwriting image to be recognized according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image; wherein, the handwriting features of each sample handwriting image include the physical features and texture features of each sample handwriting image.
[0011] In a possible implementation manner, the number of the sample handwriting images is N;
[0012] The process of determining the similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image includes:
[0013] Determine the nth physical feature similarity according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image; where n is a positive integer, n ≤ N, and N is a positive integer;
[0014] Determine the nth texture feature similarity according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image;
[0015] Determine the average value between the nth physical feature similarity and the nth texture feature similarity as the similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image.
[0016] In a possible implementation manner, the process of determining the nth physical feature similarity includes:
[0017] Determine the nth physical feature distance according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image; determine the nth physical feature similarity according to the ratio between the nth physical feature distance and the reference physical feature distance; where the reference physical feature distance is determined according to the physical features of the handwriting image to be recognized and the physical features of N sample handwriting images.
[0018] In a possible implementation manner, the process of determining the nth texture feature similarity includes:
[0019] Determine the nth texture feature distance according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image; determine the nth texture feature similarity according to the ratio between the nth texture feature distance and the reference texture feature distance; where the reference texture feature distance is determined according to the texture features of the handwriting image to be recognized and the texture features of N sample handwriting images.
[0020] In a possible implementation manner, the physical features include at least one of handwriting inclination, handwriting eccentricity, handwriting roundness, and handwriting aspect ratio.
[0021] In a possible implementation manner, the process of obtaining the handwriting image to be recognized includes:
[0022] After obtaining the original handwriting image, perform denoising processing on the original handwriting image to obtain a denoised handwriting image;
[0023] Determine the handwriting image to be recognized according to the denoised handwriting image.
[0024] In a possible implementation, the denoising process of the original handwriting image to obtain a denoised handwriting image includes:
[0025] Determine the weight to be used according to the original handwriting image;
[0026] Perform low-rank clustering processing on the original handwriting image according to the weight to be used to obtain a denoised handwriting image.
[0027] In a possible implementation, the process of determining the weight to be used includes:
[0028] Perform empirical mode decomposition on the original handwriting image to obtain the component to be used;
[0029] Perform block processing on the component to be used to obtain at least one first image block;
[0030] Determine the noise variance of each of the first image blocks;
[0031] Determine the weight to be used according to the noise variances of the at least one first image block.
[0032] In a possible implementation, the number of the first image blocks is J;
[0033] The determining the weight to be used according to the noise variances of the at least one first image block includes:
[0034] Look up the weight value corresponding to the noise variance of the j-th first image block from a preset mapping relationship; wherein, the preset mapping relationship includes the corresponding relationship between the noise variance of the j-th first image block and the weight value corresponding to the noise variance of the j-th first image block; j is a positive integer, j ≤ J, and J is a positive integer;
[0035] Perform set processing on the weight values corresponding to the noise variances of the J first image blocks to obtain the weight to be used.
[0036] In a possible implementation, the weight to be used includes J image block weights; wherein, J is a positive integer;
[0037] The performing low-rank clustering processing on the original handwriting image according to the weight to be used to obtain the denoised handwriting image includes:
[0038] Initialize a noise-free image and an image to be processed according to the original handwriting image;
[0039] Update the image to be processed according to the original handwriting image and the noise-free image;
[0040] Perform block processing on the image to be processed to obtain J second image blocks;
[0041] Perform block matching processing on the j-th second image block to obtain the j-th set of similar blocks; where j is a positive integer and j ≤ J;
[0042] Perform singular value decomposition on the j-th set of similar blocks to obtain the j-th decomposition result; where j is a positive integer and j ≤ J;
[0043] Determine the j-th estimated value according to the j-th image block weight in the weights to be used and the j-th decomposition result; where j is a positive integer and j ≤ J;
[0044] Update the noise-free image according to the J estimated values, and continue to execute the step of updating the image to be processed according to the original handwriting image and the noise-free image until, when a preset stop condition is reached, determine the denoised handwriting image according to the noise-free image.
[0045] In a possible implementation manner, the determining the handwriting image to be recognized according to the denoised handwriting image includes:
[0046] Perform blank deletion processing on the denoised handwriting image to obtain a blank-removed image;
[0047] Determine the handwriting image to be recognized according to the blank-removed image.
[0048] In a possible implementation manner, the process of determining the blank-removed image includes:
[0049] Perform grayscale processing on the denoised handwriting image to obtain a grayscale image;
[0050] Perform binarization processing on the grayscale image to obtain a binarized image;
[0051] Delete the regions that meet the preset blank conditions from the binarized image to obtain the blank-removed image.
[0052] In a possible implementation manner, the determining the handwriting image to be recognized according to the blank-removed image includes:
[0053] If it is determined that the blank-removed image does not meet the preset texture conditions, initialize the image to be filled according to the blank-removed image;
[0054] Determine the filling start position according to the image to be filled;
[0055] Update the to-be-filled image according to the texture to be used and the starting position of the filling, and continue to execute the step of determining the starting position of the filling according to the to-be-filled image until, when it is determined that the to-be-filled image meets the preset texture condition, determine the to-be-filled image as the to-be-recognized handwriting image; wherein, the texture to be used is determined according to the blanked image.
[0056] An embodiment of the present application also provides a handwriting recognition device, including:
[0057] An image acquisition unit, configured to acquire a to-be-recognized handwriting image;
[0058] A feature extraction unit, configured to extract handwriting features from the to-be-recognized handwriting image to obtain to-be-used handwriting features; wherein, the to-be-used handwriting features include physical features of the to-be-recognized handwriting image and texture features of the to-be-recognized handwriting image;
[0059] A handwriting recognition unit, configured to determine a handwriting recognition result of the to-be-recognized handwriting image according to the similarity between the to-be-used handwriting features and the handwriting features of at least one sample handwriting image; wherein, the handwriting features of each sample handwriting image include physical features of each sample handwriting image and texture features of each sample handwriting image.
[0060] An embodiment of the present application also provides a device, the device includes: a processor, a memory, and a system bus;
[0061] The processor and the memory are connected through the system bus;
[0062] The memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor executes any implementation manner of the handwriting recognition method provided in the embodiment of the present application.
[0063] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored, and when the instructions are run on a terminal device, the terminal device is enabled to execute any implementation manner of the handwriting recognition method provided in the embodiment of the present application.
[0064] An embodiment of the present application also provides a computer program product, and when the computer program product runs on a terminal device, the terminal device is enabled to execute any implementation manner of the handwriting recognition method provided in the embodiment of the present application.
[0065] Based on the above technical solutions, the present application has the following beneficial effects:
[0066] In the technical solution provided by this application, after obtaining the handwriting image to be recognized, the handwriting features of the handwriting image to be recognized are first extracted to obtain the handwriting features to be used, so that the handwriting features to be used include the physical features and the texture features of the handwriting image to be recognized; then, according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image, the handwriting recognition result of the handwriting image to be recognized is determined.
[0067] It can be seen that since the handwriting features to be used include the physical features and the texture features of the handwriting image to be recognized, the handwriting features to be used can more accurately describe the handwriting information carried by the handwriting image to be recognized, so that the handwriting recognition result determined based on the handwriting features to be used is more accurate, and thus the handwriting recognition effect can be improved. Description of the Drawings
[0068] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0069] Figure 1 It is a flowchart of a handwriting recognition method provided by an embodiment of the present application;
[0070] Figure 2 It is a schematic diagram of a handwriting recognition process provided by an embodiment of the present application;
[0071] Figure 3 It is a schematic structural diagram of a handwriting recognition device provided by an embodiment of the present application. Detailed Embodiments
[0072] The inventors found in the research on handwriting recognition technology that since the handwriting recognition technology usually performs handwriting recognition processing based on a single feature of the handwriting, the handwriting recognition effect of the handwriting recognition technology is relatively poor.
[0073] Based on the above findings, in order to solve the technical problems shown in the background art, an embodiment of the present application provides a handwriting recognition method, which includes: after obtaining the handwriting image to be recognized, first extracting the handwriting features of the handwriting image to be recognized to obtain the handwriting features to be used, so that the handwriting features to be used include the physical features and the texture features of the handwriting image to be recognized; then, according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image, the handwriting recognition result of the handwriting image to be recognized is determined.
[0074] It can be seen that since the handwriting features to be used include the physical features of the handwriting image to be recognized and the texture features of the handwriting image to be recognized, the handwriting features to be used can more accurately describe the handwriting information carried by the handwriting image to be recognized, so that the handwriting recognition result determined based on the handwriting features to be used is more accurate, thus improving the handwriting recognition effect.
[0075] In addition, the embodiments of the present application do not limit the execution subject of the handwriting recognition method. For example, the handwriting recognition method provided by the embodiments of the present application can be applied to data processing devices such as terminal devices or servers. Among them, the terminal device can be a smart phone, a computer, a personal digital assistant (PDA) or a tablet computer, etc. The server can be an independent server, a cluster server or a cloud server.
[0076] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0077] Method Embodiment 1
[0078] See Figure 1 , which is a flowchart of a handwriting recognition method provided by an embodiment of the present application.
[0079] The handwriting recognition method provided by the embodiments of the present application includes S1 - S3:
[0080] S1: Obtain a handwriting image to be recognized.
[0081] The above "handwriting image to be recognized" refers to image data that needs to be processed for handwriting recognition.
[0082] In addition, the embodiments of the present application do not limit the acquisition process of the above "handwriting image to be recognized". For example, specifically, after obtaining the original handwriting image, the original handwriting image can be directly determined as the handwriting image to be recognized. Another example is that it can be implemented by any of the implementation manners for obtaining the above "handwriting image to be recognized" shown in Method Embodiment 2 .
[0083] The above-mentioned "original handwriting image" refers to the image data collected by an image acquisition device (such as a scanning device, a photographing device, a video camera device, etc.); and the embodiments of the present application do not limit the format of the "original handwriting image". For example, it may be: Bitmap (BMP) format (*.bmp), JPG format (*.jpg), or PNG format (*.png).
[0084] S2: Extract handwriting features from the handwriting image to be recognized to obtain the handwriting features to be used.
[0085] The above-mentioned "handwriting features to be used" are used to represent the handwriting information carried by the handwriting image to be recognized; and the "handwriting features to be used" may include the physical features and the texture features of the handwriting image to be recognized.
[0086] The above-mentioned "physical features of the handwriting image to be recognized" are used to represent the handwriting physical characterization information carried by the handwriting image to be recognized (such as handwriting inclination, handwriting eccentricity, handwriting roundness, handwriting aspect ratio, etc.); and the embodiments of the present application do not limit the "physical features of the handwriting image to be recognized". For example, it may include at least one of the handwriting inclination of the handwriting image to be recognized, the handwriting eccentricity of the handwriting image to be recognized, the handwriting roundness of the handwriting image to be recognized, and the handwriting aspect ratio of the handwriting image to be recognized.
[0087] The embodiments of the present application do not limit the determination process of the above-mentioned "handwriting inclination of the handwriting image to be recognized". For example, it may be implemented using formulas (1)-(3).
[0088]
[0089]
[0090]
[0091] In the formula, f1 represents the handwriting inclination of the handwriting image to be recognized; f(x i ,y k ) represents the pixel value of the pixel at the i-th row and k-th column in the handwriting image to be recognized; x i represents the abscissa of the pixel at the i-th row and k-th column in the handwriting image to be recognized, and the embodiments of the present application do not limit x i , for example, x i = i, or x i = i - 1; y k represents the ordinate of the pixel at the i-th row and k-th column in the handwriting image to be recognized, and the embodiments of the present application do not limit y k , for example, y k = k, or y k = k - 1; x centerrepresents the abscissa of the centroid position of the handwriting image to be recognized; y center represents the ordinate of the centroid position of the handwriting image to be recognized; I represents the number of rows in the handwriting image to be recognized; K represents the number of columns in the handwriting image to be recognized; p and q are adjustable parameters of the second-order geometric central moment For example, refers to the second-order geometric central moment with p = 0 and q = 2 refers to the second-order geometric central moment with p = 2 and q = 0 refers to the second-order geometric central moment with p = 1 and q = 1
[0092] The embodiments of the present application do not limit the determination process of the above-mentioned "handwriting eccentricity of the handwriting image to be recognized". For example, it can be implemented by using formulas (1) and (4).
[0093]
[0094] In the formula, f2 represents the handwriting eccentricity of the handwriting image to be recognized.
[0095] The embodiments of the present application do not limit the determination process of the above-mentioned "handwriting roundness of the handwriting image to be recognized". For example, it can be implemented by using formulas (5)-(6).
[0096]
[0097] f3 = [r1 r2 … r H (6)
[0098] In the formula, f3 represents the handwriting roundness of the handwriting image to be recognized, and this f3 is a vector; r h represents the handwriting roundness of the h-th character in the handwriting image to be recognized; P h represents the perimeter of the h-th character in the handwriting image to be recognized; A h represents the area of the h-th character in the handwriting image to be recognized; H represents the number of characters in the handwriting image to be recognized.
[0099] The embodiments of the present application do not limit the determination process of the above-mentioned "handwriting aspect ratio of the handwriting image to be recognized". For example, it can be implemented by using formulas (1) and (7).
[0100]
[0101] In the formula, f4 represents the handwriting aspect ratio of the handwriting image to be recognized.
[0102] The "texture feature of the handwritten image to be recognized" above is used to represent the handwritten texture characterization information carried by the handwritten image to be recognized; moreover, the embodiments of the present application do not limit the determination process of the "texture feature of the handwritten image to be recognized". For example, any existing or future handwritten texture feature extraction method can be used for implementation.
[0103] Based on the relevant content of S2 above, after obtaining the handwritten image to be recognized, handwriting feature extraction (such as physical feature extraction, texture feature extraction, etc.) can be performed on the handwritten image to be recognized to obtain the handwriting features to be used, so that the handwriting features to be used can include the physical features of the handwritten image to be recognized and the texture features of the handwritten image to be recognized, thereby enabling the handwriting features to be used to more accurately represent the handwriting information carried by the handwritten image to be recognized, which is beneficial to improving the accuracy of handwriting recognition.
[0104] S3: Determine the handwriting recognition result of the handwritten image to be recognized according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwritten image.
[0105] The above "sample handwritten image" refers to the image data required for reference when performing handwriting recognition processing on the handwritten image to be recognized; moreover, the embodiments of the present application do not limit the number of the "sample handwritten images". For example, it can specifically be N; and N is a positive integer.
[0106] In addition, the embodiments of the present application do not limit the acquisition process of the above "at least one sample handwritten image". For example, it can specifically include: first, perform handwriting image acquisition processing on the nth sample object to obtain the nth sample handwritten image; then establish the corresponding relationship between the nth sample handwritten image and the identity information of the nth sample object, so that the identity information of the nth sample object can be traced based on the nth sample handwritten image in the future. Wherein, n is a positive integer, n ≤ N, and N is a positive integer.
[0107] It should be noted that the above "nth sample object" is a person; moreover, the embodiments of the present application do not limit the "identity information of the nth sample object". For example, it can include ID number, name, gender, etc.
[0108] The "handwriting feature of the nth sample handwritten image" is used to represent the handwriting information carried by the nth sample handwritten image; and the "handwriting feature of the nth sample handwritten image" can include the physical feature of the nth sample handwritten image and the texture feature of the nth sample handwritten image.
[0109] The above-mentioned "physical features of the nth sample handwriting image" are used to represent the handwriting physical characterization information carried by the nth sample handwriting image; moreover, the embodiments of the present application do not limit the "physical features of the nth sample handwriting image". For example, it may include at least one of the handwriting inclination of the nth sample handwriting image, the handwriting eccentricity of the nth sample handwriting image, the handwriting roundness of the nth sample handwriting image, and the handwriting aspect ratio of the nth sample handwriting image.
[0110] It should be noted that the relevant content of the above-mentioned "physical features of the nth sample handwriting image" is similar to the relevant content of the "physical features of the handwriting image to be recognized" above.
[0111] The above-mentioned "texture features of the nth sample handwriting image" are used to represent the handwriting texture characterization information carried by the nth sample handwriting image; and the relevant content of the "texture features of the nth sample handwriting image" is similar to the relevant content of the "texture features of the handwriting image to be recognized" above.
[0112] The above-mentioned "similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image" refers to the degree of similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image, so that the "similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image" is used to represent the similarity between the handwriting information carried by the handwriting image to be recognized and the handwriting information carried by the nth sample handwriting image.
[0113] In addition, the embodiments of the present application do not limit the determination process of the above-mentioned "similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image". For example, any existing or future similarity calculation method can be used for implementation.
[0114] In addition, in order to improve the accuracy of the similarity, the embodiments of the present application also provide another possible implementation manner for determining the "similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image", which may specifically include steps 11 - 13:
[0115] Step 11: Determine the nth physical feature similarity according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image.
[0116] The above-mentioned "nth physical feature similarity" is used to represent the similarity between the handwriting physical characterization information carried by the handwriting image to be recognized and the handwriting physical characterization information carried by the nth sample handwriting image.
[0117] In addition, the embodiments of the present application do not limit the implementation manner of step 11. For example, it may specifically include steps 111 - 112:
[0118] Step 111: Determine the nth physical feature distance according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image.
[0119] As an example, when the above "physical features" include handwriting inclination, handwriting eccentricity, handwriting roundness, and handwriting aspect ratio, Step 111 may specifically include Steps 1111 - 1115:
[0120] Step 1111: Determine the inclination difference characterization data as the difference between the handwriting inclination of the handwriting image to be recognized and the handwriting inclination of the nth sample handwriting image.
[0121] Step 1112: Determine the eccentricity difference characterization data as the difference between the handwriting eccentricity of the handwriting image to be recognized and the handwriting eccentricity of the nth sample handwriting image.
[0122] Step 1113: Determine the roundness difference characterization data as the vector distance between the handwriting roundness of the handwriting image to be recognized and the handwriting roundness of the nth sample handwriting image.
[0123] Step 1114: Determine the aspect ratio difference characterization data as the difference between the handwriting aspect ratio of the handwriting image to be recognized and the handwriting aspect ratio of the nth sample handwriting image.
[0124] Step 1115: Perform weighted summation on the inclination difference characterization data, eccentricity difference characterization data, roundness difference characterization data, and aspect ratio difference characterization data to obtain the nth physical feature distance (as shown in Equation (8)).
[0125]
[0126] In the formula, represents the nth physical feature distance (that is, the weighted distance between the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image); f1 represents the handwriting inclination of the handwriting image to be recognized; represents the handwriting inclination of the nth sample handwriting image; represents the inclination difference characterization data; f2 represents the handwriting eccentricity of the handwriting image to be recognized; represents the handwriting eccentricity of the nth sample handwriting image; represents the eccentricity difference characterization data; f3 represents the handwriting roundness of the handwriting image to be recognized; the handwriting roundness of the nth sample handwriting image; represents the roundness difference characterization data; D() represents a vector distance calculation function (for example, Euclidean distance calculation function, Euclidean weighted distance calculation function); f4 represents the handwriting aspect ratio of the handwriting image to be recognized; Denote the aspect ratio of the nth sample handwriting image; Denote the data characterizing the aspect ratio difference.
[0127] Step 112: Determine the nth physical feature similarity according to the ratio between the nth physical feature distance and the reference physical feature distance.
[0128] The above-mentioned "reference physical feature distance" refers to the physical feature distance required for normalizing the above-mentioned "nth physical feature distance"; moreover, the embodiments of the present application do not limit this "reference physical feature distance", for example, it can be preset.
[0129] For another example, in order to improve the calculation flexibility of the physical feature similarity, the above-mentioned "reference physical feature distance" can be determined according to the physical features of the handwriting image to be recognized and the physical features of N sample handwriting images; and this determination process can specifically include: first select the maximum distance from the weighted distances between the physical features of the handwriting image to be recognized and the physical features of the 1st sample handwriting image, the weighted distances between the physical features of the handwriting image to be recognized and the physical features of the 2nd sample handwriting image, the weighted distances between the physical features of the handwriting image to be recognized and the physical features of the 3rd sample handwriting image,..., and the weighted distances between the physical features of the handwriting image to be recognized and the physical features of the Nth sample handwriting image (that is, hereinafter ), as the above-mentioned "reference physical feature distance".
[0130] It should be noted that the above-mentioned "weighted distance between the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image" can be determined by using the above formula (8). Wherein, n is a positive integer, n ≤ N, and N is a positive integer.
[0131] The embodiments of the present application do not limit the implementation manner of step 112. For example, step 112 can be implemented by using formula (9).
[0132]
[0133] In the formula, Denote the nth physical feature similarity (that is, the feature similarity between the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image); and if is smaller, it indicates that the handwriting physical characterization information carried by the handwriting image to be recognized is more similar to the handwriting physical characterization information carried by the nth sample handwriting image. If is larger, it indicates that the handwriting physical characterization information carried by the handwriting image to be recognized is less similar to the handwriting physical characterization information carried by the nth sample handwriting image; Denote the nth physical feature distance; denotes the reference physical feature distance, and N represents the number of sample handwriting images.
[0134] Based on the relevant content of the above Step 11, after obtaining the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image, the feature similarity calculation process can be performed on the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image with the help of formulas (8)-(9) to obtain the nth physical feature similarity, so that the nth physical feature similarity can represent the similarity between the handwriting physical representation information carried by the handwriting image to be recognized and the handwriting physical representation information carried by the nth sample handwriting image.
[0135] Step 12: Determine the nth texture feature similarity according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image.
[0136] The above "nth texture feature similarity" is used to represent the similarity between the handwriting texture representation information carried by the handwriting image to be recognized and the handwriting texture representation information carried by the nth sample handwriting image.
[0137] In addition, the embodiments of the present application do not limit the implementation manner of Step 12. For example, it may specifically include Step 121 - Step 122:
[0138] Step 121: Determine the nth texture feature distance according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image.
[0139] The embodiments of the present application do not limit the implementation manner of Step 121. For example, it can be implemented by means of the Euclidean weighted distance (as shown in formula (10)).
[0140]
[0141] In the formula, denotes the nth texture feature distance (that is, the Euclidean weighted distance between the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image); V use denotes the texture feature of the handwriting image to be recognized, and denotes the qth eigenvalue in the texture feature of the handwriting image to be recognized; V n denotes the texture feature of the nth sample handwriting image, and denotes the qth eigenvalue in the texture feature of the nth sample handwriting image; Q represents the number of eigenvalues in a texture feature, and the embodiments of the present application do not limit Q. For example, Q = 32; δ q denotes the variance value corresponding to the qth eigenvalue, and this δq It can be obtained by performing an analysis of variance on the q-th eigenvalue of the texture features of the handwriting image to be recognized and the q-th eigenvalue of the texture features of N sample handwriting images.
[0142] Step 122: Determine the n-th texture feature similarity according to the ratio between the n-th texture feature distance and the reference texture feature distance.
[0143] The above-mentioned "reference texture feature distance" refers to the texture feature distance required for normalizing the above-mentioned "n-th texture feature distance"; and the embodiments of the present application do not limit this "reference texture feature distance", for example, it can be preset.
[0144] For another example, in order to improve the calculation flexibility of the texture feature similarity, the above-mentioned "reference texture feature distance" can be determined according to the texture features of the handwriting image to be recognized and the texture features of N sample handwriting images; and this determination process can specifically include: first select the maximum distance from the Euclidean weighted distance between the texture features of the handwriting image to be recognized and the texture features of the first sample handwriting image, the Euclidean weighted distance between the texture features of the handwriting image to be recognized and the texture features of the second sample handwriting image, the Euclidean weighted distance between the texture features of the handwriting image to be recognized and the texture features of the third sample handwriting image,..., and the Euclidean weighted distance between the texture features of the handwriting image to be recognized and the texture features of the N-th sample handwriting image (that is, below ), as the above-mentioned "reference texture feature distance".
[0145] It should be noted that the above-mentioned "Euclidean weighted distance between the texture features of the handwriting image to be recognized and the texture features of the n-th sample handwriting image" can be determined by using the above formula (10). Wherein, n is a positive integer, n ≤ N, and N is a positive integer.
[0146] The embodiments of the present application do not limit the implementation manner of step 122. For example, step 122 can be implemented by using formula (11).
[0147]
[0148] In the formula, represents the n-th texture feature similarity (that is, the feature similarity between the texture features of the handwriting image to be recognized and the texture features of the n-th sample handwriting image); and if is smaller, it means that the handwriting texture representation information carried by the handwriting image to be recognized is more similar to the handwriting texture representation information carried by the n-th sample handwriting image. If The larger it is, the less similar the handwriting texture characterization information carried by the handwriting image to be recognized is to the handwriting texture characterization information carried by the nth sample handwriting image; represents the nth texture feature distance; represents the reference texture feature distance, and N represents the number of sample handwriting images.
[0149] Based on the relevant content of the above step 12, after obtaining the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image, the feature similarity calculation process can be performed on the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image with the help of formulas (10)-(11) to obtain the nth texture feature similarity, so that the nth texture feature similarity can represent the similarity between the handwriting texture characterization information carried by the handwriting image to be recognized and the handwriting texture characterization information carried by the nth sample handwriting image.
[0150] Step 13: Determine the average value between the nth physical feature similarity and the nth texture feature similarity as the similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image (as shown in formula (12)).
[0151]
[0152] In the formula, S n represents the similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image, and if this S n is smaller, it means that the handwriting information carried by the handwriting image to be recognized is more similar to the handwriting information carried by the nth sample handwriting image. If this S n is larger, it means that the handwriting information carried by the handwriting image to be recognized is less similar to the handwriting information carried by the nth sample handwriting image; represents the nth physical feature similarity; represents the nth texture feature similarity.
[0153] Based on the relevant content of the above steps 11 to 13, after obtaining the handwriting feature to be used and the handwriting feature of the nth sample handwriting image, the "similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image" can be calculated with the help of formulas (8)-(12), so that the "similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image" can better represent the similarity between the handwriting information carried by the handwriting image to be recognized and the handwriting information carried by the nth sample handwriting image.
[0154] The above "handwriting recognition result of the handwriting image to be recognized" refers to the handwriting identity recognition result of the handwriting image to be recognized.
[0155] In addition, the embodiments of the present application do not limit the "handwriting recognition result of the handwriting image to be recognized". For example, when the above "at least one sample handwriting image" includes a target handwriting image, the similarity between the handwriting feature to be used and the handwriting feature of the target handwriting image is determined using formulas (8)-(12), and the "similarity between the handwriting feature to be used and the handwriting feature of the target handwriting image" is less than a preset similarity threshold (for example, Figure 2 in "S th "), the target handwriting image and / or the identity information corresponding to the target handwriting image can be determined as the "handwriting recognition result of the handwriting image to be recognized". Among them, the "preset similarity threshold" can be set in advance.
[0156] In addition, the embodiments of the present application do not limit the determination process of the above "handwriting recognition result of the handwriting image to be recognized". For example, it may specifically include steps 31-35:
[0157] Step 31: Initialize g to 1 (that is, g = 1).
[0158] Step 32: Obtain the handwriting feature of the g-th sample handwriting image.
[0159] The embodiments of the present application do not limit the implementation manner of step 32. For example, the handwriting feature of the g-th sample handwriting image stored in advance can be read from a preset storage space. Another example is that handwriting feature extraction can be performed on the g-th sample handwriting image to obtain the handwriting feature of the g-th sample handwriting image.
[0160] Step 33: Calculate the similarity between the handwriting feature to be used and the handwriting feature of the g-th sample handwriting image to obtain the similarity to be used.
[0161] In the embodiments of the present application, after obtaining the handwriting feature of the g-th sample handwriting image, the similarity between the handwriting feature to be used and the handwriting feature of the g-th sample handwriting image can be determined as the similarity to be used, so that the similarity to be used can represent the similarity between the handwriting information carried by the handwriting image to be recognized and the handwriting information carried by the g-th sample handwriting image.
[0162] Step 34: Determine whether the similarity to be used meets a preset similarity condition. If so, execute step 36; if not, execute step 35.
[0163] The above "preset similarity condition" can be set in advance. For example, if the above "similarity to be used" is determined with the help of the above formulas (8)-(12), the "preset similarity condition" can be: less than a preset similarity threshold.
[0164] It can be seen that for the similarity to be used determined by the above formulas (8)-(12), if the similarity to be used is less than the preset similarity threshold, it can be determined that the similarity to be used meets the preset similarity condition; if the "similarity to be used" is greater than or equal to the preset similarity threshold, it can be determined that the similarity to be used does not meet the preset similarity condition.
[0165] Based on the above related content in 34, after obtaining the similarity to be used, it is judged whether the similarity to be used meets the preset similarity condition. If it meets, it can be determined that the handwriting information carried by the g-th sample handwriting image is very similar to the handwriting information carried by the handwriting image to be recognized. Thus, it can be determined that both the g-th sample handwriting image and the handwriting image to be recognized are used to describe the handwriting of the same person. Therefore, the handwriting recognition result of the handwriting image to be recognized can be determined according to the g-th sample handwriting image. If it does not meet, it can be determined that the difference between the handwriting information carried by the g-th sample handwriting image and the handwriting information carried by the handwriting image to be recognized is relatively large. Thus, it can be determined that the g-th sample handwriting image and the handwriting image to be recognized are used to describe the handwriting of different people respectively. Furthermore, it can be determined that the g-th sample handwriting image has no reference value. Therefore, the g-th sample handwriting image can be directly discarded.
[0166] Step 35: Update g and return to execute Step 32.
[0167] In the embodiment of the present application, after determining that the similarity to be used does not meet the preset similarity condition, it can be determined that the g-th sample handwriting image has no reference value. Therefore, g can be updated according to formula (13) so that in the subsequent process, based on the updated g (that is, g′), Step 32 and its subsequent steps can be continued to execute, so as to realize the next round of handwriting comparison process.
[0168] g′ = g + 1 (13)
[0169] In the formula, g′ represents the updated g.
[0170] Step 36: Determine the handwriting recognition result of the handwriting image to be recognized according to the g-th sample handwriting image.
[0171] In the embodiment of the present application, after determining that the similarity to be used meets the preset similarity condition, it can be determined that the handwriting information carried by the g-th sample handwriting image is almost close to the handwriting information carried by the handwriting image to be recognized. Therefore, the handwriting recognition result of the handwriting image to be recognized can be determined according to the g-th sample handwriting image (for example, the g-th sample handwriting image can be determined as the handwriting recognition result of the handwriting image to be recognized. Another example is that the identity information corresponding to the g-th sample handwriting image can be determined as the handwriting recognition result of the handwriting image to be recognized. Still another example is that the g-th sample handwriting image and the identity information corresponding to the g-th sample handwriting image can be determined as the handwriting recognition result of the handwriting image to be recognized).
[0172] Based on the relevant content of the above steps 31 to 36, it can be seen that after obtaining the handwriting feature to be used, the handwriting recognition process for the handwriting image to be recognized can be realized by comparing the handwriting feature to be used with the handwriting features of multiple sample handwriting images. This is beneficial to improving the handwriting recognition effect.
[0173] Based on the relevant content of the above S1 to S3, it can be seen that for the handwriting recognition method provided in the embodiment of the present application, after obtaining the handwriting image to be recognized, the handwriting feature extraction is first performed on the handwriting image to be recognized to obtain the handwriting feature to be used, so that the handwriting feature to be used includes the physical feature and the texture feature of the handwriting image to be recognized; then, according to the similarity between the handwriting feature to be used and the handwriting features of at least one sample handwriting image, the handwriting recognition result of the handwriting image to be recognized is determined. It can be seen that because the handwriting feature to be used includes the physical feature and the texture feature of the handwriting image to be recognized, the handwriting feature to be used can more accurately describe the handwriting information carried by the handwriting image to be recognized, so that the handwriting recognition result determined based on the handwriting feature to be used is more accurate, thus improving the handwriting recognition effect.
[0174] Method Embodiment 2
[0175] In fact, when using an image acquisition device to collect image data, it is very likely to introduce noise, so that the collected image data carries noise data. Therefore, in order to avoid the adverse impact of noise data on the handwriting recognition process, the embodiment of the present application also provides another possible implementation manner for obtaining the above-mentioned "handwriting image to be recognized", which specifically may include steps 41-42:
[0176] Step 41: After obtaining the original handwriting image, perform denoising processing on the original handwriting image to obtain a denoised handwriting image.
[0177] The embodiments of the present application do not limit the implementation manner of step 41. For example, any existing or future image denoising method (such as median filtering, three-color component histogram method, mean filtering, etc.) can be used for implementation.
[0178] In addition, in order to further improve the image denoising effect, another possible implementation manner of step 41 is provided in the embodiments of the present application, which may specifically include steps 411-step 412:
[0179] Step 411: Determine the weight to be used according to the original handwriting image.
[0180] The above "weight to be used" refers to the weight required for low-rank clustering processing of the original handwriting image. For example, if the low-rank clustering processing is implemented by means of the Weighted Nuclear Norm Minimization (WNNM) method, then the "weight to be used" includes the weight values related to the singular values in WNNM.
[0181] In addition, in order to improve the denoising effect, another possible implementation manner of step 411 is provided in the embodiments of the present application, which may specifically include steps 4111-step 4114:
[0182] Step 4111: Perform empirical mode decomposition (EMD) on the original handwriting image to obtain the component to be used.
[0183] The embodiments of the present application do not limit the implementation manner of EMD, and any existing or future EMD can be used for implementation.
[0184] The embodiments of the present application also do not limit the determination process of the above "component to be used". For example, it may specifically include: first performing EMD on the original handwriting image to obtain at least one intrinsic mode function (IMF) component sorted from high frequency to low frequency, so that each IMF component represents each frequency component in the original signal (that is, the original handwriting image); then determining the IMF component with the highest frequency as the component to be used (that is, determining the IMF1 component as the component to be used).
[0185] Step 4112: Perform block processing on the component to be used to obtain at least one first image block.
[0186] The above "first image block" is used to represent the image information carried by a part of the area in the component to be used; and the embodiments of the present application do not limit the number of the "first image block". For example, it may be J, where J is a positive integer.
[0187] It should be noted that the embodiments of the present application do not limit the implementation manner of "block processing". For example, any existing or future method capable of performing block processing on an image data can be used for implementation.
[0188] Step 4113: Determine the noise variance of each first image block.
[0189] It should be noted that the embodiments of the present application do not limit the determination process of "noise variance". Any existing or future method capable of performing noise variance calculation processing on an image block can be used for implementation.
[0190] Step 4114: Determine the weight to be used according to the noise variances of at least one first image block.
[0191] As an example, when the above "at least one first image block" includes J first image blocks, step 4114 may specifically include steps 41141 - 41142:
[0192] Step 41141: Search for the weight value corresponding to the noise variance of the j-th first image block from the preset mapping relationship. Where j is a positive integer, j ≤ J, and J is a positive integer.
[0193] The above "preset mapping relationship" is used to record the weight values corresponding to each candidate noise variance interval; and the embodiments of the present application do not limit this "preset mapping relationship". For example, it may specifically include: the correspondence between the first candidate noise variance interval and the first weight value, the correspondence between the second candidate noise variance interval and the second weight value,..., and the correspondence between the T-th candidate noise variance interval and the T-th weight value. Where T is a positive integer.
[0194] It can be seen that after obtaining the noise variance of the j-th first image block, the "noise variance of the j-th first image block" can be respectively matched with the T candidate noise variance intervals in the preset mapping relationship to obtain a variance matching result; if the variance matching result indicates that the "noise variance of the j-th first image block" belongs to the target variance interval, the weight value corresponding to the target variance interval is determined as the weight value corresponding to the "noise variance of the j-th first image block". Based on this, it can be known that the above "preset mapping relationship" records the correspondence between the noise variance of the j-th first image block and the weight value corresponding to the noise variance of the j-th first image block. Where j is a positive integer, j ≤ J, and J is a positive integer.
[0195] In addition, the embodiments of the present application do not limit the construction process of the above "preset mapping relationship". For example, it can be manually constructed by relevant personnel.
[0196] Step 41142: Aggregate the weight values corresponding to the noise variances of the J first image patches to obtain the weight to be used.
[0197] In the embodiments of the present application, after obtaining the weight values corresponding to the noise variances of the 1st to Jth first image patches, the weight values corresponding to the noise variances of the J first image patches can be aggregated to obtain the weight to be used, so that the weight to be used includes the weight values corresponding to the noise variances of the J first image patches, thereby enabling the weight to be used to better represent the noise suppression weights adopted for different regions in the original handwriting image.
[0198] Based on the relevant content of the above Step 411, after obtaining the original handwriting image, the weight to be used can be determined with reference to the local noise of the original handwriting image, so that the weight to be used can better represent the noise suppression weights adopted for different regions in the original handwriting image, thereby enabling subsequent use of the weight to be used to better suppress the noise data carried by different regions in the original handwriting image.
[0199] Step 412: Perform low-rank clustering processing on the original handwriting image according to the weight to be used to obtain a denoised handwriting image.
[0200] The embodiments of the present application do not limit the implementation manner of the above "low-rank clustering processing". For example, it can be implemented by means of WNNM.
[0201] In addition, in order to improve the denoising effect, the embodiments of the present application propose a dynamic weighted nuclear norm minimization (DWNNM). For ease of understanding, the following takes a possible implementation manner of Step 412 as an example for illustration.
[0202] As an example, when the above "weight to be used" includes J image patch weights, Step 412 may specifically include Steps 4121 - 4129:
[0203] Step 4121: Initialize the noise-free image and the image to be processed according to the original handwriting image (as shown in Formulas (14)-(15)).
[0204]
[0205]
[0206] In the formula, represents the initialization value of the noise-free image (that is, the "noise-free image after the 0th update" shown below), and this is a matrix; represents the initialization value of the image to be processed (i.e., the "image to be processed after the 0th update" shown below), and this is a matrix; M original represents the original handwriting image (i.e., the original signal).
[0207] Step 4122: Update the image to be processed according to the original handwriting image and the denoised image (as shown in Equation (16)).
[0208]
[0209] In the formula, represents the image to be processed after the lth update; represents the denoised image after the (l - 1)th update; represents the image to be processed after the (l - 1)th update; M original represents the original handwriting image; δ() is a function, and for the relevant content of this δ(), please refer to the relevant content of the δ() function in WNNM; l is a positive integer, and 1 ≤ l.
[0210] Step 4123: Perform block processing on the image to be processed to obtain J second image blocks.
[0211] The above-mentioned "second image block" is used to represent the image information carried by a partial area of the image to be processed.
[0212] It should be noted that the implementation manner of Step 4123 is similar to the implementation manner of Step 4112 above.
[0213] Step 4124: Perform block matching processing on the jth second image block to obtain the jth set of similar blocks. Where j is a positive integer, j ≤ J.
[0214] The above-mentioned "jth set of similar blocks" is composed of the jth second image block and all other second image blocks in the J second image blocks that are similar to the jth second image block.
[0215] The embodiments of the present application do not limit the implementation manner of the above-mentioned "block matching processing". For example, any existing or future block matching method (for example, the method for determining a set of similar image blocks shown in WNNM) can be used for implementation.
[0216] Step 4125: Perform singular value decomposition on the jth set of similar blocks to obtain the jth decomposition result (as shown in Equation (17)). Where j is a positive integer, j ≤ J.
[0217] [U, Σ, V] = SVD(Y j ) (17)
[0218] where [U, Σ, V] represents the j-th decomposition result; Y j represents the j-th set of similar blocks; SVD() represents the singular value decomposition function.
[0219] It should be noted that for the relevant content of formulas (14)-(17), please refer to the corresponding content in WNNM.
[0220] Step 4126: Determine the j-th estimated value according to the j-th image block weight in the weights to be used and the j-th decomposition result (as shown in formula (18)). Here, j is a positive integer, and j ≤ J.
[0221] X j = Uw j (Σ)V T (18)
[0222] where X j represents the j-th estimated value; [U, Σ, V] represents the j-th decomposition result; w j represents the j-th image block weight in the weights to be used (that is, the weight value corresponding to the noise variance of the j-th first image block mentioned above); V T represents the transpose of V.
[0223] Step 4127: Update the noise-free image according to the J estimated values.
[0224] In the embodiments of the present application, after obtaining the 1st to J-th estimated values, these J estimated values can be integrated to obtain an updated noise-free image (for example, ), so that the updated noise-free image carries less noise data.
[0225] Step 4128: Determine whether the preset stop condition is reached. If so, execute Step 4129; if not, return to execute Step 4122.
[0226] The above "preset stop condition" can be preset. For example, specifically, it can be: the number of updates reaches a preset number threshold (that is, l = L). It should be noted that "L" represents the preset number threshold; and L can be preset in advance. Here, L is a positive integer.
[0227] It can be seen that after updating the noise-free image, it can be determined whether the number of updates of this noise-free image reaches the preset number threshold. If it reaches, it can be determined that the updated noise-free image hardly carries any noise data. Therefore, the denoised handwriting image can be directly determined according to the updated noise-free image (for example, ); if not, it can be determined that the updated noise-free image still carries noise data. Therefore, Step 4122 and its related steps can be continued to implement the next round of image denoising processing.
[0228] Step 4129: Determine the denoised handwriting image based on the noise-free image.
[0229] In the embodiments of the present application, after determining that the preset stop condition is met (for example, the number of updates of the noise-free image reaches the preset number threshold), the noise-free image (for example, ) can be directly determined as the denoised handwriting image, so that the denoised handwriting image hardly carries noise data, thus effectively avoiding the adverse effects caused by noise data on subsequent handwriting recognition processing.
[0230] Based on the relevant content of Step 41 above, after obtaining the original handwriting image collected by the image acquisition device, the DWNNM can be used to perform denoising processing on the original handwriting image to obtain a denoised handwriting image, so that the denoised handwriting image hardly carries noise data, thus effectively avoiding the adverse effects caused by noise data on subsequent handwriting recognition processing.
[0231] Step 42: Determine the handwriting image to be recognized based on the denoised handwriting image.
[0232] The embodiments of the present application do not limit the implementation manner of Step 42. For example, it may specifically include: directly determining the denoised handwriting image as the handwriting image to be recognized.
[0233] In fact, there may be a large number of blank areas in the denoised handwriting image. Therefore, in order to avoid the adverse effects caused by the blank areas on subsequent handwriting recognition processing, the embodiments of the present application also provide another possible implementation manner of Step 42, which may specifically include Steps 421 - 422:
[0234] Step 421: Perform blank deletion processing on the denoised handwriting image to obtain a blank-free image.
[0235] As an example, Step 421 may specifically include Steps 4211 - 4213:
[0236] Step 4211: Perform grayscale processing on the denoised handwriting image to obtain a grayscale image.
[0237] The above "grayscale image" refers to the grayscale map of the denoised handwriting image; and the embodiments of the present application do not limit the determination process of the above "grayscale image". For example, for each pixel point in the denoised handwriting image, first set R = G = B = (R + B + G) / 3 for each pixel point; then convert the average value into the corresponding grayscale level to complete the grayscale processing of the handwriting image and obtain a grayscale image. Another example is that any existing or future grayscale map conversion method can also be used for implementation.
[0238] Step 4212: Binarize the grayscale image to obtain a binarized image.
[0239] The above-mentioned "binarized image" refers to the black-and-white binarized image of the denoised handwriting image; and the embodiments of the present application do not limit the determination process of the above-mentioned "binarized image". For example, specifically, for each pixel point in the grayscale image, the grayscale value of the pixel point can be compared with a preset grayscale threshold. If the grayscale value of the pixel point is greater than the preset grayscale threshold, the pixel point is set to a first pixel value (for example, a pixel value representing white); if the grayscale value of the pixel point is not greater than the preset grayscale threshold, the pixel point is set to a second pixel value (for example, a pixel value representing black), so as to complete the purpose of converting the grayscale image into a black-and-white binarized image and obtain a binarized image. Another example is that any existing or future binarized image conversion method can also be used for implementation.
[0240] Step 4213: Delete the regions that meet the preset blank conditions from the binarized image to obtain a blank-removed image.
[0241] The above-mentioned "preset blank conditions" can be preset. For example, the blank row and column screening conditions shown in the following steps 42131-step 42137 can be adopted.
[0242] The embodiments of the present application do not limit the implementation manner of step 4213. For example, when the size of the above-mentioned "binarized image" is I×K, step 4213 specifically may include steps 42131-step 42137:
[0243] Step 42131: Sum the pixel values of all pixel points in the i-th row of the binarized image to obtain the pixel characterization data of the i-th row (such as Figure 2 in "H i "). Wherein, i is a positive integer, i≤I, and I is a positive integer.
[0244] Step 42132: Determine the blank recognition result of the i-th row according to the pixel characterization data of the i-th row. Wherein, i is a positive integer, i≤I, and I is a positive integer.
[0245] The above-mentioned "blank recognition result of the i-th row" is used to indicate whether the i-th row in the binarized image is a blank row; and the embodiments of the present application do not limit the determination process of the "blank recognition result of the i-th row". For example, specifically, it may include: if the pixel characterization data of the i-th row is higher than a preset pixel threshold (such as Figure 2 in "H th”), then determine the first annotation label (e.g., “1”) as the “blank recognition result of the i-th row” so that the “blank recognition result of the i-th row” indicates that the i-th row is a blank row; if the pixel representation data of the i-th row is not higher than the preset pixel threshold, then determine the second annotation label (e.g., “0”) as the “blank recognition result of the i-th row” so that the “blank recognition result of the i-th row” indicates that the i-th row is not a blank row.
[0246] Step 42133: Determine at least one blank row according to the blank recognition results of the first row to the I-th row.
[0247] In the embodiment of the present application, after obtaining the blank recognition result of the i-th row in the binarized image, if the blank recognition result of the i-th row meets the preset blank row condition (e.g., it is “1”), then determine the i-th row as a blank row; if the blank recognition result of the i-th row does not meet the preset blank row condition, then just discard the i-th row. Wherein, i is a positive integer, i ≤ I, and I is a positive integer.
[0248] Step 42134: Add up the pixel values of all the pixel points in the k-th column of the binarized image to obtain the pixel representation data of the k-th column (such as Figure 2 “V k ”). Wherein, k is a positive integer, k ≤ K, and K is a positive integer.
[0249] Step 42135: Determine the blank recognition result of the k-th column according to the pixel representation data of the k-th column. Wherein, k is a positive integer, k ≤ K, and K is a positive integer.
[0250] The above “blank recognition result of the k-th column” is used to indicate whether the k-th column in the binarized image is a blank column; and the embodiment of the present application does not limit the determination process of the “blank recognition result of the k-th column”. For example, it may specifically include: if the pixel representation data of the k-th column is higher than the preset pixel threshold (such as Figure 2 “V th ”), then determine the first annotation label (e.g., “1”) as the “blank recognition result of the k-th column” so that the “blank recognition result of the k-th column” indicates that the k-th column is a blank column; if the pixel representation data of the k-th column is not higher than the preset pixel threshold, then determine the second annotation label (e.g., “0”) as the “blank recognition result of the k-th column” so that the “blank recognition result of the k-th column” indicates that the k-th column is not a blank column.
[0251] Step 42136: Determine at least one blank column according to the blank recognition results of the first column to the K-th column.
[0252] In the embodiments of the present application, after obtaining the blank recognition result of the k-th column in the binary image, if the blank recognition result of the k-th column meets the preset blank column condition (for example, it is "1"), then the k-th column is determined as a blank column; if the blank recognition result of the k-th column does not meet the preset blank column condition, then the k-th column can be discarded. Wherein, k is a positive integer, k ≤ K, and K is a positive integer.
[0253] Step 42137: Delete at least one blank row and at least one blank column from the binary image to obtain a blank-removed image.
[0254] Based on the relevant content of the above Step 421, it can be known that after obtaining the denoised handwriting image, blank-removing processing can be performed on the denoised handwriting image to obtain a blank-removed image, so that there are fewer blank areas in the blank-removed image, which can effectively avoid the adverse effects caused by the blank areas on the subsequent handwriting recognition processing, and thus is beneficial to improving the handwriting recognition effect.
[0255] Step 422: Determine the handwriting image to be recognized according to the blank-removed image.
[0256] The embodiments of the present application do not limit the implementation manner of Step 422. For example, specifically, it can be: directly determine the blank-removed image as the handwriting image to be recognized.
[0257] In addition, the blank-removed image may carry very little handwriting information. Therefore, in order to avoid the adverse effects caused by the small number of handwritings on the subsequent handwriting recognition processing, the embodiments of the present application also provide another possible implementation manner of Step 422, which may specifically include Step 4221 - Step 4227:
[0258] Step 4221: Determine whether the blank-removed image meets the preset texture condition. If so, execute Step 4222; if not, execute Step 4223 - Step 4227.
[0259] The above "preset texture condition" can be preset. For example, it may include: the number of handwritings (for example, the number of characters) in the blank-removed image reaches a preset quantity threshold.
[0260] It can be seen that after obtaining the blank-removed image, it can be determined whether the number of handwritings in the blank-removed image reaches the preset quantity threshold. If it reaches, it means that the blank-removed image meets the preset texture condition, so the blank-removed image can be directly determined as the handwriting image to be recognized, so as to perform handwriting recognition processing on the handwriting image to be recognized subsequently; if it does not reach, it means that the number of handwritings in the blank-removed image is still relatively small, so the texture enhancement processing of the blank-removed image can be realized by means of Step 4223 - Step 4227 to overcome the adverse effects caused by the small number of handwritings on the subsequent handwriting recognition processing.
[0261] Step 4222: Determine the blank-removed image as the handwriting image to be recognized.
[0262] In the embodiment of the present application, after determining that the blank-removed image meets the preset texture condition, it can be determined that there is sufficient handwriting information in the blank-removed image. Therefore, the blank-removed image can be directly determined as the handwriting image to be recognized, so as to be able to perform handwriting recognition processing on the handwriting image to be recognized with the help of S2-S3 above.
[0263] Step 4223: Initialize the image to be filled according to the blank-removed image.
[0264] In the embodiment of the present application, after determining that the blank-removed image does not meet the preset texture condition, it can be determined that the handwriting information in the blank-removed image is insufficient. Therefore, the blank-removed image can be used to initialize the image to be filled (for example, directly determining the blank-removed image as the image to be filled), so as to be able to perform texture enhancement processing on the blank-removed image with the help of the texture filling process of the image to be filled.
[0265] Step 4224: Determine the filling start position according to the image to be filled.
[0266] The above-mentioned "filling start position" is used to represent the filling starting point required when performing texture filling on the image to be filled; and the embodiment of the present application does not limit the determination process of the "filling start position". For example, it may specifically include: first locating the last line including character information in the image to be filled to obtain the texture lower boundary line; and then obtaining the filling start position according to the texture lower boundary line and the preset line interval, so that the filling start position is used to represent the first line in the texture filling area.
[0267] Step 4225: Update the image to be filled according to the texture to be used and the filling start position.
[0268] The above-mentioned "texture to be used" refers to the texture information required when performing texture filling on the image to be filled; and the embodiment of the present application does not limit the "texture to be used". For example, it can be preset.
[0269] In addition, in order to improve the handwriting recognition effect, the above-mentioned "texture to be used" can be determined according to the blank-removed image; and the embodiment of the present application does not limit the determination process of the "texture to be used". For example, it may specifically include: determining all the handwriting information (that is, characters) in the blank-removed image as the texture to be used.
[0270] The embodiments of the present application do not limit the implementation manner of step 4225. For example, it may specifically include: filling the texture to be used into the image to be filled according to the filling start position to obtain the updated image to be filled, so that the updated image to be filled has the texture to be used more than the image to be filled before the update, thereby making the number of handwriting in the updated image to be filled higher than that in the image to be filled before the update.
[0271] Step 4226: Determine whether the image to be filled meets the preset texture condition. If so, execute step 4227; if not, return to execute step 4224.
[0272] In the embodiments of the present application, after updating the image to be filled, it can be determined whether the updated image to be filled meets the preset texture condition. If it meets, it can be determined that there is sufficient handwriting information in the updated image to be filled. Therefore, the updated image to be filled can be directly determined as the handwriting image to be recognized, so as to realize the handwriting recognition process for the handwriting image to be recognized with the help of S2-S3 above; if it does not meet, it can be determined that the handwriting information in the updated image to be filled is still insufficient. Therefore, step 4224 and its subsequent steps can be continued to implement the next round of texture filling process for the image to be filled.
[0273] Step 4227: Determine the image to be filled as the handwriting image to be recognized.
[0274] In the embodiments of the present application, when it is determined that the image to be filled in the current round meets the preset texture condition, it can be determined that there is sufficient handwriting information in the image to be filled. Therefore, the updated image to be filled can be directly determined as the handwriting image to be recognized, so as to realize the handwriting recognition process for the handwriting image to be recognized with the help of S2-S3 above.
[0275] Based on the relevant content of steps 4221 to 4227 above, after obtaining the blank-removed image, if the handwriting information in the blank-removed image is insufficient, texture enhancement processing can be performed on the blank-removed image to obtain the handwriting image to be recognized, so that the handwriting image to be recognized has sufficient handwriting information. In this way, the adverse impact caused by the small number of handwriting on the subsequent handwriting recognition process can be effectively avoided, which is conducive to improving the handwriting recognition effect.
[0276] Based on the relevant content of the above steps 41 to 42, after obtaining the original handwriting image collected by the image acquisition device, the original handwriting image can be first denoised to obtain a denoised handwriting image, so that the denoised handwriting image hardly carries noise data; then, based on the denoised handwriting image, a handwriting image to be recognized is determined, so that the handwriting image to be recognized can better represent the handwriting information in the original handwriting image, so as to realize the handwriting recognition process for the original handwriting image with the help of S2 - S3 above (such as Figure 2 as shown), which is beneficial to improving the handwriting recognition effect.
[0277] Based on the handwriting recognition method provided in the above method embodiment, the embodiment of the present application also provides a handwriting recognition device, which will be explained and described below with reference to the drawings.
[0278] Device Embodiment
[0279] For the introduction of the handwriting recognition device in the device embodiment, please refer to the above method embodiment for relevant content.
[0280] See Figure 3 , this figure is a schematic structural diagram of a handwriting recognition device provided by an embodiment of the present application.
[0281] The handwriting recognition device 300 provided by the embodiment of the present application includes:
[0282] An image acquisition unit 301, configured to acquire a handwriting image to be recognized;
[0283] A feature extraction unit 302, configured to extract handwriting features from the handwriting image to be recognized to obtain handwriting features to be used; wherein, the handwriting features to be used include physical features of the handwriting image to be recognized and texture features of the handwriting image to be recognized;
[0284] A handwriting recognition unit 303, configured to determine a handwriting recognition result of the handwriting image to be recognized according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image; wherein, the handwriting features of each sample handwriting image include physical features of each sample handwriting image and texture features of each sample handwriting image.
[0285] In a possible implementation manner, the number of the sample handwriting images is N;
[0286] The handwriting recognition device 300 further includes:
[0287] A similarity determination unit is configured to determine the nth physical feature similarity according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image, where n is a positive integer, n ≤ N, and N is a positive integer; determine the nth texture feature similarity according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image; and determine the average value between the nth physical feature similarity and the nth texture feature similarity as the similarity between the handwriting feature to be used and the handwriting feature of the nth sample handwriting image.
[0288] In a possible implementation manner, the similarity determination unit includes a first determination subunit and / or a second determination subunit;
[0289] The first determination subunit is configured to determine the nth physical feature distance according to the physical features of the handwriting image to be recognized and the physical features of the nth sample handwriting image; determine the nth physical feature similarity according to the ratio between the nth physical feature distance and the reference physical feature distance, where the reference physical feature distance is determined according to the physical features of the handwriting image to be recognized and the physical features of N sample handwriting images;
[0290] The second determination subunit is configured to determine the nth texture feature distance according to the texture features of the handwriting image to be recognized and the texture features of the nth sample handwriting image; determine the nth texture feature similarity according to the ratio between the nth texture feature distance and the reference texture feature distance, where the reference texture feature distance is determined according to the texture features of the handwriting image to be recognized and the texture features of N sample handwriting images.
[0291] In a possible implementation manner, the physical features include at least one of handwriting inclination, handwriting eccentricity, handwriting roundness, and handwriting aspect ratio.
[0292] In a possible implementation manner, the image acquisition unit 301 includes:
[0293] A denoising subunit is configured to perform denoising processing on the original handwriting image after the original handwriting image is acquired to obtain a denoised handwriting image;
[0294] A third determination subunit is configured to determine the handwriting image to be recognized according to the denoised handwriting image.
[0295] In a possible implementation manner, the denoising subunit includes:
[0296] A fourth determination subunit is configured to determine the weight to be used according to the original handwriting image;
[0297] A low-rank clustering subunit, configured to perform low-rank clustering processing on the original handwriting image according to the weight to be used, so as to obtain a denoised handwriting image.
[0298] In a possible implementation manner, the fourth determination subunit includes:
[0299] A mode decomposition subunit, configured to perform empirical mode decomposition on the original handwriting image to obtain components to be used;
[0300] A signal block division subunit, configured to perform block division on the components to be used to obtain at least one first image block;
[0301] A fifth determination subunit, configured to determine the noise variance of each of the first image blocks;
[0302] A sixth determination subunit, configured to determine the weight to be used according to the noise variance of the at least one first image block.
[0303] In a possible implementation manner, the number of the first image blocks is J;
[0304] The sixth determination subunit is specifically configured to: look up the weight value corresponding to the noise variance of the jth first image block from a preset mapping relationship; wherein the preset mapping relationship includes the correspondence between the noise variance of the jth first image block and the weight value corresponding to the noise variance of the jth first image block; j is a positive integer, j ≤ J, and J is a positive integer; perform set processing on the weight values corresponding to the noise variances of the J first image blocks to obtain the weight to be used.
[0305] In a possible implementation manner, the weight to be used includes J image block weights; wherein J is a positive integer;
[0306] The low-rank clustering subunit is specifically configured to: initialize a noise-free image and an image to be processed according to the original handwriting image; update the image to be processed according to the original handwriting image and the noise-free image; perform block division on the image to be processed to obtain J second image blocks; perform block matching processing on the jth second image block to obtain the jth set of similar blocks; wherein j is a positive integer, j ≤ J; perform singular value decomposition on the jth set of similar blocks to obtain the jth decomposition result; wherein j is a positive integer, j ≤ J; determine the jth estimated value according to the jth image block weight in the weight to be used and the jth decomposition result; wherein j is a positive integer, j ≤ J; update the noise-free image according to the J estimated values, and continue to execute the step of updating the image to be processed according to the original handwriting image and the noise-free image until, when a preset stop condition is reached, determine the denoised handwriting image according to the noise-free image.
[0307] In a possible implementation manner, the third determination subunit includes:
[0308] A blank deletion subunit, configured to perform blank deletion processing on the denoised handwriting image to obtain a blank-removed image;
[0309] A seventh determination subunit, configured to determine the handwriting image to be recognized according to the blank-removed image.
[0310] In a possible implementation manner, the blank deletion subunit is specifically configured to: perform grayscale processing on the denoised handwriting image to obtain a grayscale image; perform binarization processing on the grayscale image to obtain a binarized image; delete regions that meet the preset blank condition from the binarized image to obtain the blank-removed image.
[0311] In a possible implementation manner, the seventh determination subunit is specifically configured to: if it is determined that the blank-removed image does not meet the preset texture condition, initialize a to-be-filled image according to the blank-removed image; determine a filling start position according to the to-be-filled image; update the to-be-filled image according to the texture to be used and the filling start position, and continue to execute the step of determining the filling start position according to the to-be-filled image until when it is determined that the to-be-filled image meets the preset texture condition, determine the to-be-filled image as the handwriting image to be recognized; wherein, the texture to be used is determined according to the blank-removed image.
[0312] Furthermore, an embodiment of the present application further provides a device, including: a processor, a memory, and a system bus;
[0313] The processor and the memory are connected through the system bus;
[0314] The memory is used to store one or more programs, and the one or more programs include instructions, and when the instructions are executed by the processor, the processor is caused to execute any implementation method of the above handwriting recognition method.
[0315] Furthermore, an embodiment of the present application further provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions run on a terminal device, the terminal device is caused to execute any implementation method of the above handwriting recognition method.
[0316] Furthermore, an embodiment of the present application further provides a computer program product, and when the computer program product runs on a terminal device, the terminal device is caused to execute any implementation method of the above handwriting recognition method.
[0317] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present application.
[0318] It should be noted that the various embodiments in this specification are described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple. For the relevant parts, reference can be made to the description in the method part.
[0319] It should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the said element.
[0320] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be obvious to those skilled in the art. The general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A handwriting recognition method, characterized in that, The method includes: Obtaining a handwriting image to be recognized; Extracting handwriting features from the handwriting image to be recognized to obtain handwriting features to be used; wherein, the handwriting features to be used include physical features and texture features of the handwriting image to be recognized, and the physical features include handwriting inclination, handwriting eccentricity, handwriting roundness, and handwriting aspect ratio; Determining a handwriting recognition result of the handwriting image to be recognized according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image; wherein, the handwriting features of each sample handwriting image include physical features and texture features of each sample handwriting image, and the number of sample handwriting images is N; The process of determining the similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image includes: performing weighted summation on the difference between the handwriting inclination of the handwriting image to be recognized and the handwriting inclination of the nth sample handwriting image, the difference between the handwriting eccentricity of the handwriting image to be recognized and the handwriting eccentricity of the nth sample handwriting image, the vector distance between the handwriting roundness of the handwriting image to be recognized and the handwriting roundness of the nth sample handwriting image, and the difference between the handwriting aspect ratio of the handwriting image to be recognized and the handwriting aspect ratio of the nth sample handwriting image to obtain the nth physical feature distance; determining the nth physical feature similarity according to the ratio between the nth physical feature distance and the reference physical feature distance, where n is a positive integer, n ≤ N, N is a positive integer, and the reference physical feature distance is determined based on the maximum value among the first physical feature distance and the Nth physical feature distance; determining the nth texture feature distance according to the texture features of the handwriting image to be recognized and the nth sample handwriting image, and determining the nth texture feature similarity according to the ratio between the nth texture feature distance and the reference texture feature distance, where the reference texture feature distance is determined based on the maximum value among the first texture feature distance to the Nth texture feature distance, and determining the average value between the nth physical feature similarity and the nth texture feature similarity as the similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image.
2. The method according to claim 1, wherein The process of obtaining the handwriting image to be recognized includes: After obtaining the original handwriting image, performing denoising processing on the original handwriting image to obtain a denoised handwriting image; Determining the handwriting image to be recognized according to the denoised handwriting image.
3. The method according to claim 2, wherein The performing denoising processing on the original handwriting image to obtain a denoised handwriting image includes: Determining a weight to be used according to the original handwriting image; Performing low-rank clustering processing on the original handwriting image according to the weight to be used to obtain a denoised handwriting image.
4. The method according to claim 3, wherein The process of determining the weight to be used includes: Performing empirical mode decomposition on the original handwriting image to obtain components to be used; Performing block processing on the components to be used to obtain at least one first image block; Determining the noise variance of each first image block; Determine the weight to be used according to the noise variance of the at least one first image block.
5. The method according to claim 4, wherein The number of the first image blocks is J; The determining the weight to be used according to the noise variance of the at least one first image block includes: Look up the weight value corresponding to the noise variance of the j-th first image block from a preset mapping relationship; wherein, the preset mapping relationship includes the corresponding relationship between the noise variance of the j-th first image block and the weight value corresponding to the noise variance of the j-th first image block; j is a positive integer, j ≤ J, and J is a positive integer; Perform a set process on the weight values corresponding to the noise variances of the J first image blocks to obtain the weight to be used.
6. The method according to claim 3, characterized in that The weight to be used includes J image block weights; wherein, J is a positive integer; The performing low-rank clustering processing on the original handwriting image according to the weight to be used to obtain the denoised handwriting image includes: Initialize a noise-free image and an image to be processed according to the original handwriting image; Update the image to be processed according to the original handwriting image and the noise-free image; Perform a block process on the image to be processed to obtain J second image blocks; Perform a block matching process on the j-th second image block to obtain the j-th set of similar blocks; wherein, j is a positive integer, j ≤ J; Perform singular value decomposition on the j-th set of similar blocks to obtain the j-th decomposition result; wherein, j is a positive integer, j ≤ J; Determine the j-th estimated value according to the j-th image block weight in the weight to be used and the j-th decomposition result; wherein, j is a positive integer, j ≤ J; Update the noise-free image according to the J estimated values, and continue to execute the step of updating the image to be processed according to the original handwriting image and the noise-free image until, when a preset stop condition is reached, determine the denoised handwriting image according to the noise-free image.
7. The method according to any one of claims 2-6, characterized in that, The determining the handwriting image to be recognized according to the denoised handwriting image includes: Perform a blank deletion process on the denoised handwriting image to obtain a blank-removed image; Determine the handwriting image to be recognized according to the blank-removed image.
8. The method according to claim 7, wherein The process of determining the blank-removed image includes: Perform grayscale processing on the denoised handwriting image to obtain a grayscale image; Perform binarization processing on the grayscale image to obtain a binarized image; Delete the regions that meet the preset blank conditions from the binarized image to obtain the blank-removed image.
9. The method according to claim 7, wherein The determining the handwriting image to be recognized according to the blank-removed image includes: If it is determined that the blank-removed image does not meet the preset texture conditions, then initialize an image to be filled according to the blank-removed image; Determine the filling start position according to the image to be filled; Update the image to be filled according to the texture to be used and the filling start position, and continue to execute the step of determining the filling start position according to the image to be filled until, when it is determined that the image to be filled meets the preset texture conditions, determine the image to be filled as the handwriting image to be recognized; wherein, the texture to be used is determined according to the blank-removed image.
10. A handwriting recognition device, characterized in that, Includes: An image acquisition unit, configured to acquire a handwriting image to be recognized; A feature extraction unit for extracting handwriting features from the handwriting image to be recognized to obtain handwriting features to be used; wherein, the handwriting features to be used include physical features and texture features of the handwriting image to be recognized, and the physical features include handwriting inclination, handwriting eccentricity, handwriting roundness, and handwriting aspect ratio; A handwriting recognition unit for determining a handwriting recognition result of the handwriting image to be recognized according to the similarity between the handwriting features to be used and the handwriting features of at least one sample handwriting image; wherein, the handwriting features of each sample handwriting image include physical features and texture features of each sample handwriting image, and the number of sample handwriting images is N; the process of determining the similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image includes: weighting and summing the difference between the handwriting inclination of the handwriting image to be recognized and the handwriting inclination of the nth sample handwriting image, the difference between the handwriting eccentricity of the handwriting image to be recognized and the handwriting eccentricity of the nth sample handwriting image, the vector distance between the handwriting roundness of the handwriting image to be recognized and the handwriting roundness of the nth sample handwriting image, and the difference between the handwriting aspect ratio of the handwriting image to be recognized and the handwriting aspect ratio of the nth sample handwriting image to obtain the nth physical feature distance; determining the nth physical feature similarity according to the ratio between the nth physical feature distance and the reference physical feature distance, where n is a positive integer, n ≤ N, N is a positive integer, and the reference physical feature distance is determined based on the maximum value among the first physical feature distance and the Nth physical feature distance; determining the nth texture feature distance according to the texture feature of the handwriting image to be recognized and the texture feature of the nth sample handwriting image, and determining the nth texture feature similarity according to the ratio between the nth texture feature distance and the reference texture feature distance, where the reference texture feature distance is determined based on the maximum value among the first texture feature distance to the Nth texture feature distance, and determining the average value between the nth physical feature similarity and the nth texture feature similarity as the similarity between the handwriting features to be used and the handwriting features of the nth sample handwriting image.
11. A device, characterized in that, The device includes: a processor, a memory, and a system bus; The processor and the memory are connected through the system bus; The memory is used to store one or more programs, and the one or more programs include instructions that, when executed by the processor, cause the processor to execute the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, Instructions are stored in the computer-readable storage medium, and when the instructions are run on the terminal device, the terminal device is caused to execute the method according to any one of claims 1 to 9.
13. A computer program product, characterized in that, When the computer program product runs on the terminal device, the terminal device is caused to execute the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Image retrieval method and device
CN104572971A
Magnetic resonance image denoising method and device based on non-local prior and sparse representation
CN111340699A
Chinese text handwriting recognition method and device based on macro and micro features and storage medium
CN112766082A