Image quality determination method and device

By evaluating the quality of the target text line images in the document image, and using the pre-trained image quality evaluation model, the problem of long-term image quality evaluation in the prior art is solved, and efficient and reliable image quality evaluation is achieved.

CN119722549APending Publication Date: 2025-03-28ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311257599.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-26
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When performing quality evaluation of document images, it takes a long time to directly detect the entire image, which affects efficiency.

Method used

By evaluating the quality of the target text line images in the document image, each target text line image is predicted using a pre-trained image quality evaluation model to obtain its quality evaluation results, and the overall quality of the document image is determined based on these results.

Benefits of technology

This improves the efficiency of image quality evaluation, reduces the interference of background areas on evaluation, and enhances the reliability of evaluation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722549A_ABST
    Figure CN119722549A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image quality determination method and device. The image quality determination method comprises the following steps: acquiring one or more target text line images contained in a document image; performing quality evaluation on each target text line image to obtain a quality evaluation result of each target text line image; the quality evaluation result of the target text line image is used for representing the quality of the target text line image; and determining the image quality of the document image according to the quality evaluation result of each target text line image. According to the technical scheme provided by the embodiment of the invention, the image quality of the document image can be efficiently determined.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technology, and in particular to a method and device for determining image quality. Background Art

[0002] In the process of recognizing document images, in order to improve recognition efficiency, it is often necessary to first determine whether the quality of the document image meets the quality requirements. Only when the document image meets the quality requirements can the text content in the document image be further recognized.

[0003] In related technologies, image quality assessment usually directly performs quality inspection on the entire image, which takes a long time and affects the efficiency of image quality assessment. Summary of the invention

[0004] Embodiments of the present disclosure provide a method and device for determining image quality.

[0005] According to a first aspect of an embodiment of the present disclosure, a method for determining image quality is provided, the method comprising:

[0006] Obtain one or more target text line images contained in the document image;

[0007] Performing quality assessment on each of the target text line images to obtain a quality assessment result of each of the target text line images; the quality assessment result of the target text line image is used to characterize the quality of the target text line image;

[0008] The image quality of the document image is determined according to the quality evaluation results of each of the target text line images.

[0009] In some embodiments, the performing quality assessment on each of the target text line images to obtain a quality assessment result of each of the target text line images includes:

[0010] A pre-trained image quality assessment model is used to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images; wherein the image quality assessment model is obtained by training using sample text line images and quality label values ​​of the sample text line images.

[0011] In some embodiments, the step of acquiring one or more target text line images contained in the document image includes:

[0012] Performing text line detection on the document image to obtain a plurality of text line images corresponding to the document image;

[0013] One or more target text line images are extracted from the multiple text line images.

[0014] In some embodiments, the using of a pre-trained image quality assessment model to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images includes:

[0015] For each of the target text line images, the target text line image is input into the image quality assessment model to perform the following processing:

[0016] Performing image feature extraction processing on the target text line image to obtain image shallow features and image deep features;

[0017] A quality assessment result of the target text line image is obtained according to the shallow features of the image and the deep features of the image.

[0018] In some embodiments, obtaining the quality assessment result of the target text line image according to the shallow features of the image and the deep features of the image includes:

[0019] Performing fusion processing on the shallow features of the image and the deep features of the image to obtain image fusion features;

[0020] According to the image fusion feature, the quality of the target text line image is evaluated to obtain a quality evaluation result of the target text line image.

[0021] In some embodiments, the training process of the image quality assessment model includes:

[0022] Acquire a sample image set, wherein the sample image set includes a plurality of sample text line images annotated with quality label values;

[0023] Inputting the sample text line image into the image quality assessment model for prediction to obtain a quality prediction value of the sample text line image;

[0024] According to the loss value between the quality prediction value of the sample text line image and the quality label value, the parameters in the image quality assessment model are iteratively updated until preset conditions are met, thereby obtaining the trained image quality assessment model.

[0025] In some embodiments, acquiring a sample image set includes:

[0026] Performing multiple quality degradation operations on the original text line image to obtain the sample text line image;

[0027] For each of the degradation operations, obtaining an image quality score after the original text line image is degraded by the degradation operation;

[0028] The quality label value of the sample text line image is determined according to each of the image quality scores and the weight corresponding to each of the quality degradation operations.

[0029] In some embodiments, the plurality of degradation operations include at least two of blurring, compression and noise addition.

[0030] In some embodiments, determining the image quality of the document image according to the quality evaluation results of each of the target text line images includes:

[0031] Determining the resolution of each target text line image;

[0032] The image quality of the document image is determined according to the quality evaluation results and the resolution of each of the target text line images.

[0033] In some embodiments, determining the image quality of the document image according to the quality evaluation results and resolution of each of the target text line images includes:

[0034] Determining, according to the resolution of each of the target text line images, a resolution ratio corresponding to the resolution of each of the target text line images;

[0035] Determining an image quality assessment value of the document image according to a resolution ratio corresponding to a resolution of each of the target text line images and a quality assessment result of each of the target text line images;

[0036] The image quality of the document image is determined according to the image quality evaluation value of the document image.

[0037] According to a second aspect of the embodiments of the present disclosure, there is provided an image quality determination device, the device comprising:

[0038] An acquisition module, used for acquiring one or more target text line images contained in a document image;

[0039] An evaluation module, used to perform quality evaluation on each of the target text line images to obtain a quality evaluation result of each of the target text line images; the quality evaluation result of the target text line image is used to characterize the quality of the target text line image;

[0040] The determination module is used to determine the image quality of the document image according to the quality evaluation results of each target text line image.

[0041] In some embodiments, the evaluation module is used to:

[0042] A pre-trained image quality assessment model is used to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images; wherein the image quality assessment model is obtained by training using sample text line images and quality label values ​​of the sample text line images.

[0043] In some embodiments, the acquisition module is used to:

[0044] Performing text line detection on the document image to obtain a plurality of text line images corresponding to the document image;

[0045] One or more target text line images are extracted from the multiple text line images.

[0046] In some embodiments, the evaluation module is used to:

[0047] For each of the target text line images, the target text line image is input into the image quality assessment model to perform the following processing:

[0048] Performing image feature extraction processing on the target text line image to obtain image shallow features and image deep features;

[0049] A quality assessment result of the target text line image is obtained according to the shallow features of the image and the deep features of the image.

[0050] In some embodiments, the evaluation module is used to:

[0051] Performing fusion processing on the shallow features of the image and the deep features of the image to obtain image fusion features;

[0052] According to the image fusion feature, the quality of the target text line image is evaluated to obtain a quality evaluation result of the target text line image.

[0053] In some embodiments, the apparatus further comprises a training module, wherein the training module comprises:

[0054] An acquisition unit, configured to acquire a sample image set, wherein the sample image set includes a plurality of sample text line images annotated with quality label values;

[0055] A prediction unit, used for inputting the sample text line image into the image quality assessment model for prediction, so as to obtain a quality prediction value of the sample text line image;

[0056] The training unit is used to iteratively update the parameters in the image quality assessment model according to the loss value between the quality prediction value of the sample text line image and the quality label value until the preset conditions are met to obtain the trained image quality assessment model.

[0057] In some embodiments, the acquisition unit is used to:

[0058] Performing multiple quality degradation operations on the original text line image to obtain the sample text line image;

[0059] For each of the degradation operations, obtaining an image quality score after the original text line image is degraded by the degradation operation;

[0060] The quality label value of the sample text line image is determined according to each of the image quality scores and the weight corresponding to each of the quality degradation operations.

[0061] In some embodiments, the plurality of degradation operations include at least two of blurring, compression and noise addition.

[0062] In some embodiments, the determining module is used to:

[0063] Determining the resolution of each target text line image;

[0064] The image quality of the document image is determined according to the quality evaluation results and the resolution of each of the target text line images.

[0065] In some embodiments, the determining module is used to:

[0066] Determining, according to the resolution of each of the target text line images, a resolution ratio corresponding to the resolution of each of the target text line images;

[0067] Determining an image quality assessment value of the document image according to a resolution ratio corresponding to a resolution of each of the target text line images and a quality assessment result of each of the target text line images;

[0068] The image quality of the document image is determined according to the image quality evaluation value of the document image.

[0069] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image quality determination method described in any one of the first aspects is implemented.

[0070] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image quality determination method described in any one of the first aspects is implemented.

[0071] The technical solution provided by the embodiment of the present disclosure performs quality assessment on the target text line image in the document image. The quality assessment result of the target text line image can be used to characterize the quality of the target text line image. In this way, the image quality of the document image is determined based on the quality assessment value of the target text line image. Compared with directly performing quality assessment on the entire document image including the text area and the background area, the image quality of the document image can be determined efficiently, thereby improving the efficiency of image quality assessment. In addition, the interference of the background area in the document image on the image quality assessment of the document image can also be reduced, which is conducive to improving the reliability of the document image quality assessment.

[0072] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0074] Figure 1 A schematic diagram of a process of determining image quality provided by an embodiment of the present disclosure is shown;

[0075] Figure 2 A schematic diagram of a process of determining image quality provided by an embodiment of the present disclosure is shown;

[0076] Figure 3 A schematic diagram of a process of determining image quality provided by an embodiment of the present disclosure is shown;

[0077] Figure 4 A schematic diagram of a process of determining image quality provided by an embodiment of the present disclosure is shown;

[0078] Figure 5 A schematic diagram of a process of determining image quality provided by an embodiment of the present disclosure is shown;

[0079] Figure 6 A schematic diagram of a process for training an image quality assessment model provided by an embodiment of the present disclosure is shown;

[0080] Figure 7 A schematic diagram of a process for training an image quality assessment model provided by an embodiment of the present disclosure is shown;

[0081] Figures 8a to 8c A schematic diagram showing an application of an image quality determination method provided by an embodiment of the present disclosure is shown;

[0082] Fig. 9 A schematic diagram of the structure of an image quality determination device provided by an embodiment of the present disclosure is shown;

[0083] Fig.10 A schematic structural diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0084] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the appended claims.

[0085] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present invention. The singular forms of "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0086] It should be understood that although the terms first, second, third, etc. may be used to describe various information in embodiments of the present invention, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of embodiments of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0087] In the related art, image quality evaluation is generally divided into three types: full-reference (FR), reduced-reference (RR) and no-reference (NR).

[0088] Full-reference image quality evaluation refers to comparing the difference between the image to be evaluated and the reference image, analyzing the degree of distortion of the image to be evaluated, and obtaining the quality evaluation result of the image to be evaluated by comparing and analyzing the image to be evaluated with the partial feature information of the ideal image as a reference. Since reference images for actual application scenarios are difficult to obtain, image quality evaluation in actual application scenarios is often without reference, and image quality evaluation without reference is also the most difficult type.

[0089] The no-reference method is to learn the mapping relationship between the features of the image to be evaluated and the subjective quality, without using any information of the reference image. Traditional image quality evaluation schemes are basically based on gradient calculation or energy function, etc. The obvious disadvantage of such schemes is that they need to set thresholds and cannot cope with general scenarios; deep learning often takes a long time, and there are few quality evaluation schemes for document images.

[0090] Figure 1 A flow chart of a method for determining image quality provided by an embodiment of the present disclosure is shown. Figure 1 As shown, the image quality determination method may include the steps of:

[0091] 101: Obtain one or more target text line images contained in the document image;

[0092] 102: Performing quality assessment on each target text line image to obtain a quality assessment result of each target text line image; the quality assessment result of the target text line image is used to characterize the quality of the target text line image;

[0093] 103: Determine the image quality of the document image according to the quality evaluation result of each target text line image.

[0094] The image quality determination method in this embodiment can be executed by an electronic device, and the electronic device includes a terminal and / or a server. The terminal may include but is not limited to: a mobile phone, a tablet computer, a computer, a smart camera, a wearable device, a smart home device and / or a smart car device, etc. The server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server.

[0095] A document image is an image form of a document containing text information. For example, a document image may be an image of a photographed or scanned receipt, invoice, resume, insurance policy, or medical information, or the document image may be an image of a target page in a Portable Document Format (PDF) file. This embodiment does not limit the specific document image.

[0096] Here, the document image may be a grayscale image obtained by graying a color document image.

[0097] The target text line image is an image containing a text line in the document image. A text line may include one or more text strips belonging to the same row or column, and a text strip may include one or more characters.

[0098] For example, when the text in the document image is arranged in a horizontal row, each row of text is considered as a text line. When the text in the document image is arranged in a vertical row, each column of text can also be considered as a text line.

[0099] In some examples, when the total number of text line images in the document image is greater than a first threshold, some of the text line images included in the document image can be used as target text line images. Here, the first threshold can be flexibly pre-set according to actual application needs, for example, the first threshold can be a positive integer greater than or equal to 50.

[0100] For example, a preset number of target text line images are randomly selected from all text line images of the document image, or one text line image is selected every n text line images as the target text line image, where n is greater than or equal to 1. For another example, a text line image with a resolution greater than a preset resolution can be selected from all text line images of the document image as the target text line image.

[0101] In some examples, when the total number of text line images in the document image is less than or equal to a second threshold, all text line images in the document image may be used as target text line images. Here, the second threshold may be less than or equal to the first threshold.

[0102] In some examples, in step 101 above, the document image may be segmented into a text area and a background area, and the text area may be segmented into a plurality of text line images; and one or more target text line images may be determined from the plurality of text line images.

[0103] In some examples, segmenting a text region into a plurality of text line images may include:

[0104] Perform text line detection on the text area to obtain a detection result of each text line in the document image; and segment a text line image of each text line from the text area based on the detection result of each text line.

[0105] The detection result of the text line may include position information of the text line, and the position information may include coordinate information.

[0106] In some examples, OCR (Optical Character Recognition) technology may be used to detect text lines in document images. Alternatively, a text detection model may be used to detect text lines in document images. For example, the text detection model may include but is not limited to: DBNet (Differentiable Binarization Network), PSENet (Progressive Scale Expansion Network), etc. It is understandable that this embodiment does not specifically limit the implementation method of text line detection.

[0107] In this embodiment, the quality assessment result of the target text line image can be used to characterize the quality of the target text line image.

[0108] For example, the quality assessment result includes a quality assessment value. When the quality assessment value is higher, the image quality is better; conversely, when the quality assessment value is lower, the image quality is worse.

[0109] In some examples, in the above step 102, for each target text line image, the quality of the target text line image is evaluated according to a preset image quality evaluation method to obtain a quality evaluation result of the target text line image.

[0110] In some examples, the quality of the target text line image may be evaluated based on a preset gradient function, where the gradient function may be, for example, a Brenner gradient function or a Tenengrad gradient function.

[0111] In other examples, a deep learning-based approach can be used to perform quality assessment on the target text line image.

[0112] Exemplarily, an image quality assessment model may be constructed and trained so that the trained image quality assessment model can be used to predict the quality assessment result of the target text line image.

[0113] The image quality assessment model may be constructed by a neural network, and the neural network may include, for example, a convolutional neural network (CNN) or a fully connected neuron, etc., which is not specifically limited in this embodiment.

[0114] In some examples, the method may further include:

[0115] The quality assessment results of each target text line image are marked on each target text line image, so that the user can know the quality assessment results of each target text line image of the document image more intuitively.

[0116] In some examples, the method may further include:

[0117] According to the quality assessment results of each target text line image, each target text line image is quality classified, wherein different quality classifications correspond to different quality assessment value ranges. In this way, by quality classifying each target text line image, it is convenient to perform corresponding processing according to the quality classification of the target text line image.

[0118] In some examples, the method may further include:

[0119] According to the quality evaluation results of each target text line image, the target text line images whose quality evaluation values ​​are less than the first preset value are determined; and according to the number of target text line images whose quality evaluation values ​​are less than the first preset value, the quality category to which the image quality of the document image belongs is determined.

[0120] Exemplarily, the number of target text line images whose quality assessment values ​​are less than a first preset value is greater than a second preset value, or the number of target text line images whose quality assessment values ​​are less than the first preset value accounts for a greater proportion than a preset proportion in the total number of target text line images, and it is determined that the quality category to which the image quality of the document image belongs is the first quality category; or

[0121] The number of target text line images whose quality assessment value is less than the first preset value is less than or equal to the second preset value, or the proportion of the number of target text line images whose quality assessment value is less than the first preset value to the total number of target text line images is less than or equal to the preset proportion, and the quality classification to which the image quality of the document image belongs is determined to be the second quality classification; wherein the image quality corresponding to the first quality classification is lower than the image quality corresponding to the second quality classification.

[0122] In this way, by determining the quality category to which the image quality of the document image belongs based on the number of target text line images whose quality evaluation values ​​are less than the first preset value, it is convenient to perform corresponding processing according to the quality classification of the document image.

[0123] In some examples, in the above step 103, the quality evaluation value of each target text line image may be counted according to the quality evaluation result of each target text line image, and the image quality of the document image may be determined according to the statistical result.

[0124] Exemplarily, the image quality evaluation value of the document image may be an average value, a minimum value, a median value, or the like of the quality evaluation results of all target text line images.

[0125] In some examples, the image quality level of the document image can be determined according to the image quality evaluation value of the document image. Different image quality levels correspond to different image quality evaluation value ranges.

[0126] The disclosed embodiment provides an image quality determination method, which performs quality assessment on a target text line image in a document image, and the quality assessment result of the target text line image is used to characterize the quality of the target text line image. In this way, the image quality of the document image is determined based on the quality assessment value of the target text line image. Compared with directly performing quality assessment on the entire document image including the text area and the background area, the image quality of the document image can be determined efficiently, thereby improving the efficiency of image quality assessment. In addition, the interference of the background area in the document image on the image quality assessment of the document image can also be reduced, which is beneficial to improving the reliability of the document image quality assessment.

[0127] In some embodiments, Figure 2 As shown, based on Figure 1 In the above step 101, the step of obtaining one or more target text line images contained in the document image may include the following steps:

[0128] 1011: Perform text line detection on the document image to obtain multiple text line images corresponding to the document image;

[0129] 1012: Extract one or more target text line images from multiple text line images.

[0130] In some examples, in the above step 1011, a text detection model can be used to perform text line detection on the document image to obtain coordinate information of each text line in the document image; based on the coordinate information of each text line in the document image, a text line image of each text line is segmented from the document image.

[0131] Exemplarily, the coordinate information of the text line may include the coordinates of the four vertices of the minimum circumscribed rectangle (i.e., the detection box) of the text line. Here, a coordinate system may be established with the upper left corner of the document image as the coordinate origin, the width direction of the document image as the horizontal axis, and the height direction of the document image as the vertical axis to determine the coordinate information of the text line in the coordinate system.

[0132] For example, multiple text line images in a document image can be represented as; D = {p1, p2, p3, ..., p n}, where n is less than or equal to the total number of text line images in the document image. The coordinate information corresponding to the i-th text line image in the document image can be represented as: p i={(x1,y1),(x2,y2),(x3,y3),(x4,y4)}, where (x1,y1) is the upper left corner coordinate corresponding to the i-th text line image, (x2,y2) is the upper right corner coordinate corresponding to the i-th text line image, (x3,y3) is the lower right corner coordinate corresponding to the i-th text line image, and (x4,y4) is the lower left corner coordinate corresponding to the i-th text line image.

[0133] In some examples, in the above step 1012, target text line images can be extracted from multiple text line images at intervals of a preset number of images. The preset number of images can be set according to actual application needs, or the preset number of images can be set according to the total number of text line images of the document image and the target number of target text line images to be extracted.

[0134] In other examples, in the above step 1012, target text line images can be randomly extracted from multiple text line images; for example, a target number of target text line images can be randomly extracted from multiple text line images; or, target text line images can be randomly extracted from multiple text line images whose number accounts for a target ratio of the total number of all text line images.

[0135] For example, target text line images accounting for 1 / 2, 1 / 3, or 1 / 4 of all text line images are randomly extracted.

[0136] In some other examples, in the above step 1012, one or more target text line images that meet preset requirements may be extracted from multiple text line images. For example, the preset requirements may include but are not limited to at least one of the following: the number of characters in the text line image is within a preset character number range, the font size in the text line image is a preset font size, the height of the text line image is within a preset height range, and the width of the text line image is within a preset width range.

[0137] Specifically, all text line images can be traversed, and each time a text line image is traversed, it is determined whether the text line image meets the preset requirements; if the text line image meets the preset requirements, the text line image is extracted as the target text line image, until the determination of whether all text line images meet the preset requirements is completed.

[0138] In some other examples, when extracting multiple different target text line images from multiple text line images, the number of characters in different target text line images is within different preset word number ranges, and / or the font sizes in different target text line images belong to different preset font sizes, and / or the heights of different target text line images are within different preset height ranges, and / or the widths of different target text line images are within different preset width ranges.

[0139] The preset font size, number of characters, height and width in the above-mentioned text line image can all be determined based on the detection result of text line detection performed on the document image.

[0140] For example, determining the preset font size in the text line image may include: performing text detection on the document image, determining a detection frame of the detected text line, and using the height of the detection frame of each text line as the height of the text line; and determining the font size corresponding to the text line height using the correspondence between the preset font size and the text line height. Here, the detection frame is a closed shape surrounding the text line, and the closed shape may be a regular shape or an irregular shape, and is usually a rectangle.

[0141] For another example, determining the number of characters in a text line image may include: after detecting the text line image in the document image, vertically segmenting the text line image through vertical projection to obtain the coordinate position of each character in the text line image, segmenting the single characters based on the coordinate position of the characters, and determining the number of segmented single characters as the number of characters in the text line image.

[0142] For another example, determining the height and width of the text line image may include: using the height of the detection box of each text line as the height of the text line image, and using the width of the detection box of each text line as the width of the text line image.

[0143] In this embodiment, the target text line image is extracted according to the number of characters, font size, height and / or width of the text line image. This makes it easier to subsequently use the extracted target text line image to evaluate the quality of the document image. Compared to using all text line images of the document image to evaluate the quality of the document image, the text line images in the document image can be processed in a targeted manner, which saves image processing resources and also improves the efficiency of image quality evaluation.

[0144] It is understandable that, in practical applications, one or more of the above-mentioned extraction methods may be used to extract the target text line image, and the embodiments of the present disclosure do not specifically limit this.

[0145] In addition, it is worth noting that no matter what extraction method is used, when the total number of extracted target text line images is less than a first number that is less than a preset number, in order to avoid the reliability of the document image quality assessment being affected by the small number of target text line images, a second number of text line images can be randomly extracted from the remaining text line images as target text line images; here, the sum of the first number and the second number is not less than the preset number.

[0146] In the disclosed embodiment, one or more target text line images are extracted from multiple text line images of a document image, so that the quality assessment result of the extracted target text line images can be used to determine the image quality of the document image later. Compared with directly performing quality assessment on the entire document image, the image quality of the document image can be efficiently determined, thereby improving the efficiency of image quality assessment; in addition, the interference of the background area in the document image on the image quality assessment of the document image can also be reduced, which is conducive to improving the reliability of document image quality assessment. In addition, compared with performing quality assessment on all text line images of a document image one by one, the quality of the document image is assessed by performing target text line images extracted from all text line images. In this way, the sampled target text line images are processed in a targeted manner, which can greatly save image processing resources, further reduce the computational time in the quality assessment process, and thus further improve the efficiency of document image quality assessment.

[0147] In some embodiments, Figure 3 As shown, based on Figure 1 In the above step 102, the quality assessment of each target text line image is performed to obtain the quality assessment result of each target text line image, which may include the following steps:

[0148] 1021: Use a pre-trained image quality assessment model to perform prediction processing on each target text line image to obtain a quality assessment result of each target text line image; wherein the image quality assessment model is trained using sample text line images and quality label values ​​of the sample text line images.

[0149] In some examples, the image quality assessment model may include, but is not limited to: a convolutional neural network model, a deep neural network model, a recursive neural network model, or a regression model. The regression model may be, for example, a support vector regression model.

[0150] It is understandable that, in specific applications, a suitable neural network can be used to construct an image quality assessment model according to actual needs.

[0151] In some examples, the image quality assessment model may be a lightweight image quality assessment model.

[0152] Specifically, for each target text line image, the target text line image is input into a pre-trained image quality assessment model to obtain a quality assessment result of the target text line image output by the image quality assessment model.

[0153] The image quality assessment model may be trained based on sample text line images and quality label values ​​corresponding to the sample images. Here, the sample text line images may be obtained by degrading the original sample text line images.

[0154] For example, the image quality assessment model may be trained based on sample text line images and quality label values ​​corresponding to the sample text line images, and the training of the image quality assessment model may be terminated when the number of training times reaches a preset number.

[0155] In some examples, the training process of the image quality assessment model may refer to the description of the relevant embodiments in the following text and will not be described in detail here.

[0156] In the disclosed embodiment, by utilizing a pre-trained image quality assessment model to predict the quality assessment result of the target text line image, compared with image quality assessment performed using a non-deep learning image quality assessment method, this can be applied to image quality assessment in different scenarios and has better versatility.

[0157] In some embodiments, in the above step 1021, the use of a pre-trained image quality assessment model to perform prediction processing on each target text line image to obtain a quality assessment result of each target text line image may include the following steps:

[0158] For each target text line image, the target text line image is input into the image quality assessment model to perform the following processing:

[0159] Perform image feature extraction on the target text line image to obtain image shallow features and image deep features;

[0160] According to the shallow features and deep features of the image, the quality assessment result of the target text line image is obtained.

[0161] Exemplarily, the image quality assessment model may include a feature extraction network, a feature fusion network and a prediction network; wherein the feature extraction network is used to extract shallow image features and deep image features from the target text line image; the feature fusion network is used to fuse the shallow image features and deep image features extracted by the feature extraction network to obtain image fusion features; the prediction network is used to predict the image fusion features output by the feature fusion network to obtain the quality assessment result of the target text line image.

[0162] For example, the feature extraction network may include N convolution blocks cascaded in sequence, each convolution block may include two or more cascaded convolution layers, the convolution layers of different convolution blocks are used to extract different image features, and the image features output by the n-1th convolution block are used to input into the nth convolution block for image feature extraction, where n is less than or equal to N and greater than 1, and N is a positive integer greater than 2.

[0163] As an example, in the N convolution blocks cascaded sequentially in the feature extraction network, the convolution layers of the first m convolution blocks are used to extract shallow features of the image, and the convolution layers of the last Nm convolution blocks in the N convolution blocks are used to extract deep features of the image. Where m is a positive integer greater than or equal to 1 and less than N.

[0164] In some examples, obtaining a quality assessment result of the target text line image according to the shallow features of the image and the deep features of the image may include:

[0165] The shallow features and deep features of the image are fused to obtain the image fusion features;

[0166] According to the image fusion features, the quality of the target text line image is evaluated to obtain the quality evaluation result of the target text line image.

[0167] In this embodiment, after obtaining the shallow features and deep features of the image output by the feature extraction network, the shallow features and deep features of the image can be fused through the feature fusion network to obtain image fusion features. For example, the feature fusion network can be used to splice the shallow features and deep features of the image to obtain image fusion features.

[0168] In some examples, the shallow image features may include image features such as color, texture, and / or gradient, etc. The shallow image features may be extracted from the target text line image by a shallow network in the feature extraction network.

[0169] The generalization and interpretability of shallow image features are better, but the number of shallow image features is limited.

[0170] In some examples, the deep features of the image may include deep learning features. The deep learning features are deeper and more abstract features in the target text line image than the shallow features of the image. The deep learning features can be extracted by a deep network in the feature extraction network based on the shallow features of the image of the target text line image.

[0171] Compared with shallow image features, deep image features have poor interpretability, but they have an advantage in the number of features.

[0172] In some examples, the quality assessment result of the target text line image may include a quality assessment value, and the value range of the quality assessment value is, for example, 0 to 1. The larger the quality assessment value, the higher the image quality.

[0173] In this embodiment, shallow image features and deep image features of the target text line image are extracted through an image quality assessment model, so that more image features can be used to assess the quality of the target text line image, which is beneficial to improving the effect of image quality assessment.

[0174] In some embodiments, Figure 4 As shown, based on Figure 1 In the above step 103, determining the image quality of the document image according to the quality evaluation results of each target text line image may include the following steps:

[0175] 1031: Determine the resolution of each target text line image;

[0176] 1032: Determine the image quality of the document image according to the quality assessment result and resolution of each target text line image.

[0177] Here, the resolution of the image may reflect the number of pixels contained in the image. For example, compared with the resolution of the text line image of a certain content line in the document image, the resolution of the text line image of the subject line is larger.

[0178] In the above step 1031, the resolution of each target text line image can be determined based on the coordinate information corresponding to each target text line image; wherein the coordinate information corresponding to any target text line image may include the four vertex coordinates of the minimum circumscribed rectangle of the text line in the text line image.

[0179] Exemplarily, for each target text line image, the width and height of the target text line image are determined according to the coordinate information corresponding to the target text line image, and the resolution of the target text line image is determined according to the width and height of the target text line image.

[0180] Here, the resolution of the text line image can be expressed by multiplying the number of horizontal pixels by the number of vertical pixels in the text line image. For example, the resolution of the text line image is 100x10, which means that the text line image has 100 pixels in the horizontal direction and 10 pixels in the vertical direction, and the total number of pixels is the product of the number of horizontal pixels and the number of vertical pixels.

[0181] In some examples, such as Figure 5 As shown, in the above step 1032, determining the image quality of the document image according to the quality evaluation results and resolution of each target text line image may include:

[0182] 10321: Determine, according to the resolution of each target text line image, a resolution ratio corresponding to the resolution of each target text line image;

[0183] 10322: Determine an image quality assessment value of the document image according to a resolution ratio corresponding to a resolution of each target text line image and a quality assessment result of each target text line image;

[0184] 10323: Determine the image quality of the document image according to the image quality evaluation value of the document image.

[0185] In the above step 10321, the sum of the resolutions of all the target text line images can be determined based on the resolution of each target text line image, and the resolution ratio of each target text line image to the sum of the resolutions of all the target text line images can be determined. Here, the resolution of any target text line image can be expressed as the total number of pixels in the target text line image.

[0186] In the above step 10322, the quality assessment results of each target text line image may be statistically processed according to the resolution ratio corresponding to the resolution of each target text line image to obtain the image quality assessment value of the document image.

[0187] As an example, the quality assessment results of the target text line images whose resolution ratio is greater than or equal to the preset ratio threshold can be statistically processed to obtain the image quality assessment value of the document image. The preset ratio threshold can be set according to actual needs, for example, the preset ratio threshold can be set to 0.05 or 0.06.

[0188] Here, the smaller the resolution ratio of a target text line image is, the lower the impact of the quality assessment result of the target text line image on the quality assessment of the document image is. Therefore, the quality assessment result of the target text line image with a larger resolution ratio can be selected for quality assessment of the document image.

[0189] In some examples, the statistical processing of the quality assessment results of the target text line images may include, but is not limited to, one of the following: averaging the quality assessment results of the target text line images, taking the median of the quality assessment results of the target text line images, and performing weighted summation of the quality assessment results of the target text line images.

[0190] In some examples, in the above step 10322, the resolution ratio corresponding to the resolution of each target text line image can be used as the weight corresponding to each target text line image, and the quality assessment results of each target text line image can be weighted calculated to obtain the weighted calculation result as the image quality assessment value of the document image.

[0191] Specifically, the image quality evaluation value of the document image can be calculated according to the following calculation formula:

[0192] A=∑(a n *b n );

[0193] Where A represents the image quality evaluation value of the document image, a n represents the image quality assessment value of the nth target text line image, b nIndicates the resolution ratio corresponding to the nth target text line image; n is less than or equal to the total number of text line images contained in the document image; the sum of the resolution ratios of n target text line images is 1.

[0194] For example, assuming that the quality assessment results of the three target text line images of a document image are 0.7, 0.5, and 0.3, respectively, and their respective resolutions are 100x10, 100x20, and 100x10, it can be calculated that the resolution ratios corresponding to the resolutions of these three target text line images are 0.25, 0.5, and 0.25, respectively. Then the image quality assessment value of the document image is: 0.7*0.25+0.5*0.5+0.3*0.25, that is, the image quality assessment value of the document image is equal to 0.5.

[0195] In some examples, in the above step 10323, the image quality level of the document image can be determined according to the quality assessment value range to which the image quality assessment value belongs, and the image quality of the document image can be determined according to the image quality level of the document image.

[0196] Different quality evaluation value ranges correspond to different image quality levels. For example, the image quality level can be divided into the first quality level, the second quality level and the third quality level, where the first quality level is higher than the second quality level, and the second quality level is higher than the third quality level. For example, the first quality level indicates good image quality, the second quality level indicates average image quality, and the third quality level indicates poor image quality.

[0197] The quality assessment value range corresponding to each quality level can be set according to actual application needs. For example, the quality assessment value ranges corresponding to the first quality level, the second quality level and the third quality level are: [0, 0.4), [0.4, 0.6), [0.6, 1] respectively.

[0198] In some examples, in order to further improve the efficiency of image quality assessment, if the quality assessment values ​​of each of the multiple target text line images are greater than or equal to a preset value, the image quality of the document image is determined based on the statistical results of the quality assessment results of the multiple target text line images (for example, the average value of the quality assessment values ​​of the target text line images). If the quality assessment result of at least one target text line image among the multiple target text line images is less than a preset value, the image quality of the document image is determined based on the quality assessment results and resolution of each target text line image.

[0199] In this embodiment, the resolution of each target text line image is determined, and the image quality of the document image is determined based on the quality assessment results and resolution of each target text line image. In this way, the degree of influence of the resolution of different target text line images on the document image quality can be utilized to improve the efficiency of document image quality assessment and accurately perform quality assessment on the document image.

[0200] In some embodiments, Figure 6 As shown, a training method for an image quality assessment model is provided, the method comprising the following steps:

[0201] 201: Acquire a sample image set, wherein the sample image set includes a plurality of sample text line images annotated with quality label values;

[0202] 202: Inputting the sample text line image into the image quality assessment model for prediction, and obtaining a quality prediction value of the sample text line image;

[0203] 203: According to the loss value between the quality prediction value and the quality label value of the sample text line image, the parameters in the image quality assessment model are iteratively updated until the preset conditions are met, thereby obtaining a trained image quality assessment model.

[0204] The trained image quality assessment model can be used to predict the quality assessment results of the target text line image.

[0205] In some examples, the sample text line image may be obtained by degrading the original text line image. The original text line image may be a text line image with a definition greater than a preset definition.

[0206] For example, the original text line image may be a clean text line image, which is a clear text line image. For example, the quality score of the original text line image may be the upper limit of the quality score range, and the quality score of the original text line image may be 1.

[0207] In some examples, the original text line image can be obtained based on the text line detection results of a sample document image. The sample document image can be, for example, a photographed or scanned image of a document such as a receipt, invoice, resume, insurance policy, or medical information, or the document image can be an image of a target page in a document format file. This embodiment does not limit the specific sample document image.

[0208] In other examples, the original text line image may be an image generated by image rendering, for example, the original text line image may be generated by a tool such as a specific software renderer.

[0209] In some examples, different sample text line images may be obtained by performing different degradation processes on the same original text line image.

[0210] In some examples, different sample text line images can be obtained by using the same degradation operation to degrade the same original text line image to different degrees.

[0211] In some examples, different sample text line images may be obtained by performing the same or multiple different degradation processes on different original text line images.

[0212] In some examples, the degradation process may include at least one of a blurring process, a compression process, and a noise adding process.

[0213] For example, the original text line image is blurred with different blurring degrees to obtain a plurality of sample text line images.

[0214] For example, a first fuzzy processing is performed on a part of the original text line image, and a second fuzzy processing is performed on another part of the original text line image to obtain a sample text line image.

[0215] For example, the original text line image is compressed to different compression degrees to obtain a plurality of sample text line images.

[0216] For example, the original text line image is subjected to noise processing to obtain a sample text line image.

[0217] In some examples, the resolution of the original text line image is the same as the resolution of the sample text line image obtained by degrading the original text line image.

[0218] In some examples, the quality label value of the sample text line image may be an objective quality score, or may also be a subjective quality score.

[0219] In the above step 202, the sample text line image is input into the image quality assessment model for prediction to obtain the quality prediction value of the sample text line image. The relevant description of step 1021 in the above embodiment can be referred to and will not be repeated here.

[0220] In some examples, the preset conditions may include: the loss value between the quality prediction value and the quality label value of the sample text line image is less than or equal to a preset threshold, or the difference between the loss value obtained in the current round of training and the loss value obtained in the previous round of training is less than a preset difference.

[0221] In the disclosed embodiment, the image quality assessment model is iteratively trained by using sample text line images annotated with quality label values, which can improve the training effect of the image quality assessment model and further improve the image quality assessment effect of the image quality assessment model.

[0222] In some embodiments, Figure 7 As shown, in the above step 201, obtaining a sample image set may include the following steps:

[0223] 2011: The original text line image is processed by various degradation operations to obtain a sample text line image;

[0224] 2012: For each degradation operation, obtain the image quality score after the original text line image is degraded by the degradation operation;

[0225] 2013: Determine the quality label value of the sample text line image based on the quality score of each image and the weight corresponding to each degradation operation.

[0226] In some examples, the multiple degradation operations include at least two of blurring, compression, and noise addition.

[0227] In some examples, the original text line image may be blurred, compressed, and noised in sequence to obtain a sample text line image, or the original text line image may be blurred, noised, and compressed in sequence to obtain a sample text line image.

[0228] In this embodiment, the image quality score after the original text line image is blurred is negatively correlated with the blurred convolution kernel; the image quality score after the original text line image is compressed is negatively correlated with the compression degree; the image quality score after the original text line image is denoised is negatively correlated with the number of noise points.

[0229] In some examples, the blurring process may include, but is not limited to, Gaussian blurring, mean blurring, and / or median blurring.

[0230] For example, Gaussian blur uses a Gaussian convolution kernel to perform a convolution operation on all pixels in the original image to obtain a blurred image.

[0231] In some examples, the compression process may be a compression process using a preset compression algorithm, and the compression algorithm may include, but is not limited to, a JPEG (Joint Photographic Experts Group) compression coding algorithm, Shannon coding, or Huffman coding.

[0232] Noise processing may include, but is not limited to, random noise, salt and pepper noise, or Gaussian noise. Random noise is the process of randomly adding noise points to an image through a random function. Salt and pepper noise, also known as impulse noise, can randomly set a certain proportion of pixels in an image to 0 or 255, so that black and white noise points are randomly distributed on the image. Gaussian noise refers to a type of noise whose probability density function in an image follows a Gaussian distribution (i.e., normal distribution).

[0233] In some examples, in the above step 2012, the image quality score after the original text line image is degraded by various degradation operations may be obtained based on image statistical characteristics.

[0234] For example, the image statistical characteristics may include: a mean value, a standard deviation and / or an average gradient of image pixels.

[0235] The mean value of image pixels can reflect the average brightness of the image. The greater the average brightness, the better the image quality.

[0236] The standard deviation of image pixels is used to characterize the degree of dispersion of the grayscale values ​​of image pixels relative to the mean. The larger the standard deviation, the more dispersed the grayscale levels in the image and the better the image quality.

[0237] The average gradient of image pixels is used to reflect the detail contrast and texture transformation in the image. The average gradient reflects the clarity of the image to a certain extent.

[0238] In some examples, in step 2013, a weighted sum may be performed according to the weights corresponding to the degradation operations according to the image quality scores, and the weighted sum result may be determined as the quality label value of the sample text line image. Here, the sum of the weights corresponding to the degradation operations is 1.

[0239] In some examples, the weight corresponding to the blurring process is greater than the weight corresponding to the compression process.

[0240] In some examples, the weight corresponding to the blurring process is greater than the weight corresponding to the noise adding process.

[0241] In some examples, the weights corresponding to the fuzzy processing, compression processing, and noise processing can be set according to expert experience. For example, the weight corresponding to the fuzzy processing, the weight corresponding to the compression processing, and the weight corresponding to the noise processing can be 0.8, 0.1, and 0.1, respectively, but the embodiments of the present disclosure are not limited to this.

[0242] In practical applications, compared with image compression and image noise, image blurring is a very important factor of image degradation. Setting a greater weight for image blurring can reliably determine the image quality score after image degradation.

[0243] In this embodiment, a sample text line image is obtained by performing a plurality of degradation operations on the original text line image, and image quality scores after the original text line image is degraded by each degradation operation are obtained respectively, and a quality label value of the sample text line image is determined according to each image quality score and a weight corresponding to each degradation operation. Thus, when determining the quality label value of the sample text line image, by combining the different degradation operations used to generate the sample text line image and the weights corresponding to the different degradation operations, the image quality score of the sample text line image can be reliably obtained compared to a single degradation operation, which can improve the availability of training samples of the image evaluation model, and thereby improve the model effect of subsequent training.

[0244] In order to further explain any embodiments of the present disclosure, some specific embodiments are provided below.

[0245] The disclosed embodiments provide an image quality determination method, which can be applied to the quality evaluation of document images in general scenarios, and can determine an image quality assessment value similar to that of the human eye without reference, which is beneficial to the development of downstream tasks.

[0246] The image quality determination method provided by the embodiment of the present disclosure first obtains the image quality assessment value of the text line image (the text line may include one or more "text bars") in the image document, and then calculates the contribution of each text line image to the quality assessment value of the entire image based on the resolution of each text line image, thereby obtaining the quality assessment value of the entire image.

[0247] In some embodiments, obtaining an image quality assessment value of a text line image in an image document may include: predicting the image quality of the text line image in the image document based on an image quality assessment model (e.g., a deep learning model) to obtain an image quality assessment value of the text line image.

[0248] In some embodiments, the training process of the image quality assessment model may include: constructing a training sample set; using the training sample set to train the image quality assessment model to obtain a trained image quality assessment model, and the trained image quality assessment model is used to predict the image quality score of the text line image.

[0249] In some embodiments, the training sample set may include: a training sample image obtained by degrading a rendered text line image. For example, a clear text line image is first rendered, and the resolution of the text line image is 32*320, and then the text line image is degraded by text blurring, image compression, and image noise. These three degradation operations provide different proportions of quality contribution. For example, the quality contribution corresponding to text blurring, image compression, and image noise is 80%, 10%, and 10%, respectively.

[0250] The quality of the image after text blurring is negatively correlated with the size of the convolution kernel used for text blurring. The image compression algorithm can adopt the JPEG algorithm, and the image quality is negatively correlated with the degree of image compression. The image noise adopts a randomly distributed form, and the image quality is negatively correlated with the number of noise points.

[0251] The image quality score of the training sample image is: the image quality score of the training sample image = 0.8*image blur score+0.1*image compression score+0.1*image noise score.

[0252] Please refer to Figures 8a to 8c , which is a schematic diagram of an application of an image quality determination method provided in an embodiment of the present disclosure.

[0253] The image quality assessment model includes an input layer (Input), an intermediate layer and an output layer (Output); wherein the input layer is used to input a text line image; the output layer is used to output an image quality score of the text line image; the intermediate layer includes multiple neural network layers, for example, the intermediate layer includes a first convolution layer (Convolution, Conv), a first batch normalization layer (BatchNormalization, BN), a second convolution layer, and a second batch normalization layer.

[0254] For example, Figure 8a After performing text line detection on the document image shown in Figure 8b The text line image shown as the input to the image quality assessment model is processed by the image quality assessment model, and the image quality assessment model can output the following Figure 8c The image quality assessment results are shown. For example, the quality assessment value corresponding to the first text line image of the document image is 0.78, the quality assessment value corresponding to the second text line image is 0.64, the quality assessment value corresponding to the third text line image is 0.78, and so on. The higher the quality assessment value of the text line image, the better the quality of the text line image.

[0255] In this embodiment, a document image is used as the document image whose image quality is to be determined. Text line detection is performed on the document image to obtain the position of each text line image in the document image. Each text line image in the document image will be outputted with an image quality assessment value through an image quality assessment model. Finally, the image quality assessment value of the document image is calculated based on the image quality assessment value of each text line image and the resolution of each text line image.

[0256] In practical applications, in order to improve the accuracy of image quality evaluation, the following calculation formula is provided based on the different contributions of each text line image to the entire document image due to different resolutions:

[0257] A=Σ(a n *b n );

[0258] Where A represents the image quality evaluation value of the document image, a n represents the image quality assessment value of the nth text line image of the document image, b n Represents the resolution ratio of the nth text line image of the document image; n is less than or equal to the total number of text line images contained in the document image; the sum of the resolution ratios of n text line images is 1.

[0259] For example, for three text line images in a document image, the image quality assessment values ​​of the three text line images are 0.7, 0.5, and 0.3, respectively, and the resolution ratios of the three text line images are 0.4, 0.3, and 0.3, respectively. Then, the image quality assessment value of the document image is: 0.7*0.4+0.5*0.3+0.3*0.3, that is, the image quality assessment value of the document image is 0.52.

[0260] In some embodiments, the image quality level of the document image can be determined according to the quality evaluation value range to which the image quality evaluation value belongs, and different quality evaluation value ranges correspond to different image quality levels. For example, the image quality level can be divided into a first quality level, a second quality level, and a third quality level, the first quality level is higher than the second quality level, and the second quality level is higher than the third quality level. For example, the first quality level indicates good image quality, the second quality level indicates average image quality, and the third quality level indicates poor image quality.

[0261] For the effect test in practical application, when the text strip is used as the test set, the accuracy can reach about 85%, and when the whole image is used as the data set, the accuracy reaches 96%. The test results show that the image quality determination method provided in this embodiment has good effectiveness.

[0262] In summary, the image quality determination method provided by the embodiment of the present disclosure has a simple method for generating a training data set for an image quality assessment model, has a low cost for acquiring training data, has better model performance, and can more efficiently predict the quality score of a document image.

[0263] Fig. 9 FIG. 1 is a structural block diagram of an apparatus for determining image quality according to an exemplary embodiment. Fig. 9 , the image quality determination device 100 may include:

[0264] An acquisition module 110 is used to acquire one or more target text line images contained in a document image;

[0265] An evaluation module 120 is used to perform quality evaluation on each of the target text line images to obtain a quality evaluation result of each of the target text line images; the quality evaluation result of the target text line image is used to characterize the quality of the target text line image;

[0266] The determination module 130 is used to determine the image quality of the document image according to the quality evaluation results of each of the target text line images.

[0267] In some embodiments, the evaluation module 120 is used to:

[0268] A pre-trained image quality assessment model is used to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images; wherein the image quality assessment model is obtained by training using sample text line images and quality label values ​​of the sample text line images.

[0269] In some embodiments, the acquisition module 110 is used to:

[0270] Performing text line detection on the document image to obtain a plurality of text line images corresponding to the document image;

[0271] One or more target text line images are extracted from the multiple text line images.

[0272] In some embodiments, the evaluation module 120 is used to:

[0273] For each of the target text line images, the target text line image is input into the image quality assessment model to perform the following processing:

[0274] Performing image feature extraction processing on the target text line image to obtain image shallow features and image deep features;

[0275] A quality assessment result of the target text line image is obtained according to the shallow features of the image and the deep features of the image.

[0276] In some embodiments, the evaluation module 120 is used to:

[0277] Performing fusion processing on the shallow features of the image and the deep features of the image to obtain image fusion features;

[0278] According to the image fusion feature, the quality of the target text line image is evaluated to obtain a quality evaluation result of the target text line image.

[0279] In some embodiments, the apparatus further comprises a training module, wherein the training module comprises:

[0280] An acquisition unit, configured to acquire a sample image set, wherein the sample image set includes a plurality of sample text line images annotated with quality label values;

[0281] A prediction unit, used for inputting the sample text line image into the image quality assessment model for prediction, so as to obtain a quality prediction value of the sample text line image;

[0282] The training unit is used to iteratively update the parameters in the image quality assessment model according to the loss value between the quality prediction value of the sample text line image and the quality label value until the preset conditions are met to obtain the trained image quality assessment model.

[0283] In some embodiments, the acquisition unit is used to:

[0284] Performing multiple quality degradation operations on the original text line image to obtain the sample text line image;

[0285] For each of the degradation operations, obtaining an image quality score after the original text line image is degraded by the degradation operation;

[0286] The quality label value of the sample text line image is determined according to each of the image quality scores and the weight corresponding to each of the quality degradation operations.

[0287] In some embodiments, the plurality of degradation operations include at least two of blurring, compression and noise addition.

[0288] In some embodiments, the determination module 130 is used to:

[0289] Determining the resolution of each target text line image;

[0290] The image quality of the document image is determined according to the quality evaluation results and the resolution of each of the target text line images.

[0291] In some embodiments, the determination module 130 is used to:

[0292] Determining, according to the resolution of each of the target text line images, a resolution ratio corresponding to the resolution of each of the target text line images;

[0293] Determining an image quality assessment value of the document image according to a resolution ratio corresponding to a resolution of each of the target text line images and a quality assessment result of each of the target text line images;

[0294] The image quality of the document image is determined according to the image quality evaluation value of the document image.

[0295] Regarding the image quality determination device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the image quality determination method, and will not be elaborated here.

[0296] An embodiment of the present disclosure further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image quality determination method provided by any embodiment of the present disclosure is implemented.

[0297] The device may be, but is not limited to: a terminal and / or a server. The terminal may be, but is not limited to, a mobile phone, a tablet computer, a computer, a wearable device, a vehicle-mounted device, a smart home device and / or a smart vehicle-mounted device.

[0298] Here, the server may be various types of servers; for example, the server may be, but is not limited to, a cloud server or a local server.

[0299] The memory may include various types of storage media, which are non-transitory computer storage media that can continue to memorize information stored thereon after the communication device loses power.

[0300] The processor may be connected to the memory via a bus or the like, and is used to read an executable program stored in the memory, for example, to implement the image quality determination method provided by any embodiment of the present disclosure.

[0301] An embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an executable program, wherein when the executable program is executed by a processor, the image quality determination method provided by any embodiment of the present disclosure is implemented.

[0302] like Fig.10 FIG. 2 is a diagram showing a structure of an electronic device 200 according to an exemplary embodiment. For example, the electronic device 200 may be provided as a network side device. Fig.10 The electronic device 200 includes a processing component 210, which further includes one or more processors, and a memory resource represented by a memory 220 for storing instructions executable by the processing component 210, such as an application. The application stored in the memory 220 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 210 is configured to execute the instructions to perform the image quality determination method in the above-mentioned embodiment.

[0303] The electronic device 200 may further include a power supply component 230 configured to perform power management of the electronic device 200, a wired or wireless network interface 240 configured to connect the electronic device 200 to a network, and an input / output (I / O) interface 250. The electronic device 200 may operate based on an operating system stored in the memory 220, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0304] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0305] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A method for determining image quality, characterized in that: The method comprises: Obtain one or more target text line images contained in the document image; Performing quality assessment on each of the target text line images to obtain a quality assessment result of each of the target text line images; the quality assessment result of the target text line image is used to characterize the quality of the target text line image; The image quality of the document image is determined according to the quality evaluation results of each of the target text line images.

2. The method according to claim 1, characterized in that The performing quality assessment on each of the target text line images to obtain a quality assessment result of each of the target text line images includes: A pre-trained image quality assessment model is used to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images; wherein the image quality assessment model is obtained by training using sample text line images and quality label values ​​of the sample text line images.

3. The method according to claim 1, characterized in that The step of acquiring one or more target text line images contained in the document image comprises: Performing text line detection on the document image to obtain a plurality of text line images corresponding to the document image; One or more target text line images are extracted from the multiple text line images.

4. The method according to claim 2, characterized in that: The method of using a pre-trained image quality assessment model to perform prediction processing on each of the target text line images to obtain a quality assessment result of each of the target text line images includes: For each of the target text line images, the target text line image is input into the image quality assessment model to perform the following processing: Performing image feature extraction processing on the target text line image to obtain image shallow features and image deep features; A quality assessment result of the target text line image is obtained according to the shallow features of the image and the deep features of the image.

5. The method according to claim 4, characterized in that The obtaining, according to the shallow features of the image and the deep features of the image, a quality assessment result of the target text line image includes: Performing fusion processing on the shallow features of the image and the deep features of the image to obtain image fusion features; According to the image fusion feature, the quality of the target text line image is evaluated to obtain a quality evaluation result of the target text line image.

6. The method according to claim 2, characterized in that The training process of the image quality assessment model includes: Acquire a sample image set, wherein the sample image set includes a plurality of sample text line images annotated with quality label values; Inputting the sample text line image into the image quality assessment model for prediction to obtain a quality prediction value of the sample text line image; According to the loss value between the quality prediction value of the sample text line image and the quality label value, the parameters in the image quality assessment model are iteratively updated until preset conditions are met, thereby obtaining the trained image quality assessment model.

7. The method according to claim 6, characterized in that The step of obtaining a sample image set comprises: Performing multiple quality degradation operations on the original text line image to obtain the sample text line image; For each of the degradation operations, obtaining an image quality score after the original text line image is degraded by the degradation operation; The quality label value of the sample text line image is determined according to each of the image quality scores and the weight corresponding to each of the quality degradation operations.

8. The method according to any one of claims 1 to 7, characterized in that: Determining the image quality of the document image according to the quality evaluation results of each target text line image includes: Determining the resolution of each target text line image; The image quality of the document image is determined according to the quality evaluation results and the resolution of each of the target text line images.

9. The method according to claim 8, characterized in that Determining the image quality of the document image according to the quality evaluation results and resolution of each of the target text line images includes: Determining, according to the resolution of each of the target text line images, a resolution ratio corresponding to the resolution of each of the target text line images; Determining an image quality assessment value of the document image according to a resolution ratio corresponding to a resolution of each of the target text line images and a quality assessment result of each of the target text line images; The image quality of the document image is determined according to the image quality evaluation value of the document image.

10. An image quality determination device, characterized in that: The device comprises: An acquisition module, used for acquiring one or more target text line images contained in a document image; An evaluation module, used to perform quality evaluation on each of the target text line images to obtain a quality evaluation result of each of the target text line images; the quality evaluation result of the target text line image is used to characterize the quality of the target text line image; The determination module is used to determine the image quality of the document image according to the quality evaluation results of each target text line image.