A skin quality extraction and skin quality migration method, apparatus, and device

By using HSL color space and multi-scale standard face skin texture extraction and transfer technology, the problems of single and unstable skin texture transfer effects in beauty filters have been solved, achieving diversity and stability in skin texture transfer while preserving skin texture details.

CN116012221BActive Publication Date: 2026-03-27XIAMEN MEITUZHIJIA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-09
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing skin texture transfer technologies have limited effects and are inconsistent with different face sizes, resulting in a lack of diversity and stability in skin texture layering and a tendency for effects to be either too mild or too severe.

Method used

Skin texture is extracted using the HSL color space, combined with multi-scale standard faces for skin texture extraction and transfer. Through preprocessing and remapping techniques on model images, multi-scale standard skin texture images are generated and applied to user images to be processed to achieve skin texture transfer.

Benefits of technology

It enriches the generation of skin texture materials, achieves the stability of skin texture transfer result images and adaptability to faces of different sizes, preserves the skin texture details of the user image to be processed, and the skin texture effect is close to the real skin texture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116012221B_ABST
    Figure CN116012221B_ABST
Patent Text Reader

Abstract

The application discloses a skin extraction and skin migration method, device, equipment and storage medium, which comprises the following steps: acquiring a model picture meeting a preset condition, performing skin extraction on the model picture based on an HSL color space to obtain a model skin picture; performing skin extraction on the model skin picture based on a multi-scale standard face to obtain a multi-scale standard skin picture; after preprocessing a to-be-processed user picture, performing skin migration on the standard skin picture to obtain a corresponding skin migration result picture. The result face picture after skin migration has stable skin texture effect and can retain the skin texture details of the to-be-processed user picture.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to a skin texture extraction and migration method, device and equipment. BACKGROUND

[0002] In the picture editing industry, the portrait beauty of pictures mostly loses skin texture details after skin smoothing processing. The skin texture details on the market are mostly superimposed by using a fixed single material processed in advance to realize image superimposition. The skin texture effect of superimposition lacks diversity and stability on different sizes of faces, and problems such as too light details or too heavy noise occur, and the effect coverage is not rich enough. SUMMARY

[0003] Therefore, the present application aims to provide a skin texture extraction and migration method, device and equipment to solve the problems of single effect and unstable skin texture effect on different sizes of faces in the existing beauty skin texture migration.

[0004] To achieve the above-mentioned purpose, the present application provides a skin texture extraction and migration method, which comprises:

[0005] Obtaining a model picture meeting a preset condition, extracting skin texture of the model picture based on an HSL color space to obtain a model skin texture picture;

[0006] Extracting skin texture of the model skin texture picture based on a multi-scale standard face to obtain a multi-scale standard skin texture picture;

[0007] After preprocessing a to-be-processed user picture, performing skin texture migration based on the standard skin texture picture to obtain a corresponding skin texture migration result picture.

[0008] Preferably, the step of extracting skin texture of the model picture based on the HSL color space to obtain the model skin texture picture comprises:

[0009] Performing a skin texture removal operation on the model picture to obtain a model skin texture removal picture;

[0010] Converting the model picture and the model skin texture removal picture into an HSL color space to obtain a first brightness value and a second brightness value of each pixel on the corresponding picture respectively;

[0011] Calculating a skin texture detail value of the corresponding pixel according to the first brightness and the second brightness to obtain the model skin texture picture.

[0012] Preferably, the step of converting the model picture and the model skin texture removal picture into the HSL color space to obtain the first brightness value and the second brightness value of each pixel on the corresponding picture respectively comprises:

[0013] The model image and the model skin-removed image are converted from the RGB color space to the HSL color space according to a formula L = 0.5 * (Max(R, G, B) + Min(R, G, B)) to obtain the first brightness value and the second brightness value of the HSL color space of each pixel on the corresponding image.

[0014] Preferably, the skin extraction based on the multi-scale standard face to obtain the multi-scale standard skin image comprises:

[0015] The face size is calculated according to the face detection on the model image to obtain the corresponding face size;

[0016] After comparing the face size with the preset size, the model image is up-sampled and / or down-sampled to obtain three different scale portrait images;

[0017] The largest scale portrait image is selected as the first portrait image, the first portrait image is skin-removed to obtain a skin-removed portrait image, and the skin-removed portrait image is down-sampled by 2 and 4 to obtain a first skin-removed image and a second skin-removed image;

[0018] The skin is extracted based on the HSL color space from the three different scale portrait images, the skin-removed portrait image, the first skin-removed image and the second skin-removed image to obtain a first skin image, a second skin image and a third skin image, and the first skin image, the second skin image and the third skin image are stored in the R, G and B three different channels of the pre-processed general skin image to obtain the multi-scale standard skin image.

[0019] Preferably, after comparing the face size with the preset size, the model image is up-sampled and / or down-sampled to obtain three different scale portrait images, which comprises:

[0020] When the face size is greater than or equal to 1024, the model image is down-sampled by (W / 2, H / 2) and (W / 4, H / 4) using the Lanczos resampling;

[0021] When the face size is less than 1024 and greater than or equal to 512, the model image is up-sampled by (W*2, H*2) and down-sampled by (W / 2, H / 2) using the Lanczos resampling;

[0022] When the face size is less than 512, the model image is down-sampled by (W*4, H*4) and (W / 4, H / 4) using the Lanczos resampling.

[0023] Preferably, the pre-processing of the to-be-processed user graph comprises:

[0024] The low-frequency information of the to-be-processed user graph is obtained by using a large-radius Gaussian bilateral filter, the high-contrast graph is calculated according to the low-frequency information, and the user variance graph is obtained by performing mean filtering on the high-contrast graph.

[0025] Preferably, the skin quality migration based on the standard skin quality graph comprises:

[0026] The actual size of the face frame of the to-be-processed user graph is matched to the corresponding standard skin quality graph to be remapped to the to-be-processed user graph, and the user skin quality migration graph is obtained.

[0027] The fusion degree of the skin quality of the to-be-processed user graph is calculated according to the user variance graph, the to-be-processed user graph is converted into an HSL color space, the user skin quality migration graph is superimposed on the L channel using soft light, and a first result graph is obtained.

[0028] The second result graph is obtained by calculating based on a preset formula according to the fusion degree and the first result graph, the second result graph is converted back to an RGB color space, and the skin quality migration result graph is obtained.

[0029] To achieve the above object, the present application further provides a skin quality extraction and migration device, which comprises:

[0030] The first skin quality extraction unit is used for acquiring a model graph meeting a preset condition, extracting the skin quality of the model graph based on an HSL color space, and obtaining a model skin quality graph.

[0031] The second skin quality extraction unit is used for extracting the skin quality of the model skin quality graph based on a multi-scale standard face, and obtaining a multi-scale standard skin quality graph.

[0032] The skin quality migration unit is used for pre-processing a to-be-processed user graph, and migrating the skin quality based on the standard skin quality graph to obtain a corresponding skin quality migration result graph.

[0033] To achieve the above object, the present application further provides a skin quality extraction and migration device, which comprises a processor, a memory and a computer program stored in the memory, wherein the computer program is executed by the processor to implement the steps of a skin quality extraction and migration method as described in the above embodiments.

[0034] To achieve the above object, the present application further provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to implement the steps of a skin quality extraction and migration method as described in the above embodiments.

[0035] Advantages:

[0036] The above scheme can realize automatic extraction of skin texture material pictures by selecting a model face picture with good skin texture, and apply the skin texture material picture to other face pictures, thereby enriching the generation of skin texture material and the multiple choices of skin texture migration.

[0037] The above scheme can match the corresponding standard skin texture picture according to the face of different sizes to be remapped to the user picture to be processed, so that the result face picture after skin texture migration has stable skin texture effect and can retain the skin texture details of the user picture to be processed.

[0038] The above scheme is based on the skin texture extraction of the HSL color space and the skin texture extraction of the model skin texture picture based on the multi-scale standard face, which can prevent non-skin texture effects such as flaws and bright spots from being extracted compared with the traditional RGB color space skin texture extraction, so as to realize the skin texture effect of the result picture after skin texture migration more close to the real skin texture. BRIEF DESCRIPTION OF DRAWINGS

[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0040] Figure 1 A flowchart of a skin texture extraction and skin texture migration method provided by an embodiment of the present application.

[0041] Figure 2 An effect diagram of the model picture before and after the skin texture extraction through the HSL color space provided by an embodiment of the present application.

[0042] Figure 3 An effect diagram of the model skin texture picture converted into a multi-scale standard skin texture picture provided by an embodiment of the present application.

[0043] Figure 4 A comparison diagram of the user picture to be processed and the skin texture migration result picture provided by an embodiment of the present application.

[0044] Figure 5 A structure diagram of a skin texture extraction and skin texture migration device provided by an embodiment of the present application.

[0045] The realization of the purpose of the application, the functional characteristics and the advantages will be further described with reference to the embodiments and the drawings. DETAILED DESCRIPTION

[0046] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of the present application.

[0047] In the description of the present application, the terms “first”, “second” are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with “first”, “second” can explicitly or implicitly include one or more of the features.

[0048] The content of the present application will be described in detail below in combination with embodiments.

[0049] Referring to Figure 1 Fig. 1 shows a flowchart of a skin quality extraction and skin quality migration method provided by an embodiment of the present application.

[0050] In this embodiment, the method comprises:

[0051] S11, acquiring a model image satisfying a preset condition, performing skin quality extraction on the model image based on an HSL color space to obtain a model skin quality image. The model image satisfying the preset condition has a face image with good skin quality details and few face occlusions.

[0052] Further, in step S11, the skin quality extraction on the model image based on the HSL color space to obtain the model skin quality image comprises:

[0053] S11-1, performing a skin quality removal operation on the model image to obtain a model skin quality removed image;

[0054] S11-2, performing HSL color space conversion on the model image and the model skin quality removed image to obtain a first luminance value and a second luminance value of each pixel on the corresponding image respectively;

[0055] S11-3, calculating a skin quality detail value of the corresponding pixel according to the first luminance and the second luminance to obtain the model skin quality image.

[0056] AsFigure 2 The model skin texture image is obtained (as shown in the figure: the left is a model image, the middle is a model skin texture image, and the right is a model skin texture image). In this embodiment, for a given model image with good skin texture details and few facial occlusions, the model image is first subjected to a skin texture removal operation, and the portrait face region of the model image is sequentially subjected to acne removal to remove large defects and high-contrast skin smoothing to remove skin detail textures, and finally a model skin texture image is obtained, which is used for skin texture extraction. The model image and the model skin texture image are subjected to color space conversion from the RGB color space to the HSL color space to obtain the brightness value (L) of each pixel in the HSL color space of the image, and the calculation formula is as follows: L = 0.5 * (Max (R, G, B) + Min (R, G, B)). According to the model image brightness L_i and the model skin texture image brightness L_r of each pixel calculated above, the skin texture detail value T of the corresponding pixel is calculated, and the model skin texture image is obtained, and the calculation is as follows:

[0057] if (L_r < 0.0001) {T = 0.5;}

[0058] elif (L_i < L_r) {T = max (0.0, 0.5 * (L_i - L_r * L_r) / (L_r - L_r * L_r));}

[0059] else {T = min (1.0, 0.5 * (L_i + sqrt (L_r) - 2.0 * L_r) / (sqrt (L_r) - L_r));}

[0060] S12, skin texture extraction is performed on the model skin texture image based on a multi-scale standard face to obtain a multi-scale standard skin texture image.

[0061] Further, in step S12, the skin texture extraction of the model skin texture image based on a multi-scale standard face to obtain a multi-scale standard skin texture image comprises:

[0062] S12-1, calculating the face frame width and height of the model image according to face detection to obtain the corresponding face size;

[0063] S12-2, comparing the face size with a preset size, and performing up-sampling and / or down-sampling processing on the model image to obtain three different scale portrait images;

[0064] S12-3, selecting the largest scale portrait image as the first portrait image, performing skin texture removal operation on the first portrait image to obtain a portrait skin texture removal image, and performing 2 times and 4 times down-sampling on the portrait skin texture removal image to obtain a first skin texture removal image and a second skin texture removal image;

[0065] S12-4, respectively, based on HSL color space, skin extraction is performed on the three different scales of the portrait, the portrait skin-free image, the first skin-free image and the second skin-free image, to obtain a first skin image, a second skin image and a third skin image, and the first skin image, the second skin image and the third skin image are stored on the R, G and B three different channels of the pre-processed general skin image, to obtain the multi-scale standard skin image.

[0066] In the present embodiment, the extracted model skin image is related to the resolution of the used model image and the face points of the model image, and therefore, it is necessary to convert the model skin image into a standard skin image.

[0067] First, a Gaussian random noise base image with a fixed size of 1024*1024 is generated, and then a Gaussian blur and a relief effect are used to simulate skin detail effects as a base image Texture_base of the general skin image.

[0068] For a given model image with a size of (W, H), according to face detection of the model image, the face frame width and height in the model image are calculated as Face_w and Face_h, and the face size FaceSize is max(Face_w, Face_h). The size of FaceSize is judged:

[0069] a. If FaceSize >= 1024, the model image is down-sampled to two scales of (W / 2, H / 2) and (W / 4, H / 4) using Lanczos resampling;

[0070] b. If FaceSize < 1024 and FaceSize >= 512, the model image is up-sampled to (W*2, H*2) and down-sampled to (W / 2, H / 2) using Lanczos resampling;

[0071] c. If FaceSize < 512, the model image is down-sampled to two scales of (W*4, H*4) and (W / 4, H / 4) using Lanczos resampling;

[0072] Finally, three different scale model portrait pictures can be obtained from a single model picture through the Lanse resampling, from large to small, Img0, Img1, Img2, the largest Img0 uses the skin removing operation method in step S11-1 to obtain the portrait skin removing picture Remove0, and then Remove0 is down-sampled by 2 times and 4 times to obtain Remove1 and Remove2 (corresponding to the first skin removing picture and the second skin removing picture). The three different scale model portrait pictures Img0, Img1, Img2 and the portrait skin removing pictures Remove0, Remove1, Remove2 are combined according to the scale, and the skin extraction method in step S11 is performed on the three groups (Img0+Remove0), (Img1+Remove1), (Img2+Remove2) to obtain Texture0, Texture1, Texture2 (corresponding to the first skin texture picture, the second skin texture picture, and the third skin texture picture, respectively). The three scales of Texture0, Texture1, Texture2 are stored in the R, G, and B channels of the above-mentioned pre-processed general skin texture picture Texture_base, respectively, to obtain a multi-scale standard skin texture picture. As shown in Figure 3

[0073] S13, after pre-processing the to-be-processed user picture, performing skin texture migration based on the standard skin texture picture to obtain a corresponding skin texture migration result picture.

[0074] Further, in step S13, the skin texture migration based on the standard skin texture picture to obtain a corresponding skin texture migration result picture includes:

[0075] S13-1, according to the actual size of the face frame of the to-be-processed user picture, matching the corresponding standard skin texture picture to remap to the to-be-processed user picture to obtain a user skin texture migration picture; including: calculating the actual size of the face frame of the to-be-processed user picture, after matching the actual size with a preset size, using the corresponding channel of the R, G, and B channels of the standard skin texture picture for rendering;

[0076] S13-2, calculating the fusion degree of the skin texture of the to-be-processed user picture according to the user variance picture, after converting the to-be-processed user picture to the HSL color space, using soft light to superimpose the user skin texture migration picture on the L channel to obtain a first result picture;

[0077] S13-3, calculating a second result picture based on a preset formula according to the fusion degree and the first result picture, converting the second result picture back to the RGB color space to obtain the skin texture migration result picture.

[0078] ​In the embodiment, the skin texture migration to-be-processed user image I org, first uses a large radius of Gaussian bilateral filter to obtain low frequency information I low, and then calculates a high contrast image I var=0.5*(I org-I low)+0.5, and then performs mean filtering on the high contrast image to obtain a user variance image I detail.

[0079] According to the face points of the to-be-processed user image, the standard skin texture image obtained above is remapped to the to-be-processed user image to obtain a user skin texture migration image I texture. When remapping and rendering, according to the actual size of the face frame of the to-be-processed user image, if the face size of the to-be-processed user image is greater than 512, the R channel of the standard skin texture image is used for rendering; if the face size is less than 512 and greater than 256, the G channel of the standard skin texture image is used for rendering; and if the face size is less than 256, the B channel of the standard skin texture image is used for rendering.

[0080] On the to-be-processed user image, the fusion degree of the skin texture is calculated according to the variance value obtained above:

[0081] mix_degree=max(0.0,1.0-(2.0*I_detail-1.0)^2*4.0);

[0082] The to-be-processed user image is first converted to the HSL color space (H, S, L), and then for each pixel coordinate, the L channel of the current coordinate is used to superimpose the user skin texture migration image I texture at the pixel value of the coordinate to obtain L_texture (the first result image):

[0083] L2=min(1.0,max(0.0,L-0.35), (here L2 is an intermediate calculation value, which is used in the following calculation)

[0084] L_texture=0.3*(2.0*I_texture-1.0)*(L2-L2*L2)+L; if(I_texture>0.5),

[0085] L_texture=0.3*(2.0*I_texture-1.0)*(sqrt(L2)-L2)+L; if(I_texture<=0.5);

[0086] According to the fusion degree, the final second result image L_new=(1.0-mix_degree)*L+mix_degree*L_texture is obtained.

[0087] Finally, (H, S, L_new) is converted back to the RGB color space to obtain the skin texture migration result image of the to-be-processed user image. For example,Figure 4 are shown (left is the original image, and right is the result image).

[0088] Referring to Figure 5 Fig. 1 shows a structural schematic diagram of a skin extraction and skin transfer device according to an embodiment of the present application.

[0089] In this embodiment, the device 50 comprises:

[0090] A first skin extraction unit 51 is configured to acquire a model image satisfying a preset condition, perform skin extraction on the model image based on an HSL color space, and obtain a model skin image.

[0091] A second skin extraction unit 52 is configured to perform skin extraction on the model skin image based on a multi-scale standard face, and obtain a multi-scale standard skin image.

[0092] A skin transfer unit 53 is configured to perform skin transfer on a preprocessed user image based on the standard skin image, and obtain a corresponding skin transfer result image.

[0093] Further, the first skin extraction unit 51 comprises:

[0094] A model skin removal unit is configured to perform a skin removal operation on the model image, and obtain a model skin-removed image.

[0095] An HSL color space conversion unit is configured to perform HSL color space conversion on the model image and the model skin-removed image, and obtain a first brightness value and a second brightness value of each pixel in the corresponding image.

[0096] A skin detail calculation unit is configured to calculate a skin detail value of the corresponding pixel according to the first brightness and the second brightness, and obtain a model skin image.

[0097] Further, the second skin extraction unit 52 comprises:

[0098] A face size calculation unit is configured to calculate a face frame width and height of the model image according to face detection, and obtain a corresponding face size.

[0099] A sampling processing unit is configured to compare the face size with a preset size, and perform up-sampling and down-sampling processing on the model image, and obtain three different scale portrait images.

[0100] A portrait skin removal unit is configured to select a largest-scale portrait image from the portrait images as a first portrait image, perform a skin removal operation on the first portrait image, and obtain a portrait skin-removed image, and perform 2-fold and 4-fold down-sampling on the portrait skin-removed image, and obtain a first skin-removed image and a second skin-removed image.

[0101] The standard skin quality processing unit is configured to perform skin quality extraction on the portrait image, the portrait skin quality removed image, the first skin quality removed image and the second skin quality removed image based on HSL color space respectively to obtain a first skin quality image, a second skin quality image and a third skin quality image, and store the first skin quality image, the second skin quality image and the third skin quality image on R, G and B channels of a pre-processed general skin quality image to obtain the multi-scale standard skin quality image.

[0102] Further, the skin quality migration unit 53 comprises:

[0103] The remapping unit is configured to match the actual size of the face frame of the user image to be processed to the corresponding standard skin quality image to obtain a user skin quality migration image.

[0104] The superposition processing unit is configured to calculate the fusion degree of the skin quality of the user image to be processed according to the user variance image, and superimpose the user skin quality migration image on the L channel of the user image to be processed after HSL color space conversion to obtain a first result image.

[0105] The RGB color space conversion unit is configured to calculate a second result image based on a preset formula according to the fusion degree and the first result image, and convert the second result image back to the RGB color space to obtain the skin quality migration result image.

[0106] The various unit modules of the device 50 can respectively perform the corresponding steps in the above method embodiments, and thus the unit modules will not be described here. For details, please refer to the description of the corresponding steps above.

[0107] The embodiment of the present application also provides a skin quality extraction and migration device, which comprises the skin quality extraction and migration device as described above. Figure 5 The structure of the embodiment can correspondingly perform the Figure 1 The technical solutions of the method embodiments shown above have similar implementation principles and technical effects, and details can be referred to the related description in the above embodiments, which will not be described here.

[0108] The skin quality extraction and migration device can comprise a mobile phone, a digital camera, a tablet computer or other devices with photographing function, or devices with image processing function, or devices with image display function. The skin quality extraction and migration device can comprise a memory, a processor, an input unit, a display unit, a power supply and other components.

[0109] The memory can be used to store software programs and modules, and the processor executes various functions and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required by at least one function (such as an image playing function, etc.), and the like; and the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory can also include a memory controller to provide access to the memory for the processor and the input unit.

[0110] The input unit can be used to receive inputted digital or character or image information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls. Specifically, the input unit of the embodiment can include a camera, in addition to a touch-sensitive surface (such as a touch display screen) and other input devices.

[0111] The display unit can be used to display information input by the user or information provided to the user and various graphical user interfaces of the device, which can be composed of graphics, text, icons, video and any combination thereof. The display unit can include a display panel, which can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface can cover the display panel, and when the touch-sensitive surface detects a touch operation on or near it, it transmits to the processor to determine the type of touch event, and then the processor provides corresponding visual output on the display panel according to the type of touch event.

[0112] The embodiment of the application also provides a computer readable storage medium, which can be a computer readable storage medium contained in the memory in the above-mentioned embodiments; or can exist separately and not be assembled into the device. The computer readable storage medium stores at least one instruction, which is loaded and executed by the processor to implement the skin quality extraction and skin quality migration method shown in the embodiment. Figure 1 The computer readable storage medium can be a read-only memory, a magnetic disk or an optical disk, etc.

[0113] It should be noted that each of the embodiments described in this specification has a corresponding counterpart embodiment not mentioned explicitly. Therefore, each of the embodiments described in this specification should not be taken as excluding the other. For example, the method embodiments can be implemented by a device or apparatus, and the device or apparatus embodiments can be implemented by a method. Therefore, the device or apparatus embodiments are not mutually exclusive with the method embodiments.

[0114] Also, as used in the description of the embodiments of the application and the appended claims, the singular forms "a", "an" and "the" include plural referents unless the context clearly dictates otherwise. Thus, for example, reference to "a component" or "the component" can include a plurality of such components unless the context clearly dictates otherwise.

[0115] The above specification, examples and data provide essential information for constructing and implementing known expedients. The description suffices for implementing by those of ordinary skill in the art. The present application is not limited to the details of the foregoing, since the present application can be implemented in various other combinations, modifications, and environments, and is capable of changes or modifications within the scope of the inventive concept as expressed herein, through the application of the teachings or knowledge in the art. Changes and modifications to the present application should not be seen as a departure from the spirit and scope of the present application, which is defined by the appended claims.

Claims

1. A skin quality extraction and skin quality migration method, characterized by, The method comprises: Obtaining a model picture meeting preset conditions, performing skin quality extraction on the model picture based on an HSL color space to obtain a model skin quality picture; The skin quality extraction on the model picture based on the HSL color space to obtain the model skin quality picture comprises: Performing skin quality removal on the model picture to obtain a model skin quality removed picture; Converting the model picture and the model skin quality removed picture into the HSL color space to obtain a first luminance value and a second luminance value of each pixel in the corresponding picture; Calculating a skin quality detail value of the corresponding pixel according to the first luminance and the second luminance to obtain the model skin quality picture; Performing skin quality extraction on the model skin quality picture based on a multi-scale standard face to obtain a multi-scale standard skin quality picture; The skin quality extraction on the model skin quality picture based on the multi-scale standard face to obtain the multi-scale standard skin quality picture comprises: Calculating a face frame width and height of the model picture according to face detection to obtain a corresponding face size; Comparing the face size with a preset size, and performing up-sampling and / or down-sampling on the model picture to obtain three different scale portrait pictures; Selecting a largest scale portrait picture in the portrait pictures as a first portrait picture, performing skin quality removal on the first portrait picture to obtain a portrait skin quality removed picture, and performing 2-fold and 4-fold down-sampling on the portrait skin quality removed picture to obtain a first skin quality removed picture and a second skin quality removed picture; Performing skin quality extraction on the three different scale portrait pictures, the portrait skin quality removed picture, the first skin quality removed picture and the second skin quality removed picture based on the HSL color space to obtain a first skin quality picture, a second skin quality picture and a third skin quality picture, and storing the first skin quality picture, the second skin quality picture and the third skin quality picture on R, G and B three different channels of a pre-processed general skin quality picture to obtain the multi-scale standard skin quality picture; Performing skin quality migration on a to-be-processed user picture based on the standard skin quality picture to obtain a corresponding skin quality migration result picture.

2. The skin quality extraction and skin quality migration method according to claim 1, characterized in that, The conversion of the model picture and the model skin quality removed picture into the HSL color space to obtain a first luminance value and a second luminance value of each pixel in the corresponding picture comprises: Converting the model picture and the model skin quality removed picture from an RGB color space to an HSL color space according to a formula L=0.5*(Max(R,G,B)+Min(R,G,B)) to obtain the first luminance value and the second luminance value of each pixel in the corresponding picture in the HSL color space.

3. The method of claim 1, wherein the skin quality is extracted and transferred by using a skin quality extraction and transfer device. The up-sampling and / or down-sampling on the model picture to obtain three different scale portrait pictures after comparing the face size with a preset size comprises: When the face size is greater than or equal to 1024, performing (W / 2, H / 2) and (W / 4, H / 4) scale down-sampling on the model picture by using the Lanczos resampling; When the face size is less than 1024 and greater than or equal to 512, performing (W*2, H*2) up-sampling and (W / 2, H / 2) down-sampling on the model picture by using the Lanczos resampling; When the face size < 512, the model image is down-sampled in two scales of (W*4, H*4) and (W / 4, H / 4) by using Lanzos resampling.

4. The skin quality extraction and skin quality migration method of claim 1, wherein, The preprocessing of the user image to be processed comprises: The low-frequency information of the user image to be processed is obtained by using a large-radius Gaussian bilateral filter, the high-contrast image is calculated according to the low-frequency information, and the user variance image is obtained by performing mean filtering on the high-contrast image.

5. The skin quality extraction and skin quality migration method according to claim 4, wherein, The skin quality migration based on the standard skin quality image comprises: The user skin quality migration image is obtained by matching the actual size of the face frame of the user image to be processed to the corresponding standard skin quality image to remap to the user image to be processed; The fusion degree of the skin quality of the user image to be processed is calculated according to the user variance image, the first result image is obtained by superimposing the user skin quality migration image on the L channel of the user image to be processed after the user image to be processed is converted into the HSL color space; The second result image is calculated based on a preset formula according to the fusion degree and the first result image, the skin quality migration result image is obtained by converting the second result image back to the RGB color space.

6. A skin quality extraction and skin quality migration device, characterized by, The device comprises: A first skin quality extraction unit is configured to acquire a model image satisfying a preset condition, perform skin quality extraction on the model image based on an HSL color space, and obtain a model skin quality image. The first skin quality extraction unit comprises: A model skin removal unit is configured to perform skin removal on the model image to obtain a model skin removal image. An HSL color space conversion unit is configured to convert the model image and the model skin removal image into an HSL color space to obtain a first luminance value and a second luminance value of each pixel in the corresponding image. A skin detail calculation unit is configured to calculate a skin detail value of each pixel according to the first luminance value and the second luminance value to obtain the model skin quality image. A second skin quality extraction unit is configured to perform skin quality extraction on the model skin quality image based on a multi-scale standard face to obtain a multi-scale standard skin quality image. The second skin quality extraction unit comprises: A face size calculation unit is configured to calculate the face size of the model image according to face detection. A sampling processing unit is configured to compare the face size with a preset size, and perform up-sampling and down-sampling processing on the model image to obtain three portrait images of different scales. A portrait skin removal unit is configured to select the largest-scale portrait image as a first portrait image, perform skin removal on the first portrait image to obtain a portrait skin removal image, and perform 2-fold and 4-fold down-sampling on the portrait skin removal image to obtain a first skin removal image and a second skin removal image. a standard skin processing unit configured to perform skin extraction on the portrait image, the portrait skin-removed image, the first skin-removed image and the second skin-removed image based on HSL color space respectively to obtain a first skin map, a second skin map and a third skin map, and store the first skin map, the second skin map and the third skin map on R, G and B channels of a pre-processed general skin map to obtain the multi-scale standard skin map; a skin transfer unit configured to perform skin transfer on a pre-processed user image based on the standard skin map to obtain a corresponding skin transfer result image.

7. A skin quality extraction and skin quality migration apparatus, characterized by, A computer program product comprising a processor, a memory, and a computer program stored in the memory, the computer program being executed by the processor to implement the steps of the skin extraction and skin transfer method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, A computer program product comprising a processor, a memory, and a computer program stored in the memory, the computer program being executed by the processor to implement the steps of the skin extraction and skin transfer method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Facial image processing system, facial image processing method, and facial image processing program

    CN109416827A

  • Image processing method and system, terminal equipment and storage medium

    CN114926520A