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

By training the initial image processing network, a preset image processing network is generated for image skin grinding processing, the problem of unreality of the image after skin grinding in the prior art is solved, and a high-reality image beautification effect is achieved.

CN114187200BActive Publication Date: 2025-04-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111492372.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-04-11
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

After the existing image processing technology, the generated images appear unreal after the skin grinding process, and cannot meet the beautification needs of users.

Method used

By obtaining the original image, defect repair labeled images and labeling neutral gray layers in the training set, the initial image processing network is trained to generate a preset image processing network. This network is used to grind the image input to be processed to generate grind result images.

Benefits of technology

It improves the authenticity of the skin-beating result images, so that they are close to or achieve the image effects generated by manual editing, and meets the beautification needs of users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114187200B_ABST
    Figure CN114187200B_ABST
Patent Text Reader

Abstract

The present application relates to an image processing method and device, an electronic device, and a computer-readable storage medium. The method includes: obtaining an image to be processed, inputting the image to be processed into a preset image processing network for skin smoothing processing, and generating a skin smoothing result image. Since the defect repair annotated image and the annotated neutral gray layer of each original image in the training set are the annotated neutral gray layer or the generated defect repair annotated image used for the skin smoothing processing of the original image in a manual manner, the accuracy of the generated preset image processing network is improved by training the initial image processing network based on the training set. Furthermore, the image to be processed is input into the preset image processing network for skin smoothing processing, and the generated skin smoothing result image can be close to or reach the skin smoothing effect of the image generated by manual photo retouching. The authenticity of the skin smoothing result image generated by the preset image processing network is improved, and the beautification needs of the user are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the rapid development of computer technology, image processing related technologies have also developed rapidly. In the camera, beauty or other image processing applications in current electronic devices, images can be beautified to a certain extent. For example, by performing skin smoothing on an image through the above-mentioned image processing applications, wrinkles and blemishes on the face can be removed to a certain extent, and the image can be beautified.

[0003] Although the images generated by using the above application to perform skin smoothing processing on the images can remove wrinkles and blemishes on the face to a certain extent, compared with the images generated by manual photo retouching, they still appear unreal and cannot meet the beautification needs of users. Summary of the invention

[0004] The embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium, which can improve the effect of performing skin resurfacing processing on an image.

[0005] In one aspect, an image processing method is provided, comprising:

[0006] Get the image to be processed;

[0007] The image to be processed is input into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; the preset image processing network is a network generated by training an initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in a training set.

[0008] On the other hand, a training method for an image processing network is provided, comprising:

[0009] Acquire a training set, wherein the training set includes an original image, a defect repair annotated image of the original image, and an annotated neutral gray layer of the original image;

[0010] The initial image processing network is trained according to the original image, the defect repair annotated image of the original image and the annotated neutral gray layer of the original image to generate a preset image processing network.

[0011] In another aspect, an image processing apparatus is provided, comprising:

[0012] The module for acquiring the image to be processed is used to acquire the image to be processed;

[0013] The skin resurfacing processing module is used to input the image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; the preset image processing network is a network generated by training the initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in the training set.

[0014] On the other hand, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0015] On the other hand, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0016] In another aspect, a computer program product is provided, comprising a computer program, which implements the steps of the method described above when executed by a processor.

[0017] The above-mentioned image processing method and device, electronic device, and computer-readable storage medium obtain an image to be processed, input the image to be processed into a preset image processing network for skin refining processing, and generate a skin refining result image. Since the defect repair annotated image and the annotated neutral gray layer of each original image in the training set are the annotated neutral gray layer used for the skin refining processing of the original image in a manual manner, or the generated defect repair annotated image, the accuracy of the annotated neutral gray layer and the defect repair annotated image is relatively high. Therefore, training the initial image processing network based on the training set improves the accuracy of the generated preset image processing network. Furthermore, the image to be processed is input into the preset image processing network for skin refining processing, and the generated skin refining result image can approach or reach the skin refining effect of the image generated by manual photo retouching. Finally, the authenticity of the skin refining result image generated by the preset image processing network is improved, and the beautification needs of the user are met. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application 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 only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A diagram showing an application environment of an image processing method in an embodiment;

[0020] Figure 2is a flowchart of an image processing method in one embodiment;

[0021] Figure 3 for Figure 2 A flowchart of a method for inputting an image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image;

[0022] Figure 4 for Figure 3 The image to be processed is input into the defect repair network for defect repair, and a flowchart of the defect repair image method is generated;

[0023] Figure 5 A schematic diagram of performing skin resurfacing processing on an image to be processed in one embodiment;

[0024] Figure 6 is a flow chart of a training process of a defect repair network in one embodiment;

[0025] Figure 7 A flowchart of a training process of a neutral gray layer prediction network in one embodiment;

[0026] Figure 8 is a flowchart of a method for training an image processing network in one embodiment;

[0027] Fig. 9 is a flowchart of an image processing method in a specific embodiment;

[0028] Fig.10 is a schematic diagram of an image processing method in a specific embodiment;

[0029] Fig.11 is a structural block diagram of an image processing device in one embodiment;

[0030] Fig.12 for Fig.11 The structural block diagram of the microdermabrasion processing module;

[0031] Fig.13 is a structural block diagram of a training device for an image processing network in one embodiment;

[0032] Fig.14 FIG. 1 is a schematic diagram of the internal structure of an electronic device in an embodiment. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0034] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first image processing result may be referred to as a second image processing result, and similarly, a second image processing result may be referred to as a first image processing result. Both the first image processing result and the second image processing result are image processing results, but they are not the same image processing result.

[0035] Figure 1 FIG. 1 is a schematic diagram of an application environment of an image processing method in an embodiment. Figure 1 As shown, the application environment includes an electronic device 120. The electronic device 120 can obtain an image to be processed 110; input the image to be processed 110 into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image 130; the preset image processing network is a network generated by training the initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in the training set. The electronic device 120 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0036] Figure 2 FIG. 1 is a flowchart of an image processing method in an embodiment. The image processing method in this embodiment is executed on Figure 1 The electronic device in the example is used to describe. Figure 2 As shown, the image processing method includes steps 220 to 240, wherein:

[0037] Step 220: Obtain an image to be processed.

[0038] The image to be processed may be an image captured by a camera of the electronic device. In other cases, the image to be processed may be an image stored locally in the electronic device, or may be an image downloaded from the network by the electronic device, etc., which is not limited in this application.

[0039] After the electronic device obtains the image to be processed, it can pre-process the image to be processed. Specifically, the image can be scaled based on bilinear interpolation, for example, the resolution of the image to be processed is sampled from 1241*376 to 1024*320, of course, this application does not limit this. The image parameters of the image to be processed can also be adjusted, and the image parameters here include but are not limited to brightness, contrast, saturation, hue, etc.

[0040] After preprocessing the image to be processed to generate a preprocessed image, the preprocessed image can be subjected to skin smoothing processing.

[0041] Step 240, input the image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; the preset image processing network is a network generated by training an initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in the training set.

[0042] The preset image processing network is a network obtained by pre-training through a training set and used for performing skin refining on an image. The preset image processing network may be a network obtained by training a neural network, and this application does not limit this. Skin refining refers to the process of removing wrinkles and blemishes on a face from an image.

[0043] The training set includes multiple original images and defect repair annotated images and annotated neutral gray layers of each original image. For each original image, the defect repair annotated image and the annotated neutral gray layer of the original image can be obtained in advance by manual annotation. Among them, the defect repair annotated image of the original image refers to the image obtained by manually repairing the defect of the original image. The annotated neutral gray layer of the original image refers to the neutral gray layer used in the process of manually smoothing the original image.

[0044] Among them, the use of neutral gray layer can be used to refine the highlight and dark parts of the image, making the image more layered and three-dimensional. "Neutral gray" refers to the color presented when the values ​​of the three channels R, G, and B are equal under the RGB color channel. And when the values ​​of the three channels R, G, and B are all equal to 128 (the values ​​of the three channels R, G, and B are from 0 to 255), the neutral gray presented is called "absolute neutral gray". "Layer" is like a film containing elements such as text or graphics. The films are stacked together in order to form the final effect of the image. "Neutral gray layer" is a layer composed of pixels with equal values ​​of the three channels R, G, and B. The manual method here includes but is not limited to professional photo retouchers in photo studios.

[0045] Specifically, the process of training to obtain a preset image processing network includes: obtaining a training set, which includes the original image, the defect-repaired annotated image of the original image, and the annotated neutral gray layer of the original image; training the initial image processing network based on the original image, the defect-repaired annotated image of the original image, and the annotated neutral gray layer of the original image to generate a preset image processing network.

[0046] In the embodiment of the present application, since the defect repair annotated images and the annotated neutral gray layers of each original image in the training set are the annotated neutral gray layers used for the manual skin smoothing of the original image, or the generated defect repair annotated images, the accuracy of the annotated neutral gray layers and the defect repair annotated images is relatively high. Therefore, by training the initial image processing network based on the training set, the accuracy of the generated preset image processing network is improved. Furthermore, the image to be processed is input into the preset image processing network for skin smoothing, and the generated skin smoothing result image can approach or reach the skin smoothing effect of the image generated by manual photo retouching. Finally, the authenticity of the skin smoothing result image generated by the preset image processing network is improved, meeting the beautification needs of the user.

[0047] Following the previous embodiment, it is further explained that the preset image processing network includes a defect repair network and a neutral gray layer prediction network. Therefore, in this embodiment, Figure 3 As shown in the figure, the specific implementation steps of step 240, inputting the image to be processed into the preset image processing network for skin resurfacing processing, and generating the skin resurfacing result image, include:

[0048] Step 242, inputting the image to be processed into a defect repair network to repair defects and generate a defect repaired image;

[0049] Specifically, the preset image processing network includes a defect repair network and a neutral gray layer prediction network. The defect repair network here is obtained by training based on each original image in the training set and the defect repair annotated image of each original image. The neutral gray layer prediction network here is obtained by training based on each original image in the training set and the annotated neutral gray layer of each original image.

[0050] Among them, the defect repair network is used to repair defects in the input image, that is, it is mainly used to remove wrinkles and defects on the face of the input image. Here, the defect repair network can be a neural network. Of course, this application does not limit this. Among them, the neutral gray layer prediction network is used to predict the neutral gray layer used in the skin smoothing process of the input image, that is, the neutral gray layer prediction network is used to predict the R, G, and B channel values ​​of each pixel in the neutral gray layer. For example, the predicted R, G, and B channel values ​​are all 80, 80, and 80. Of course, this is just an example and does not specifically limit the R, G, and B channel values.

[0051] Then, the image to be processed is input into the defect repair network for defect repair, wrinkles and defects on the face of the input image are removed, and a defect repair image is generated.

[0052] Step 244, inputting the defect repair image into a neutral gray layer prediction network to perform neutral gray layer prediction, thereby generating a neutral gray layer of the defect repair image;

[0053] Then, the defect repair image is input into the neutral gray layer prediction network for neutral gray layer prediction. Based on the image parameters related to the shadow in the defect repair image, the neutral gray layer prediction network is used to determine the predicted grayscale value of the neutral gray layer for the input defect repair image. After the predicted grayscale value is obtained, the neutral gray layer can be generated based on the predicted grayscale value. The R, G, and B channel values ​​of each pixel in the neutral gray layer are equal and equal to the predicted grayscale value.

[0054] Step 246, the defect repair image and the neutral gray layer are merged to generate a skin smoothing result image.

[0055] After the above steps, the image to be processed is input into the defect repair network for defect repair to generate a defect repair image, and the defect repair image is input into the neutral gray layer prediction network for neutral gray layer prediction to generate a neutral gray layer of the defect repair image. Then, the defect repair image and the neutral gray layer can be fused to generate a skin smoothing result image. Here, the defect repair image and the neutral gray layer can be mixed with soft light to achieve fusion and generate a skin smoothing result image.

[0056] When merging the blemish repair image and the neutral gray layer, first, convert the RGB values ​​(0-255) of the blemish repair image and the neutral gray layer to values ​​between 0 and 1. Here, 0 represents pure black, 0.5 represents absolute neutral gray, and 1 represents pure white. Then, merge the converted RGB values ​​of the blemish repair image and the neutral gray layer to generate the skin smoothing result image.

[0057] In the embodiment of the present application, the defect repair network here is obtained by training based on each original image in the training set and the defect repair annotated image of each original image. The neutral gray layer prediction network here is obtained by training based on each original image in the training set and the annotated neutral gray layer of each original image. The image to be processed is input into the defect repair network for defect repair to generate a defect repair image. The defect repair image is input into the neutral gray layer prediction network for neutral gray layer prediction to generate a neutral gray layer of the defect repair image. The defect repair image and the neutral gray layer are fused to generate a skin smoothing result image. Since the defect repair network and the neutral gray layer prediction network are generated by training based on the training set, the image to be processed is sequentially input into the defect repair network and the neutral gray layer prediction network for processing, and the skin smoothing result image finally generated can be close to or reach the skin smoothing effect of the image generated by manual photo retouching. Finally, the authenticity of the generated skin smoothing result image is improved to meet the beautification needs of users.

[0058] Continuing from the previous embodiment, the defect repair network includes a defect detection network. Figure 4 As shown, the specific implementation steps of step 242, inputting the image to be processed into the defect repair network to repair the defects and generating the defect repaired image, include:

[0059] Step 242a, inputting the image to be processed into a defect detection network for defect detection to generate a defect mask image;

[0060] Specifically, the preset image processing network includes a defect repair network and a neutral gray layer prediction network, and the defect repair network includes a defect detection network. The training set also includes defect annotation maps of each original image, where the defect annotation map refers to an image generated by annotating wrinkles and defects on the face of the original image. Among them, defects include but are not limited to moles, acne, acne marks, spots, blackheads, etc. The defect detection network is generated by training the initial defect detection network based on each original image and the defect annotation map of each original image in the training set. Here, the initial defect detection network can be a neural network, such as a YOLO (you only look once) neural network. Of course, this application does not limit this. The YOLO neural network is a convolutional neural network that can predict the position and category of multiple detection boxes (Box) at one time, and is mainly used to achieve end-to-end target detection and recognition. The initial defect detection network can also be a deep learning network, such as an SSD (Single Shot MultiBox Detector) deep learning network. The SSD deep learning network is also a target detection algorithm. Of course, this application does not limit this.

[0061] When repairing defects in an image to be processed, first, the image to be processed is input into a defect detection network for defect detection to generate a defect mask. Specifically, the image to be processed is input into a defect detection network for defect detection to generate the position information and shape information of the defect detection frame on the image to be processed. Assuming that the detection frames here are all rectangular, the position information and shape information of the defect detection frame are generated. The position information and shape information of the detection frame are specifically embodied as (x i ,y i ,w i ,h i ). Among them, x i Indicates the horizontal coordinate of the center point of the detection box, y i Indicates the vertical coordinate of the center point of the detection box, w i Indicates the width of the detection box, h i Indicates the height of the detection frame. Based on the position information and shape information of the detection frame, the position and shape of the detection frame can be accurately determined on the image to be processed.

[0062] After the position and shape of the detection frame are accurately determined on the image to be processed, a defect mask can be generated based on the position and shape of the detection frame. Specifically, a mask image with the same size as the image to be processed is first established; then, based on the position and shape of the detection frame in the mask image, the pixels within the detection frame are set to 0, and the pixels outside the detection frame are set to 1, thus obtaining a defect mask.

[0063] Step 242b: Based on the defect mask image and the image to be processed, perform defect repair on the image to be processed to generate a defect repaired image.

[0064] Then, the image to be processed is repaired based on the defect mask image by an image repair algorithm to generate a defect repair image. The image repair algorithm here includes an inpainting algorithm, which is mainly implemented by the inpaint function and can be used to remove dust and scratches from an image or video, or to remove unwanted objects from an image or video.

[0065] The image repair algorithm here also includes an image repair algorithm based on OpenCV, such as the Telea algorithm, that is, the fast marching method (FMM). The idea behind the FMM algorithm is to first process the pixels on the edge of the area to be repaired, and then advance inward layer by layer until all the pixels are repaired.

[0066] In an embodiment of the present application, the image to be processed is input into a defect detection network for defect detection, and a defect mask map is generated. Based on the defect mask map and the image to be processed, defects are repaired on the image to be processed to generate a defect repaired image. First, defect detection is performed based on the defect detection network to generate a defect mask map, and the range of the defect is accurately determined in the defect mask map. Then, the image repair algorithm can be used to repair defects on the image to be processed based on the defect mask map to generate a defect repaired image. In this way, it is equivalent to restoring the process of manual defect repair, and therefore, it can approach or achieve the effect of the defect repair image generated by manual defect repair.

[0067] Continuing with the above-mentioned embodiment, the specific implementation steps of step 244, inputting the defect repair image into the neutral gray layer prediction network to perform neutral gray layer prediction, and generating the neutral gray layer of the defect repair image, include:

[0068] Inputting the defect repair image into the neutral gray layer prediction network to determine the predicted grayscale value of the neutral gray layer of the defect repair image;

[0069] Generates a neutral gray layer of the defect repair image based on the predicted grayscale values.

[0070] Combination Figure 5 FIG. 1 is a schematic diagram of performing skin resurfacing processing on an image to be processed in one embodiment. First, the image to be processed S is input into a defect detection network for defect detection to generate a defect mask; secondly, based on the defect mask and the image to be processed, the image to be processed is repaired to generate a defect repair image I1; thirdly, the defect repair image is input into a neutral gray layer prediction network for neutral gray layer prediction to generate a neutral gray layer I2 of the defect repair image; finally, the defect repair image I1 and the neutral gray layer I2 are fused to generate a skin resurfacing result image R.

[0071] Among them, the neutral gray layer prediction network here is obtained by inputting each original image in the training set and the annotated neutral gray layer of each original image into the initial neutral gray layer prediction network for training. Among them, the initial neutral gray layer prediction network includes an image translation network, and the image translation network is mainly used to realize the conversion of images into other forms of images. The image translation network includes at least one of the pix2pix network, the pix2pixHD network, and the vid2vid network. Of course, this application does not limit this. Through at least one of the pix2pix network, the pix2pixHD network, and the vid2vid network, the neutral gray layer of the original image can be regressed.

[0072] Among them, the specific implementation process of inputting the defect repair image into the neutral gray layer prediction network for neutral gray layer prediction and generating the neutral gray layer I2 of the defect repair image includes: inputting the defect repair image into the neutral gray layer prediction network, determining the predicted grayscale value of the neutral gray layer of the defect repair image; based on the predicted grayscale value, generating the neutral gray layer of the defect repair image.

[0073] Since the neutral gray layer is a layer composed of pixels with equal R, G, and B channel values, when generating the neutral gray layer, the predicted gray value of the neutral gray layer is first determined. Then, the neutral gray layer can be generated based on the predicted gray value.

[0074] In the embodiment of the present application, the neutral gray layer prediction network is obtained by training based on each original image in the training set and the annotated neutral gray layer of each original image. And the annotated neutral gray layer of the original image refers to the neutral gray layer used in the process of manually smoothing the original image. Therefore, the defect repair image is input into the neutral gray layer prediction network to determine the predicted grayscale value of the neutral gray layer of the defect repair image. Based on the predicted grayscale value, a neutral gray layer of the defect repair image is generated. The generated neutral gray layer can be close to or reach the annotated neutral gray layer used by professional photo retouchers. Thereby, the authenticity of the skin smoothing result image generated by the subsequent skin smoothing process based on the neutral gray layer is improved, and the beautification needs of the user are met.

[0075] In one embodiment, the defect repair image and the neutral gray layer are merged to generate a skin smoothing result image, including:

[0076] Combine the blemish repair image and the neutral gray layer in the Soft Light blending mode to generate the skin smoothing result image.

[0077] Combination Figure 5 As shown, the defect repair image I1 and the neutral gray layer I2 are fused in the soft light blending mode to generate the skin smoothing result image R. The soft light blending mode refers to. The defect repair image and the neutral gray layer are fused in the soft light blending mode to increase or decrease the brightness of the image, thereby eliminating the shadow in the image. Here, if a brighter neutral gray layer is used for fusion, the brightness of the image is increased; if a smaller neutral gray layer is used for fusion, the brightness of the image is decreased.

[0078] Specifically, the formula for blending the defect repair image and the neutral gray layer in the soft light blending mode is as follows:

[0079]

[0080] Where a in formula (1-1) represents the RGB channel value of the pixel in the defect repair image I1, and b represents the RGB value of the same pixel in the neutral gray layer I2. When the defect repair image and the neutral gray layer are merged, the RGB values ​​(0-255) of the defect repair image and the neutral gray layer are divided by 255 in advance and converted to values ​​between 0 and 1. For the R channel, if the converted R channel value of the pixel in the neutral gray layer I2 is less than 0.5, 2ab+a is used. 2(1-2b) is used to calculate the R channel value of the new pixel in the skin smoothing result image with the same position as the pixel. At this time, a represents the R channel value of the pixel in the defect repair image I1, and b represents the R channel value of the pixel in the neutral gray layer I2. Similarly, for the G channel, when the converted G channel value of the pixel in the neutral gray layer I2 is less than 0.5, 2ab+a is used. 2 (1-2b) is used to calculate the G channel value of the new pixel in the skin smoothing result image with the same position as the pixel. At this time, a represents the G channel value of the pixel in the defect repair image I1, and b represents the G channel value of the pixel in the neutral gray layer I2. Similarly, for the B channel, when the converted B channel value of the pixel in the neutral gray layer I2 is less than 0.5, 2ab+a is used. 2 (1-2b) is used to calculate the B channel value of the new pixel in the skin smoothing result image at the same position as the pixel. At this time, a represents the B channel value of the pixel in the defect repair image I1, and b represents the B channel value of the pixel in the neutral gray layer I2.

[0081] For the R channel, when the converted R channel value of the pixel in the neutral gray layer I2 is greater than or equal to 0.5, To calculate the R channel value of the new pixel in the skin smoothing result image with the same position as the pixel. At this time, a represents the R channel value of the pixel in the defect repair image I1, and b represents the R channel value of the pixel in the neutral gray layer I2. Similarly, for the G channel, when the converted G channel value of the pixel in the neutral gray layer I2 is greater than or equal to 0.5, use Calculate the G channel value of the new pixel in the skin smoothing result image with the same position as the pixel. At this time, a represents the G channel value of the pixel in the defect repair image I1, and b represents the G channel value of the pixel in the neutral gray layer I2. For the B channel, when the converted B channel value of the pixel in the neutral gray layer I2 is greater than or equal to 0.5, use Calculate the B channel value of the new pixel in the skin smoothing result image at the same position as the pixel. At this time, a represents the B channel value of the pixel in the defect repair image I1, and b represents the B channel value of the pixel in the neutral gray layer I2.

[0082] In this way, a skin resurfacing result image is generated based on the RGB channel values ​​of the new pixels.

[0083] In the embodiment of the present application, the above formula is used to fuse the defect repair image and the neutral gray layer in the soft light blending mode to generate a skin smoothing result image. The brightness of the image can be increased or decreased, thereby eliminating shadows in the image. Ultimately, the authenticity of the generated skin smoothing result image is improved, meeting the user's beautification needs.

[0084] In one embodiment, Figure 6As shown, the training process of the defect repair network is also provided, including:

[0085] Step 620, inputting the original image in the training set into the initial defect repair network to generate a defect repair prediction image corresponding to the original image;

[0086] The training set includes multiple original images and defect repair annotated images of each original image. The defect repair annotated image of the original image refers to an image obtained by manually repairing the defect of the original image. The original image in the training set is input into the initial defect repair network for defect repair, and a defect repair prediction image corresponding to the original image is generated. The initial defect repair network includes a YOLO neural network, and the YOLO neural network includes any one of a YOLOV3 neural network, a YOLO V4 neural network, and a YOLO V5 neural network.

[0087] Among them, the YOLO neural network is a fast and compact open source object detection model. Compared with other networks, the YOLO neural network has stronger performance at the same size and has very good stability. It is the first end-to-end neural network that can predict the category and bounding box of an object. And the original model of YOLO V3 is based on the Darknet network model.

[0088] Among them, the YOLO network is mainly composed of three main components:

[0089] 1) Backbone: A convolutional neural network that can aggregate and form image features at different image granularities.

[0090] 2) Neck: It is a series of network layers that mix and combine image features and pass the image features to the prediction layer.

[0091] 3) Head: used to predict image features, generate bounding boxes and predict categories.

[0092] Step 640, calculating the value of the loss function according to the defect repair annotation image and the defect repair prediction image of the original image;

[0093] For each original image, obtain the defect repair annotated image of the original image from the training set, and calculate the value of the loss function based on the defect repair annotated image and the defect repair predicted image of the original image. The loss function here can be a cross entropy loss function, of course, this application is not limited to this. Among them, the cross entropy loss function can be used in classification problems, especially when neural networks are used for classification problems, cross entropy can be used as a loss function. In addition, since cross entropy involves calculating the probability of each category, cross entropy almost always appears with the sigmoid (or softmax) function.

[0094] Step 660: Adjust the parameters of the initial defect repair network according to the value of the loss function to generate a defect repair network.

[0095] After calculating the value of the loss function based on the defect repair annotation image and the defect repair prediction image of the original image, the initial parameters of the initial defect repair network can be adjusted according to the value of the loss function to generate the target parameters. The defect repair network can be generated based on the target parameters.

[0096] In an embodiment of the present application, the original image in the training set is input into the initial defect repair network to generate a defect repair prediction image corresponding to the original image. The value of the loss function is calculated based on the defect repair annotated image and the defect repair prediction image of the original image. The parameters of the initial defect repair network are adjusted according to the value of the loss function to generate the defect repair network. Since the defect repair annotated image of the original image is manually pre-annotated, the initial defect repair network is trained through the original image in the training set and the defect repair annotated image of the original image to generate the final defect repair network. In this way, the image to be processed is input into the defect repair network for defect repair, and the generated defect repair image can approach or reach the effect of the defect repair image generated by manual photo retouching. Finally, the authenticity of the skin resurfacing result image generated by the preset image processing network is improved, and the user's beautification needs are met.

[0097] In one embodiment, Figure 7 As shown, the training process of the neutral gray layer prediction network is also provided, including:

[0098] Step 720, inputting the original image in the training set into the initial neutral gray layer prediction network to generate a predicted neutral gray layer corresponding to the original image;

[0099] The training set includes multiple original images and annotated neutral gray layers corresponding to each original image. The original images in the training set are input into the initial neutral gray layer prediction network for prediction to generate a predicted neutral gray layer corresponding to the original image. Among them, the initial neutral gray layer prediction network includes an image translation network, and the image translation network is mainly used to realize the conversion of images into other forms of images. The image translation network includes at least one of a pix2pix network, a pix2pixHD network, and a vid2vid network. Of course, this application does not limit this. The pix2pixHD network, based on the pix2pix network, better solves the problem of high-resolution image conversion (translation), and the vid2vid network, based on the pix2pixHD network, better solves the problem of high-resolution video conversion.

[0100] Step 740, calculating the value of the loss function according to the annotated neutral gray layer and the predicted neutral gray layer of the original image;

[0101] Step 760, adjusting the parameters of the initial neutral gray layer prediction network according to the value of the loss function to generate a neutral gray layer prediction network.

[0102] For each original image, the annotated neutral gray layer of the original image is obtained from the training set, and the value of the loss function is calculated based on the annotated neutral gray layer and the predicted neutral gray layer of the original image. The loss function here can be a cross entropy loss function, of course, this application does not limit this.

[0103] After calculating the value of the loss function based on the annotated neutral gray layer and the predicted neutral gray layer of the original image, the initial parameters of the initial neutral gray layer prediction network can be adjusted according to the value of the loss function to generate the target parameters. Based on the target parameters, the neutral gray layer prediction network can be generated.

[0104] In the embodiment of the present application, since the annotated neutral gray layer is manually pre-annotated, the original image in the training set is input into the initial neutral gray layer prediction network to generate a predicted neutral gray layer corresponding to the original image. Then, based on the annotated neutral gray layer and the predicted neutral gray layer of the original image, the value of the loss function is calculated. Finally, the parameters of the initial neutral gray layer prediction network are adjusted according to the value of the loss function to generate a neutral gray layer prediction network. In this way, the image to be processed is input into the neutral gray layer prediction network for prediction, and the generated neutral gray layer can approach or reach the effect of the neutral gray layer used for manual photo retouching. Finally, the authenticity of the skin refining result image generated by the preset image processing network is improved, and the user's beautification needs are met.

[0105] In one embodiment, Figure 8 As shown, a training method for an image processing network is provided, comprising:

[0106] Step 820, obtaining a training set, the training set including the original image, the defect repair annotated image of the original image, and the annotated neutral gray layer of the original image;

[0107] The training set includes multiple original images and defect repair annotated images and annotated neutral gray layers of each original image. The original image may refer to an image captured by an electronic device through a camera. In other cases, the original image may also be an image stored locally in the electronic device, or an image downloaded from the Internet by the electronic device, etc., which is not limited in this application. For each original image, the defect repair annotated image of the original image and the annotated neutral gray layer of the original image may be obtained in advance by manual annotation. Among them, the defect repair annotated image of the original image refers to the image obtained by manually repairing the defects of the original image. The annotated neutral gray layer of the original image refers to the neutral gray layer used in the process of manually smoothing the original image.

[0108] Step 840 , training the initial image processing network according to the original image, the defect repair annotated image of the original image, and the annotated neutral gray layer of the original image to generate a preset image processing network.

[0109] Among them, the initial image processing network includes an initial defect repair network and an initial neutral gray layer prediction network. And the initial defect repair network includes a YOLO neural network, and the YOLO neural network includes any one of a YOLO V3 neural network, a YOLO V4 neural network, and a YOLO V5 neural network. Of course, this application does not limit this. The initial neutral gray layer prediction network includes an image translation network, and the image translation network is mainly used to realize the conversion of images into other forms of images. The image translation network includes at least one of a pix2pix network, a pix2pixHD network, and a vid2vid network. Of course, this application does not limit this.

[0110] The original image is sequentially input into the initial defect repair network and the initial neutral gray layer prediction network for training to generate defect repair prediction images and predicted neutral gray layers. Based on the defect repair prediction image and defect repair annotated image of the original image, the value of the loss function is calculated; the parameters of the initial defect repair network are adjusted according to the value of the loss function to generate the defect repair network. Based on the annotated neutral gray layer and predicted neutral gray layer of the original image, the value of the loss function is calculated; the parameters of the initial neutral gray layer prediction network are adjusted according to the value of the loss function to generate the neutral gray layer prediction network.

[0111] Finally, a preset image processing network is generated based on the trained defect repair network and neutral gray layer prediction network.

[0112] In an embodiment of the present application, a training method for an image processing network is provided, wherein an initial image processing network is trained based on the original image, the defect repair annotated image of the original image, and the annotated neutral gray layer of the original image included in the training set to generate a preset image processing network. Since the defect repair annotated image of the original image and the annotated neutral gray layer of the original image are both obtained in advance by manual annotation, the trained preset image processing network can restore the process of manual image retouching, thereby improving the authenticity of the skin refining result image generated by the preset image processing network and meeting the user's beautification needs.

[0113] Continuing from the previous embodiment, a method for training an image processing network is described. In this embodiment, step 840 is described in detail. The specific implementation steps of training the initial image processing network according to the original image, the defect repair annotated image of the original image, and the annotated neutral gray layer of the original image to generate a preset image processing network include:

[0114] The initial defect repair network is trained according to the original image and the defect repair annotated image of the original image in the training set to generate a defect repair network;

[0115] According to the original image in the training set and the neutral gray layer of the original image, the initial neutral gray layer prediction network is trained to generate a neutral gray layer prediction network;

[0116] Based on the defect repair network and the neutral gray layer prediction network, a preset image processing network is generated.

[0117] Specifically, first, the original image is input into the initial defect repair network for training to generate a defect repair prediction image. Then, based on the defect repair prediction image and defect repair annotation image of the original image, the value of the loss function is calculated; the parameters of the initial defect repair network are adjusted according to the value of the loss function to generate a defect repair network.

[0118] Secondly, the original image is input into the initial neutral gray layer prediction network for training to generate the predicted neutral gray layer. Then, the value of the loss function is calculated based on the annotated neutral gray layer and the predicted neutral gray layer of the original image; the parameters of the initial neutral gray layer prediction network are adjusted according to the value of the loss function to generate the neutral gray layer prediction network.

[0119] Finally, the trained defect repair network and neutral gray layer prediction network are combined, and a step of fusing the defect repair image and the neutral gray layer in a soft light blending mode is added to generate a preset image processing network.

[0120] In an embodiment of the present application, a method for training an image processing network is provided. According to the original image in the training set, the defect repair annotated image of the original image, and the annotated neutral gray layer of the original image, the initial defect repair network and the initial neutral gray layer prediction network are trained in sequence to generate a defect repair network and a neutral gray layer prediction network. Finally, based on the combination of the trained defect repair network and the neutral gray layer prediction network, a step of fusing the defect repair image and the neutral gray layer in a soft light blending mode is added to generate a preset image processing network. Different networks are trained in sequence according to the steps of manual photo retouching, and finally a preset image processing network is obtained. Therefore, the preset image processing network can restore the process of manual photo retouching, thereby improving the authenticity of the skin smoothing result image generated by the preset image processing network and meeting the beautification needs of users.

[0121] In a specific embodiment, Fig. 9 As shown, an image processing method is provided, including: a training process of an image processing network and an image processing process;

[0122] Among them, the training process of the image processing network includes:

[0123] Step 902, obtaining a training set A, wherein the training set A includes an original image, a defect repair annotated image of the original image, and an annotated neutral gray layer of the original image;

[0124] Step 904, training the initial defect repair network according to the original image and the defect repair annotated image of the original image in the training set to generate a defect repair network;

[0125] Step 906, training the initial neutral gray layer prediction network according to the original image in the training set and the neutral gray layer of the original image to generate a neutral gray layer prediction network;

[0126] Step 908: Generate a preset image processing network based on the defect repair network and the neutral gray layer prediction network.

[0127] Among them, combined Fig.10 As shown, the image processing process includes:

[0128] Step 910, obtaining an image S to be processed;

[0129] Step 912, inputting the image to be processed S into a defect detection network for defect detection to generate a defect mask;

[0130] Step 914, based on the defect mask and the image to be processed S, repair the defects of the image to be processed S to generate a defect repaired image I1;

[0131] Step 916, inputting the defect repair image I1 into the neutral gray layer prediction network to determine the predicted grayscale value of the neutral gray layer of the defect repair image I1;

[0132] Step 918, generating a neutral gray layer I2 of the defect repair image based on the predicted gray value;

[0133] Step 920 , the defect repair image I1 and the neutral gray layer I2 are merged in a soft light blending mode to generate a skin resurfacing result image R.

[0134] In the embodiment of the present application, different networks are trained in sequence according to the steps of manual photo editing, and finally a preset image processing network is obtained. Therefore, the preset image processing network can restore the process of manual photo editing. Then, the image to be processed is input into the preset image processing network for skin smoothing, and the generated skin smoothing result image can be close to or reach the skin smoothing effect of the image generated by manual photo editing. Finally, the authenticity of the skin smoothing result image generated by the preset image processing network is improved, and the beautification needs of users are met.

[0135] In one embodiment, Fig.11 As shown, an image processing device 1100 is provided, comprising:

[0136] The to-be-processed image acquisition module 1120 is used to acquire the to-be-processed image;

[0137] The skin resurfacing processing module 1140 is used to input the image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; the preset image processing network is a network generated by training the initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in the training set.

[0138] In one embodiment, the preset image processing network includes a defect repair network and a neutral gray layer prediction network; Fig.12 As shown, the microdermabrasion processing module 1140 includes:

[0139] The defect repair unit 1142 is used to input the image to be processed into the defect repair network to perform defect repair and generate a defect repaired image;

[0140] A neutral gray layer generating unit 1144 is used to input the defect repair image into the neutral gray layer prediction network to perform neutral gray layer prediction and generate a neutral gray layer of the defect repair image;

[0141] The fusion unit 1146 is used to fuse the defect repair image and the neutral gray layer to generate a skin resurfacing result image.

[0142] In one embodiment, the defect repair network includes a defect detection network; the defect repair unit 1142 is also used to input the image to be processed into the defect detection network for defect detection and generate a defect mask map; based on the defect mask map and the image to be processed, the defect of the image to be processed is repaired to generate a defect repaired image.

[0143] In one embodiment, the neutral gray layer generation unit 1144 is further used to input the defect repair image into the neutral gray layer prediction network to determine the predicted grayscale value of the neutral gray layer of the defect repair image; and generate the neutral gray layer of the defect repair image based on the predicted grayscale value.

[0144] In one embodiment, the fusion unit 1146 is further configured to fuse the defect repair image and the neutral gray layer in a soft light blending mode to generate a skin smoothing result image.

[0145] In one embodiment, an image processing device 1100 is provided, further comprising: a defect repair network generation module, used to input the original image in the training set into the initial defect repair network to generate a defect repair prediction image corresponding to the original image; calculate the value of the loss function based on the defect repair annotation image and the defect repair prediction image of the original image; adjust the parameters of the initial defect repair network according to the value of the loss function to generate the defect repair network.

[0146] In one embodiment, the initial defect repair network includes a YOLO neural network.

[0147] In one embodiment, the YOLO neural network includes any one of a YOLO V3 neural network, a YOLO V4 neural network, and a YOLO V5 neural network.

[0148] In one embodiment, an image processing device 1100 is provided, further comprising: a neutral gray layer prediction network generation module, for inputting an original image in a training set into an initial neutral gray layer prediction network to generate a predicted neutral gray layer corresponding to the original image; calculating a value of a loss function based on the labeled neutral gray layer and the predicted neutral gray layer of the original image; and adjusting parameters of the initial neutral gray layer prediction network based on the value of the loss function to generate a neutral gray layer prediction network.

[0149] In one embodiment, the initial neutral gray layer prediction network includes an image translation network.

[0150] In one embodiment, the image translation network includes at least one of a pix2pix network, a pix2pixHD network, and a vid2vid network.

[0151] In one embodiment, Fig.13As shown, a training device 1300 for an image processing network is provided, comprising:

[0152] The training set acquisition module 1320 is used to acquire a training set, which includes an original image, a defect repair annotated image of the original image, and an annotated neutral gray layer of the original image;

[0153] The network training module 1340 is used to train the initial image processing network according to the original image, the defect repair annotated image of the original image and the annotated neutral gray layer of the original image to generate a preset image processing network.

[0154] In one embodiment, the network training module 1340 is also used to train an initial defect repair network based on the original image in the training set and the defect repair annotated image of the original image to generate a defect repair network; train an initial neutral gray layer prediction network based on the original image in the training set and the neutral gray layer of the original image to generate a neutral gray layer prediction network; and generate a preset image processing network based on the defect repair network and the neutral gray layer prediction network.

[0155] It should be understood that, although the various steps in the above-mentioned flow chart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above-mentioned flow chart may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0156] The division of the modules in the above-mentioned image processing device is only for illustration. In other embodiments, the image processing device may be divided into different modules as needed to complete all or part of the functions of the above-mentioned image processing device.

[0157] For the specific definition of the image processing device, please refer to the definition of the image processing method above, which will not be repeated here. Each module in the above image processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0158] Fig.14Schematic diagram of the internal structure of an electronic device in an embodiment. The electronic device can be any terminal device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a car computer, a wearable device, etc. The electronic device includes a processor and a memory connected via a system bus. Among them, the processor may include one or more processing units. The processor may be a CPU (Central Processing Unit) or a DSP (Digital Signal Processing), etc. The memory may include a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The computer program can be executed by the processor to implement an image processing method provided in each of the following embodiments. The internal memory provides a cache operating environment for the operating system computer program in the non-volatile storage medium.

[0159] The implementation of each module in the image processing device provided in the embodiment of the present application may be in the form of a computer program. The computer program may be run on an electronic device. The program module constituted by the computer program may be stored in a memory of the electronic device. When the computer program is executed by a processor, the steps of the method described in the embodiment of the present application are implemented.

[0160] The embodiment of the present application also provides a computer-readable storage medium, which is one or more non-volatile computer-readable storage media containing computer-executable instructions, and when the computer-executable instructions are executed by one or more processors, the processors execute the steps of the image processing method.

[0161] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the image processing method.

[0162] Any reference to memory, storage, database or other medium used in this application may include non-volatile and / or volatile memory. Non-volatile memory may include ROM (Read-Only Memory), PROM (Programmable Read-only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-only Memory) or flash memory. Volatile memory may include RAM (Random Access Memory), which is used as an external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as SRAM (Static Random Access Memory), DRAM (Dynamic Random Access Memory), SDRAM (Synchronous Dynamic Random Access Memory), Double Data Rate DDRSDRAM (Double Data Rate Synchronous Dynamic Random Access memory), ESDRAM (Enhanced Synchronous Dynamic Random Access memory), SLDRAM (Sync Link Dynamic Random Access Memory), RDRAM (Rambus Dynamic Random Access Memory), and DRDRAM (Direct Rambus Dynamic Random Access Memory).

[0163] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image processing method, characterized in that: include: Get the image to be processed; Inputting the image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; The preset image processing network is a network generated by training the initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in the training set; The preset image processing network includes a defect repair network and a neutral gray layer prediction network; the step of inputting the image to be processed into the preset image processing network for skin resurfacing processing to generate a skin resurfacing result image includes: Inputting the image to be processed into the defect repair network to perform defect repair and generate a defect repaired image; Inputting the defect repair image into the neutral gray layer prediction network to perform neutral gray layer prediction, and generating a neutral gray layer of the defect repair image; The defect repair image and the neutral gray layer are fused to generate the skin resurfacing result image.

2. The method according to claim 1, characterized in that: The defect repair network includes a defect detection network; the step of inputting the image to be processed into the defect repair network to perform defect repair and generate a defect repaired image includes: Inputting the image to be processed into the defect detection network to perform defect detection and generate a defect mask map; Based on the defect mask image and the image to be processed, defect repair is performed on the image to be processed to generate the defect repaired image.

3. The method according to claim 1 or 2, characterized in that: The step of inputting the defect repair image into the neutral gray layer prediction network to perform neutral gray layer prediction to generate the neutral gray layer of the defect repair image includes: Inputting the defect repair image into the neutral gray layer prediction network to determine the predicted grayscale value of the neutral gray layer of the defect repair image; Based on the predicted grayscale value, a neutral gray layer of the defect repair image is generated.

4. The method according to claim 1 or 2, characterized in that: The step of fusing the defect repair image and the neutral gray layer to generate the skin resurfacing result image includes: The defect repair image and the neutral gray layer are fused in a soft light blending mode to generate the skin resurfacing result image.

5. The method according to claim 1, characterized in that: The method further comprises: Inputting the original image in the training set into an initial defect repair network to generate a defect repair prediction image corresponding to the original image; Calculating a value of a loss function according to the defect repair annotated image of the original image and the defect repair predicted image; The parameters of the initial defect repair network are adjusted according to the value of the loss function to generate the defect repair network.

6. The method according to claim 5, characterized in that The initial defect repair network includes a YOLO neural network.

7. The method according to claim 6, characterized in that The YOLO neural network includes any one of a YOLO V3 neural network, a YOLO V4 neural network, and a YOLO V5 neural network.

8. The method according to claim 1, characterized in that The method further comprises: Inputting the original image in the training set into an initial neutral gray layer prediction network to generate a predicted neutral gray layer corresponding to the original image; Calculating a value of a loss function according to the annotated neutral gray layer of the original image and the predicted neutral gray layer; The parameters of the initial neutral gray layer prediction network are adjusted according to the value of the loss function to generate the neutral gray layer prediction network.

9. The method according to claim 8, characterized in that The initial neutral gray layer prediction network includes an image translation network.

10. The method according to claim 9, characterized in that The image translation network includes at least one of a pix2pix network, a pix2pixHD network, and a vid2vid network.

11. A training method for an image processing network, characterized in that: include: Acquire a training set, wherein the training set includes an original image, a defect repair annotated image of the original image, and an annotated neutral gray layer of the original image; The initial image processing network is trained according to the original image, the defect repair annotated image of the original image and the annotated neutral gray layer of the original image to generate a preset image processing network.

12. The method according to claim 11, characterized in that The training of the initial image processing network according to the original image, the defect repair annotated image of the original image and the annotated neutral gray layer of the original image to generate the preset image processing network includes: Training an initial defect repair network according to the original image and the defect repair annotated image of the original image in the training set to generate the defect repair network; Training an initial neutral gray layer prediction network according to the original image in the training set and the neutral gray layer of the original image to generate the neutral gray layer prediction network; The preset image processing network is generated based on the defect repair network and the neutral gray layer prediction network.

13. An image processing device, characterized in that: include: The module for acquiring the image to be processed is used to acquire the image to be processed; A skin resurfacing processing module, used for inputting the image to be processed into a preset image processing network for skin resurfacing processing to generate a skin resurfacing result image; the preset image processing network is a network generated by training an initial image processing network based on the defect repair annotated images and annotated neutral gray layers of each original image in a training set; The preset image processing network includes a defect repair network and a neutral gray layer prediction network; the skin resurfacing processing module includes: A defect repair unit, used for inputting the image to be processed into the defect repair network to perform defect repair and generate a defect repaired image; A neutral gray layer generating unit, used for inputting the defect repair image into the neutral gray layer prediction network to perform neutral gray layer prediction, and generating a neutral gray layer of the defect repair image; A fusion unit is used to fuse the defect repair image and the neutral gray layer to generate the skin resurfacing result image.

14. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the computer program is executed by the processor, the processor executes the steps of the image processing method according to any one of claims 1 to 10 and the image processing network training method according to claims 11 to 12.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 10 and the image processing network training method according to claims 11 to 12 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the steps of the image processing method described in any one of claims 1 to 10 and the image processing network training method described in claims 11 to 12.

Citation Information

Patent Citations

  • Image processing device, image processing system, image processing method, and image processing program therefor

    JP2016139176A