Image processing method and device, computer readable storage medium and electronic device

By performing down-sampling and up-sampling processes that combine key point detection and mask maps on the image, the problem of poor image repair effects in the existing technology is solved, and the detail expression and repair effect of the image are significantly improved.

CN113128389BActive Publication Date: 2024-10-15GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110400357.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-14
Publication Date
2024-10-15
Estimated Expiration
2041-04-14

AI Technical Summary

Technical Problem

Existing image repair algorithms have problems such as insufficient detail performance and poor repair effects.

Method used

By detecting key points in the image to be processed, the key area mask is determined, and combined with the mask, down-sampling and up-sampling are performed to obtain a repaired image to restore the details of the key area.

Benefits of technology

The image repair effect is improved, especially the detail expression in key areas such as face images, and the overall quality of the image is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113128389B_ABST
    Figure CN113128389B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image processing method, an image processing device, a computer-readable storage medium and an electronic device, and relates to the field of image processing technology. The image processing method comprises: performing key point detection on an image to be processed to determine a key area mask map of the image to be processed; performing downsampling processing on the image to be processed in combination with the key area mask map to obtain an intermediate feature map; performing upsampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed. The present disclosure can improve the image restoration effect.
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 processing method, an image processing device, a computer-readable storage medium, and an electronic device. Background Art

[0002] In the field of image processing technology, due to reasons such as the scene or the shooting device, the acquired image may be unclear or distorted. In this case, the image can be repaired to improve the image quality.

[0003] Currently, image restoration algorithms generally have problems such as insufficient detail representation and poor restoration effects. Summary of the invention

[0004] The present disclosure provides an image processing method, an image processing device, a computer-readable storage medium and an electronic device, thereby overcoming the problem of poor image restoration effect at least to a certain extent.

[0005] According to a first aspect of the present disclosure, there is provided an image processing method, comprising: performing key point detection on an image to be processed to determine a key area mask map of the image to be processed; performing down-sampling processing on the image to be processed in combination with the key area mask map to obtain an intermediate feature map; and performing up-sampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed.

[0006] According to a second aspect of the present disclosure, an image processing device is provided, including: a key point detection module, used to perform key point detection on an image to be processed to determine a key area mask map of the image to be processed; a downsampling module, used to perform downsampling processing on the image to be processed in combination with the key area mask map to obtain an intermediate feature map; an upsampling module, used to perform upsampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed.

[0007] According to a third aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned image processing method is implemented.

[0008] According to a fourth aspect of the present disclosure, an electronic device is provided, comprising a processor; and a memory for storing one or more programs, wherein when the one or more programs are executed by the processor, the processor implements the above-mentioned image processing method.

[0009] In the technical solutions provided by some embodiments of the present disclosure, key point detection is performed on the image to be processed to determine the key area mask map of the image to be processed, and the image to be processed is downsampled in combination with the key area mask map to obtain an intermediate feature map, and then the intermediate feature map is upsampled to obtain a repaired image corresponding to the image to be processed. The disclosed solution combines the key area mask map to achieve image repair, which can better restore the details of the key area, improve the expression of details, and help improve the image repair effect.

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

[0011] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0012] Figure 1 A schematic diagram showing an exemplary system architecture for applying the image processing solution of an embodiment of the present disclosure;

[0013] Figure 2 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure is shown;

[0014] Figure 3 A flowchart schematically shows an image processing method according to an exemplary embodiment of the present disclosure;

[0015] Figure 4 A schematic diagram of a network structure for image processing according to an embodiment of the present disclosure is shown;

[0016] Figure 5 A schematic diagram of the structure of a generation network combined with a key area mask map according to an embodiment of the present disclosure is shown;

[0017] Figure 6 A schematic diagram showing the structure of a discriminant network according to an embodiment of the present disclosure is shown;

[0018] Figure 7 A diagram schematically shows a comparison of the effects of image restoration using the image processing method according to an exemplary embodiment of the present disclosure;

[0019] Figure 8 A block diagram schematically shows an image processing apparatus according to an exemplary embodiment of the present disclosure;

[0020] Fig. 9 A block diagram schematically shows an image processing apparatus according to another exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0022] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0023] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation. In addition, all the terms "first", "second", and "third" below are only for the purpose of distinction and should not be used as limitations of the present disclosure.

[0024] Figure 1 A schematic diagram showing an exemplary system architecture of an image processing solution according to an embodiment of the present disclosure.

[0025] like Figure 1 As shown, the system architecture may include a terminal device 1001 and a server 1002. The terminal device 1001 and the server 1002 may be connected via a network, and the connection type of the network may include, for example, a wired or wireless communication link or an optical fiber cable.

[0026] It should be understood that the number of terminal devices 1001 and servers 1002 is only illustrative. According to implementation requirements, there may be any number of terminal devices and servers. For example, server 1002 may be a server cluster composed of multiple servers. Server 1002 may also be referred to as a cloud or cloud server.

[0027] The terminal device 1001 can interact with the server 1002 through the network to receive or send messages, etc. Figure 1 In the figure, a smart phone is used as an example, however, the terminal device 1001 also includes a tablet computer, a smart wearable device, a personal computer and other devices with a shooting function. Among them, the terminal device 1001 can also be called a terminal, a mobile terminal, a mobile terminal, a smart terminal, etc.

[0028] When the image processing process of the exemplary embodiment of the present disclosure is executed by the terminal device 1001, first, the terminal device 1001 can perform key point detection on the image to be processed to determine the key area mask map of the image to be processed, and then down-sample the image to be processed in combination with the key area mask map to obtain an intermediate feature map; next, the terminal device 1001 can up-sample the intermediate feature map to obtain a restored image corresponding to the image to be processed.

[0029] Taking the image to be processed as a face image as an example, the terminal device 1001 can determine the rectangular frame coordinates of the eyes, nose, mouth, etc. in the face image based on the key point detection algorithm to form a key area mask map. The terminal device 1001 can use this mask as attention and integrate it into the downsampling process. In other words, the face image is downsampled in combination with the key area mask map to obtain an intermediate feature map. Then, the terminal device 1001 performs upsampling on the intermediate feature map to obtain a repaired face image.

[0030] In addition, the face image can also be an image cropped from the original image. The present disclosure does not limit the source of the face image or the original image. For example, it can be an image taken by the terminal device 1001 through a camera module, or it can be an image obtained from other devices or servers, such as old photos.

[0031] In the case where the image processing process of the exemplary embodiment of the present disclosure is performed by the server 1002, first, the server 1002 can obtain the image to be processed sent by the terminal device 1001, perform key point detection on the image to be processed to determine the key area mask map of the image to be processed, and then down-sample the image to be processed in combination with the key area mask map to obtain an intermediate feature map; next, the server 1002 can up-sample the intermediate feature map to obtain a repaired image corresponding to the image to be processed.

[0032] After the server 1002 determines the restored image, the server 1002 may send the restored image to the terminal device 1001 , which may be stored and / or displayed by the terminal device 1001 .

[0033] Similarly, when the image to be processed is a facial image, the server 1002 can generate a restored facial image.

[0034] In the solution of implementing image restoration by applying the image processing process disclosed in the present invention, the key area mask map is combined as attention to realize image restoration, which can better restore the details of the key area, improve the detail expression, and help improve the image restoration effect. Taking the face image as an example, the details of the face such as eyes, nose, mouth, etc. can be better restored to improve the expression of the image.

[0035] It should be noted that any step of processing the image in the solution can be executed by the terminal device 1001 or the server 1002, and the present disclosure does not impose any limitation on this.

[0036] Figure 2 Schematic diagram of an electronic device suitable for implementing the exemplary embodiment of the present disclosure is shown. The terminal device of the exemplary embodiment of the present disclosure may be configured as follows Figure 2 It should be noted that Figure 2 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.

[0037] The electronic device of the present disclosure includes at least a processor and a memory, wherein the memory is used to store one or more programs. When the one or more programs are executed by the processor, the processor can implement the image processing method of the exemplary embodiment of the present disclosure.

[0038] Specifically, Figure 2As shown, the electronic device 200 may include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294, and a Subscriber Identification Module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor, etc.

[0039] It is to be understood that the structure illustrated in the embodiment of the present disclosure does not constitute a specific limitation on the electronic device 200. In other embodiments of the present disclosure, the electronic device 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0040] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU). Different processing units may be independent devices or integrated into one or more processors. In addition, a memory may be provided in the processor 210 for storing instructions and data.

[0041] The electronic device 200 can realize the shooting function through the ISP, the camera module 291, the video codec, the GPU, the display screen 290 and the application processor. In some embodiments, the electronic device 200 may include 1 or N camera modules 291, where N is a positive integer greater than 1. If the electronic device 200 includes N cameras, one of the N cameras is a main camera.

[0042] The image to be processed or the original image mentioned in the present disclosure can be captured by the camera module 291 .

[0043] The internal memory 221 can be used to store computer executable program codes, which include instructions. The internal memory 221 can include a program storage area and a data storage area. The external memory interface 222 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200.

[0044] The present disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device.

[0045] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any combination thereof. 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 thereof. 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 conjunction with an instruction execution system, apparatus, or device.

[0046] Computer-readable storage media can send, propagate or transmit programs for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0047] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments.

[0048] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flow chart, and the combination of the boxes in the block diagram 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.

[0049] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0050] The following description will be made by taking a terminal device executing the image processing method according to an exemplary embodiment of the present disclosure as an example. In this case, the image processing apparatus may be configured in the terminal device.

[0051] Figure 3 The flowchart of the image processing method according to the exemplary embodiment of the present disclosure is schematically shown. Figure 3 , the image processing method may include the following steps:

[0052] S32. Perform key point detection on the image to be processed to determine a key area mask of the image to be processed.

[0053] In an exemplary embodiment of the present disclosure, the image to be processed is any image to be restored. For example, the image to be processed may be an image with low resolution, much noise and / or blur. The present disclosure does not limit the image content contained in the image to be processed. For example, the image to be processed may include a face image, an animal or plant image, or any object.

[0054] The terminal device can directly obtain the image to be processed. In one embodiment, the terminal device can capture the image to be processed with the aid of a camera module equipped therewith. For example, the camera of the terminal device can be aimed at a face to obtain the face image to be processed. In another embodiment, the terminal device can obtain the image to be processed from its own photo album, other devices or servers. For example, an old photo can be obtained from a server as the image to be processed.

[0055] When the image to be processed is a face image, the terminal device may also obtain the original image and crop the image to be processed from the original image.

[0056] First, the terminal device captures the original image through the camera module or obtains it from other devices. Next, the terminal device uses a standard face data to align the original image and determine the area of ​​the image to be processed on the original image. Among them, the standard face data is a pre-configured coordinate of a standard face, which includes, for example, standard eye coordinates, nose coordinates, mouth coordinates, etc. These coordinates can be used to align the original image with the standard face. For example, the eyes in the original image correspond to the eyes of the standard face, the nose in the original image corresponds to the nose of the standard face, and the mouth in the original image corresponds to the mouth of the standard face.

[0057] Then, the terminal device crops the original image based on the area of ​​the image to be processed on the original image to obtain the image to be processed and the background image of the original image except the image to be processed.

[0058] It should be noted that the original image may include at least one image to be processed. In the scenario of face image restoration, if the original image does not include a face image, the terminal device may give a prompt.

[0059] After determining the image to be processed, the terminal device can perform key point detection on the image to be processed to determine a key area mask of the image to be processed, wherein the key area mask can be understood as a one-dimensional feature map, which contains coordinate information of the key area.

[0060] In an exemplary embodiment of the present disclosure, the mask may also be referred to as Mask. Taking the face image as an example, when the key areas are defined as eyes, nose, and mouth, the determined key area mask image includes the rectangular frame coordinates of the eyes, nose, and mouth in the face, and the rest of the image to be processed is configured as the background.

[0061] In addition, it should be noted that the key area can be set flexibly, and the present disclosure does not limit this.

[0062] Specifically, the key point detection network can be used to process the image to be processed to obtain a key area mask. The present disclosure does not limit the specific structure of the key point detection network. For example, the key point detection network can be constructed based on cascade shape regression, based on deep learning, based on parameterized shape model, etc.

[0063] S34. Combined with the key area mask map, downsample the image to be processed to obtain an intermediate feature map.

[0064] In an exemplary embodiment of the present disclosure, the downsampling process may include at least one downsampling process.

[0065] In the case where the downsampling process includes only one downsampling process, the feature map obtained after the image to be processed undergoes the downsampling process can be fused with the key area mask map determined in step S32 to obtain an intermediate feature map. Specifically, a dot multiplication operation is performed on the feature map obtained after the image to be processed undergoes the downsampling process and the key area mask map to obtain the intermediate feature map.

[0066] In case that the downsampling process includes a plurality of downsampling processes, the downsampling processes may be sequentially performed based on a cascade manner.

[0067] Specifically, the feature map obtained by the i-th downsampling process can be fused with the key area mask map, and the i+1-th downsampling process is performed on the fused feature map until all downsampling processes are completed to obtain an intermediate feature map. Where i is a positive integer. In other words, for the result of each downsampling process, the key area mask map is fused, and then the next downsampling process is performed.

[0068] In this way, the key area is used as an attention to implement the downsampling process, which helps to restore the details of the key area.

[0069] Similarly, the fusion process also performs a dot multiplication operation. In this case, for the i-th fusion process, the terminal device can compare the size of the key area mask map with the size of the feature map obtained by the i-th downsampling process.

[0070] If the size of the key area mask image matches the size of the feature map obtained in the i-th downsampling process, that is, the size of the key area mask image is consistent with the size of the feature map obtained in the i-th downsampling process, for example, both are 512*512, then the fusion process of the two can be directly performed.

[0071] If the size of the key area mask does not match the size of the feature map obtained by the i-th downsampling process, the size of the key area mask is first adjusted to match the size of the feature map obtained by the i-th downsampling process, and the feature map obtained by the i-th downsampling process is fused with the resized key area mask.

[0072] For example, if the size of the key area mask is 512*512, and the size of the feature map obtained by the i-th downsampling process is 256*256, the size of the key area mask can be adjusted to 1 / 2 of the original size to complete the dot multiplication operation and finally obtain the intermediate feature map.

[0073] S36. Perform upsampling on the intermediate feature map to obtain a restored image corresponding to the image to be processed.

[0074] After determining the intermediate feature map, the terminal device can perform upsampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed. Taking the image to be processed as a face image to be processed as an example, after step S36, the restored face image can be obtained.

[0075] When the image to be processed is an image obtained by cropping the original image, after obtaining the restored image corresponding to the image to be processed, the background image of the original image of the restored image except the image to be processed can be spliced ​​to obtain an image with the restored face area corresponding to the original image.

[0076] According to some embodiments of the present disclosure, the terminal device can repair the image to be processed by using a trained key point detection network and a trained generative network in a generative adversarial network to obtain a repaired image corresponding to the image to be processed. The generative network includes an encoder and a decoder.

[0077] It should be noted that the training process of the network model can be performed by the terminal device. In addition, the training process can also be performed by a server or other device, and the terminal device can directly obtain the trained network model to execute the exemplary solution of the present disclosure.

[0078] The following will refer to Figure 4 These embodiments are described.

[0079] like Figure 4 As shown, the image to be processed can be input into a key point detection network, and the key point detection network is used to perform key point detection on the image to be processed to determine a key area mask of the image to be processed.

[0080] In addition, the image to be processed can also be input into the encoder of the generation network. The encoder is used in combination with the key area mask map determined by the key point detection network to downsample the image to be processed to obtain an intermediate feature map.

[0081] Figure 5 FIG. 2 shows a schematic diagram of the structure of the encoder according to an embodiment of the present disclosure. Figure 5 As shown, the key area mask map of the face can be fused with the feature map extracted by the encoder by point multiplication at different scales.

[0082] Next, the intermediate feature map is input into the decoder of the generative network, and the decoder is used to upsample the intermediate feature map to obtain the restored image corresponding to the image to be processed. Figure 5, the features of the same scale on the encoder can be added to the decoder by using skip connections to transfer information. Specifically, for the generative network, the feature map obtained by downsampling the encoder can be added to the feature map of the same scale obtained by the decoder to obtain the restored image.

[0083] During the training phase, the generative adversarial network needs to combine the output results of the discriminative network to update the parameters in the generative adversarial network.

[0084] Figure 6 The schematic diagram of the structure of the discrimination network of the embodiment of the present disclosure is shown schematically. Figure 6 As shown in the figure, the discriminant network undergoes a 32-fold downsampling process and outputs a probability feature map. The elements on the feature map are all probability values ​​between 0 and 1. Then they are averaged to obtain a "true" or "false" discrimination result.

[0085] The following uses a group of training samples as an example to illustrate the training process of the generative adversarial network used in the present disclosure.

[0086] First, the terminal device obtains a first sample image, wherein the first sample image is an image with relatively high image quality. The terminal device may perform image degradation processing on the first sample image to obtain a second sample image, wherein the image quality of the second sample image is worse than that of the first sample image. The image degradation processing may, for example, include operations such as adding noise and blurring the image.

[0087] Next, the first sample image is input into the key point detection network to obtain a key area mask image of the first sample image. It is easy to understand that the first sample image can have a manually annotated label.

[0088] The second sample image is input into the encoder, and the encoder is used to combine the key area mask image of the first sample image to downsample the second sample image to obtain an intermediate sample feature map.

[0089] Then, the intermediate sample feature map is input into the decoder to obtain the third sample image, and the third sample image is input into the discriminant network in the generative adversarial network, and the generative adversarial network is trained in combination with the output result of the discriminant network.

[0090] In an exemplary embodiment of the present disclosure, in order to improve the repair effect, the following loss function is configured:

[0091] L total =α*L gan +β*L pixel +λ*L perceptual

[0092] Among them, L totalis the total loss function; L gan Represents the loss of image pixel value distribution, ensuring that the image generated by the generative network has a similar pixel value distribution to the corresponding high-quality image; L pixel represents the L1 norm loss between the image generated by the generative network and the high-quality image, ensuring that the generated image is similar to the corresponding high-quality image at the pixel level; L perceptual represents the perceptual loss, which calculates the L2 norm distance between the features of the generated image and the corresponding high-quality image on vgg19 pre-trained with the Imagenet dataset. In addition, α, β, and λ are the weights of the above items respectively.

[0093] In order to verify the effect of the image processing method disclosed in the present invention, 358 low-quality portraits were restored, and the restoration effect was good, with good restoration of details such as eyes, mouth, and teeth. Figure 7 A comparison chart of the effects of using the disclosed image processing method to repair three low-quality portraits is given. It can be seen that the repaired images are clearer and the facial detail information is more expressive.

[0094] In addition, the present disclosure also uses the image quality evaluation algorithm BRISQUE algorithm to batch evaluate and score 358 images before and after restoration. During the evaluation process, in order to evaluate the restoration effects of different resolutions, the evaluation was carried out at two different resolutions. The scoring results are shown in Table 1:

[0095] Table 1

[0096] Image size Original dataset The repaired dataset 512*512 57.6 49.36 256*256 42.186 37.45

[0097] The smaller the score, the better the image quality. It can be seen that through the image processing process disclosed in the present invention, the quality of the restored image is significantly improved.

[0098] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.

[0099] Furthermore, this exemplary embodiment also provides an image processing device.

[0100] Figure 8 FIG. 1 schematically shows a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. Figure 8 According to an exemplary embodiment of the present disclosure, the image processing device 8 may include a key point detection module 81 , a down-sampling module 83 , and an up-sampling module 85 .

[0101] Specifically, the key point detection module 81 can be used to perform key point detection on the image to be processed to determine the key area mask map of the image to be processed; the downsampling module 83 can be used to downsample the image to be processed in combination with the key area mask map to obtain an intermediate feature map; the upsampling module 85 can be used to upsample the intermediate feature map to obtain a repaired image corresponding to the image to be processed.

[0102] According to an exemplary embodiment of the present disclosure, the downsampling process includes multiple downsampling processes. In this case, the downsampling module 83 can be configured to perform: fusing the feature map obtained by the i-th downsampling process with the key area mask map, and performing the i+1-th downsampling process on the fused feature map until the multiple downsampling processes are completed to obtain an intermediate feature map; wherein i is a positive integer.

[0103] According to an exemplary embodiment of the present disclosure, the process in which the downsampling module 83 fuses the feature map obtained in the i-th downsampling process with the key area mask map can be configured to perform: comparing the size of the key area mask map with the size of the feature map obtained in the i-th downsampling process; if the size of the key area mask map does not match the size of the feature map obtained in the i-th downsampling process, adjusting the size of the key area mask map to match the size of the feature map obtained in the i-th downsampling process, and fusing the feature map obtained in the i-th downsampling process with the resized key area mask map.

[0104] According to an exemplary embodiment of the present disclosure, the image to be processed is a face image. In this case, the key point detection module 81 can also be configured to perform: obtaining an original image; aligning the original image using a standard face data to determine the area of ​​the image to be processed on the original image; based on the area of ​​the image to be processed on the original image, cropping the original image to obtain the image to be processed and a background image in the original image excluding the image to be processed.

[0105] According to an exemplary embodiment of the present disclosure, the upsampling module 85 can also be configured to perform: after obtaining a restored image corresponding to the image to be processed, splicing the restored image with the background image to obtain an image with a restored face area corresponding to the original image.

[0106] According to an exemplary embodiment of the present disclosure, the image to be processed is repaired by a trained key point detection network and a generative network in a trained generative adversarial network to obtain a repaired image corresponding to the image to be processed; wherein the generative network includes an encoder and a decoder. In this case, the key point detection network performs key point detection on the image to be processed to determine a key area mask of the image to be processed; the encoder performs downsampling processing on the image to be processed in combination with the key area mask determined by the key point detection network to obtain an intermediate feature map; the decoder performs upsampling processing on the intermediate feature map to obtain a repaired image corresponding to the image to be processed.

[0107] It can be understood that the key point detection module 81 can be configured to include a key point detection network, the downsampling module 83 can be configured to include an encoder, and the upsampling module 85 can be configured to include a decoder.

[0108] According to an exemplary embodiment of the present disclosure, referring to Fig. 9 Compared with the image processing device 8 , the image processing device 9 may further include a network training module 91 .

[0109] Specifically, the network training module 91 can be configured to execute: performing image degradation processing on the first sample image to obtain a second sample image; inputting the first sample image into the key point detection network to obtain a key area mask map of the first sample image; inputting the second sample image into the encoder, and using the encoder and combining with the key area mask map of the first sample image to downsample the second sample image to obtain an intermediate sample feature map; inputting the intermediate sample feature map into the decoder to obtain a third sample image; inputting the third sample image into the discriminant network in the generative adversarial network, and training the generative adversarial network in combination with the output result of the discriminant network.

[0110] Since the functional modules of the image processing device in the embodiment of the present disclosure are the same as those in the above-mentioned method embodiment, they will not be described in detail here.

[0111] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0112] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0113] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0114] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and embodiments are to be considered merely as exemplary, and the true scope and spirit of the present disclosure are indicated by the claims.

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

Claims

1. An image processing method, characterized in that: include: Performing key point detection on the image to be processed to determine a key area mask of the image to be processed; In combination with the key area mask map, down-sampling the image to be processed is performed to obtain an intermediate feature map; Performing upsampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed; The downsampling process includes multiple downsampling processes; combining the key area mask map, downsampling the image to be processed to obtain an intermediate feature map, including: The feature map obtained by the i-th downsampling process is fused with the key area mask map, and the i+1-th downsampling process is performed on the fused feature map until the multiple downsampling processes are completed to obtain the intermediate feature map; i is a positive integer.

2. The image processing method according to claim 1, characterized in that: The feature map obtained by the i-th downsampling process is fused with the key area mask map, including: Comparing the size of the key area mask image with the size of the feature map obtained by the i-th downsampling process; If the size of the key area mask image does not match the size of the feature map obtained in the i-th downsampling process, the size of the key area mask image is adjusted to match the size of the feature map obtained in the i-th downsampling process, and the feature map obtained in the i-th downsampling process is fused with the resized key area mask image.

3. The image processing method according to claim 1, characterized in that: The image to be processed is a face image; wherein the image processing method further comprises: Get the original image; Performing an alignment operation on the original image using standard face data to determine the area of ​​the image to be processed on the original image; Based on the area of ​​the image to be processed on the original image, the original image is cropped to obtain the image to be processed and a background image in the original image excluding the image to be processed.

4. The image processing method according to claim 3, characterized in that: After obtaining the restored image corresponding to the image to be processed, the image processing method further includes: The repaired image is spliced ​​with the background image to obtain an image with the repaired face area corresponding to the original image.

5. The image processing method according to any one of claims 1 to 4, characterized in that: The image to be processed is repaired by the trained key point detection network and the generative network in the trained generative adversarial network to obtain a repaired image corresponding to the image to be processed; wherein the generative network includes an encoder and a decoder; Using the key point detection network to perform key point detection on the image to be processed to determine a key area mask of the image to be processed; Using the encoder and combining the key area mask map determined by the key point detection network, down-sampling the image to be processed to obtain the intermediate feature map; The decoder is used to upsample the intermediate feature map to obtain a restored image corresponding to the image to be processed.

6. The image processing method according to claim 5, characterized in that: The image processing method further comprises: Performing image degradation processing on the first sample image to obtain a second sample image; Inputting the first sample image into the key point detection network to obtain a key area mask image of the first sample image; Inputting the second sample image into the encoder, and performing downsampling processing on the second sample image by using the encoder and combining the key area mask image of the first sample image to obtain an intermediate sample feature map; Inputting the intermediate sample feature map into the decoder to obtain a third sample image; The third sample image is input into the discriminant network in the generative adversarial network, and the generative adversarial network is trained in combination with the output result of the discriminant network.

7. An image processing device, characterized in that: include: A key point detection module, used for performing key point detection on the image to be processed to determine a key area mask of the image to be processed; A downsampling module, used to perform downsampling processing on the image to be processed in combination with the key area mask image to obtain an intermediate feature map; An upsampling module, used for performing upsampling processing on the intermediate feature map to obtain a restored image corresponding to the image to be processed; Among them, the downsampling processing includes multiple downsampling processes; the downsampling module is configured to: fuse the feature map obtained by the i-th downsampling process with the key area mask map, and perform the i+1-th downsampling process on the fused feature map until the multiple downsampling processes are completed to obtain the intermediate feature map; i is a positive integer.

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

9. An electronic device, characterized in that: include: processor; A memory for storing one or more programs, which, when executed by the processor, enables the processor to implement the image processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Human face restoration model training method, restoration method, device and equipment and medium

    CN111507914A

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

    CN111553864A

  • Image processing method, electronic device and non-transitory computer-readable recording medium

    US20190378247A1