Image quality processing method, device, electronic equipment and storage medium

By detecting the quality defect type of text images and applying corresponding enhancement processing strategies, the problem of lack of high-quality supervision information in the prior art is solved, and diversified repair and accuracy improvement of text images are achieved.

CN115082417BActive Publication Date: 2025-04-29BEIJING ZITIAO NETWORK TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210814039.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-11
Publication Date
2025-04-29
Estimated Expiration
2042-07-11

AI Technical Summary

Technical Problem

Existing text image repair technology requires high-quality supervised information for training, but high-quality text images are difficult to obtain, making text image repair models difficult to train and cannot meet the diverse repair needs.

Method used

By detecting the image characteristics of the original text image, determining its target quality defect type, and determining the corresponding enhancement processing strategy based on this type, quality enhancement processing is performed on the image features to achieve diversified repair of text images.

Benefits of technology

In the absence of high-quality text images, precise positioning and enhance image quality is met to meet the diverse repair needs of text images and improve repair accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115082417B_ABST
    Figure CN115082417B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, electronic device and storage medium for processing image quality. The method includes: obtaining an original text image to be processed; using a pre-trained text processing model to extract a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature; determining a target enhancement processing strategy corresponding to the target quality defect type, and using the target enhancement processing strategy to perform quality enhancement processing on a second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image. Compared with existing image restoration methods, the method disclosed in the present disclosure locates the image quality enhancement method more accurately. And by using an image enhancement processing strategy to enhance the original text image, it is possible to meet the diverse restoration needs of text images in the absence of high-quality text, and also improve the restoration accuracy of text images.
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 an image quality processing method, device, electronic device and storage medium. Background Art

[0002] The current mainstream text image restoration technology requires high-quality text images as supervision information for training. However, it is not easy to obtain a large number of high-quality text images. Therefore, during the training process, many images with quality defects lack corresponding high-quality text images as training samples. This makes it difficult to train and develop text image restoration models, and ultimately results in the inability of text image restoration models to meet the diverse restoration needs of text images. Summary of the invention

[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, electronic device and storage medium for processing image quality.

[0004] According to one aspect of an embodiment of the present disclosure, a method for processing image quality is provided, which is applied to a text processing model, and the method includes:

[0005] Get the original text image to be processed;

[0006] Extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature;

[0007] Determine a target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image.

[0008] According to another aspect of the embodiment of the present disclosure, there is also provided an image quality processing device, including:

[0009] An acquisition module, used for acquiring the original text image to be processed;

[0010] An extraction module, configured to extract a first image feature of the original text image using a pre-trained text processing model, and obtain a target quality defect type of the original text image based on the first image feature;

[0011] A determination module is used to determine a target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image.

[0012] According to another aspect of an embodiment of the present disclosure, a storage medium is further provided, the storage medium including a stored program, and the above steps are executed when the program is run.

[0013] According to another aspect of the present disclosure, there is also provided an electronic device, including:

[0014] A memory for storing at least one computer program;

[0015] At least one processor is used to execute any one of the above method steps by running the at least one computer program stored in the memory.

[0016] The embodiment of the present disclosure also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.

[0017] The above technical solution provided by the embodiment of the present disclosure has the following advantages: the method provided by the embodiment of the present disclosure determines the defect type currently existing in the original text image by detecting the first image feature of the original text image, and obtains the image enhancement processing strategy by using the defect type, which locates the image quality enhancement method more accurately than the existing image repair method. And the image enhancement processing strategy is used to enhance the second image feature to be enhanced in the original text image, thereby achieving the satisfaction of the diversified repair requirements of the text image in the absence of high-quality text, and also improving the repair accuracy of the text image. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 A flowchart of a method for processing image quality provided by an embodiment of the present disclosure;

[0021] Figure 2 A flowchart of a method for processing image quality provided by another embodiment of the present disclosure;

[0022] Figure 3 A flowchart of a method for processing image quality provided by another embodiment of the present disclosure;

[0023] Figure 4 A schematic diagram of a text processing model provided by an embodiment of the present disclosure;

[0024] Figure 5 A block diagram of an image quality processing device provided by an embodiment of the present disclosure;

[0025] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. The schematic embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute improper limitations on the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present disclosure.

[0027] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0028] The embodiments of the present disclosure provide a method, device, electronic device and storage medium for processing image quality. The method provided by the embodiments of the present disclosure can be applied to any required electronic device, for example, it can be an electronic device such as a server or a terminal, which is not specifically limited here. For the convenience of description, it is referred to as an electronic device in the following.

[0029] According to one aspect of an embodiment of the present disclosure, a method embodiment of a method for processing image quality is provided. Figure 1 A flowchart of a method for processing image quality provided by an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method may include the following steps:

[0030] Step S11, obtaining the original text image to be processed.

[0031] In the disclosed embodiment, the original text image to be processed is a text image with quality defects, and the quality defects include: low brightness, low contrast, blur, damage, etc. The original text image can be an image sent by an image acquisition device or an image uploaded by a user. The image acquisition device can be a device with a shooting function such as a camera, an electronic surveillance camera, etc.

[0032] Step S12: extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature.

[0033] In an embodiment of the present disclosure, before extracting the first image feature of the original text image, the method also includes: obtaining a pre-trained text processing model, wherein the text processing model includes: a quality defect prediction network and an image quality processing network, the quality defect prediction network includes a first convolutional subnetwork and a prediction subnetwork, and the image quality processing network includes multiple associated second convolutional subnetworks and a repair subnetwork.

[0034] In the embodiment of the present disclosure, step S12, extracting the first image feature of the original text image, and detecting the target quality defect type of the original text image based on the first image feature, includes the following steps A1-A2:

[0035] Step A1: extract the first image feature corresponding to the original text image through the first convolutional sub-network, and input the first image feature into the prediction sub-network.

[0036] Step A2: obtaining the target quality defect type corresponding to the original text image through the prediction subnetwork according to the first image feature and the first corresponding relationship, wherein the first corresponding relationship is the corresponding relationship between the image feature and the quality defect type.

[0037] In the disclosed embodiment, the original text image is detected by the first convolutional subnetwork of the quality defect prediction network to obtain the first image feature corresponding to the original text image, and the obtained first image feature is input into the prediction subnetwork of the quality defect prediction network. The prediction subnetwork obtains the target quality defect type based on the first image feature and the correspondence between the pre-learned image feature and the quality defect type.

[0038] Step S13, determining a target enhancement processing strategy corresponding to the target quality defect type, and using the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image.

[0039] In the embodiment of the present disclosure, determining the enhancement processing strategy corresponding to the predicted quality defect type, and using the enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain the target text image includes the following steps B1-B2:

[0040] Step B1, extracting at least one candidate image feature for quality enhancement from the original text image through the second convolutional sub-network, and passing the candidate image feature to the restoration sub-network.

[0041] Step B2, obtaining the target enhancement processing strategy according to the second corresponding relationship and the target quality defect type through the repair subnetwork, and determining the image feature matching the target quality defect type in the candidate image features as the second image feature, performing quality enhancement processing on the second image feature according to the target enhancement processing strategy to obtain the target text image, wherein the second corresponding relationship is the corresponding relationship between the quality defect type and the enhancement processing strategy.

[0042] In the disclosed embodiment, during the image restoration process, the original text image is firstly subjected to convolution processing by the convolution layer in the second convolution subnetwork in the image quality processing network, thereby extracting candidate image features that can be used for image quality enhancement in the original text image, and the candidate image features can be foreground features, background features, etc. Then, the candidate image features are input into the restoration subnetwork.

[0043] In the disclosed embodiment, the repair subnetwork obtains the target enhancement processing strategy based on the second correspondence between the quality defect type and the enhancement processing strategy and the target quality defect type. At the same time, the image feature matching the target enhancement processing strategy among the candidate image features is determined as the second image feature, and finally the second image feature is enhanced according to the target enhancement processing strategy to obtain the target text image.

[0044] As an example, the second correspondence includes: quality defect type: low brightness, and its corresponding enhancement processing strategy may be to increase the contrast between foreground features and background features. Quality defect type: image blur, and its corresponding enhancement processing strategy may be to denoise the foreground feature image and optimize the texture features of the foreground features. At this time, the target quality defect type is low brightness. Based on the second correspondence, the target enhancement processing strategy can be: increase the contrast between foreground features and background features. Based on this, the second image features that match the low brightness are extracted from the candidate image features, including: foreground features and background features. Then, the contrast between the foreground features and the background features is increased according to the enhancement processing strategy, and finally the target text image is obtained, and the brightness of the target text image is higher than that of the original text image.

[0045] The method provided by the embodiment of the present disclosure determines the defect type currently existing in the original text image by detecting the first image feature of the original text image, and obtains the image enhancement processing strategy using the defect type, which more accurately locates the image quality enhancement method compared with the existing image restoration method. The second image feature to be enhanced in the original text image is enhanced using the image enhancement processing strategy, thereby meeting the diverse restoration needs of the text image in the absence of high-quality text, and also improving the restoration accuracy of the text image.

[0046] Figure 2 A flowchart of a method for processing image quality provided by another embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:

[0047] Step S21, obtaining an input text image.

[0048] The method provided by the embodiment of the present disclosure is applied to a text processing model to obtain an input text image, which is used as a training sample of the text processing model. The input text image is a text image with quality defects.

[0049] Step S22: extracting a third image feature of the input text image using the initial text processing model to be trained, and obtaining a predicted quality defect type of the input text image based on the third image feature.

[0050] In the disclosed embodiment, after obtaining the input text image, the text processing model can first extract the third image features of the input text image by using multiple convolutional layers, and then use a fully connected layer to make predictions based on the third image features to obtain the predicted quality defect type of the input text image.

[0051] Step S23, determining the enhancement processing strategy corresponding to the predicted quality defect type, and using the enhancement processing strategy to perform quality enhancement processing on the fourth image feature to obtain an output text image, wherein the fourth image feature is the image feature to be quality enhanced in the input text image.

[0052] In the embodiment of the present disclosure, the text processing model reuses multiple convolutional layers to extract the fourth image features of the input text image, and then uses a bidirectional gate loop control unit to obtain the enhancement processing strategy corresponding to the predicted quality defect type, and enhances the fourth image features according to the enhancement processing strategy to obtain the final output text image.

[0053] Step S24, determining a target loss between the input text image and the output text image, and correcting the initial text processing model based on the target loss until a trained text processing model is obtained.

[0054] In the disclosed embodiment, after obtaining the output text image, the target loss of the image in the enhancement process is calculated using the output text image and the input text image, and when the target loss meets the current training requirements, it is determined that the text processing model training is completed. When the target loss does not meet the current training requirements, the model parameters of the text processing model are corrected, and the corrected text processing model is repeatedly trained until the loss between the final output text image and the input text image meets the training requirements.

[0055] The method provided by the embodiment of the present disclosure first trains the model to obtain the predicted quality defect type based on the image features, then determines the enhancement processing strategy according to the predicted quality defect type, and uses the enhancement processing strategy to automatically enhance the image features to obtain a high-quality text image. The entire process does not require the high-quality text image to be used as supervisory information during training. While ensuring that a high-quality text image is obtained, the difficulty of model training is reduced and the efficiency of model training is improved.

[0056] Figure 3 A flowchart of a method for processing image quality provided by another embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the method includes:

[0057] Step S31, obtaining an input text image.

[0058] In the disclosed embodiment, the input text image includes two annotation information, the first annotation information is a quality defect type label, and the quality defect type label is used to characterize the quality defect type corresponding to the image feature. The second annotation information is an enhancement processing strategy label, and the enhancement processing strategy label is used to characterize the enhancement processing strategy corresponding to the quality defect type. Among them, the quality defect types include: low brightness, low contrast, blur, damage, etc. Each quality defect type corresponds to at least one enhancement processing strategy.

[0059] Step S32: extracting a third image feature of the input text image using the initial text processing model to be trained, and obtaining a predicted quality defect type of the input text image based on the third image feature.

[0060] In the disclosed embodiment, the text processing model includes a quality defect prediction network and an image quality processing network. Figure 4 As shown, Figure 4 Part (a) is the quality defect prediction network. Figure 4Part (b) in the figure is the image quality processing network. The quality defect prediction network includes a first convolutional subnetwork and a prediction subnetwork. The first convolutional subnetwork includes four convolutional layers. The image quality processing network includes: N consecutively arranged shallow residual blocks (SRBs). Each SRB module includes an associated second convolutional subnetwork and a repair subnetwork. The input of the repair subnetwork is also connected to the output of the prediction subnetwork. The second convolutional subnetwork includes 2 convolutional layers.

[0061] In the embodiment of the present disclosure, extracting the third image feature of the input text image, and obtaining the predicted quality defect type of the input text image based on the third image feature, includes the following steps C1-C2:

[0062] Step C1, extracting the third image feature of the input text image through the first convolutional sub-network, and inputting the third image feature into the prediction sub-network.

[0063] Step C2: The prediction subnetwork learns the first corresponding relationship between the third image feature and the quality defect type label, and obtains the predicted quality defect type of the input text image based on the first corresponding relationship and the third image feature.

[0064] In the embodiments of the present disclosure, Figure 4 As shown, the input text image I is processed by the convolution layer in the first convolution subnetwork in the quality defect prediction network. HR The convolution process is performed to obtain the third image feature, that is, the spatial feature map corresponding to the input text image (Spatial estimation). At the same time, the prediction sub-network learns the first correspondence between the third image feature and the quality defect type label. The prediction sub-network is then used to perform global average pooling on the third image feature to obtain the processed third image feature, and the predicted quality defect type kernel k is obtained based on the first correspondence and the processed third image feature.

[0065] In the disclosed embodiment, by determining the loss between the predicted quality defect type and the quality defect type label, the prediction sub-network is reversely updated based on the loss so that the prediction sub-network can more accurately learn the first correspondence between the image features and the quality defect type.

[0066] Step S23, determining the enhancement processing strategy corresponding to the predicted quality defect type, and using the enhancement processing strategy to perform quality enhancement processing on the fourth image feature to obtain an output text image, wherein the fourth image feature is the image feature to be quality enhanced in the input text image.

[0067] In the embodiment of the present disclosure, by determining the enhancement processing strategy corresponding to the predicted quality defect type, the fourth image feature is subjected to quality enhancement processing using the enhancement processing strategy to obtain an output text image, including the following steps D1-D2:

[0068] Step D1, extracting at least one candidate image feature for quality enhancement from the input text image through the second convolutional subnetwork, and passing the candidate image feature to the restoration subnetwork.

[0069] Step D2, learning the second correspondence between the quality defect type label and the enhancement processing strategy label through the repair sub-network, obtaining the enhancement processing strategy based on the second correspondence and the predicted quality defect type, and determining the image feature matching the enhancement processing strategy in the candidate image features as the fourth image feature, performing quality enhancement processing on the fourth image feature according to the enhancement processing strategy, and obtaining an output text image, wherein the enhancement processing strategy label is the label carried by the input text image.

[0070] In the disclosed embodiment, the input text image is simultaneously input into the quality defect prediction network and the image quality processing network in the text processing model, and the quality defect prediction network is connected to the image quality processing network.

[0071] Therefore, in the process of image restoration, the input text image I is firstly processed by the convolutional layer in the second convolutional subnetwork in the image quality processing network. HR Convolution processing is performed to extract candidate image features that can be used for image quality enhancement in the input text image, and the candidate image features can be foreground features, background features, etc. The candidate image features are then input into the restoration subnetwork.

[0072] The repair sub-network first learns the second correspondence between the quality defect type label and the enhancement processing strategy label. Then, the repair sub-network can obtain the enhancement processing strategy based on the second correspondence and the predicted quality defect type kernel k. At the same time, the image feature matching the enhancement processing strategy in the candidate image features is determined as the fourth image feature. Finally, the fourth image feature is enhanced according to the enhancement processing strategy to obtain the output text image I HQ .

[0073] As an example, the second correspondence includes: quality defect type: low brightness, and its corresponding enhancement processing strategy may be to increase the contrast between foreground features and background features. Quality defect type: image blur, and the corresponding enhancement processing strategy may be to denoise the foreground feature image and optimize the texture features of the foreground feature. At this time, the predicted quality defect type is low brightness, and the enhancement processing strategy may be: increase the contrast between foreground features and background features. Based on this, the fourth image feature matching the low brightness extracted from the candidate image features includes: foreground features and background features. Then, the contrast between the foreground features and the background features is increased according to the enhancement processing strategy, and finally an output text image is obtained, and the brightness of the output text image is higher than that of the text input image.

[0074] Step S24, determining a target loss between the input text image and the output text image, and correcting the initial text processing model based on the target loss until a trained text processing model is obtained.

[0075] In the disclosed embodiment, determining the target loss between the input text image and the output text image includes the following steps E1-E3:

[0076] Step E1, identifying a first text feature corresponding to the output text image and a second text feature corresponding to the input text image, and calculating a text recognition loss based on the first text feature and the second text feature.

[0077] In the disclosed embodiment, a text recognizer is used to recognize first text features and second text features corresponding to an output text image and an input text image, respectively, and a text recognition loss is calculated based on the first text features and the second text features.

[0078] Among them, the calculation formula for text recognition loss is as follows:

[0079] Where, L rec is the text recognition loss, L is the maximum length prediction value of the text recognizer, is the encoded text-level annotation of the jth text feature, and I1 is the second text feature of the output text image.

[0080] It should be noted that the embodiment of the present disclosure uses a text recognizer to identify the text recognition loss between the output text image and the input text image, which can effectively ensure the accuracy of text recognition during the image restoration process.

[0081] Step E2, calculating the image pixel loss between the output text image and the input text image.

[0082] In the disclosed embodiment, since it is very important to maintain the style of the image, in order to keep the image style between the input text image and the output text image unchanged, the input text image can be enhanced by a pixel information constraint model. The disclosed embodiment uses mean square error to calculate the image pixel loss during the image restoration process to ensure that the image style remains unchanged. Specifically, the calculation formula for image pixel loss is as follows:

[0083] L sty =||P1,P2||2, where L sty is the image pixel loss, P1 is the pixel value of the output text image, and P2 is the pixel value of the input text image.

[0084] Step E3, calculating based on the image pixel loss and the text recognition loss to obtain the target loss.

[0085] In the embodiment of the present disclosure, the formula for calculating the target loss based on the image pixel loss and the text recognition loss is as follows:

[0086] L HR =αL rec +L sty , where L HR is the target loss, and α is a hyperparameter that balances the image pixel loss and the text recognition loss.

[0087] In the embodiment of the present disclosure, the text processing model is corrected based on the target loss, including the following steps F1-F2:

[0088] Step F1, when it is determined that the target loss does not fall within the preset loss range, the parameters of the quality defect prediction network and the image quality processing network in the text processing model are updated based on the target loss to obtain an updated quality defect prediction network and an updated image quality processing network;

[0089] Step F2, continue training the updated quality defect prediction network and the updated image quality processing network until the target loss of the text image output by the updated image quality processing network falls within a preset loss range.

[0090] In the embodiment of the present disclosure, when it is determined that the target loss does not fall within the preset loss range, it is determined that the current text processing model does not meet the training requirements. Therefore, it is necessary to update / optimize the parameters of the quality defect prediction network and the image quality processing network in the text processing model based on the target loss, and continue to train the updated quality defect prediction network and the updated image quality processing network until the target loss of the final output text falls within the preset loss range, which indicates that the text processing model meets the training requirements.

[0091] In the disclosed embodiment, after obtaining the output text image, the final target loss is calculated using the text recognition loss and the image pixel loss between the output text image and the input text image, thereby ensuring that the style of the image will not change during the image enhancement process and that the accuracy of the text recognition results will not be misrecognized in the text in the final text image.

[0092] Figure 5 This is a block diagram of an image quality processing device provided by an embodiment of the present disclosure. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 5 As shown, the device comprises:

[0093] An acquisition module 51 is used to acquire an original text image to be processed;

[0094] An extraction module 52, configured to extract a first image feature of the original text image, and detect a target quality defect type of the original text image based on the first image feature;

[0095] The determination module 53 is used to determine the target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is the image feature to be quality enhanced in the original text image.

[0096] The present disclosure also provides an electronic device, such as Figure 6 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .

[0097] Memory 1503, used for storing computer programs;

[0098] The processor 1501 is used to implement the steps of the above embodiment when executing the computer program stored in the memory 1503.

[0099] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0100] The communication interface is used for communication between the above terminal and other devices.

[0101] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0102] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0103] In another embodiment provided by the present disclosure, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes any one of the image quality processing methods in the above embodiments.

[0104] In another embodiment provided by the present disclosure, a computer program product including instructions is also provided, and when the computer is run on the computer, the computer executes any one of the image quality processing methods in the above embodiments.

[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present disclosure is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.

[0106] According to one or more embodiments of the present disclosure, Example 1 provides a method for processing image quality, the method comprising:

[0107] Get the original text image to be processed;

[0108] Extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature;

[0109] Determine a target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image.

[0110] Furthermore, before extracting the first image feature of the original text image, the method further includes:

[0111] Obtain a pre-trained text processing model, wherein the text processing model includes: a quality defect prediction network and an image quality processing network, the quality defect prediction network includes a first convolutional subnetwork and a prediction subnetwork, and the image quality processing network includes multiple associated second convolutional subnetworks and a repair subnetwork.

[0112] Further, extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature, includes:

[0113] Extracting a first image feature corresponding to the original text image through the first convolutional sub-network, and inputting the first image feature into the prediction sub-network;

[0114] The target quality defect type corresponding to the original text image is obtained through the prediction subnetwork according to the first image feature and the first corresponding relationship, wherein the first corresponding relationship is the corresponding relationship between the image feature and the quality defect type.

[0115] Further, determining a target enhancement processing strategy corresponding to the target quality defect type, and using the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, including:

[0116] Extracting at least one candidate image feature for quality enhancement from the original text image through a second convolutional sub-network, and transferring the candidate image feature to the restoration sub-network;

[0117] A target enhancement processing strategy is obtained through the repair subnetwork according to the second corresponding relationship and the target quality defect type, and the image feature matching the target quality defect type in the candidate image features is determined as the second image feature. The second image feature is quality enhanced according to the target enhancement processing strategy to obtain the target text image, wherein the second corresponding relationship is the corresponding relationship between the quality defect type and the enhancement processing strategy.

[0118] Furthermore, the training method of the text processing model includes:

[0119] Get the input text image;

[0120] Extracting a third image feature of the input text image using the initial text processing model to be trained, and obtaining a predicted quality defect type of the input text image based on the third image feature;

[0121] Determine an enhancement processing strategy corresponding to the predicted quality defect type, and use the enhancement processing strategy to perform quality enhancement processing on the fourth image feature to obtain an output text image, wherein the fourth image feature is an image feature to be quality enhanced in the input text image;

[0122] A target loss between an input text image and an output text image is determined, and the initial text processing model is corrected based on the target loss until a trained text processing model is obtained.

[0123] Further, the initial text processing model to be trained is used to extract a third image feature of the input text image, and based on the third image feature, a predicted quality defect type of the input text image is obtained, including:

[0124] Extracting a third image feature of the input text image through the first convolutional sub-network, and inputting the third image feature into the prediction sub-network;

[0125] The first correspondence between the third image feature and the quality defect type label is learned through the prediction subnetwork, and based on the first correspondence and the third image feature, the predicted quality defect type of the input text image is obtained, wherein the quality defect type label is the label carried by the input text image.

[0126] Further, determining an enhancement processing strategy corresponding to the predicted quality defect type, and using the enhancement processing strategy to perform quality enhancement processing on the fourth image feature to obtain an output text image, including:

[0127] Extracting at least one candidate image feature for quality enhancement from the input text image through a second convolutional subnetwork, and passing the candidate image feature to the restoration subnetwork;

[0128] The second correspondence between the quality defect type label and the enhancement processing strategy label is learned by the repair sub-network, and the enhancement processing strategy is obtained according to the second correspondence and the predicted quality defect type, and the image feature matching the enhancement processing strategy in the candidate image features is determined as the fourth image feature, and the fourth image feature is quality enhanced according to the enhancement processing strategy to obtain an output text image, wherein the enhancement processing strategy label is the label carried by the input text image.

[0129] Furthermore, the target loss between the input text image and the output text image is determined, including:

[0130] Identify a first text feature corresponding to the output text image and a second text feature corresponding to the input text image, and calculate a text recognition loss based on the first text feature and the second text feature;

[0131] Calculate the image pixel loss between the output text image and the input text image;

[0132] The target loss is calculated based on the image pixel loss and the text recognition loss.

[0133] Furthermore, the text processing model is corrected based on the target loss, including:

[0134] When it is determined that the target loss does not fall within the preset loss range, the parameters of the quality defect prediction network and the image quality processing network in the text processing model are updated based on the target loss to obtain an updated quality defect prediction network and an updated image quality processing network;

[0135] The updated quality defect prediction network and the updated image quality processing network continue to be trained until the target loss of the text image output by the updated image quality processing network falls within a preset loss range.

[0136] According to one or more embodiments of the present disclosure, Example 2 provides an image quality processing device, including:

[0137] An acquisition module, used for acquiring the original text image to be processed;

[0138] An extraction module, used to extract a first image feature of the original text image, and detect a target quality defect type of the original text image based on the first image feature;

[0139] A determination module is used to determine a target enhancement processing strategy corresponding to a target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on a second image feature to obtain a target text image, wherein the second image feature is an image feature in an original text image to be quality enhanced.

[0140] Furthermore, the acquisition module is also used to obtain a pre-trained text processing model, wherein the text processing model includes: a quality defect prediction network and an image quality processing network, the quality defect prediction network includes a first convolutional subnetwork and a prediction subnetwork, and the image quality processing network includes multiple associated second convolutional subnetworks and a repair subnetwork.

[0141] Furthermore, an extraction module is used to extract a first image feature corresponding to the original text image through a first convolutional subnetwork, and input the first image feature into a prediction subnetwork; through the prediction subnetwork, a target quality defect type corresponding to the original text image is obtained based on the first image feature and a first corresponding relationship, wherein the first corresponding relationship is a corresponding relationship between the image feature and the quality defect type.

[0142] Furthermore, a determination module is used to extract at least one candidate image feature for quality enhancement in the original text image through a second convolutional subnetwork, and pass the candidate image feature to the repair subnetwork; obtain a target enhancement processing strategy through the repair subnetwork based on the second correspondence and the target quality defect type, and determine the image feature in the candidate image features that matches the target quality defect type as the second image feature, perform quality enhancement processing on the second image feature according to the target enhancement processing strategy, and obtain a target text image, wherein the second correspondence is a correspondence between the quality defect type and the enhancement processing strategy.

[0143] In the embodiment of the present disclosure, the image quality processing device further includes: a training module, the training module including:

[0144] An acquisition unit, used for acquiring an input text image;

[0145] An extraction unit, configured to extract a third image feature of the input text image using the initial text processing model to be trained, and obtain a predicted quality defect type of the input text image based on the third image feature;

[0146] a determination unit, configured to determine an enhancement processing strategy corresponding to the predicted quality defect type, and perform quality enhancement processing on the fourth image feature using the enhancement processing strategy to obtain an output text image, wherein the fourth image feature is an image feature to be quality enhanced in the input text image;

[0147] The processing unit is used to determine the target loss between the input text image and the output text image, and to correct the initial text processing model based on the target loss until a trained text processing model is obtained.

[0148] In an embodiment of the present disclosure, an extraction unit is used to extract a third image feature of an input text image through a first convolutional subnetwork, and input the third image feature into a prediction subnetwork; learn a first correspondence between the third image feature and a quality defect type label through the prediction subnetwork, and obtain a predicted quality defect type of the input text image based on the first correspondence and the third image feature, wherein the quality defect type label is a label carried by the input text image.

[0149] In an embodiment of the present disclosure, a determination unit is used to extract at least one candidate image feature for quality enhancement in an input text image through a second convolutional subnetwork, and pass the candidate image feature to a repair subnetwork; learn a second correspondence between a quality defect type label and an enhancement processing strategy label through the repair subnetwork, obtain an enhancement processing strategy based on the second correspondence and the predicted quality defect type, and determine an image feature in the candidate image features that matches the enhancement processing strategy as a fourth image feature, perform quality enhancement processing on the fourth image feature according to the enhancement processing strategy, and obtain an output text image, wherein the enhancement processing strategy label is a label carried by the input text image.

[0150] In an embodiment of the present disclosure, a processing unit is used to identify a first text feature corresponding to an output text image and a second text feature corresponding to an input text image, and calculate a text recognition loss based on the first text feature and the second text feature; calculate an image pixel loss between the output text image and the input text image; and calculate based on the image pixel loss and the text recognition loss to obtain a target loss.

[0151] In an embodiment of the present disclosure, a processing unit is used to update the parameters of a quality defect prediction network and an image quality processing network in a text processing model based on the target loss when it is determined that the target loss does not fall within a preset loss range, so as to obtain an updated quality defect prediction network and an updated image quality processing network; and continue to train the updated quality defect prediction network and the updated image quality processing network until the target loss of the text image output by the updated image quality processing network falls within a preset loss range.

[0152] The above are only preferred embodiments of the present disclosure and are not intended to limit the protection scope of the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure are included in the protection scope of the present disclosure.

[0153] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features applied herein.

Claims

1. A method for processing image quality, characterized in that: The method comprises: Get the original text image to be processed; Obtaining a pre-trained text processing model, wherein the text processing model includes: an image quality processing network, the image quality processing network includes a plurality of associated second convolutional subnetworks and a restoration subnetwork; Extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature; Determine a target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image; The step of determining a target enhancement processing strategy corresponding to the target quality defect type, and performing quality enhancement processing on the second image feature using the target enhancement processing strategy to obtain a target text image includes: Extracting at least one candidate image feature for quality enhancement from the original text image through the second convolutional sub-network, and transferring the candidate image feature to the restoration sub-network; The target enhancement processing strategy is obtained through the repair subnetwork according to the second corresponding relationship and the target quality defect type, and the image feature matching the target quality defect type among the candidate image features is determined as the second image feature, and the second image feature is subjected to quality enhancement processing according to the target enhancement processing strategy to obtain the target text image, wherein the second corresponding relationship is the corresponding relationship between the quality defect type and the enhancement processing strategy.

2. The method according to claim 1, characterized in that The text processing model also includes: a quality defect prediction network, and the quality defect prediction network includes a first convolutional subnetwork and a prediction subnetwork.

3. The method according to claim 2, characterized in that Extracting a first image feature of the original text image, and detecting a target quality defect type of the original text image based on the first image feature, comprises: Extracting a first image feature corresponding to the original text image through the first convolutional sub-network, and inputting the first image feature into the prediction sub-network; The target quality defect type corresponding to the original text image is obtained through the prediction subnetwork according to the first image feature and the first corresponding relationship, wherein the first corresponding relationship is the corresponding relationship between the image feature and the quality defect type.

4. The method according to claim 2, characterized in that: The training method of the text processing model includes: Get the input text image; Extracting a third image feature of the input text image using the initial text processing model to be trained, and obtaining a predicted quality defect type of the input text image based on the third image feature; Determining an enhancement processing strategy corresponding to the predicted quality defect type, and performing quality enhancement processing on the fourth image feature using the enhancement processing strategy to obtain an output text image, wherein the fourth image feature is an image feature to be quality enhanced in the input text image; A target loss between the input text image and the output text image is determined, and the initial text processing model is corrected based on the target loss until a trained text processing model is obtained.

5. The method according to claim 4, characterized in that The extracting the third image feature of the input text image by using the initial text processing model to be trained, and obtaining the predicted quality defect type of the input text image based on the third image feature, comprises: Extracting a third image feature of the input text image through the first convolutional sub-network, and inputting the third image feature into the prediction sub-network; The first correspondence between the third image feature and the quality defect type label is learned through the prediction subnetwork, and based on the first correspondence and the third image feature, the predicted quality defect type of the input text image is obtained, wherein the quality defect type label is a label carried by the input text image.

6. The method according to claim 4, characterized in that The step of determining an enhancement processing strategy corresponding to the predicted quality defect type and performing quality enhancement processing on the fourth image feature using the enhancement processing strategy to obtain an output text image includes: extracting at least one candidate image feature for quality enhancement from the input text image through the second convolutional sub-network, and transferring the candidate image feature to the restoration sub-network; The second correspondence between the quality defect type label and the enhancement processing strategy label is learned through the repair sub-network, and the enhancement processing strategy is obtained according to the second correspondence and the predicted quality defect type, and the image feature matching the enhancement processing strategy among the candidate image features is determined as the fourth image feature, and the fourth image feature is subjected to quality enhancement processing according to the enhancement processing strategy to obtain an output text image, wherein the enhancement processing strategy label is the label carried by the input text image.

7. The method according to claim 6, characterized in that Determining a target loss between an input text image and an output text image includes: Identify a first text feature corresponding to the output text image and a second text feature corresponding to the input text image, and calculate a text recognition loss based on the first text feature and the second text feature; Calculating image pixel loss between the output text image and the input text image; A target loss is obtained by performing calculation based on the image pixel loss and the text recognition loss.

8. The method according to claim 7, characterized in that The correcting the text processing model based on the target loss includes: When it is determined that the target loss does not fall within the preset loss range, updating the parameters of the quality defect prediction network and the image quality processing network in the text processing model based on the target loss to obtain an updated quality defect prediction network and an updated image quality processing network; The updated quality defect prediction network and the updated image quality processing network continue to be trained until the target loss of the text image output by the updated image quality processing network falls within a preset loss range.

9. An image quality processing device, characterized in that: include: An acquisition module, used for acquiring the original text image to be processed; An extraction module, used to extract a first image feature of the original text image, and obtain a target quality defect type of the original text image based on the first image feature; A determination module is used to determine a target enhancement processing strategy corresponding to the target quality defect type, and use the target enhancement processing strategy to perform quality enhancement processing on the second image feature to obtain a target text image, wherein the second image feature is an image feature to be quality enhanced in the original text image; The acquisition module is further used to acquire a pre-trained text processing model, wherein the text processing model includes an image quality processing network, and the image quality processing network includes a plurality of associated second convolutional subnetworks and a restoration subnetwork; The determination module is used to extract at least one candidate image feature for quality enhancement in the original text image through the second convolutional subnetwork, and pass the candidate image feature to the repair subnetwork; obtain the target enhancement processing strategy through the repair subnetwork according to the second corresponding relationship and the target quality defect type, and determine the image feature matching the target quality defect type in the candidate image features as the second image feature, perform quality enhancement processing on the second image feature according to the target enhancement processing strategy, and obtain the target text image, wherein the second corresponding relationship is the corresponding relationship between the quality defect type and the enhancement processing strategy.

10. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the method of any one of claims 1 to 8 is executed.

11. An electronic device, characterized in that: include: A memory for storing at least one computer program; At least one processor, configured to execute the method of any one of claims 1 to 8 by running the at least one computer program stored in the memory.

Citation Information

Patent Citations

  • Image processing method and device, electronic equipment and storage medium

    CN111445414A

  • Mobile phone screen defect detection method, device and system, computer equipment and medium

    CN111612763A