Face image enhancement method, device and electronic equipment
By performing image segmentation and local enhancement processing on face images, combined with splicing technology, the problem of poor face image enhancement effects in the existing technology is solved, and precise enhancement of each part of the face is achieved and the overall visual effect is improved.
Patent Information
- Application Number
- CN201911297530.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-13
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2039-12-13
AI Technical Summary
Existing face image enhancement methods cannot accurately enhance various parts of the face in a targeted manner, resulting in poor overall visual effects of the enhanced face image.
Multiple target partial images are obtained through image segmentation processing, each partial image is enhanced, and the initial enhanced image and the local enhanced image are spliced to ensure a natural transition at the splicing boundary and improve the enhancement effect of each part of the face.
The enhancement effect of various parts of the face in the face image is improved, thereby improving the overall visual effect of the face image.
Smart Images

Figure CN112991191B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a face image enhancement method, device and electronic equipment. Background Art
[0002] Image enhancement refers to enhancing the useful information of an image, improving the resolution of the image, improving the visual experience of the image, purposefully emphasizing the local and overall features of the image, suppressing uninteresting features, and making the image meet specific needs. Many application scenarios have adopted face image enhancement technology, such as beauty, image restoration, and beautification of old photos. Face image enhancement can improve the quality of face images, not only making them clearer visually, but also making them easier for computers to process and recognize.
[0003] Currently, face image enhancement methods are mainly divided into two categories. One category uses traditional face image enhancement algorithms, such as sequential image fusion methods or nonlinear transformation algorithms based on gamma transform and logarithmic transform. The other category uses face image enhancement algorithms based on deep learning.
[0004] However, the feature information extracted by traditional face image enhancement algorithms is limited and their general performance is poor. Existing face image enhancement algorithms based on deep learning will generate overly complex feature information when the entire face image is input into the corresponding network model, and cannot accurately enhance all parts of the face in the face image at the same time, resulting in poor overall visual effect of the enhanced face image. Summary of the invention
[0005] The object of the present invention is to provide a facial image enhancement method, device and electronic device to improve the enhancement effect of various parts of the face in the facial image, thereby improving the overall visual effect of the facial image.
[0006] The embodiment of the present invention provides a method for enhancing a facial image, comprising:
[0007] Perform image segmentation processing on the original face image to be processed to obtain multiple target local images;
[0008] Performing image enhancement processing on each of the target local images respectively to obtain a local enhanced image corresponding to each of the target local images;
[0009] Obtaining an initial enhanced image after image enhancement processing is performed on the original face image;
[0010] The initial enhanced image and each of the local enhanced images are subjected to image stitching processing to obtain a target enhanced image corresponding to the original face image.
[0011] Furthermore, the image segmentation process is performed on the original face image to be processed to obtain a plurality of target partial images, including:
[0012] The original face image to be processed is input into a pre-trained segmentation model to obtain a plurality of target local images output by the segmentation model; wherein the segmentation model is used to perform segmentation processing on the input image.
[0013] Furthermore, the image segmentation process is performed on the original face image to be processed to obtain a plurality of target partial images, including:
[0014] Inputting the original face image to be processed into a pre-trained face parsing model to obtain a plurality of local parsing images output by the face parsing model; wherein the local parsing images include one or more of a mouth parsing image, an eye parsing image, a nose parsing image, a hair parsing image, an eyebrow parsing image, and an ear parsing image;
[0015] Performing closing operations on each of the local analytical images to obtain a plurality of optimized local analytical images;
[0016] Obtaining regional position information of each of the optimized local analysis images in the original face image;
[0017] According to the area position information corresponding to each of the optimized local analytical images, image capture is performed in the original face image to obtain a plurality of target local images.
[0018] Furthermore, the step of obtaining the regional position information of each of the optimized local analysis images in the original face image includes:
[0019] Finding the bounding rectangle of each optimized local parsed image;
[0020] The position coordinate information of the circumscribed rectangle of each optimized local parsed image is determined as the region position information of the optimized local parsed image in the original face image.
[0021] Furthermore, performing image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images includes:
[0022] Input each of the target local images into a pre-trained local enhancement model to obtain a plurality of local enhanced images output by the local enhancement model; wherein the local enhancement model includes a deep neural network model.
[0023] Furthermore, before performing image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images, the method further includes:
[0024] Acquire a plurality of first training face images;
[0025] Adjusting the resolution of each of the first training face images to obtain a second training face image; wherein the resolution of the second training face image is smaller than the resolution of the first training face image;
[0026] Performing image segmentation processing on each of the first training face images and each of the second training face images respectively to obtain a local image corresponding to each of the first training face images and a local image corresponding to each of the second training face images;
[0027] The initial local enhancement model to be trained is trained using the local images corresponding to each of the first training face images and the local images corresponding to each of the second training face images to obtain the trained local enhancement model.
[0028] Furthermore, before performing image segmentation processing on each of the second training face images, the method further includes:
[0029] Noise addition processing and blur processing are performed on each of the second training face images, and the processed second training face images are used as second training face images for image segmentation processing.
[0030] Furthermore, the performing image stitching processing on the initial enhanced image and each of the local enhanced images to obtain a target enhanced image corresponding to the original face image includes:
[0031] Acquire the region position information corresponding to each of the local enhanced images;
[0032] According to the area position information corresponding to each of the local enhanced images, each of the local enhanced images is spliced to the corresponding area in the initial enhanced image to obtain a target enhanced image corresponding to the original face image.
[0033] The embodiment of the present invention further provides a facial image enhancement device, comprising:
[0034] A segmentation module, used for performing image segmentation processing on the original face image to be processed to obtain multiple target local images;
[0035] An enhancement module, used to perform image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images;
[0036] An acquisition module, used for acquiring an initial enhanced image after image enhancement processing is performed on the original face image;
[0037] The stitching module is used to perform image stitching processing on the initial enhanced image and each of the local enhanced images to obtain a target enhanced image corresponding to the original face image.
[0038] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and the processor implements the above-mentioned facial image enhancement method when executing the computer program.
[0039] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned facial image enhancement method is executed.
[0040] In the face image enhancement method, device and electronic device provided by the embodiment of the present invention, the method includes: performing image segmentation processing on the original face image to be processed to obtain multiple target local images; performing image enhancement processing on each target local image respectively to obtain a local enhanced image corresponding to each target local image; obtaining an initial enhanced image after the original face image is subjected to image enhancement processing; performing image splicing processing on the initial enhanced image and each local enhanced image to obtain a target enhanced image corresponding to the original face image. In this way, multiple target local images of concern to the user are obtained through image segmentation processing, and targeted enhancement of various parts of the face is achieved by performing image enhancement processing on multiple target local images. Finally, the target enhanced image is obtained by performing image splicing processing on the initial enhanced image and each local enhanced image, which can ensure the natural transition at the splicing boundary in the target enhanced image. Compared with the prior art in which the entire original face image is directly subjected to image enhancement processing, the face image enhancement method, device and electronic device provided by the embodiment of the present invention improve the enhancement effect of various parts of the face in the face image, thereby improving the overall visual effect of the face image. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of a flow chart of a facial image enhancement method provided by an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a flow chart of another facial image enhancement method provided by an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a training process of a local enhancement model provided by an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of the structure of a facial image enhancement device provided by an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of the structure of another facial image enhancement device provided by an embodiment of the present invention;
[0047] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] The existing deep learning-based face image enhancement algorithms cannot accurately enhance the various parts of the face in the face image, resulting in poor overall visual effects of the enhanced face image. Based on this, the embodiments of the present invention provide a face image enhancement method, device and electronic device, which use image enhancement technology based on multi-region feature understanding to improve the enhancement effect of various parts of the face in the face image, thereby improving the overall visual effect of the face image. Feature understanding refers to analyzing the data and the information contained therein to further understand the characteristics and underlying structure of the data.
[0050] To facilitate understanding of this embodiment, a facial image enhancement method disclosed in an embodiment of the present invention is first introduced in detail.
[0051] An embodiment of the present invention provides a facial image enhancement method, which can be executed by an electronic device with image processing capability, and the electronic device can be but is not limited to any of the following: a desktop computer, a laptop computer, a tablet computer, and a smart phone, etc.
[0052] See also Figure 1 The flowchart of a method for enhancing a facial image is shown in FIG. 1 , and the method mainly includes the following steps S102 to S108:
[0053] Step S102, performing image segmentation processing on the original face image to be processed to obtain a plurality of target partial images.
[0054] The original face image to be processed may be a low-resolution face image, or a face image with certain noise and / or blur. By performing image segmentation processing on the original face image to be processed, multiple target local images of interest to the user are obtained, such as a mouth image, an eye image, a nose image, and an eyebrow image.
[0055] Step S104: performing image enhancement processing on each target local image to obtain a local enhanced image corresponding to each target local image.
[0056] The existing image enhancement methods (for example, the method of sequential image fusion, a nonlinear transformation algorithm based on gamma transformation and logarithmic transformation, or a face image enhancement algorithm based on deep learning) can be used to perform image enhancement processing on each target local image to obtain a local enhanced image corresponding to each target local image. In this way, feature understanding of multiple regions is achieved.
[0057] Step S106, obtaining an initial enhanced image after image enhancement processing is performed on the original face image.
[0058] The original face image can be enhanced by using an existing image enhancement method (e.g., a method of sequential image fusion, a nonlinear transformation algorithm based on gamma transformation and logarithmic transformation, or a face image enhancement algorithm based on deep learning) to obtain an initial enhanced image. The enhancement effect of the area where the user is more focused in the initial enhanced image is not ideal and cannot meet the user's enhancement needs, so the initial enhanced image needs to be optimized by the following step S108.
[0059] Step S108, performing image stitching processing on the initial enhanced image and each local enhanced image to obtain a target enhanced image corresponding to the original face image.
[0060] The local enhanced images can be spliced in the corresponding areas of the initial enhanced image to obtain the target enhanced image corresponding to the original face image. In this way, the enhancement effect of the local area that the user is more concerned about is strengthened on the basis of the initial enhanced image, thereby improving the overall visual effect of the face image.
[0061] In addition, when performing image stitching, boundary fusion processing can also be performed. The specific boundary fusion processing method can refer to the relevant existing technology and will not be repeated here. The target enhanced image obtained by boundary fusion processing has a more natural transition at the stitching boundary, further improving the overall visual effect of the face image.
[0062] In the embodiment of the present invention, multiple target local images of interest to the user are obtained through image segmentation processing, and targeted enhancement of various parts of the face is achieved by performing image enhancement processing on the multiple target local images. Finally, the target enhanced image is obtained by performing image splicing processing on the initial enhanced image and each local enhanced image, which can ensure a natural transition at the splicing boundary in the target enhanced image. Compared with the prior art of directly performing image enhancement processing on the entire original face image, the face image enhancement method provided by the embodiment of the present invention improves the enhancement effect of various parts of the face in the face image, thereby improving the overall visual effect of the face image.
[0063] For ease of understanding, the embodiment of the present invention also provides a specific implementation process of a face image enhancement method. Figure 1 The various steps in the Figure 2 FIG. 1 is a flow chart of another method for enhancing a facial image, wherein the method adopts an image enhancement technology based on deep learning, and the method includes the following steps S202 to S210:
[0064] Step S202, inputting the original face image to be processed into a pre-trained segmentation model to obtain a plurality of target local images output by the segmentation model; wherein the segmentation model is used to perform segmentation processing on the input image.
[0065] The above segmentation model can be trained on the electronic device to which the above method is applied, or it can be deployed on the electronic device after being trained on other devices.
[0066] Step S204, input each target local image into a pre-trained local enhancement model to obtain a plurality of local enhanced images output by the local enhancement model; wherein the local enhancement model includes a deep neural network model.
[0067] The above-mentioned local enhancement model can be trained on the electronic device to which the above-mentioned method is applied, or it can be deployed on the electronic device after being trained on other devices. The regional information of different regions in the original face image (each target local image) can be input into the deep neural network model to obtain the enhanced images (local enhanced images) of each region output by the deep neural network model. The deep neural network model can be understood as including multiple pre-trained enhancement models, and the enhancement models correspond to the target local images one by one, and each enhancement model only processes the corresponding target local image.
[0068] Step S206, using a deep learning-based face image enhancement algorithm to perform image enhancement processing on the original face image to obtain an initial enhanced image.
[0069] Step S208: Acquire the region position information corresponding to each local enhanced image.
[0070] For each local enhanced image, the region position information corresponding to the optimized local analytical image corresponding to the local enhanced image may be used as the region position information corresponding to the local enhanced image.
[0071] Step S210, according to the region position information corresponding to each local enhanced image, each local enhanced image is spliced to the corresponding region in the initial enhanced image to obtain a target enhanced image corresponding to the original face image.
[0072] When the location information of the region corresponding to each local enhanced image is known, each local enhanced image can be used to replace the corresponding region in the initial enhanced image to achieve the splicing of each local enhanced image and the initial enhanced image. The target enhanced image obtained in this way is composed of each local enhanced image and the initial enhanced image except the corresponding region of each local enhanced image, which improves the enhancement effect of the target local image in the original face image.
[0073] The facial image enhancement method based on multi-region feature understanding proposed in the embodiment of the present invention can achieve more accurate enhancement of information such as facial features by performing multi-region feature understanding on the original facial image, thereby improving the overall visual effect of the face while enhancing the resolution.
[0074] An embodiment of the present invention also provides another possible implementation method of the above-mentioned step S102, as follows: first, the original face image to be processed is input into a pre-trained face parsing model to obtain multiple local parsing images output by the face parsing model; wherein the local parsing images include one or more of a mouth parsing image, an eye parsing image, a nose parsing image, a hair parsing image, an eyebrow parsing image and an ear parsing image; then, each local parsing image is respectively subjected to a closing operation to obtain multiple optimized local parsing images; then, the regional position information of each optimized local parsing image in the original face image is obtained; finally, according to the regional position information corresponding to each optimized local parsing image, image capture is performed in the original face image to obtain multiple target local images.
[0075] In specific implementation, the above-mentioned face parsing model can be obtained by using the Helen facial features dataset through Deeplab-v3 segmentation network training, where the Helen facial features dataset is a dataset for facial feature point tasks, and the Deeplab-v3 segmentation network is a semantic segmentation network. Only the image of the required area is retained in the local parsed image, and the other areas are empty. There may be holes in the local parsed image, so it is necessary to fill the holes in the local parsed image through closing operations, so that the parsed facial features (optimized local parsed image) are more accurate.
[0076] The regional position information of each optimized local analytical image in the original face image can be obtained through the following process: find the bounding rectangle of each optimized local analytical image; determine the position coordinate information of the bounding rectangle of each optimized local analytical image as the regional position information of the optimized local analytical image in the original face image. Specifically, the optimized local analytical image is in the form of a two-dimensional matrix. If the position coordinates of each pixel point in the image are set to (x, y), the bounding rectangle of the optimized local analytical image can be obtained by detecting the maximum and minimum values of x and the maximum and minimum values of y in the optimized local analytical image (the position coordinates of the four vertices of the bounding rectangle are composed of the maximum and minimum values of x and the maximum and minimum values of y). The regional position information corresponding to the optimized local analytical image can include the position coordinates of the four vertices of the bounding rectangle.
[0077] The above-mentioned image segmentation processing method based on the face analysis model can segment the original face image more accurately, thereby facilitating more accurate enhancement of subsequent information such as facial features.
[0078] In addition, the embodiment of the present invention also provides a training method for a local enhancement model, see Figure 3 The training process diagram of a local enhancement model is shown in FIG. 1 , and the local enhancement model is obtained by training through the following steps:
[0079] Step S302: Acquire a plurality of first training face images.
[0080] Prepare a high-definition image dataset, which includes a plurality of first training face images, wherein the first training face images are preferably high-definition face images with high resolution (greater than a set resolution threshold) and high clarity (greater than a set clarity threshold). The specific resolution threshold and clarity threshold can be set according to actual needs and are not limited here.
[0081] Step S304, adjusting the resolution of each first training face image to obtain a second training face image; wherein the resolution of the second training face image is smaller than the resolution of the first training face image.
[0082] The high-definition image dataset can be downsampled to obtain a low-resolution image dataset. Obviously, the resolution of the images in the low-resolution image dataset is smaller than the resolution of the corresponding images in the high-definition image dataset. The images in the low-resolution image dataset can be used as the second training face images.
[0083] Preferably, in order to improve the training effect of the local enhancement model, various noises (such as Gaussian noise and image compression noise, etc.) can be added to the low-resolution image data set, and Gaussian blurs of different intensities can be randomly added to obtain a low-resolution image data set, and the images in the low-resolution image data set are used as the second training face images for subsequent image segmentation processing. Based on this, before executing step S306, the method also includes: performing noise addition processing and blur processing on each second training face image, and using the processed second training face image as the second training face image for image segmentation processing.
[0084] Step S306 , performing image segmentation processing on each first training face image and each second training face image respectively to obtain a local image corresponding to each first training face image and a local image corresponding to each second training face image.
[0085] The specific image segmentation method can refer to the corresponding content of the above embodiment, which will not be repeated here. In specific implementation, through image segmentation processing, a mouth data set, an eye data set, a nose data set, a hair data set, an ear data set, an eyebrow data set, etc. corresponding to the high-definition image data set, and a mouth data set, an eye data set, a nose data set, a hair data set, an ear data set, an eyebrow data set, etc. corresponding to the low-definition image data set can be obtained.
[0086] Step S308, training the initial local enhancement model to be trained using the local images corresponding to each first training face image and the local images corresponding to each second training face image to obtain a trained local enhancement model.
[0087] The local images corresponding to each second training face image are the input data of the initial local enhancement model to be trained. The initial local enhancement model continuously adjusts the model parameters by comparing the output data with the local images corresponding to each first training face image, thereby realizing the training of the initial local enhancement model.
[0088] In specific implementation, the local enhancement model can adopt a deep neural network model, such as the ESRGAN (Enhanced Super-Resolution Generative Adversarial Networks) model. A deep neural network model for image generation can be built. The deep neural network model can adopt a pixel shuffle upsampling method combined with a method of connecting the front layer output with the deep layer output. At the same time, the weight normalization method can also be used to design the deep neural network model. Among them, the method of connecting the front layer output with the deep layer output means that the deep neural network model will build multiple layers, each layer will have its own input data and output data, and the output data of the previous layer is generally the input data of the next layer. The pixel shuffle upsampling method combined with the method of connecting the front layer output with the deep layer output means that it is assumed that the Nth layer has completed an upsampling operation, and the output data of the N-1th layer is processed by the pixel shuffle upsampling method to obtain the first output data, and the first output data is merged (concat) with the output data of the Nth layer as the input data of the N+1th layer.
[0089] Corresponding to the above-mentioned face image enhancement method, the embodiment of the present invention further provides a face image enhancement device. Figure 4 The structure diagram of a face image enhancement device shown in FIG. 1 includes:
[0090] A segmentation module 42 is used to perform image segmentation processing on the original face image to be processed to obtain multiple target partial images;
[0091] The enhancement module 44 is used to perform image enhancement processing on each target local image to obtain a local enhanced image corresponding to each target local image;
[0092] An acquisition module 46 is used to acquire an initial enhanced image after performing image enhancement processing on the original face image;
[0093] The stitching module 48 is used to perform image stitching processing on the initial enhanced image and each local enhanced image to obtain a target enhanced image corresponding to the original face image.
[0094] In the embodiment of the present invention, multiple target local images of interest to the user are obtained through image segmentation processing, and targeted enhancement of various parts of the face is achieved by performing image enhancement processing on the multiple target local images. Finally, the target enhanced image is obtained by performing image splicing processing on the initial enhanced image and each local enhanced image, which can ensure a natural transition at the splicing boundary in the target enhanced image. Compared with the prior art of directly performing image enhancement processing on the entire original face image, the face image enhancement device provided by the embodiment of the present invention improves the enhancement effect of various parts of the face in the face image, thereby improving the overall visual effect of the face image.
[0095] In some possible embodiments, the segmentation module 42 is specifically used to: input the original face image to be processed into a pre-trained segmentation model to obtain a plurality of target local images output by the segmentation model; wherein the segmentation model is used to perform segmentation processing on the input image.
[0096] In some other possible embodiments, the segmentation module 42 is specifically used to: input the original face image to be processed into a pre-trained face parsing model to obtain a plurality of local parsing images output by the face parsing model; wherein the local parsing images include one or more of a mouth parsing image, an eye parsing image, a nose parsing image, a hair parsing image, an eyebrow parsing image and an ear parsing image; perform a closing operation on each local parsing image to obtain a plurality of optimized local parsing images; obtain the regional position information of each optimized local parsing image in the original face image; and perform image capture in the original face image according to the regional position information corresponding to each optimized local parsing image to obtain a plurality of target local images.
[0097] Furthermore, the segmentation module 42 is further used to: find the bounding rectangle of each optimized local parsed image; and determine the position coordinate information of the bounding rectangle of each optimized local parsed image as the region position information of the optimized local parsed image in the original face image.
[0098] Furthermore, the enhancement module 44 is specifically used to: input each target local image into a pre-trained local enhancement model to obtain a plurality of local enhanced images output by the local enhancement model; wherein the local enhancement model includes a deep neural network model.
[0099] Furthermore, the stitching module 48 is specifically used to: obtain the area position information corresponding to each local enhanced image; stitch each local enhanced image in the corresponding area in the initial enhanced image according to the area position information corresponding to each local enhanced image, and obtain a target enhanced image corresponding to the original face image.
[0100] Alternatively, see Figure 5The structural diagram of another face image enhancement device shown in FIG. Figure 4 On the basis of, the above-mentioned device also includes a training module 52, and the training module 52 is used to: obtain multiple first training face images; adjust the resolution of each first training face image respectively to obtain a second training face image; wherein the resolution of the second training face image is smaller than the resolution of the first training face image; perform image segmentation processing on each first training face image and each second training face image respectively to obtain a local image corresponding to each first training face image and a local image corresponding to each second training face image; use the local images corresponding to each first training face image and the local images corresponding to each second training face image to train the initial local enhancement model to be trained to obtain a trained local enhancement model.
[0101] Furthermore, before performing image segmentation processing on each second training face image, the training module 52 is also used to: perform noise addition processing and blur processing on each second training face image, and use the processed second training face image as the second training face image for image segmentation processing.
[0102] The implementation principle and technical effects of the device provided in this embodiment are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0103] See also Figure 6 An embodiment of the present invention further provides an electronic device 100, comprising: a processor 60, a memory 61, a bus 62 and a communication interface 63, wherein the processor 60, the communication interface 63 and the memory 61 are connected via the bus 62; the processor 60 is used to execute an executable module stored in the memory 61, such as a computer program.
[0104] The memory 61 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0105] The bus 62 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0106] Among them, the memory 61 is used to store programs, and the processor 60 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0107] The processor 60 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 60. The above processor 60 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 61, and the processor 60 reads the information in the memory 61 and completes the steps of the above method in combination with its hardware.
[0108] The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the face image enhancement method described in the above method embodiment is executed. The computer-readable storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0109] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.
[0110] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the method and computer program product according to multiple embodiments of the present invention. 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 module, a 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 consecutive boxes 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 and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0111] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0112] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A facial image enhancement method, characterized in that: include: Perform image segmentation processing on the original face image to be processed to obtain multiple target local images; Performing image enhancement processing on each of the target local images respectively to obtain a local enhanced image corresponding to each of the target local images; Obtaining an initial enhanced image after image enhancement processing is performed on the original face image; Performing image stitching processing on the initial enhanced image and each of the local enhanced images to obtain a target enhanced image corresponding to the original face image; The performing image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images includes: Input each of the target local images into a pre-trained local enhancement model to obtain multiple local enhanced images output by the local enhancement model; wherein the local enhancement model includes a deep neural network model, and the deep neural network model adopts a pixel shuffle upsampling method combined with a method of connecting the front layer output with the deep layer output; the pixel shuffle upsampling method combined with a method of connecting the front layer output with the deep layer output means that it is assumed that the Nth layer completes an upsampling operation, and the output data of the N-1th layer is processed by the pixel shuffle upsampling method to obtain the first output data, and the first output data is merged with the output data of the Nth layer as the input data of the N+1th layer.
2. The method according to claim 1, characterized in that The image segmentation process is performed on the original face image to be processed to obtain multiple target local images, including: The original face image to be processed is input into a pre-trained segmentation model to obtain a plurality of target local images output by the segmentation model; wherein the segmentation model is used to perform segmentation processing on the input image.
3. The method according to claim 1, characterized in that The image segmentation process is performed on the original face image to be processed to obtain multiple target local images, including: Inputting the original face image to be processed into a pre-trained face parsing model to obtain a plurality of local parsing images output by the face parsing model; wherein the local parsing images include one or more of a mouth parsing image, an eye parsing image, a nose parsing image, a hair parsing image, an eyebrow parsing image, and an ear parsing image; Performing closing operations on each of the local analytical images to obtain a plurality of optimized local analytical images; Obtaining regional position information of each of the optimized local analysis images in the original face image; According to the area position information corresponding to each of the optimized local analytical images, image capture is performed in the original face image to obtain a plurality of target local images.
4. The method according to claim 3, characterized in that The obtaining of the regional position information of each of the optimized local analysis images in the original face image includes: Finding the bounding rectangle of each optimized local parsed image; The position coordinate information of the circumscribed rectangle of each optimized local parsed image is determined as the regional position information of the optimized local parsed image in the original face image.
5. The method according to claim 1, characterized in that Before performing image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images, the method further includes: Acquire a plurality of first training face images; Adjusting the resolution of each of the first training face images to obtain a second training face image; wherein the resolution of the second training face image is smaller than the resolution of the first training face image; Performing image segmentation processing on each of the first training face images and each of the second training face images respectively to obtain a local image corresponding to each of the first training face images and a local image corresponding to each of the second training face images; The initial local enhancement model to be trained is trained using the local images corresponding to each of the first training face images and the local images corresponding to each of the second training face images to obtain the trained local enhancement model.
6. The method according to claim 5, characterized in that Before performing image segmentation processing on each of the second training face images, the method further includes: Noise addition processing and blur processing are performed on each of the second training face images, and the processed second training face images are used as second training face images for image segmentation processing.
7. The method according to claim 1, characterized in that The performing image stitching processing on the initial enhanced image and each of the local enhanced images to obtain a target enhanced image corresponding to the original face image includes: Acquire the region position information corresponding to each of the local enhanced images; According to the area position information corresponding to each of the local enhanced images, each of the local enhanced images is spliced to the corresponding area in the initial enhanced image to obtain a target enhanced image corresponding to the original face image.
8. A facial image enhancement device, characterized in that: include: A segmentation module, used for performing image segmentation processing on the original face image to be processed to obtain multiple target local images; An enhancement module, used to perform image enhancement processing on each of the target local images to obtain a local enhanced image corresponding to each of the target local images; An acquisition module, used for acquiring an initial enhanced image after image enhancement processing is performed on the original face image; A stitching module, used for performing image stitching processing on the initial enhanced image and each of the local enhanced images to obtain a target enhanced image corresponding to the original face image; The enhancement module is specifically used to: input each of the target local images into a pre-trained local enhancement model to obtain multiple local enhanced images output by the local enhancement model; wherein the local enhancement model includes a deep neural network model, and the deep neural network model adopts a pixel shuffle upsampling method combined with a method of connecting the front layer output with the deep layer output; the pixel shuffle upsampling method combined with a method of connecting the front layer output with the deep layer output means that it is assumed that the Nth layer completes an upsampling operation, and the output data of the N-1th layer is processed by the pixel shuffle upsampling method to obtain the first output data, and the first output data is merged with the output data of the Nth layer as the input data of the N+1th layer.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is performed.
Citation Information
Patent Citations
Human face recognizing method based on multi-level local obvious mode characteristic counting
CN103246880A
Face super-resolution processing method based on deformable local block and system thereof
CN106203269A
Recognition-oriented remote human face image enhancement method
CN107516083A
Face image enhancement method and system
CN107895358A
Image enhancement model training method, device, electronic device, and readable storage medium
CN109102483A
