Handwritten Text Quality Detection Method, Apparatus, Device, and Storage Medium

By obtaining the size of handwritten characters and using the preset search tree for scale adjustment and feature vector generation, the problem of the impact of handwritten characters' quality detection in Chinese characters is solved, and more accurate writing score calculation is achieved.

CN113283389BActive Publication Date: 2025-07-22CHINA PING AN LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110704348.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-24
Publication Date
2025-07-22
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

The existing handwritten text quality detection methods fail to effectively consider the impact of text size on the detection results, resulting in inaccurate detection results.

Method used

By obtaining the text size in the image to be detected, using the preset search tree to match the standard text and scale adjustment, the target feature vector is generated, and the writing score is calculated.

Benefits of technology

Improve the accuracy of writing scores to ensure the accuracy and consistency of the test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113283389B_ABST
    Figure CN113283389B_ABST
Patent Text Reader

Abstract

The present invention relates to artificial intelligence, and provides a method, device, equipment and storage medium for detecting the quality of handwritten text. The method can obtain an image to be detected, recognize the text to be detected in the image to be detected, determine the text size of the text to be detected in the image to be detected as the text size to be detected, traverse multiple standard texts matching the text to be detected and the standard text size of each standard text from a preset search tree, perform scale adjustment on the text to be detected according to the text size to be detected and the standard text size to obtain a target text, obtain the standard feature vector of each standard text from the preset search tree, generate a target feature vector according to the preset search tree and the text features of the target text, and generate a writing score according to the target feature vector and the standard feature vector. The present invention can improve the determination accuracy of the writing score. In addition, the present invention also relates to blockchain technology, and the writing score can be stored in the blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular, to a method, device, equipment and storage medium for detecting the quality of handwritten text. Background Art

[0002] With the improvement of people's living standards, the willingness of users to purchase insurance has also increased. In the insurance purchase scenario, there are various links including handwritten signatures. However, in the handwritten signature link, the standard degree of the user's handwritten text will affect the processing of subsequent links. Therefore, it is necessary to detect the quality of the user's handwritten text.

[0003] However, the inventor has realized that in the current handwritten quality detection method, since the influence of the size of the user's handwritten text on the handwritten text features is not considered, the quality detection result is inaccurate. Summary of the Invention

[0004] In view of the above, it is necessary to provide a method, device, equipment and storage medium for detecting the quality of handwritten text, which can obtain the text quality detection result.

[0005] On the one hand, the present invention provides a method for detecting the quality of handwritten text, and the method for detecting the quality of handwritten text includes:

[0006] When receiving a text quality detection request, obtaining a to-be-detected image according to the text quality detection request;

[0007] Identifying the to-be-detected text in the to-be-detected image;

[0008] Determining the text size of the to-be-detected text in the to-be-detected image as the to-be-detected text size;

[0009] Traversing a plurality of standard texts matching the to-be-detected text and the standard text size of each standard text from a preset search tree;

[0010] Performing scale adjustment on the to-be-detected text according to the to-be-detected text size and the standard text size to obtain a target text;

[0011] Obtaining the standard feature vector of each standard text from the preset search tree;

[0012] Generating a target feature vector according to the preset search tree and the text features of the target text;

[0013] Generating a writing score of the to-be-detected text according to the target feature vector and the standard feature vector.

[0014] According to a preferred embodiment of the present invention, the obtaining the to-be-detected image according to the text quality detection request includes:

[0015] Parse the message of the text quality detection request to obtain the data information carried in the message;

[0016] Obtain the information corresponding to the first preset tag from the data information as the writing device address, where the first preset tag is used to indicate the writing device;

[0017] Obtain the information corresponding to the second preset tag from the data information as the image number, where the second preset tag is used to indicate the image;

[0018] Obtain the information corresponding to the image number from the writing device address as the image to be detected.

[0019] According to a preferred embodiment of the present invention, the determining the character size of the text to be detected in the image to be detected as the character size to be detected includes:

[0020] Obtain the character pixels of the text to be detected from the image to be detected, where the character pixels include horizontal pixels and vertical pixels;

[0021] Obtain the horizontal pixel position of the horizontal pixels in the image to be detected;

[0022] Select the horizontal pixel position with the smallest position as the first pixel position, and select the horizontal pixel position with the largest position as the second pixel position;

[0023] Calculate the position difference between the second pixel position and the first pixel position to obtain the horizontal length;

[0024] Obtain the vertical pixel position of the vertical pixels in the image to be detected;

[0025] Select the vertical pixel position with the smallest position as the third pixel position, and select the vertical pixel position with the largest position as the fourth pixel position;

[0026] Calculate the position difference between the fourth pixel position and the third pixel position to obtain the vertical length;

[0027] Determine the horizontal length and the vertical length as the character size to be detected.

[0028] According to a preferred embodiment of the present invention, before traversing multiple standard characters and the standard character sizes of each standard character that match the text to be detected from a preset search tree, the method further includes:

[0029] Obtain the configured text, and obtain the standard font of the configured text from each preset font library;

[0030] Determine the font size of each standard font and generate a font vector based on each standard font;

[0031] Use the configured text as the parent node, and each standard font as the first child node of the parent node, the font size of each standard font as the second child node of the parent node, and each font vector as the third child node of the parent node to construct the preset search tree.

[0032] According to a preferred embodiment of the present invention, the generating a font vector based on each standard font includes:

[0033] Obtain the font pixel values of the standard font;

[0034] Perform vectorization processing on the font pixel values to obtain the vector values of the standard font;

[0035] Determine the splicing order of the font pixel values in the standard font;

[0036] Splice the vector values according to the splicing order to obtain the font vector.

[0037] According to a preferred embodiment of the present invention, the generating a target feature vector based on the preset search tree and the text features of the target text includes:

[0038] Obtain the determination method of the vector values according to the preset search tree;

[0039] Obtain the pixel values of the target text as the text features;

[0040] Perform vectorization processing on the text features according to the determination method to obtain the feature values of the target text;

[0041] Determine the composition order of the text features in the target text;

[0042] Splice the feature values according to the composition order to obtain the target feature vector.

[0043] According to a preferred embodiment of the present invention, the generating the writing score of the text to be detected based on the target feature vector and the standard feature vector includes:

[0044] Calculate the similarity between the target feature vector and the standard feature vector;

[0045] Determine the similarity with the largest value as the target similarity;

[0046] Perform quantization processing on the target similarity to obtain the writing score.

[0047] On the other hand, the present invention also provides a handwritten text quality detection device, which includes:

[0048] An acquisition unit, configured to obtain an image to be detected according to the text quality detection request when receiving the text quality detection request;

[0049] An identification unit, configured to identify the text to be detected in the image to be detected;

[0050] A determination unit, configured to determine the text size of the text to be detected in the image to be detected as the text size to be detected;

[0051] A traversal unit, configured to traverse multiple standard texts matching the text to be detected and the standard text size of each standard text from a preset search tree;

[0052] An adjustment unit, configured to perform scale adjustment on the text to be detected according to the text size to be detected and the standard text size to obtain a target text;

[0053] The acquisition unit is further configured to obtain the standard feature vector of each standard text from the preset search tree;

[0054] A generation unit, configured to generate a target feature vector according to the preset search tree and the text features of the target text;

[0055] The generation unit is further configured to generate a writing score of the text to be detected according to the target feature vector and the standard feature vector.

[0056] On the other hand, the present invention also provides an electronic device, which includes:

[0057] A memory, storing computer-readable instructions; and

[0058] A processor, executing the computer-readable instructions stored in the memory to implement the handwritten text quality detection method.

[0059] On the other hand, the present invention also provides a computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions are executed by a processor in an electronic device to implement the handwritten text quality detection method.

[0060] As can be seen from the above technical solutions, the present invention adjusts the scale of the text to be detected by the text size of the text to be detected in the image to be detected and the text sizes of multiple standard texts that match the text to be detected, which can avoid the problem that the similarity cannot be accurately determined due to the inconsistent text sizes of the text to be detected and the multiple standard texts, thereby improving the accuracy of determining the writing score. In addition, the present invention vectorizes the text features of the target text through the preset search tree, and can accurately generate the target feature vector. Since the standard feature vector and the target feature vector are obtained from the same dimension, the similarity can be accurately determined, thereby also improving the accuracy of determining the writing score. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] Figure 1 is a flowchart of a preferred embodiment of the method for detecting the quality of handwritten text according to the present invention.

[0062] Figure 2 is a tree diagram of the preset search tree according to the present invention.

[0063] Figure 3 is a functional module diagram of a preferred embodiment of the device for detecting the quality of handwritten text according to the present invention.

[0064] Figure 4 is a schematic structural diagram of an electronic device of a preferred embodiment for implementing the method for detecting the quality of handwritten text according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0065] In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0066] As Figure 1 shown, it is a flowchart of a preferred embodiment of the method for detecting the quality of handwritten text according to the present invention. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

[0067] The method for detecting the quality of handwritten text is applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored computer-readable instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a digital signal processor (DSP), an embedded device, etc.

[0068] The electronic device can be any kind of electronic product that can perform human-computer interaction with users. For example, personal computers, tablet computers, smart phones, personal digital assistants (PDAs), game consoles, Internet Protocol Television (IPTV), smart wearable devices, etc.

[0069] The electronic device may include a network device and / or a user device. Among them, the network device includes, but is not limited to, a single network electronic device, a group of electronic devices composed of multiple network electronic devices, or a cloud composed of a large number of hosts or network electronic devices based on cloud computing.

[0070] The network where the electronic device is located includes, but is not limited to: the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.

[0071] S10. When a text quality detection request is received, obtain a to-be-detected image according to the text quality detection request.

[0072] In at least one embodiment of the present invention, in an insurance scenario, the text quality detection request may be triggered by a staff member of an insurance company; in a homework correction scenario, the text quality detection request may be triggered by a teacher.

[0073] The text quality detection request includes, but is not limited to: writing device address, image number, etc.

[0074] The to-be-detected image refers to an image generated after a user writes text on a terminal device, and the to-be-detected image may be generated by a screenshot operation triggered by the terminal device.

[0075] In at least one embodiment of the present invention, the electronic device obtaining the to-be-detected image according to the text quality detection request includes:

[0076] Parse the message of the text quality detection request to obtain the data information carried by the message;

[0077] Obtain the information corresponding to a first preset tag from the data information as the writing device address, and the first preset tag is used to indicate the writing device;

[0078] Obtain the information corresponding to a second preset tag from the data information as the image number, and the second preset tag is used to indicate the image;

[0079] Obtain the information corresponding to the image number from the writing device address as the image to be detected.

[0080] Among them, the data information includes, but is not limited to: the writing device address, the image number, etc.

[0081] The first preset tag and the second preset tag can be stored in a tag library.

[0082] The image format of the image to be detected can be JPG format, and the image format of the image to be detected can also be PNG format. The present invention does not limit the image format of the image to be detected.

[0083] By parsing the message, since it is not necessary to parse the entire text quality detection request, the acquisition efficiency of the data information can be improved. By obtaining the image to be detected through the writing device address, since it is not necessary to query multiple device addresses one by one, the acquisition efficiency of the image to be detected can be improved.

[0084] S11. Identify the text to be detected in the image to be detected.

[0085] In at least one embodiment of the present invention, the text to be detected refers to the text that needs to be subjected to quality and normativity detection.

[0086] In at least one embodiment of the present invention, the electronic device uses an OCR algorithm to identify the text to be detected in the image to be detected.

[0087] S12. Determine the text size of the text to be detected in the image to be detected as the text size to be detected.

[0088] In at least one embodiment of the present invention, the text size to be detected refers to the text length and text width of the text to be detected.

[0089] In at least one embodiment of the present invention, the electronic device determines the text size of the text to be detected in the image to be detected as the text size to be detected, including:

[0090] Obtain the text pixels of the text to be detected from the image to be detected, and the text pixels include horizontal pixels and vertical pixels;

[0091] Obtain the horizontal pixel position of the horizontal pixels in the image to be detected;

[0092] Select the horizontal pixel position with the smallest position as the first pixel position, and select the horizontal pixel position with the largest position as the second pixel position;

[0093] Calculate the position difference between the second pixel position and the first pixel position to obtain the horizontal length;

[0094] Obtain the vertical pixel position of the vertical pixel in the image to be detected;

[0095] Select the vertical pixel position with the smallest position as the third pixel position, and select the vertical pixel position with the largest position as the fourth pixel position;

[0096] Calculate the position difference between the fourth pixel position and the third pixel position to obtain the vertical length;

[0097] Determine the horizontal length and the vertical length as the size of the text to be detected.

[0098] The horizontal length can be accurately determined through the horizontal pixel position of the text to be detected, and the vertical length can be accurately determined through the vertical pixel position of the file to be detected, so that the size of the text to be detected can be accurately determined.

[0099] S13. Traverse multiple standard texts that match the text to be detected and the standard text size of each standard text from a preset search tree.

[0100] In at least one embodiment of the present invention, the preset search tree includes multiple subtrees, each subtree corresponds to a configured text, and each subtree includes standard fonts of various different fonts that match the corresponding configured text, the font size of the standard font, and the font vector corresponding to the standard font. Further, the various different fonts include: regular script, Song typeface, etc.

[0101] The multiple standard texts refer to various standard fonts that match the text to be detected.

[0102] The standard text size refers to the text length and text width of each standard text.

[0103] In at least one embodiment of the present invention, before traversing multiple standard texts that match the text to be detected and the standard text size of each standard text from a preset search tree, the method further includes:

[0104] Obtain the configured text, and obtain the standard font of the configured text from each preset font library;

[0105] Determine the font size of each standard font, and generate a font vector according to each standard font;

[0106] Construct the preset search tree with the configuration text as the parent node, each standard font as the first child node of the parent node, the font size of each standard font as the second child node of the parent node, and each font vector as the third child node of the parent node.

[0107] Among them, the configuration text contains common texts in the insurance signature link. For example, the configuration text contains multiple surnames.

[0108] Each preset font library stores the text standard format corresponding to each font. Further, the fonts include: cursive script, regular script, running script, etc.

[0109] Through the preset font library, the standard font can be accurately obtained, so that the font size and font vector of each standard font can be accurately determined. By constructing the preset search tree, it is beneficial to quickly search for information corresponding to the configuration text subsequently.

[0110] See Figure 2 , Figure 2 is the tree diagram of the preset search tree of the present invention. Figure 2 The preset search tree in contains three subtrees, and each subtree has two standard fonts.

[0111] Specifically, the electronic device generates a font vector according to each standard font, including:

[0112] Obtain the font pixel value of the standard font;

[0113] Perform vectorization processing on the font pixel value to obtain the vector value of the standard font;

[0114] Determine the splicing order of the font pixel value in the standard font;

[0115] Splice the vector values according to the splicing order to obtain the font vector.

[0116] Through the font pixel value and the splicing order, the font vector corresponding to the standard font can be accurately generated.

[0117] In at least one embodiment of the present invention, the electronic device traverses multiple standard texts and the standard text sizes of each standard text that match the text to be detected from the preset search tree, including:

[0118] Obtain the subtree corresponding to the text to be detected from the preset search tree;

[0119] Obtain the node corresponding to the first configuration identifier from the subtree as the multiple standard texts, and the first configuration identifier is used to indicate the text corresponding to each font;

[0120] Obtain a node corresponding to the second configuration identifier from the subtree as the standard text size, where the second configuration identifier is used to indicate the text size.

[0121] Through the text to be detected, the subtree can be quickly obtained from the preset search tree, so that the multiple standard texts and the standard text size can be quickly obtained.

[0122] S14. Scale-adjust the text to be detected according to the size of the text to be detected and the standard text size to obtain the target text.

[0123] In at least one embodiment of the present invention, the target text refers to the text with the same size as the multiple standard texts.

[0124] In at least one embodiment of the present invention, the electronic device scales and adjusts the text to be detected according to the size of the text to be detected and the standard text size to obtain the target text, including:

[0125] Divide the standard text size by the size of the text to be detected to obtain a transformation ratio;

[0126] Scale-adjust the text to be detected according to the transformation ratio to obtain the target text.

[0127] Through the size of the text to be detected and the standard text size, the transformation ratio can be accurately determined, so that the target text with the same size as the multiple standard texts can be accurately generated.

[0128] S15. Obtain the standard feature vector of each standard text from the preset search tree.

[0129] In at least one embodiment of the present invention, the standard feature vector refers to the vectorized representation of the standard text in the preset search tree.

[0130] In at least one embodiment of the present invention, the manner in which the electronic device obtains the standard feature vector of each standard text from the preset search tree is the same as the manner in which the electronic device traverses out multiple standard texts matching the text to be detected and the standard text size of each standard text from the preset search tree, and the present invention will not elaborate on this.

[0131] S16. Generate a target feature vector according to the preset search tree and the text feature of the target text.

[0132] In at least one embodiment of the present invention, the target feature vector refers to the vectorized representation of the target text in the same dimension as the standard feature vector.

[0133] In at least one embodiment of the present invention, the electronic device generating a target feature vector according to the preset search tree and the text feature of the target text includes:

[0134] Obtaining the determination method of the vector value according to the preset search tree;

[0135] Obtaining the pixel value of the target text as the text feature;

[0136] Performing vectorization processing on the text feature according to the determination method to obtain the feature value of the target text;

[0137] Determining the composition order of the text feature in the target text;

[0138] Concatenating the feature values according to the composition order to obtain the target feature vector.

[0139] Wherein, the determination method refers to a vector mapping table for generating the vector value based on the font pixel value.

[0140] Through the pixel value of the target text, the text feature can be accurately extracted. Furthermore, by performing vectorization processing on the text feature according to the determination method, the target feature vector can be generated in the same dimension as the font vector in the preset search tree, so that the target feature vector can be accurately generated.

[0141] S17, generating a writing score of the text to be detected according to the target feature vector and the standard feature vector.

[0142] It should be emphasized that to further ensure the privacy and security of the above writing score, the above writing score can also be stored in a node of a blockchain.

[0143] In at least one embodiment of the present invention, the writing score refers to the quantification of the normativity of the text to be detected.

[0144] In at least one embodiment of the present invention, the electronic device generating the writing score of the text to be detected according to the target feature vector and the standard feature vector includes:

[0145] Calculating the similarity between the target feature vector and the standard feature vector;

[0146] Determining the maximum similarity value as the target similarity;

[0147] Performing quantization processing on the target similarity to obtain the writing score.

[0148] Through the above embodiments, since the text of different fonts will have a certain impact on the determination of the similarity, therefore, by quantifying the similarity with the largest value to obtain the writing score, the standard degree of the text to be detected can be accurately determined, thereby improving the result of the text quality detection.

[0149] Specifically, the electronic device's quantification process of the target similarity refers to converting the target similarity into a percentage. For example, if the target similarity is 0.8, then the writing score is 80 points.

[0150] In at least one embodiment of the present invention, after generating the writing score of the text to be detected according to the target feature vector and the standard feature vector, the method further includes:

[0151] Obtain the request number of the text quality detection request;

[0152] Generate a prompt message according to the request number and the writing score;

[0153] Encrypt the prompt message using symmetric encryption technology to obtain a ciphertext;

[0154] Send the ciphertext to the triggering terminal of the text quality detection request.

[0155] By encrypting the prompt message, the security of the writing score can be improved.

[0156] It can be seen from the above technical solutions that the present invention adjusts the scale of the text to be detected through the text size of the text to be detected in the image to be detected and the text sizes of multiple standard texts matching the text to be detected, which can avoid the problem that the similarity cannot be accurately determined due to the inconsistent text sizes of the text to be detected and the multiple standard texts, thereby improving the determination accuracy of the writing score. In addition, the present invention vectorizes the text features of the target text through the preset search tree, which can accurately generate the target feature vector. Since the standard feature vector and the target feature vector are obtained from the same dimension, the similarity can be accurately determined, thereby also improving the determination accuracy of the writing score.

[0157] Such as Figure 3As shown in the figure, it is a functional module diagram of a preferred embodiment of the handwritten text quality detection device of the present invention. The handwritten text quality detection device 11 includes an acquisition unit 110, an identification unit 111, a determination unit 112, a traversal unit 113, an adjustment unit 114, a generation unit 115, a construction unit 116, an encryption unit 117, and a sending unit 118. The module / unit referred to in the present invention refers to a series of computer-readable instruction segments that can be acquired by a processor 13 and can complete fixed functions, and are stored in a memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0158] When receiving a text quality detection request, the acquisition unit 110 acquires an image to be detected according to the text quality detection request.

[0159] In at least one embodiment of the present invention, in an insurance scenario, the text quality detection request can be triggered by a staff member of an insurance company; in a homework correction scenario, the text quality detection request can be triggered by a teacher.

[0160] The text quality detection request includes, but is not limited to: writing device address, image number, etc.

[0161] The image to be detected refers to an image generated after a user writes text on a terminal device, and the image to be detected can be generated by the terminal device triggering a screenshot operation.

[0162] In at least one embodiment of the present invention, the acquisition unit 110 acquiring an image to be detected according to the text quality detection request includes:

[0163] Parsing the message of the text quality detection request to obtain the data information carried by the message;

[0164] Obtaining the information corresponding to a first preset tag from the data information as the writing device address, and the first preset tag is used to indicate the writing device;

[0165] Obtaining the information corresponding to a second preset tag from the data information as the image number, and the second preset tag is used to indicate the image;

[0166] Obtaining the information corresponding to the image number from the writing device address as the image to be detected.

[0167] Among them, the data information includes, but is not limited to: the writing device address, the image number, etc.

[0168] The first preset tag and the second preset tag can be stored in a tag library.

[0169] The image format of the image to be detected may be the JPG format, or it may also be the PNG format. The present invention does not limit the image format of the image to be detected.

[0170] By parsing the message, since it is not necessary to parse the entire text quality detection request, the acquisition efficiency of the data information can be improved. By obtaining the image to be detected through the writing device address, since it is not necessary to query multiple device addresses one by one, the acquisition efficiency of the image to be detected can be improved.

[0171] The recognition unit 111 recognizes the text to be detected in the image to be detected.

[0172] In at least one embodiment of the present invention, the text to be detected refers to the text that needs to be subjected to quality standardization detection.

[0173] In at least one embodiment of the present invention, the recognition unit 111 uses the OCR algorithm to recognize the text to be detected in the image to be detected.

[0174] The determination unit 112 determines the text size of the text to be detected in the image to be detected as the text size to be detected.

[0175] In at least one embodiment of the present invention, the text size to be detected refers to the text length and text width of the text to be detected.

[0176] In at least one embodiment of the present invention, the determination unit 112 determines the text size of the text to be detected in the image to be detected as the text size to be detected, including:

[0177] Obtain the text pixels of the text to be detected from the image to be detected, where the text pixels include horizontal pixels and vertical pixels;

[0178] Obtain the horizontal pixel position of the horizontal pixels in the image to be detected;

[0179] Select the horizontal pixel position with the smallest position as the first pixel position, and select the horizontal pixel position with the largest position as the second pixel position;

[0180] Calculate the position difference between the second pixel position and the first pixel position to obtain the horizontal length;

[0181] Obtain the vertical pixel position of the vertical pixels in the image to be detected;

[0182] Select the vertical pixel position with the smallest position as the third pixel position, and select the vertical pixel position with the largest position as the fourth pixel position;

[0183] Calculate the position difference between the fourth pixel position and the third pixel position to obtain the vertical length;

[0184] Determine the horizontal length and the vertical length as the size of the text to be detected.

[0185] The horizontal length can be accurately determined through the horizontal pixel positions of the text to be detected, and the vertical length can be accurately determined through the vertical pixel positions of the text to be detected, so that the size of the text to be detected can be accurately determined.

[0186] The traversal unit 113 traverses multiple standard texts that match the text to be detected and the standard text sizes of each standard text from a preset search tree.

[0187] In at least one embodiment of the present invention, the preset search tree contains multiple subtrees, each subtree corresponds to a configured text, and each subtree contains standard fonts of various different fonts that match the corresponding configured text, the font sizes of the standard fonts, and the font vectors corresponding to the standard fonts. Further, the various different fonts include: regular script, Song typeface, etc.

[0188] The multiple standard texts refer to various standard fonts that match the text to be detected.

[0189] The standard text size refers to the text length and text width of each standard text.

[0190] In at least one embodiment of the present invention, before traversing multiple standard texts that match the text to be detected and the standard text sizes of each standard text from a preset search tree, the acquisition unit 110 acquires the configured text and acquires the standard font of the configured text from each preset font library;

[0191] The generation unit 115 determines the font size of each standard font and generates a font vector according to each standard font;

[0192] The construction unit 116 constructs the preset search tree with the configured text as the parent node, each standard font as the first child node of the parent node, the font size of each standard font as the second child node of the parent node, and each font vector as the third child node of the parent node.

[0193] Among them, the configured text contains common texts in the insurance signature link. For example, the configured text contains multiple surnames.

[0194] Each preset font library stores the standard text format corresponding to each font. Further, the fonts include: cursive script, regular script, running script, etc.

[0195] The standard font can be accurately obtained through the preset font library, so that the font size and font vector of each standard font can be accurately determined. By constructing the preset search tree, it is beneficial to quickly search for information corresponding to the configured text in the subsequent process.

[0196] See Figure 2 , Figure 2 which is the tree diagram of the preset search tree of the present invention. Figure 2 The preset search tree in [[ ]] contains three subtrees, and each subtree has two standard fonts.

[0197] Specifically, the generating unit 115 generating the font vector according to each standard font includes:

[0198] Obtaining the font pixel value of the standard font;

[0199] Performing vectorization processing on the font pixel value to obtain the vector value of the standard font;

[0200] Determining the splicing order of the font pixel value in the standard font;

[0201] Splicing the vector values according to the splicing order to obtain the font vector.

[0202] Through the font pixel value and the splicing order, the font vector corresponding to the standard font can be accurately generated.

[0203] In at least one embodiment of the present invention, the traversing unit 113 traversing multiple standard texts matching the text to be detected and the standard text size of each standard text from the preset search tree includes:

[0204] Obtaining the subtree corresponding to the text to be detected from the preset search tree;

[0205] Obtaining the node corresponding to the first configuration identifier in the subtree as the multiple standard texts, where the first configuration identifier is used to indicate the text corresponding to each font;

[0206] Obtaining the node corresponding to the second configuration identifier in the subtree as the standard text size, where the second configuration identifier is used to indicate the text size.

[0207] Through the text to be detected, the subtree can be quickly obtained from the preset search tree, so that the multiple standard texts and the standard text size can be quickly obtained.

[0208] The adjusting unit 114 adjusts the scale of the text to be detected according to the size of the text to be detected and the standard text size to obtain the target text.

[0209] In at least one embodiment of the present invention, the target text refers to text having the same text size as the plurality of standard texts.

[0210] In at least one embodiment of the present invention, the adjustment unit 114 performs scale adjustment on the text to be detected according to the size of the text to be detected and the size of the standard text, and obtaining the target text includes:

[0211] Dividing the size of the standard text by the size of the text to be detected to obtain a transformation ratio;

[0212] Performing scale adjustment on the text to be detected according to the transformation ratio to obtain the target text.

[0213] The transformation ratio can be accurately determined by the size of the text to be detected and the size of the standard text, so that the target text having the same size as the plurality of standard texts can be accurately generated.

[0214] The acquisition unit 110 acquires the standard feature vector of each standard text from the preset search tree.

[0215] In at least one embodiment of the present invention, the standard feature vector refers to the vectorized representation of the standard text in the preset search tree.

[0216] In at least one embodiment of the present invention, the manner in which the acquisition unit 110 acquires the standard feature vector of each standard text from the preset search tree is the same as the manner in which the traversal unit 113 traverses a plurality of standard texts matching the text to be detected and the standard text size of each standard text from the preset search tree, and the present invention will not elaborate on this.

[0217] The generation unit 115 generates a target feature vector according to the preset search tree and the text features of the target text.

[0218] In at least one embodiment of the present invention, the target feature vector refers to the vectorized representation of the target text in the same dimension as the standard feature vector.

[0219] In at least one embodiment of the present invention, the generation unit 115 generating a target feature vector according to the preset search tree and the text features of the target text includes:

[0220] Obtaining the determination method of the vector value according to the preset search tree;

[0221] Obtaining the pixel value of the target text as the text feature;

[0222] Performing vectorization processing on the text feature according to the determination method to obtain the feature value of the target text;

[0223] Determine the composition order of the text features in the target text;

[0224] Concatenate the feature values according to the composition order to obtain the target feature vector.

[0225] Wherein, the determination method refers to a vector mapping table for generating the vector values based on the font pixel values.

[0226] Through the pixel values of the target text, the text features can be accurately extracted, and then through the determination method, the text features are vectorized, so that the target feature vector can be generated in the same dimension as the font vector in the preset search tree, thereby accurately generating the target feature vector.

[0227] The generating unit 115 generates a writing score for the text to be detected according to the target feature vector and the standard feature vector.

[0228] It should be emphasized that to further ensure the privacy and security of the above writing score, the above writing score can also be stored in a node of a blockchain.

[0229] In at least one embodiment of the present invention, the writing score refers to the quantification of the normality of the text to be detected.

[0230] In at least one embodiment of the present invention, the generating unit 115 generating the writing score for the text to be detected according to the target feature vector and the standard feature vector includes:

[0231] Calculate the similarity between the target feature vector and the standard feature vector;

[0232] Determine the maximum similarity value as the target similarity;

[0233] Perform quantization processing on the target similarity to obtain the writing score.

[0234] Through the above implementation manner, since texts of different fonts will have a certain impact on the determination of the similarity, therefore, by performing quantization processing on the maximum similarity value to obtain the writing score, the normality degree of the text to be detected can be accurately determined, thereby improving the text quality detection result.

[0235] Specifically, the generating unit 115 performing quantization processing on the target similarity means converting the target similarity into a percentage. For example, if the target similarity is 0.8, then the writing score is 80 points.

[0236] In at least one embodiment of the present invention, after generating the writing score of the text to be detected according to the target feature vector and the standard feature vector, the obtaining unit 110 obtains the request number of the text quality detection request;

[0237] The generating unit 115 generates a prompt message according to the request number and the writing score;

[0238] The encryption unit encrypts the prompt message using symmetric encryption technology to obtain a ciphertext;

[0239] The sending unit sends the ciphertext to the triggering terminal of the text quality detection request.

[0240] By encrypting the prompt message, the security of the writing score can be improved.

[0241] It can be seen from the above technical solutions that the present invention adjusts the scale of the text to be detected through the text size of the text to be detected in the image to be detected and the text sizes of multiple standard texts matching the text to be detected, which can avoid the problem that the similarity cannot be accurately determined due to the inconsistent text sizes of the text to be detected and the multiple standard texts, thereby improving the determination accuracy of the writing score. In addition, the present invention vectorizes the text features of the target text through the preset search tree, can accurately generate the target feature vector. Since the standard feature vector and the target feature vector are obtained from the same dimension, the similarity can be accurately determined, thereby also improving the determination accuracy of the writing score.

[0242] As Figure 4 shown, it is a schematic structural diagram of an electronic device according to a preferred embodiment of the method for detecting the quality of handwritten text of the present invention.

[0243] In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions stored in the memory 12 and executable on the processor 13, such as a handwritten text quality detection program.

[0244] Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 1, does not constitute a limitation on the electronic device 1, and may include more or fewer components than shown, or combine some components, or different components. For example, the electronic device 1 may further include input / output devices, network access devices, buses, etc.

[0245] The processor 13 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor 13 is the operation core and control center of the electronic device 1, connecting various parts of the entire electronic device 1 through various interfaces and circuits, and executing the operating system of the electronic device 1 and various installed application programs, program codes, etc.

[0246] Exemplarily, the computer-readable instructions may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, and the computer-readable instruction segments are used to describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into an acquisition unit 110, an identification unit 111, a determination unit 112, a traversal unit 113, an adjustment unit 114, a generation unit 115, a construction unit 116, an encryption unit 117, and a sending unit 118.

[0247] The memory 12 may be used to store the computer-readable instructions and / or modules. The processor 13 realizes various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12, and calling the data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area may store data created according to the use of the electronic device. The memory 12 may include non-volatile and volatile memories, such as: hard disks, memories, plug-in hard disks, SmartMedia Cards (SMCs), Secure Digital (SD) cards, Flash Cards, at least one magnetic disk storage device, flash memory device, or other storage devices.

[0248] The memory 12 can be an external memory and / or an internal memory of the electronic device 1. Further, the memory 12 can be a memory in physical form, such as a memory module, a TF card (Trans-flash Card), etc.

[0249] If the modules / units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by computer-readable instructions to instruct relevant hardware. The computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed by a processor, the steps of the above-mentioned various method embodiments can be implemented.

[0250] Among them, the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer-readable medium can include: any entity or device capable of carrying the computer-readable instruction codes, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory).

[0251] The blockchain referred to in the present invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithms. Blockchain, essentially a decentralized database, is a string of data blocks generated by using cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of the information (anti-counterfeiting) and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, an application service layer, etc.

[0252] Combined with Figure 1 , the memory 12 in the electronic device 1 stores computer-readable instructions to implement a handwritten text quality detection method, and the processor 13 can execute the computer-readable instructions to thereby implement:

[0253] When receiving a text quality detection request, obtain a to-be-detected image according to the text quality detection request;

[0254] Identify the to-be-detected text in the to-be-detected image;

[0255] Determine the text size of the to-be-detected text in the to-be-detected image as the to-be-detected text size;

[0256] Traverse multiple standard texts that match the text to be detected and the standard text sizes of each standard text from the preset search tree;

[0257] Perform scale adjustment on the text to be detected according to the size of the text to be detected and the standard text sizes to obtain the target text;

[0258] Obtain the standard feature vectors of each standard text from the preset search tree;

[0259] Generate a target feature vector according to the preset search tree and the text features of the target text;

[0260] Generate a writing score for the text to be detected according to the target feature vector and the standard feature vector.

[0261] Specifically, for the specific implementation method of the above computer-readable instructions by the processor 13, reference can be made to Figure 1 the description of the relevant steps in the corresponding embodiment, which will not be elaborated here.

[0262] In several embodiments provided by the present invention, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0263] Computer-readable instructions are stored on the computer-readable storage medium, wherein when the computer-readable instructions are executed by the processor 13, the following steps are implemented:

[0264] When a text quality detection request is received, obtain the image to be detected according to the text quality detection request;

[0265] Identify the text to be detected in the image to be detected;

[0266] Determine the text size of the text to be detected in the image to be detected as the size of the text to be detected;

[0267] Traverse multiple standard texts that match the text to be detected and the standard text sizes of each standard text from the preset search tree;

[0268] Perform scale adjustment on the text to be detected according to the size of the text to be detected and the standard text sizes to obtain the target text;

[0269] Obtain the standard feature vectors of each standard text from the preset search tree;

[0270] Generate a target feature vector according to the preset search tree and the text features of the target text;

[0271] Generate a writing score for the text to be detected based on the target feature vector and the standard feature vector.

[0272] The module described as a separation component may or may not be physically separated. The component shown as a module may or may not be a physical unit, that is, it may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0273] In addition, in each embodiment of the present invention, the functional modules can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated unit can be implemented in the form of hardware or in the form of a combination of hardware and software functional modules.

[0274] Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be encompassed by the present invention. Any reference signs in the claims should not be construed as limiting the claims involved.

[0275] In addition, obviously, the term "including" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices can also be implemented by one unit or device through software or hardware. The terms such as first and second are used to represent names and do not represent any specific order.

[0276] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not restrictive. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for detecting the quality of handwritten text, characterized in that, The described handwritten text quality detection method includes: When receiving a text quality detection request, obtaining a to-be-detected image according to the text quality detection request; Identifying the to-be-detected text in the to-be-detected image; Determining the text size of the to-be-detected text in the to-be-detected image as the to-be-detected text size; Obtaining a configured text, and obtaining the standard font of the configured text from each preset font library; Determining the font size of each standard font, and generating a font vector according to each standard font; Constructing a preset search tree with the configured text as the parent node, each standard font as the first child node of the parent node, the font size of each standard font as the second child node of the parent node, and each font vector as the third child node of the parent node; Traversing from the preset search tree to obtain multiple standard texts that match the to-be-detected text and the standard text size of each standard text; Performing scale adjustment on the to-be-detected text according to the to-be-detected text size and the standard text size to obtain a target text, where the target text refers to a text with the same text size as the multiple standard texts; Obtaining the standard feature vector of each standard text from the preset search tree; Generating a target feature vector according to the preset search tree and the text feature of the target text, including: obtaining the determination method of the vector value of the standard font according to the preset search tree; obtaining the pixel value of the target text as the text feature; performing vectorization processing on the text feature according to the determination method to obtain the feature value of the target text; determining the composition order of the text feature in the target text; splicing the feature values according to the composition order to obtain the target feature vector, and the determination method indicates a vector mapping table for generating the vector value; Generating a writing score of the to-be-detected text according to the target feature vector and the standard feature vector.

2. The handwritten text quality detection method according to claim 1, characterized in that The obtaining the to-be-detected image according to the text quality detection request includes: Parsing the message of the text quality detection request to obtain the data information carried by the message; Obtaining the information corresponding to the first preset tag from the data information as the writing device address, where the first preset tag is used to indicate the writing device; Obtaining the information corresponding to the second preset tag from the data information as the image number, where the second preset tag is used to indicate the image; Obtaining the information corresponding to the image number from the writing device address as the to-be-detected image.

3. The handwritten text quality detection method according to claim 1, wherein The determining the text size of the to-be-detected text in the to-be-detected image as the to-be-detected text size includes: Obtaining the text pixels of the to-be-detected text from the to-be-detected image, where the text pixels include horizontal pixels and vertical pixels; Obtaining the horizontal pixel position of the horizontal pixels in the to-be-detected image; Selecting the horizontal pixel position with the smallest position as the first pixel position, and selecting the horizontal pixel position with the largest position as the second pixel position; Calculating the position difference between the second pixel position and the first pixel position to obtain the horizontal length; Obtaining the vertical pixel position of the vertical pixels in the to-be-detected image; Select the longitudinal pixel position with the smallest position as the third pixel position, and select the longitudinal pixel position with the largest position as the fourth pixel position; Calculate the position difference between the fourth pixel position and the third pixel position to obtain the longitudinal length; Determine the horizontal length and the longitudinal length as the size of the text to be detected.

4. The handwritten text quality detection method according to claim 1, wherein, The generating the font vector according to each standard font includes: Obtain the font pixel values of the standard font; Perform vectorization processing on the font pixel values to obtain the vector values of the standard font; Determine the splicing order of the font pixel values in the standard font; Splice the vector values according to the splicing order to obtain the font vector.

5. The handwritten text quality detection method according to claim 1, characterized in that The generating the writing score of the text to be detected according to the target feature vector and the standard feature vector includes: Calculate the similarity between the target feature vector and the standard feature vector; Determine the similarity with the largest value as the target similarity; Perform quantization processing on the target similarity to obtain the writing score.

6. A handwritten text quality detection device, characterized in that, The handwritten text quality detection device includes: An acquisition unit, configured to obtain an image to be detected according to the text quality detection request when receiving the text quality detection request; An identification unit, configured to identify the text to be detected in the image to be detected; A determination unit, configured to determine the size of the text to be detected in the image to be detected as the size of the text to be detected; The acquisition unit is further configured to obtain a configured text, and obtain the standard font of the configured text from each preset font library; A generation unit, configured to determine the font size of each standard font, and generate a font vector according to each standard font; A construction unit, configured to use the configured text as the parent node, each standard font as the first child node of the parent node, the font size of each standard font as the second child node of the parent node, and each font vector as the third child node of the parent node to construct a preset search tree; A traversal unit, configured to traverse multiple standard texts matching the text to be detected and the standard text size of each standard text from the preset search tree; An adjustment unit, configured to perform scale adjustment on the text to be detected according to the size of the text to be detected and the standard text size to obtain a target text, where the target text refers to a text with the same text size as the multiple standard texts; The acquisition unit is further configured to obtain the standard feature vector of each standard text from the preset search tree; A generation unit, configured to generate a target feature vector according to the preset search tree and the text feature of the target text, including: obtaining the determination method of the vector value of the standard font according to the preset search tree; obtaining the pixel value of the target text as the text feature; performing vectorization processing on the text feature according to the determination method to obtain the feature value of the target text; determining the composition order of the text feature in the target text; splicing the feature values according to the composition order to obtain the target feature vector, where the determination method indicates a vector mapping table for generating the vector value. The generating unit is further configured to generate a writing score of the text to be detected according to the target feature vector and the standard feature vector.

7. An electronic device, characterized in that, The electronic device includes: a memory storing computer-readable instructions; and a processor that executes the computer-readable instructions stored in the memory to implement the handwritten text quality detection method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored in the computer-readable storage medium, and the computer-readable instructions are executed by a processor in an electronic device to implement the handwritten text quality detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Calligraphy quality detection method and device based on artificial intelligence, and electronic equipment

    CN108734165A

  • A method and a device for determining the quality level of a writing type

    CN109472249A