Image character verification method and device

By generating and pre-processing the original image, the OCR results are checked by using the leaked pixel detection method, the problem of inaccurate OCR results in the prior art is solved, and efficient and accurate text verification is achieved.

CN119942566APending Publication Date: 2025-05-06SINOPEC SHARED SERVICES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411992465.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing OCR result verification methods cannot achieve 100% accuracy, especially in the case of complex text layout and diverse fonts, which often require manual review, which increases labor costs and workload.

Method used

By generating the reconstructed image set and preprocessing the original image, using the leaked pixel detection method, the overlay relationship between the reconstructed image set and the preprocessed original image is compared, and the verification result of the text content is determined.

Benefits of technology

It improves the efficiency and accuracy of text verification in images, can automatically verify the consistency of fonts, theoretically achieve 100% accuracy, and simplifies the original image quality detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119942566A_ABST
    Figure CN119942566A_ABST
Patent Text Reader

Abstract

The invention provides an image character verification method and device, and relates to the technical field of character processing. The method comprises the following steps: generating a reconstructed image set and a preprocessed original image according to text content in the original image; respectively taking the reconstructed image set and the preprocessed original image as covered images, covering the covered images with the covered images, and obtaining a detection result of the leaked pixels; and determining a verification result of the text content in the original image according to the leaked pixel detection result. The device executes the method. According to the image character verification method and device provided by the embodiment of the invention, the efficiency and accuracy of character verification in the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of word processing, and in particular to an image word checking method and device. Background Art

[0002] OCR (Optical Character Recognition) technology is widely used in many fields such as document digitization, bill processing, and ID card recognition. However, due to factors such as image quality, font diversity, and text layout, OCR recognition results may be incorrect. Therefore, in key application scenarios, it is usually necessary to verify the OCR results to ensure the accuracy of the final results.

[0003] The existing OCR result verification methods are mainly divided into two categories: manual proofreading and automated proofreading. Automated proofreading includes double OCR proofreading, rule-based proofreading, and machine learning-based proofreading, which are described as follows:

[0004] 1.1 Manual proofreading:

[0005] Process: Manually proofread the OCR results word by word to ensure the accuracy of the text.

[0006] Advantages: High accuracy, able to handle complex text layouts and diverse fonts.

[0007] Disadvantages: time-consuming and labor-intensive, low efficiency, high cost, and easily affected by human factors.

[0008] 1.2 Automated Proofreading:

[0009] 1.2.1 Double OCR verification:

[0010] Process: Use two different OCR engines to recognize the same text and compare the results. If they are consistent, they are considered reliable.

[0011] Advantages: Improve recognition accuracy through complementarity between engines.

[0012] Disadvantages: Increases system complexity and cost; different engines may produce different errors; it is impossible to completely eliminate all errors.

[0013] 1.2.2 Rule-based verification:

[0014] Process: Use predefined rules to verify the OCR results, such as checking the correctness of specific formats (dates, numbers).

[0015] Advantages: It works better in specific areas and can automatically correct some recognition errors.

[0016] Disadvantages: Relies on predefined rules, cannot cover all situations and exceptions, and cannot guarantee 100% accuracy.

[0017] 1.2.3 Verification based on machine learning:

[0018] Process: Use machine learning algorithms to verify and correct OCR results, such as using language models for grammar and semantic verification.

[0019] Advantages: Handles complex text layouts and diverse fonts, improving recognition accuracy.

[0020] Disadvantages: Requires a large amount of training data and computing resources, model training is complex, depends on the quality of training data, and still has errors.

[0021] However, none of the above methods can achieve the theoretical 100% accuracy. In key application scenarios, each OCR result usually needs to be combined with manual review and proofreading to ensure the accuracy of the final result, which increases labor costs and workload. At the same time, although manual proofreading can improve accuracy, it is inefficient and easily affected by human factors, making it difficult to guarantee high-accuracy proofreading results in various complex scenarios. Summary of the invention

[0022] In view of the problems in the prior art, an embodiment of the present invention provides an image text verification method and device, which can at least partially solve the problems in the prior art.

[0023] In one aspect, the present invention provides an image text verification method, comprising:

[0024] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0025] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0026] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0027] The reconstructed image set is generated according to the text content in the original image, including:

[0028] According to the recognition result of the text content, the text content is drawn using a preset font to obtain drawn text;

[0029] The reconstructed image set containing the drawn text and having a transparent background is generated.

[0030] The preprocessing of the original image is generated according to the text content in the original image, including:

[0031] Converting the original image into a grayscale image, and performing threshold segmentation on the grayscale image to generate a binary image;

[0032] The binary image is used as a mask to copy the text content onto a transparent background image to obtain the pre-processed original image.

[0033] The step of obtaining the leaked pixel detection result includes:

[0034] Traversing each reconstructed image in the reconstructed image set, taking each reconstructed image as a covered image, taking the preprocessed original image as a covering image, and calculating the first number of leaked pixels respectively;

[0035] If it is determined that there is a first target leaked pixel number of zero, determining the first leaked pixel detection result to be zero;

[0036] The pre-processed original image is used as a covered image, and each reconstructed image is used as a covering image, and the second number of leaked pixels is calculated respectively;

[0037] If it is determined that there is a second target leaked pixel number of zero, then the second leaked pixel detection result is determined to be zero.

[0038] The step of obtaining the leaked pixel detection result further includes:

[0039] If it is determined that the first target number of leaked pixels does not exist, first ratios corresponding to the first number of leaked pixels and the number of font pixels of each reconstructed image are calculated respectively;

[0040] taking the minimum first ratio among the first ratios as a first leaked pixel detection result;

[0041] If it is determined that the second target number of leaked pixels does not exist, calculating second ratios of the second number of leaked pixels to the number of font pixels of the pre-processed original image respectively;

[0042] The minimum second ratio among the second ratios is used as a second leaked pixel detection result.

[0043] Wherein, determining the verification result of the text content in the original image according to the leaked pixel detection result includes:

[0044] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are zero, determining that the verification result is a verification pass;

[0045] If it is determined that the first leaked pixel detection result and the second leaked pixel detection result are not both zero, then the verification result is determined to be verification failure.

[0046] Wherein, the image text verification method further includes:

[0047] If it is determined that the first leaked pixel detection result or the second leaked pixel detection result is zero, using the first leaked pixel detection result or the second leaked pixel detection result that is not zero as the first verification quantization indicator data;

[0048] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are not zero, the product of the first leaked pixel detection result and the second leaked pixel detection result is used as the second verification quantization index data.

[0049] In one aspect, the present invention provides an image text verification device, comprising:

[0050] A generating unit, used for generating a reconstructed image set and preprocessing the original image according to the text content in the original image;

[0051] An acquisition unit, configured to use the reconstructed image set and the preprocessed original image as covered images respectively, overlay the covering image onto the covered image, and acquire a leaked pixel detection result;

[0052] A verification unit is used to determine a verification result of the text content in the original image according to the leaked pixel detection result.

[0053] In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein:

[0054] The processor and the memory communicate with each other via the bus;

[0055] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:

[0056] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0057] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0058] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0059] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:

[0060] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:

[0061] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0062] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0063] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0064] The image text verification method and device provided by the embodiment of the present invention generate a reconstructed image set and a preprocessed original image according to the text content in the original image; use the reconstructed image set and the preprocessed original image as covered images respectively, overlay the covering image on the covered image, and obtain the leakage pixel detection result; determine the verification result of the text content in the original image according to the leakage pixel detection result, which can improve the efficiency and accuracy of text verification in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0066] Figure 1 It is a flowchart of an image text verification method provided by an embodiment of the present invention.

[0067] Figure 2 It is a flowchart of an image text verification method provided by another embodiment of the present invention.

[0068] Figure 3 It is a schematic diagram of the structure of an image text verification device provided by an embodiment of the present invention.

[0069] Figure 4 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0070] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0071] Figure 1 It is a schematic flowchart of an image text verification method provided by an embodiment of the present invention. As Figure 1 shown, the image text verification method provided by the embodiment of the present invention includes:

[0072] Step S1: Generate a reconstructed image set and preprocess the original image according to the text content in the original image.

[0073] Step S2: Use the reconstructed image set and the preprocessed original image as the covered images respectively, cover the covering image on the covered image, and obtain the leaked pixel detection result.

[0074] Step S3: Determine the verification result of the text content in the original image according to the leaked pixel detection result.

[0075] In the above step S1, the device generates a reconstructed image set and preprocesses the original image according to the text content in the original image. The device may be a computer device that executes this method, such as a server. It should be noted that the acquisition and analysis of data involved in the embodiments of the present invention are authorized by the user. Generating a reconstructed image set according to the text content in the original image includes:

[0076] According to the recognition result of the text content, and use a preset font to draw the text content to obtain the drawn text; the recognition result can be obtained by performing OCR technology on the text content. The preset font may be the same font as the text content, may be some common fonts, or may be a manually specified font.

[0077] Generate the reconstructed image set that includes the drawn text and has a transparent background as the image background. Further, memory resources can also be called, and the text content is drawn using a preset font, and then a reconstructed image is obtained. Calling memory resources compared to reconstructing images on other storage media such as hard disks, since reconstructing images in memory has no interference such as blurring and noise, and does not require additional image preprocessing steps, such as denoising and enhancing contrast, thus simplifying the processing flow and also improving the image quality.

[0078] For target texts with unclear edge region features in the text content, multiple reconstructed images can be generated respectively and form a reconstructed image set. For example, if the text content has a character "干" and a character "于", then generate another reconstructed image by replacing the character "干" with the character "于", and generate another reconstructed image by replacing the character "于" with the character "干", and form a reconstructed image set. If there are multiple target texts with unclear edge region features, multiple reconstructed images can be generated in a permutation and combination manner and form a reconstructed image set.

[0079] You can use a variety of common programming languages ​​and graphics libraries to draw and process text in specific fonts, such as Python's Pillow library, Java's AWT library, C++'s OpenCV library, MATLAB's graphics processing toolbox, etc.

[0080] Furthermore, the font size, format, rotation angle, etc. may also be taken into consideration when reconstructing an image, thereby obtaining a reconstructed image set containing more reconstructed images.

[0081] Generate a preprocessed original image according to the text content in the original image, including:

[0082] Converting the original image into a grayscale image, and performing threshold segmentation on the grayscale image to generate a binary image;

[0083] Using the binary image as a mask, the text content is copied onto the transparent background image to obtain the pre-processed original image. In order to improve the accuracy of background transparency, the following method can be used:

[0084] Edge detection: Use edge detection technology (such as Canny edge detection) to extract text edges and improve the accuracy of background transparency processing.

[0085] Morphological operations: Use morphological operations (such as dilation, erosion, etc.) to optimize the transparent background processing of the image and further improve the accuracy of the background transparency processing.

[0086] In the above step S2, the device uses the reconstructed image set and the preprocessed original image as covered images, overlays the overlay image on the covered image, and obtains the leaked pixel detection result. The obtaining of the leaked pixel detection result includes:

[0087] Traversing each reconstructed image in the reconstructed image set, taking each reconstructed image as a covered image, taking the preprocessed original image as a covering image, and calculating the first number of leaked pixels respectively;

[0088] If it is determined that there is a first target leaked pixel number of zero, determining the first leaked pixel detection result to be zero;

[0089] The pre-processed original image is used as a covered image, and each reconstructed image is used as a covering image, and the second number of leaked pixels is calculated respectively;

[0090] If it is determined that there is a second target leaked pixel number of zero, then the second leaked pixel detection result is determined to be zero. Figure 2 As shown, the order of calculating the first number of leaked pixels and calculating the second number of leaked pixels is not specifically limited.

[0091] The obtaining of the leaked pixel detection result further includes:

[0092] If it is determined that the first target number of leaked pixels does not exist, first ratios corresponding to the first number of leaked pixels and the number of font pixels of each reconstructed image are calculated respectively;

[0093] taking the minimum first ratio among the first ratios as a first leaked pixel detection result;

[0094] If it is determined that the second target number of leaked pixels does not exist, calculating second ratios of the second number of leaked pixels to the number of font pixels of the pre-processed original image respectively;

[0095] The minimum second ratio among the second ratios is used as the second leaked pixel detection result. Figure 2 As shown, the order of calculating the first ratio and calculating the second ratio is not specifically limited.

[0096] In the above step S3, the device determines the verification result of the text content in the original image according to the leaked pixel detection result. The verification result of the text content in the original image according to the leaked pixel detection result includes:

[0097] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are zero, determining that the verification result is a verification pass;

[0098] If it is determined that the first leaked pixel detection result and the second leaked pixel detection result are not both zero, then the verification result is determined to be verification failure.

[0099] The image text verification method also includes:

[0100] If it is determined that the first leaked pixel detection result or the second leaked pixel detection result is zero, using the first leaked pixel detection result or the second leaked pixel detection result that is not zero as the first verification quantization indicator data;

[0101] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are not zero, the product of the first leaked pixel detection result and the second leaked pixel detection result is used as the second verification quantization index data.

[0102] The image text verification method provided by the embodiment of the present invention has the following beneficial technical effects:

[0103] Comprehensive automatic font consistency verification:

[0104] The present invention uses a double-covering method to compare the opaque parts of two transparent background images to detect leaked pixels. Since the double-covering method can effectively eliminate the characteristics of pixel leakage in individual strokes, the technical solution of the present application can fully and automatically verify the consistency of the font and ensure the reliability of the recognition result. The present invention is simple and easy to implement, with high efficiency, and the detection result can theoretically achieve 100% accuracy.

[0105] Simplified the original image quality inspection process:

[0106] Existing OCR technology is prone to recognition errors and inconsistencies when processing complex backgrounds and low-quality images. The present invention generates a high-quality reference image method through automatic memory direct reconstruction. Since the original image interference and noise will be entangled with the interference pixels during the transparent processing, the technical solution of the present invention not only automatically verifies the accuracy of the OCR recognition result, but also can evaluate the quality of the original image by simply comparing it with the transparent processed original image, thus avoiding the complex processing of the original image quality detection.

[0107] Provide quantifiable recognition accuracy indicators:

[0108] The present invention calculates the ratio of the number of pixels of the leaked font to the number of pixels of the font reconstructed in the memory. Since this method provides the characteristics of a quantitative index of recognition accuracy, this quantitative index makes the evaluation of the recognition result more objective and accurate. Therefore, the technical solution of the present invention facilitates the automatic evaluation and improvement of the recognition result.

[0109] In summary, the present invention overcomes the disadvantage that the traditional OCR recognition result automatic detection is affected by the original image quality through the memory reconstruction image method and the double coverage method leaked pixel detection method, and realizes an efficient and reliable OCR recognition quality detection method.

[0110] The present invention performs background transparency processing on the original image (including scanned and photographed images), retains the pixel information of the text part, and uses it to draw text with a specific font, setting the background to be transparent. By comparing the opaque parts of two transparent background images, the consistency of the font is verified.

[0111] The present invention can effectively eliminate the pixel loss in individual strokes and can achieve 100% accuracy in theory. Due to the high quality characteristics of the memory reconstructed image, the detection result not only verifies the accuracy of the OCR recognition result, but also evaluates the quality of the original image and eliminates errors caused by image quality.

[0112] The image text verification method provided by the embodiment of the present invention generates a reconstructed image set and a preprocessed original image according to the text content in the original image; uses the reconstructed image set and the preprocessed original image as covered images respectively, overlays the covering image on the covered image, and obtains the leakage pixel detection result; determines the verification result of the text content in the original image according to the leakage pixel detection result, which can improve the efficiency and accuracy of text verification in the image.

[0113] Furthermore, a reconstructed image set is generated according to the text content in the original image, including:

[0114] According to the recognition result of the text content, the text content is drawn using a preset font to obtain drawn text; the description can be made with reference to the above embodiment and will not be repeated here.

[0115] Generate the reconstructed image set containing the drawn text and the image background being a transparent background. Please refer to the above embodiment for description, which will not be repeated here.

[0116] Further, generating a preprocessed original image according to the text content in the original image includes:

[0117] The original image is converted into a grayscale image, and the grayscale image is subjected to threshold segmentation to generate a binary image; the above-mentioned embodiment can be referred to for description and will not be described in detail.

[0118] The binary image is used as a mask to copy the text content onto the transparent background image to obtain the pre-processed original image. The above description can be referred to in the above embodiment and will not be repeated here.

[0119] Further, the obtaining of the leaked pixel detection result includes:

[0120] Each reconstructed image in the reconstructed image set is traversed, each reconstructed image is used as a covered image, the preprocessed original image is used as a covering image, and the first number of leaked pixels is calculated respectively; the above embodiment can be referred to for description and will not be repeated here.

[0121] If it is determined that there is a first target leaked pixel number of zero, then the first leaked pixel detection result is determined to be zero; the above description may be referred to and will not be repeated herein.

[0122] The preprocessed original image is used as the covered image, and each reconstructed image is used as a covering image, and the second number of leaked pixels is calculated respectively; the description may refer to the above embodiment, which will not be repeated here.

[0123] If it is determined that there is a second target leaked pixel number of zero, then the second leaked pixel detection result is determined to be zero. The above description may be referred to, and will not be repeated.

[0124] Furthermore, the obtaining of the leaked pixel detection result further includes:

[0125] If it is determined that the first target leaked pixel number does not exist, first ratios corresponding to the first leaked pixel number and the number of font pixels of each reconstructed image are calculated respectively; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0126] The minimum first ratio among the first ratios is used as the first leaked pixel detection result; the description may refer to the above embodiment and will not be repeated herein.

[0127] If it is determined that the second target leaked pixel number does not exist, the second ratios corresponding to the second leaked pixel number and the font pixel number of the pre-processed original image are calculated respectively; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0128] The minimum second ratio among the second ratios is used as the second leaked pixel detection result. The above description can be referred to, and will not be repeated here.

[0129] Further, determining the verification result of the text content in the original image according to the leaked pixel detection result includes:

[0130] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are zero, then the verification result is determined to be a passed verification; the above-mentioned embodiment can be referred to for description and will not be repeated herein.

[0131] If it is determined that the first leaked pixel detection result and the second leaked pixel detection result are not both zero, then the verification result is determined to be a verification failure. The above description may be referred to, and will not be repeated.

[0132] Furthermore, the image text verification method also includes:

[0133] If it is determined that the first leaked pixel detection result or the second leaked pixel detection result is zero, the first leaked pixel detection result or the second leaked pixel detection result that is not zero is used as the first verification quantization index data; the above embodiment can be referred to for description and will not be repeated here.

[0134] If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are not zero, the product of the first leaked pixel detection result and the second leaked pixel detection result is used as the second verification quantization index data.

[0135] Figure 3 FIG. 1 is a schematic diagram of the structure of an image text verification device provided by an embodiment of the present invention. Figure 3As shown, the image text verification device provided by the embodiment of the present invention includes a generating unit 301, an acquiring unit 302 and a verifying unit 303, wherein:

[0136] The generation unit 301 is used to generate a reconstructed image set and a preprocessed original image according to the text content in the original image; the acquisition unit 302 is used to use the reconstructed image set and the preprocessed original image as covered images respectively, overlay the covering image on the covered image, and obtain the leakage pixel detection result; the verification unit 303 is used to determine the verification result of the text content in the original image according to the leakage pixel detection result.

[0137] Specifically, the generating unit 301 in the device is used to generate a reconstructed image set and a preprocessed original image according to the text content in the original image; the acquiring unit 302 is used to use the reconstructed image set and the preprocessed original image as covered images respectively, overlay the covering image on the covered image, and obtain the leaked pixel detection result; the verifying unit 303 is used to determine the verification result of the text content in the original image according to the leaked pixel detection result.

[0138] The image text verification device provided by the embodiment of the present invention generates a reconstructed image set and a preprocessed original image according to the text content in the original image; uses the reconstructed image set and the preprocessed original image as covered images respectively, overlays the covering image on the covered image, and obtains the leakage pixel detection result; determines the verification result of the text content in the original image according to the leakage pixel detection result, which can improve the efficiency and accuracy of text verification in the image.

[0139] The embodiment of the image text verification device provided by the embodiment of the present invention can be specifically used to execute the processing flow of the above-mentioned method embodiments. Its functions are not repeated here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0140] Figure 4 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 4 As shown, the electronic device includes: a processor (processor) 401, a memory (memory) 402 and a bus 403;

[0141] The processor 401 and the memory 402 communicate with each other via a bus 403;

[0142] The processor 401 is used to call the program instructions in the memory 402 to execute the methods provided by the above method embodiments, for example, including:

[0143] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0144] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0145] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0146] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above method embodiments, for example, including:

[0147] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0148] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0149] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0150] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables the computer to execute the methods provided by the above method embodiments, for example, including:

[0151] Generate a reconstructed image set and pre-process the original image according to the text content in the original image;

[0152] Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result;

[0153] A verification result of the text content in the original image is determined according to the leaked pixel detection result.

[0154] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0155] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0156] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0158] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0159] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for verifying image text, characterized in that: include: Generate a reconstructed image set and pre-process the original image according to the text content in the original image; Using the reconstructed image set and the preprocessed original image as covered images respectively, overlaying the covering image on the covered image, and obtaining a leaked pixel detection result; A verification result of the text content in the original image is determined according to the leaked pixel detection result.

2. The image text verification method according to claim 1, characterized in that: Generate a reconstructed image set based on the text content in the original image, including: According to the recognition result of the text content, the text content is drawn using a preset font to obtain drawn text; The reconstructed image set containing the drawn text and having a transparent background is generated.

3. The image text verification method according to claim 1, characterized in that: Generate a preprocessed original image according to the text content in the original image, including: Converting the original image into a grayscale image, and performing threshold segmentation on the grayscale image to generate a binary image; The binary image is used as a mask to copy the text content onto a transparent background image to obtain the pre-processed original image.

4. The image text verification method according to any one of claims 1 to 3, characterized in that: The obtaining of the leaked pixel detection result includes: Traversing each reconstructed image in the reconstructed image set, taking each reconstructed image as a covered image, taking the preprocessed original image as a covering image, and calculating the first number of leaked pixels respectively; If it is determined that there is a first target leaked pixel number of zero, determining the first leaked pixel detection result to be zero; The pre-processed original image is used as a covered image, and each reconstructed image is used as a covering image, and the second number of leaked pixels is calculated respectively; If it is determined that there is a second target leaked pixel number of zero, then the second leaked pixel detection result is determined to be zero.

5. The image text verification method according to claim 4, characterized in that: The obtaining of the leaked pixel detection result further includes: If it is determined that the first target number of leaked pixels does not exist, first ratios corresponding to the first number of leaked pixels and the number of font pixels of each reconstructed image are calculated respectively; taking the minimum first ratio among the first ratios as a first leaked pixel detection result; If it is determined that the second target number of leaked pixels does not exist, calculating second ratios of the second number of leaked pixels to the number of font pixels of the pre-processed original image respectively; The minimum second ratio among the second ratios is used as a second leaked pixel detection result.

6. The image text verification method according to claim 5, characterized in that: The step of determining the verification result of the text content in the original image according to the leaked pixel detection result includes: If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are zero, determining that the verification result is a verification pass; If it is determined that the first leaked pixel detection result and the second leaked pixel detection result are not both zero, then the verification result is determined to be verification failure.

7. The image text verification method according to claim 6, characterized in that: The image text verification method also includes: If it is determined that the first leaked pixel detection result or the second leaked pixel detection result is zero, using the first leaked pixel detection result or the second leaked pixel detection result that is not zero as the first verification quantization indicator data; If it is determined that both the first leaked pixel detection result and the second leaked pixel detection result are not zero, the product of the first leaked pixel detection result and the second leaked pixel detection result is used as the second verification quantization index data.

8. An image text verification device, characterized in that: include: A generating unit, used for generating a reconstructed image set and preprocessing the original image according to the text content in the original image; An acquisition unit, configured to use the reconstructed image set and the preprocessed original image as covered images respectively, overlay the covering image onto the covered image, and acquire a leaked pixel detection result; A verification unit is used to determine a verification result of the text content in the original image according to the leaked pixel detection result.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.