Image super-resolution method and device, storage medium and program product
By combining a general super-resolution model and a text-specific super-resolution model, the images containing text are processed and fused separately, solving the problems of poor resolution and artifacts in the text part in the existing technology, and achieving better image super-resolution. resolution effect.
Patent Information
- Application Number
- CN202310345195.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-15
AI Technical Summary
When existing super-resolution models process images containing text, it is difficult to effectively improve the resolution of the text part, and it is easy to produce unnatural artifacts, and specialized text super-resolution models will discolor when processing complex UGC images. Phenomenon.
Two super-resolution models are used to divide the work: the first super-resolution model processes the overall image, and the second super-resolution model specifically processes the text area, and the two are merged to improve the super-resolution effect of the overall image.
Through this method, the resolution effect of text areas is improved, and the resolution effect of non-text areas is improved. The super-resolution processing effect of text-containing images is overall improved, and artifacts and discoloration are reduced.
Smart Images

Figure CN118780981A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to the field of computer and network communication technology, and in particular, to an image super-resolution method, device, storage medium, and program product. Background Art
[0002] Super-resolution is the process of improving the resolution of the original image, aiming to enhance the resolution and restore the details of the image.
[0003] In one existing technology, a super-resolution model is used to perform super-resolution processing on images. However, since there are often a large amount of different content in images, and different images have different distributions and structures, especially images containing text, the text structure and the distribution of natural images are quite different. When a general super-resolution model is used to perform super-resolution processing on images containing text, unnatural artifacts are easily generated, and the super-resolution effect on the text part is poor. Summary of the invention
[0004] The embodiments of the present disclosure provide an image super-resolution method, device, storage medium and program product to improve the super-resolution effect of images containing text.
[0005] In a first aspect, an embodiment of the present disclosure provides an image super-resolution method, comprising:
[0006] Acquire an image to be processed, wherein the display content of the image to be processed includes text;
[0007] Processing the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed;
[0008] Processing the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to a text region of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text region than the first super-resolution model;
[0009] The first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed.
[0010] In a second aspect, an embodiment of the present disclosure provides an image super-resolution device, including:
[0011] An acquisition unit, used for acquiring an image to be processed, wherein the display content of the image to be processed includes text;
[0012] A first super-resolution unit, configured to process the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed;
[0013] A second super-resolution unit is used to process the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model;
[0014] A fusion unit is used to fuse the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed.
[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
[0016] The memory stores computer-executable instructions;
[0017] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image super-resolution method described in the first aspect and various possible designs of the first aspect.
[0018] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the image super-resolution method described in the first aspect and various possible designs of the first aspect is implemented.
[0019] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, comprising computer execution instructions. When a processor executes the computer execution instructions, the image super-resolution method as described in the first aspect and various possible designs of the first aspect is implemented.
[0020] The image super-resolution method, device, storage medium and program product provided by the embodiments of the present disclosure obtain an image to be processed, wherein the display content of the image to be processed includes text; the image to be processed is processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; the image to be processed is processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model; the first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed. The two super-resolution models are used to process the image containing text in a division of labor, so that both the text area and the non-text area obtain better super-resolution effects, and the super-resolution effect of the image containing text is improved as a whole. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure 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, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0022] Figure 1 An example diagram of an application scenario of an image super-resolution method provided by an embodiment of the present disclosure;
[0023] Figure 2 A schematic diagram of a flow chart of an image super-resolution method provided by an embodiment of the present disclosure;
[0024] Figure 3a A schematic diagram of a flow chart of an image super-resolution method provided by another embodiment of the present disclosure;
[0025] Figure 3b A schematic diagram of a flow chart of an image super-resolution method provided by another embodiment of the present disclosure;
[0026] Figure 4a A schematic diagram of a flow chart of an image super-resolution method provided by another embodiment of the present disclosure;
[0027] Figure 4b A schematic diagram of a flow chart of an image super-resolution method provided by another embodiment of the present disclosure;
[0028] Figure 5 A structural block diagram of an image super-resolution device provided in one embodiment of the present disclosure;
[0029] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] 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. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0031] In one existing technology, a super-resolution model is used to perform super-resolution processing on images. However, since images often contain a large amount of different content and different images have different distributions and structures, especially images containing text, the text structure and natural image distribution are quite different.
[0032] When a general super-resolution model is used to perform super-resolution processing on images containing text, since the training data sets of the general super-resolution model are mostly natural scenes with fewer texts, and the structure of text and the distribution of natural images are quite different, the super-resolution model is more suitable for super-resolution processing of natural scene images, but is not good at super-resolution processing of images containing text, which makes it easy for unnatural artifacts to be generated in the text part, and the super-resolution effect of the text part is poor.
[0033] In order to improve the super-resolution effect of the text part, a special text super-resolution model can be used for processing. However, the special text super-resolution model usually only focuses on processing the text part, and the training data set is monotonous, with only images of the text part. The trained text super-resolution model is not good at processing text in real images, especially in UGC (User Generated Content) images, where the distribution and structure of text and background may be more complex. Since the non-text area (background, etc.) is not considered, the text part will show more serious color discoloration (color cast).
[0034] In order to solve the above technical problems, the disclosed embodiment provides an image super-resolution method, which is performed by obtaining an image to be processed, wherein the display content of the image to be processed includes text; processing the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; processing the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model; the first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed. The two super-resolution models are used to process the image containing text in a division of labor, so that both the text area and the non-text area obtain better super-resolution effects, thereby improving the super-resolution effect of the image containing text as a whole.
[0035] The application scenarios of the image super-resolution method provided by the present disclosure are as follows: Figure 1 As shown, the execution subject can be a processing device such as a server or a terminal device, and the image to be processed is input into the processing device. In the processing device, the image to be processed is processed by two super-resolution models, wherein the image to be processed is processed according to the first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; the image to be processed is processed according to the second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; and the first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed, and output or display it.
[0036] The image super-resolution method disclosed in the present invention will be described in detail below in conjunction with specific embodiments.
[0037] refer to Figure 2 , Figure 2 A flowchart of an image super-resolution method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device or a server, and the image super-resolution method includes:
[0038] S201, obtaining an image to be processed, wherein the display content of the image to be processed includes text.
[0039] In this embodiment, when it is necessary to perform super-resolution processing on a processing image containing text, the image to be processed is first acquired. The specific process of processing the image to be processed is not limited in this embodiment.
[0040] S202: Process the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed.
[0041] In this embodiment, the first super-resolution model is a general model for super-resolution processing of images, which can be trained in advance, and its training data can be any high-resolution image and the corresponding degraded image, wherein the resolution of the degraded image is lower than that of the high-resolution image, the degraded image is used as the input of the first super-resolution model, and the corresponding high-resolution image is used as the true value to train the first super-resolution model. Optionally, the high-resolution images in the training data of the first super-resolution model may include images containing text and images not containing text, so the first super-resolution model obtained by training can perform super-resolution processing on images not containing text, and can also perform super-resolution processing on images containing text, but because the training process is not targeted, the first super-resolution model has a poor effect of super-resolution processing on images containing text. Alternatively, the high-resolution images in the training data of the first super-resolution model only have images not containing text, so that the first super-resolution model is trained in a targeted manner, and the effect of processing images not containing text is better. It should be noted that the specific model of the first super-resolution model is not limited in this embodiment, and it can be any machine learning model or other model.
[0042] In this embodiment, based on the first super-resolution model obtained by the above training, super-resolution processing is performed on the entire image to be processed, that is, the image to be processed is input into the first super-resolution model, and the first super-resolution model performs super-resolution processing and outputs a first super-resolution image corresponding to the image to be processed. Since the first super-resolution model has not been specifically trained for super-resolution processing of text, the super-resolution effect of the non-text area in the first super-resolution image is relatively good, while the super-resolution effect of the text area is relatively poor.
[0043] S203, processing the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model.
[0044] In this embodiment, the second super-resolution model is obtained by pre-training for images containing text, so that the second super-resolution model has a better super-resolution effect on the text area, especially the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model. Its training data can be any high-resolution image containing text and the corresponding degraded image, wherein the resolution of the degraded image is lower than that of the high-resolution image, the degraded image is used as the input of the second super-resolution model, and the corresponding high-resolution image is used as the true value to train the second super-resolution model. It should be noted that the specific model of the second super-resolution model is not limited in this embodiment, and it can be any machine learning model or other model.
[0045] In this embodiment, based on the second super-resolution model obtained by the above training, super-resolution processing is performed on the image to be processed. Super-resolution processing can be performed only on the text area of the image to be processed, or super-resolution processing can be performed on the entire image to be processed, and finally a second super-resolution image corresponding to the text area of the image to be processed is obtained.
[0046] It should be noted that there is no limitation on the execution order of S203 and S204.
[0047] S204: Fusing the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed.
[0048] In this embodiment, since the first super-resolution image is a super-resolution image corresponding to the entire image to be processed, and the second super-resolution image is only a super-resolution image corresponding to the text area in the image to be processed, and the super-resolution effect of the text area in the second super-resolution image is better than that of the text area in the first super-resolution image, the second super-resolution image can be fused with the first super-resolution image, and the text area in the first super-resolution is replaced by the text area in the second super-resolution image to obtain the target super-resolution image corresponding to the image to be processed, so that the super-resolution effect of both the text area and the non-text area is relatively good.
[0049] Among them, when performing fusion, the second super-resolution image can be superimposed on the first super-resolution image according to the position of the text area in the image to be processed. Through image superposition, the text area in the second super-resolution image can cover the text area in the first super-resolution image, thereby realizing the replacement of the text area.
[0050] Furthermore, considering that the first super-resolution image and the second super-resolution image are generated by different models, there may be certain differences between them. Therefore, if the second super-resolution image is directly superimposed on the first super-resolution image, the boundary between the second super-resolution image and the first super-resolution image may be more obvious. Therefore, in this embodiment, after the second super-resolution image is superimposed on the first super-resolution image, the boundary between the second super-resolution image and the first super-resolution image may be smoothed to make the boundary transition smoothly, so that the second super-resolution image and the first super-resolution image are better integrated, and the boundary between the second super-resolution image and the first super-resolution image is not obvious.
[0051] The image super-resolution method provided in this embodiment obtains an image to be processed, wherein the display content of the image to be processed includes text; processes the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; processes the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model; and fuses the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed. By dividing the work of processing the image containing text with two super-resolution models, both the text area and the non-text area obtain better super-resolution effects, thereby improving the super-resolution effect of the image containing text as a whole.
[0052] In an optional embodiment, the processing of the image to be processed according to the second super-resolution model described in S203 above to obtain a second super-resolution image corresponding to the text area of the image to be processed is specifically as follows: Figure 3a As shown, it may include:
[0053] S301, detecting a text area from the image to be processed, and capturing an image of the text area;
[0054] S302: input the text region image into the second super-resolution model, and use the second super-resolution model to perform a super-resolution operation on the text region image to obtain the second super-resolution image.
[0055] In this embodiment, refer to Figure 3bWhen acquiring the second super-resolution image, the text area of the image to be processed can be first detected by the text detection model, and one or more low-quality text area images can be intercepted according to the detection result (text detection frame), and the text area images are input into the second super-resolution model separately, so that the second super-resolution model only performs super-resolution operation on the text area image, and obtains the second super-resolution image corresponding to the text area, and then merges it with the first super-resolution image obtained by the first super-resolution model to obtain the target super-resolution image. In this embodiment, the second super-resolution model does not need to perform super-resolution processing on the entire image to be processed, but only performs super-resolution processing on the text area image, which avoids redundant calculations, greatly improves the processing efficiency of the second super-resolution model, and reduces resource occupancy.
[0056] In another optional embodiment, the processing of the image to be processed according to the second super-resolution model described in S203 above to obtain a second super-resolution image corresponding to the text area of the image to be processed is specifically as follows: Figure 4a As shown, it may include:
[0057] S401, inputting the image to be processed into the second super-resolution model, and using the second super-resolution model to perform a super-resolution operation on the image to be processed to obtain a third super-resolution image corresponding to the image to be processed;
[0058] S402: Detect a text area from the third super-resolution image, and capture an image of the text area as the second super-resolution image.
[0059] In this embodiment, although there is little redundant calculation in the process of S301-S302, the text detection may fail when facing a very low quality (low definition) text image, that is, some very low quality text in the image to be processed cannot be accurately detected, so that the corresponding second super-resolution image cannot be obtained. Figure 4bWhen obtaining the second super-resolution image, the second super-resolution model is preferentially used to perform super-resolution processing on the entire image to be processed, that is, the image to be processed is input into the second super-resolution model as a whole for super-resolution processing, and a third super-resolution image corresponding to the image to be processed is obtained. The clarity of the text area in the third super-resolution image is significantly improved, so the text area can be accurately detected by the text detection model, and a more accurate text detection frame is obtained. The text area image is intercepted as the second super-resolution image, and then merged with the first super-resolution image obtained by the first super-resolution model to obtain the target super-resolution image. Although there is redundant calculation in this embodiment, the amount of calculation is relatively increased, but it can ensure that the image containing low-definition text can also stably obtain the corresponding second super-resolution image, avoiding the problem that the low-definition text cannot be detected by the text detection model and cannot be processed by the second super-resolution model.
[0060] On the basis of the above embodiment, the first super-resolution model can be trained using a conventional training method, and its training data can be any high-resolution image and a corresponding degraded image, the resolution of the degraded image is lower than that of the high-resolution image, wherein the high-resolution image may include images containing text and images without text, or the high-resolution image may only include images without text. During the training process, the degraded image is used as the input of the first super-resolution model, and the corresponding high-resolution image is used as the true value. The specific training process will not be repeated here.
[0061] On the basis of the above embodiment, the second super-resolution model can also be trained in a conventional training method, and multiple high-resolution original images containing text and degraded images corresponding to the original images can be obtained, and the resolution of the degraded images is lower than the corresponding original images; each group of original images and the corresponding degraded images are used as training data, and the degraded images are used as inputs of the second super-resolution model during the training process, and the corresponding high-resolution original images are used as true values to train the second super-resolution model. The specific training process is not repeated here. In this embodiment, since each image in the training data includes a text area and a background (non-text area), the text and its background are included in the training together. Compared with other text super-resolution data sets (only the pure text part in the image is used for training), the second super-resolution model can better perform super-resolution processing on text of different colors and reduce color cast.
[0062] Optionally, when obtaining multiple original images containing text and degraded images corresponding to the original images, multiple original images containing text can be obtained, for example, a large number of high-resolution original images containing more text are collected from professional data sets and UGC scenarios, and each of the original images is degraded by simulating the degradation process to obtain the corresponding degraded image.
[0063] Optionally, considering that there are many screenshots from videos in the actual image super-resolution processing process, these screenshots contain not only noise during image compression but also noise from video compression during the compression and storage process. Therefore, the above-mentioned second super-resolution model obtained by only using image datasets for training cannot process artifacts in video screenshots well, especially because text has a strong structure, and the artifacts generated by video compression and image compression will be quite different. Therefore, video screenshots containing text are introduced as training data in this embodiment.
[0064] Specifically, a video file containing text can be obtained, and an original video frame containing text can be obtained as the original image; the video file is compressed to increase video compression noise, that is, the video frame obtained from the compressed video file has video compression noise; according to the original video frame, a corresponding target video frame is obtained from the compressed video file; the target video frame is degraded, that is, image compression noise is increased, and a degraded image corresponding to the original image is obtained, which has both video compression noise and image compression noise. A second super-resolution image is trained based on such original image and degraded image, so that the second super-resolution image can achieve better super-resolution effect on the text in the video screenshot.
[0065] Corresponding to the image super-resolution method of the above embodiment, Figure 5 This is a structural block diagram of an image super-resolution device provided by an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 5 The image super-resolution device 500 includes: an acquisition unit 501, a first super-resolution unit 502, a second super-resolution unit 503, and a fusion unit 504.
[0066] The acquisition unit 501 is used to acquire an image to be processed, wherein the display content of the image to be processed includes text;
[0067] A first super-resolution unit 502 is used to process the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed;
[0068] A second super-resolution unit 503 is used to process the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model;
[0069] The fusion unit 504 is used to fuse the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed.
[0070] In one or more embodiments of the present disclosure, when the second super-resolution unit 503 processes the image to be processed according to the second super-resolution model to obtain the second super-resolution image corresponding to the text area of the image to be processed, it is used to:
[0071] Detecting a text area from the image to be processed and capturing an image of the text area;
[0072] The text area image is input into the second super-resolution model, and the second super-resolution model is used to perform a super-resolution operation on the text area image to obtain the second super-resolution image.
[0073] In one or more embodiments of the present disclosure, when the second super-resolution unit 503 processes the image to be processed according to the second super-resolution model to obtain the second super-resolution image corresponding to the text area of the image to be processed, it is used to:
[0074] Inputting the image to be processed into the second super-resolution model, and performing a super-resolution operation on the image to be processed using the second super-resolution model to obtain a third super-resolution image corresponding to the image to be processed;
[0075] A text area is detected from the third super-resolution image, and an image of the text area is captured as the second super-resolution image.
[0076] In one or more embodiments of the present disclosure, when fusing the first super-resolution image and the second super-resolution image, the fusion unit 504 is configured to:
[0077] The second super-resolution image is superimposed on the first super-resolution image according to the position of the text area in the image to be processed.
[0078] In one or more embodiments of the present disclosure, after superimposing the second super-resolution image on the first super-resolution image, the fusion unit 504 is further configured to:
[0079] A smoothing process is performed on a boundary position between the second super-resolution image and the first super-resolution image.
[0080] In one or more embodiments of the present disclosure, the device further includes a training unit, configured to:
[0081] Acquire a plurality of original images containing text and degraded images corresponding to the original images, wherein the resolution of the degraded images is lower than the corresponding original images;
[0082] Each group of original images and the corresponding degraded images are used as training data, and the second super-resolution model is trained according to the training data.
[0083] In one or more embodiments of the present disclosure, when acquiring a plurality of original images containing text and degraded images corresponding to the original images, the training unit is configured to:
[0084] A plurality of original images containing text are obtained, and each of the original images is degraded to obtain a corresponding degraded image.
[0085] In one or more embodiments of the present disclosure, when acquiring a plurality of original images containing text and degraded images corresponding to the original images, the training unit is configured to:
[0086] Acquire a video file containing text, and acquire an original video frame containing text as the original image;
[0087] compressing the video file to increase video compression noise;
[0088] According to the original video frame, obtaining a corresponding target video frame from a compressed video file;
[0089] The target video frame is degraded to obtain a degraded image corresponding to the original image.
[0090] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.
[0091] refer to Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure, and the electronic device 600 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0092] like Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0093] Typically, the following devices may be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0094] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0095] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0096] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0097] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0098] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0099] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0101] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0102] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] In a first aspect, according to one or more embodiments of the present disclosure, there is provided an image super-resolution method, comprising:
[0104] Acquire an image to be processed, wherein the display content of the image to be processed includes text;
[0105] Processing the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed;
[0106] Processing the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to a text region of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text region than the first super-resolution model;
[0107] The first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed.
[0108] According to one or more embodiments of the present disclosure, the processing of the image to be processed according to the second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed includes:
[0109] Detecting a text area from the image to be processed and capturing an image of the text area;
[0110] The text area image is input into the second super-resolution model, and the second super-resolution model is used to perform a super-resolution operation on the text area image to obtain the second super-resolution image.
[0111] According to one or more embodiments of the present disclosure, the processing of the image to be processed according to the second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed includes:
[0112] Inputting the image to be processed into the second super-resolution model, and performing a super-resolution operation on the image to be processed using the second super-resolution model to obtain a third super-resolution image corresponding to the image to be processed;
[0113] A text area is detected from the third super-resolution image, and an image of the text area is captured as the second super-resolution image.
[0114] According to one or more embodiments of the present disclosure, the fusing of the first super-resolution image and the second super-resolution image includes:
[0115] The second super-resolution image is superimposed on the first super-resolution image according to the position of the text area in the image to be processed.
[0116] According to one or more embodiments of the present disclosure, after superimposing the second super-resolution image on the first super-resolution image, the method further includes:
[0117] A smoothing process is performed on a boundary position between the second super-resolution image and the first super-resolution image.
[0118] According to one or more embodiments of the present disclosure, the method further includes:
[0119] Acquire a plurality of original images containing text and degraded images corresponding to the original images, wherein the resolution of the degraded images is lower than the corresponding original images;
[0120] Each group of original images and the corresponding degraded images are used as training data, and the second super-resolution model is trained according to the training data.
[0121] According to one or more embodiments of the present disclosure, the step of acquiring a plurality of original images containing text and degraded images corresponding to the original images includes:
[0122] A plurality of original images containing text are obtained, and each of the original images is degraded to obtain a corresponding degraded image.
[0123] According to one or more embodiments of the present disclosure, the step of acquiring a plurality of original images containing text and degraded images corresponding to the original images includes:
[0124] Acquire a video file containing text, and acquire an original video frame containing text as the original image;
[0125] compressing the video file to increase video compression noise;
[0126] According to the original video frame, obtaining a corresponding target video frame from a compressed video file;
[0127] The target video frame is degraded to obtain a degraded image corresponding to the original image.
[0128] In a second aspect, according to one or more embodiments of the present disclosure, there is provided an image super-resolution device, comprising:
[0129] An acquisition unit, used for acquiring an image to be processed, wherein the display content of the image to be processed includes text;
[0130] A first super-resolution unit, configured to process the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed;
[0131] A second super-resolution unit is used to process the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model;
[0132] A fusion unit is used to fuse the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed.
[0133] According to one or more embodiments of the present disclosure, when the second super-resolution unit processes the image to be processed according to the second super-resolution model to obtain the second super-resolution image corresponding to the text area of the image to be processed, it is used to:
[0134] Detecting a text area from the image to be processed and capturing an image of the text area;
[0135] The text area image is input into the second super-resolution model, and the second super-resolution model is used to perform a super-resolution operation on the text area image to obtain the second super-resolution image.
[0136] According to one or more embodiments of the present disclosure, when the second super-resolution unit processes the image to be processed according to the second super-resolution model to obtain the second super-resolution image corresponding to the text area of the image to be processed, it is used to:
[0137] Inputting the image to be processed into the second super-resolution model, and performing a super-resolution operation on the image to be processed using the second super-resolution model to obtain a third super-resolution image corresponding to the image to be processed;
[0138] A text area is detected from the third super-resolution image, and an image of the text area is captured as the second super-resolution image.
[0139] According to one or more embodiments of the present disclosure, when fusing the first super-resolution image and the second super-resolution image, the fusion unit is used to:
[0140] The second super-resolution image is superimposed on the first super-resolution image according to the position of the text area in the image to be processed.
[0141] According to one or more embodiments of the present disclosure, after superimposing the second super-resolution image on the first super-resolution image, the fusion unit is further configured to:
[0142] A smoothing process is performed on a boundary position between the second super-resolution image and the first super-resolution image.
[0143] According to one or more embodiments of the present disclosure, the device further includes a training unit, configured to:
[0144] Acquire a plurality of original images containing text and degraded images corresponding to the original images, wherein the resolution of the degraded images is lower than the corresponding original images;
[0145] Each group of original images and the corresponding degraded images are used as training data, and the second super-resolution model is trained according to the training data.
[0146] According to one or more embodiments of the present disclosure, when acquiring a plurality of original images containing text and degraded images corresponding to the original images, the training unit is configured to:
[0147] A plurality of original images containing text are obtained, and each of the original images is degraded to obtain a corresponding degraded image.
[0148] According to one or more embodiments of the present disclosure, when acquiring a plurality of original images containing text and degraded images corresponding to the original images, the training unit is configured to:
[0149] Acquire a video file containing text, and acquire an original video frame containing text as the original image;
[0150] compressing the video file to increase video compression noise;
[0151] According to the original video frame, obtaining a corresponding target video frame from a compressed video file;
[0152] The target video frame is degraded to obtain a degraded image corresponding to the original image.
[0153] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0154] The memory stores computer-executable instructions;
[0155] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the image super-resolution method described in the first aspect and various possible designs of the first aspect.
[0156] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer execution instructions. When a processor executes the computer execution instructions, the image super-resolution method described in the first aspect and various possible designs of the first aspect is implemented.
[0157] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising computer execution instructions. When a processor executes the computer execution instructions, the image super-resolution method as described in the first aspect and various possible designs of the first aspect is implemented.
[0158] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0159] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0160] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. An image super-resolution method, characterized in that: include: Acquire an image to be processed, wherein the display content of the image to be processed includes text; Processing the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; Processing the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to a text region of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text region than the first super-resolution model; The first super-resolution image and the second super-resolution image are fused to obtain a target super-resolution image corresponding to the image to be processed.
2. The method according to claim 1, characterized in that The step of processing the image to be processed according to the second super-resolution model to obtain a second super-resolution image corresponding to a text area of the image to be processed includes: Detecting a text area from the image to be processed and capturing an image of the text area; The text area image is input into the second super-resolution model, and the second super-resolution model is used to perform a super-resolution operation on the text area image to obtain the second super-resolution image.
3. The method according to claim 1, characterized in that: The step of processing the image to be processed according to the second super-resolution model to obtain a second super-resolution image corresponding to a text area of the image to be processed includes: Inputting the image to be processed into the second super-resolution model, and performing a super-resolution operation on the image to be processed using the second super-resolution model to obtain a third super-resolution image corresponding to the image to be processed; A text area is detected from the third super-resolution image, and an image of the text area is captured as the second super-resolution image.
4. The method according to any one of claims 1 to 3, characterized in that: The fusing the first super-resolution image and the second super-resolution image comprises: The second super-resolution image is superimposed on the first super-resolution image according to the position of the text area in the image to be processed.
5. The method according to claim 4, characterized in that After superimposing the second super-resolution image onto the first super-resolution image, the method further comprises: A smoothing process is performed on a boundary position between the second super-resolution image and the first super-resolution image.
6. The method according to claim 1, characterized in that The method further comprises: Acquire a plurality of original images containing text and degraded images corresponding to the original images, wherein the resolution of the degraded images is lower than the corresponding original images; Each group of original images and the corresponding degraded images are used as training data, and the second super-resolution model is trained according to the training data.
7. The method according to claim 6, characterized in that The obtaining of a plurality of original images containing text and degraded images corresponding to the original images includes: A plurality of original images containing text are obtained, and each of the original images is degraded to obtain a corresponding degraded image.
8. The method according to claim 6, characterized in that The obtaining of a plurality of original images containing text and degraded images corresponding to the original images includes: Acquire a video file containing text, and acquire an original video frame containing text as the original image; compressing the video file to increase video compression noise; According to the original video frame, obtaining a corresponding target video frame from a compressed video file; The target video frame is degraded to obtain a degraded image corresponding to the original image.
9. An image super-resolution device, characterized in that: include: An acquisition unit, used for acquiring an image to be processed, wherein the display content of the image to be processed includes text; A first super-resolution unit, configured to process the image to be processed according to a first super-resolution model to obtain a first super-resolution image corresponding to the image to be processed; A second super-resolution unit is used to process the image to be processed according to a second super-resolution model to obtain a second super-resolution image corresponding to the text area of the image to be processed; wherein the second super-resolution model has a better super-resolution effect on the text area than the first super-resolution model; A fusion unit is used to fuse the first super-resolution image and the second super-resolution image to obtain a target super-resolution image corresponding to the image to be processed.
10. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 8 is implemented.
12. A computer program product, characterized in that The method comprises computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 8 is implemented.
