Facial feature enhancement display method, device, electronic device and medium

Through the methods of face key points processing, brightness adjustment and color parameter filling, the problem of unclear display of pigment spot detection in the prior art by face recognition is solved, and a clearer display of skin features such as pigment spots in the face is achieved.

CN112257501BActive Publication Date: 2025-05-23SHENZHEN SHULIAN TIANXIA INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010974862.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-16
Publication Date
2025-05-23
Estimated Expiration
2040-09-16

AI Technical Summary

Technical Problem

The existing facial recognition technology does not detect pigment spots in the face clearly enough, making it difficult to effectively display skin characteristics.

Method used

By obtaining the face image to be processed, obtaining images without non-skin areas according to the face key points, adjusting the brightness value, obtaining preset color parameters, processing and filling the image, and generating face feature enhancement images to more clearly display skin features such as pigment spots.

Benefits of technology

It achieves clearer and more obvious display of skin characteristics such as pigment spots in the face, which facilitates users to intuitively understand the skin quality of the face.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112257501B_ABST
    Figure CN112257501B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and medium for displaying enhanced facial features. The method includes: obtaining a facial image to be processed; obtaining a first image corresponding to the facial image to be processed according to the facial key points in the facial image to be processed, wherein the first image does not include a non-skin area; obtaining the brightness value of the first image, and determining whether the brightness value is less than a first brightness threshold; if less than, adjusting the brightness value of the facial image to be processed, and obtaining a preset color parameter when the brightness value of the first image is not less than the first brightness threshold, processing the facial image to be processed according to the preset color parameter to obtain a processed image, and classifying the pixels in the processed image according to the preset color parameter; filling the processed image according to the preset color filling parameter and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method, device, electronic equipment and medium for enhancing and displaying facial features. Background Art

[0002] Face recognition refers to computer technology that uses analysis and comparison of facial visual feature information to identify people. The main research areas of face recognition include face identity recognition, face expression recognition, face gender recognition, face expression recognition, etc.

[0003] At present, face recognition technology is relatively mature. In face recognition, there is also a wide demand and application for the detection of facial skin features, such as the detection of the distribution of pigment spots on the face. Pigment spots are unevenly distributed melanin particles in the skin, resulting in local spots and patches that are darker than normal skin color. However, the color of pigment spots is similar to the skin color of the face. Only when the pigment spots accumulate seriously will they be obvious. The current face recognition method does not detect pigment spots clearly enough. Summary of the invention

[0004] The present application provides a method, device, electronic device and medium for enhancing display of facial features.

[0005] In a first aspect, a method for enhancing display of facial features is provided, comprising:

[0006] Obtain the face image to be processed;

[0007] Obtaining a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area;

[0008] Obtaining a brightness value of the first image, and determining whether the brightness value is less than a first brightness threshold;

[0009] If the brightness value of the first image is less than the first brightness threshold, adjusting the brightness value of the face image to be processed so that the brightness value of the first image corresponding to the face image to be processed is not less than the first brightness threshold;

[0010] When the brightness value of the first image is not less than the first brightness threshold, obtaining a preset color parameter, processing the face image to be processed according to the preset color parameter to obtain a processed image, and classifying pixels in the processed image according to the preset color parameter;

[0011] The processed image is filled according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0012] In a second aspect, a facial feature enhancement display device is provided, comprising:

[0013] An acquisition module, used for acquiring a face image to be processed;

[0014] A detection module, configured to obtain a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area;

[0015] A brightness module, used to obtain a brightness value of the first image, and determine whether the brightness value is less than a first brightness threshold;

[0016] If the brightness value of the first image is less than the first brightness threshold, adjusting the brightness value of the face image to be processed so that the brightness value of the first image corresponding to the face image to be processed is not less than the first brightness threshold;

[0017] an enhancement module, configured to obtain a preset color parameter when the brightness value of the first image is not less than the first brightness threshold, process the first image according to the preset color parameter to obtain a processed image, and classify pixels in the processed image according to the preset color parameter;

[0018] The enhancement module is also used to fill the processed image according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0019] According to a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the first aspect and any possible implementation thereof.

[0020] In a fourth aspect, a computer storage medium is provided, wherein the computer storage medium stores one or more instructions, wherein the one or more instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned first aspect and any possible implementation thereof.

[0021] The present application obtains a facial image to be processed; obtains a first image corresponding to the facial image to be processed based on facial key points in the facial image to be processed, wherein the first image does not include non-skin areas; obtains a brightness value of the first image, and determines whether the brightness value is less than a first brightness threshold; if it is less than, adjusts the brightness value of the facial image to be processed, and when the brightness value of the first image is not less than the first brightness threshold, obtains preset color parameters, processes the facial image to be processed based on the preset color parameters, and obtains a processed image, and the pixels in the processed image are classified according to the preset color parameters; fills the processed image according to the preset color filling parameters and the classification of the pixels in the processed image, and obtains a facial feature enhanced image corresponding to the facial image to be processed, and enhances the corresponding area in the face by selecting preset color parameters of a color similar to the detected skin features such as pigmentation spots, so that skin features such as pigmentation spots in the face can be displayed more clearly and obviously, which is convenient for assisting users to intuitively understand the skin condition of the face. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0023] Figure 1 A schematic diagram of a flow chart of a method for enhancing and displaying facial features provided in an embodiment of the present application;

[0024] Figure 2A A schematic diagram of a facial image provided in an embodiment of the present application;

[0025] Figure 2B A schematic diagram of a first mask provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of a first image provided in an embodiment of the present application;

[0027] Figure 4 A schematic diagram of a flow chart of another method for enhancing and displaying facial features provided in an embodiment of the present application;

[0028] Figure 5 A schematic diagram of image processing provided in an embodiment of the present application;

[0029] Figure 6 A schematic diagram of a facial feature enhanced image provided in an embodiment of the present application;

[0030] Figure 7 Another schematic diagram of an image with enhanced facial features provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the structure of a facial feature enhancement display device provided in an embodiment of the present application;

[0032] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0034] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0036] The deep learning (DL) involved in the embodiments of the present application is a new research direction in the field of machine learning (ML). It is introduced into machine learning to make it closer to its original goal, artificial intelligence (AI). Deep learning is the inherent laws and representation levels of learning sample data. The information obtained in these learning processes is of great help in the interpretation of data such as text, images, and sounds. Its ultimate goal is to enable machines to have analytical learning capabilities like humans and to recognize data such as text, images, and sounds.

[0037] Artificial Neural Networks (ANNs), also referred to as Neural Networks (NNs) or Connection Model, is an algorithmic mathematical model that imitates the behavioral characteristics of animal neural networks and performs distributed parallel information processing. This network relies on the complexity of the system to adjust the interconnected relationships between a large number of internal nodes to achieve the purpose of processing information. The facial feature enhancement display method in the embodiment of the present application can be implemented based on a pre-trained neural network.

[0038] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.

[0039] See also Figure 1 , Figure 1 : is a flowchart of a method for enhancing the display of facial features provided by an embodiment of the present application. The method may include:

[0040] 101. Obtain a face image to be processed.

[0041] The execution subject of the embodiment of the present application may be a facial feature enhancement display device, which may be an electronic device. In a specific implementation, the electronic device may be a terminal, which may also be referred to as a terminal device, including but not limited to a desktop computer, which may have a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the device may also be other portable devices such as a mobile phone, a laptop computer, or a tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0042] Among them, the above-mentioned facial image to be processed is an image of the facial area. Key point detection can be performed on the image containing the facial area, multiple key points of the facial area can be located, the facial area in the image can be captured, the above-mentioned facial image to be processed is obtained, and it is processed as the input of the algorithm model in the embodiment of the present application.

[0043] The image of the face area can be an image collected by any device, such as a face photo taken by a mobile phone camera. In the embodiment of the present application, any face key point detection model or algorithm can be used to detect key points, for example, 68 key points of the face contour can be located. The above process removes the background outside the face, which can make the processing of the face image more accurate and shorten the processing time.

[0044] 102. Obtain a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area.

[0045] In the scenario of detecting the skin condition of a human face, the recognition of non-skin areas can be excluded first, that is, the skin area is identified in the face image to be processed for further processing.

[0046] In one implementation, the above step 102 specifically includes:

[0047] Determine the non-skin area in the face image to be processed according to the face key points in the face image to be processed;

[0048] According to the above-mentioned face image to be processed and the above-mentioned non-skin area, a first mask is obtained, wherein the above-mentioned first mask is used to screen the skin area in the above-mentioned face image to be processed;

[0049] The original face image to be processed and the first mask are superimposed to obtain the first image.

[0050] Through the facial key point detection algorithm, the non-skin area in the face can be found according to the identified facial key points. In an optional embodiment, the non-skin area may include the eye area, the eyebrow area and the mouth area. The specific processing method is to generate a corresponding first mask for the non-skin area determined based on the key points. The function of the first mask is to block the non-skin area in the image to be processed, which can be understood as ignoring these areas in subsequent detection. The first mask and the original face image to be processed are then superimposed, which can be understood as adding the color value of the pixel points in the original face image to be processed to the first mask, but the non-skin area of ​​the first mask cannot be filled, and only the skin area has the same color value as the face image to be processed, so as to obtain the first image, that is, the face image that only displays the skin area normally and ignores the non-skin area.

[0051] In one embodiment, the step of obtaining a first mask according to the face image to be processed and the non-skin area includes:

[0052] The pixel values ​​of the non-skin area in the face image to be processed are set as a first threshold, and the pixel values ​​of other areas in the face image to be processed are set as a second threshold, so as to obtain a first mask.

[0053] Specifically, the first threshold and the second threshold may be preset, for example, respectively set to 255 and 0. It can be understood that the other regions are selected in a similar binarization manner.

[0054] Figure 2A A schematic diagram of a face image provided in an embodiment of the present application. The white frame covering the eyes of the face in the embodiment of the present application is a mosaic to protect the privacy of the portrait, and in actual application it can be a complete face image. Figure 2AThe face image shown in FIG. 1 is subjected to key point recognition to obtain the face region (i.e., the face image to be processed as described above), and then step 102 is performed to obtain the face region. Figure 2B Specifically, for the face image to be processed, the eyebrows, lips, and eye regions of the face are obtained according to the key points. The pixel values ​​of these regions can be set to 255, that is, white, and the pixel values ​​of other regions can be set to 0, that is, black, so that the following can be obtained: Figure 2B Mask image shown.

[0055] You can refer to Figure 3 A schematic diagram of a first image is shown in FIG. Figure 2B After a first mask is formed, the first mask can be further combined with the original Figure 2A The face area shown in the figure is superimposed, and the color value of the pixel point in the original face image to be processed is added to the first mask, but the pixel value of the non-skin area of ​​the first mask is 255, and the pixel value of other areas is 0. After filling, the black area is still black, and the color value of other areas is the same as that in the face image to be processed. The first image corresponding to the face image to be processed is obtained, such as Figure 3 As shown in the figure, it can be seen that the eyebrows, eyes, and mouth areas are black, and other areas remain in their original state (the face of the face can be the original color, can be colored, Figure 3 The image is gray and not shown in the figure) to ignore the processing of eyebrows, eyes, and mouth areas, and better identify the characteristics of the skin area.

[0056] 103. Obtain a brightness value of the first image, and determine whether the brightness value is less than a first brightness threshold.

[0057] If the brightness value of the first image is less than the first brightness threshold, step 103 may be performed; if the brightness value of the first image is less than the first brightness threshold, step 105 may be performed.

[0058] 104. If the brightness value of the first image is less than the first brightness threshold, adjust the brightness value of the facial image to be processed so that the brightness value of the first image corresponding to the facial image to be processed is not less than the first brightness threshold.

[0059] In one embodiment, the brightness value of the first image is a brightness value obtained through a Lab channel in Lab mode;

[0060] The above adjustment of the brightness value of the face image to be processed includes:

[0061] The value of the L channel of the face image to be processed is fitted with a preset spline interpolation function to adjust the brightness value of the face image to be processed.

[0062] The Lab mode involved in the embodiment of the present application is a color mode. The Lab color model makes up for the shortcomings of the RGB and CMYK color modes. It is a device-independent color model and also a color model based on physiological characteristics. The Lab color model consists of three elements, one element is brightness (L), and a and b are two color channels. The colors included in a are from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value); b is from bright blue (low brightness value) to gray (medium brightness value) to yellow (high brightness value). Therefore, this color mixture will produce a color with a bright effect, which is suitable for displaying the skin condition of the face. The embodiment of the present application can perform image processing based on the Lab mode.

[0063] Specifically, for example, the first brightness threshold L=220 is set. When the brightness value of the first image is less than this threshold, the value of the L channel of the original face image to be processed can be adjusted by fitting a preset spline interpolation function to adjust the brightness of the face image to be processed. This value is closer to the brightness value of the skin area and excludes the influence of other non-skin areas. That is, it can be measured as follows: Figure 3 The brightness of the skin area in the first image is obtained, and if it does not meet the brightness requirement, the brightness of the original face image to be processed is adjusted. After the adjustment, the first image corresponding to the face image also meets the requirement (the brightness value is greater than the first brightness threshold L), so that subsequent processing can continue. The subsequent color processing part is for the whole face.

[0064] In practical problems, it is often necessary to draw an approximate curve based on some observed data, that is, some discrete points on the plane. These discrete points are called control points. If the curve does not necessarily pass through all the control points, but is approximated to these points in some way, the problem is called a fitting problem. In numerical analysis of mathematical disciplines, a spline is a special function that is defined by polynomials in pieces. The embodiment of the present application fits the value of the L channel of the original face image to be processed in the first image through a preset spline interpolation function to obtain a corresponding approximate curve, thereby achieving an overall brightness adjustment effect.

[0065] Specifically, the value of the L channel represents the brightness of the pixel point. A fitting function can be generated based on the value of the L channel of the original part of the face image to be processed. The fitting function corresponds to an approximate curve of these values ​​(i.e., corresponding to the above control points). The approximate curve does not necessarily pass through all the control points. Some control points are far away from the approximate curve. After obtaining the above fitting function, the fitting function is used to recalculate the values ​​of the control points far away from the approximate curve, and then these control points are modified to the calculated values ​​to adjust the brightness of the pixel point.

[0066] 105. Obtain preset color parameters, process the first image according to the preset color parameters to obtain a processed image, and classify pixels in the processed image according to the preset color parameters.

[0067] Specifically, pixels of a specific color can be screened by preset color parameters to detect corresponding skin features. For example, preset color parameters of a color similar to that of pigmented spots are selected to identify target pixels of a color similar to that of pigmented spots from the above-mentioned face image to be processed for enhancement. According to the preset color parameters, the pixel values ​​of the pixels in the face image to be processed are compared, and the target pixels and other pixels are screened out respectively. The image obtained by pixel classification is the above-mentioned processed image, and step 104 can be executed.

[0068] The pigment spots involved in the embodiments of the present application are uneven distribution of melanin particles in the skin, resulting in local spots and patches that are darker than normal skin color. The pigment spots in the embodiments of the present application can include four categories: chloasma, freckles, hidden spots and moles.

[0069] 104. Fill the processed image according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0070] Specifically, the preset color filling parameters can be set in advance, and then the preset color filling parameters are used to fill the pixels in the processed image according to the classification of the pixels, that is, the pixel values ​​of the pixels are adjusted to enhance the regional display effect of the target pixels.

[0071] In one embodiment, after the above step 104, the method further includes:

[0072] The facial feature enhanced image is adjusted to a preset contrast and a second brightness threshold.

[0073] By adjusting the contrast and brightness at the end, the display effect of the image can be improved. After experimental processing of the sample image, the brightness and contrast parameters with better display effect can be obtained to adjust the brightness and contrast of the above-mentioned facial feature enhanced image.

[0074] The embodiment of the present application obtains a facial image to be processed; obtains a first image corresponding to the facial image to be processed based on facial key points in the facial image to be processed, wherein the first image does not include non-skin areas; obtains a brightness value of the first image, and determines whether the brightness value is less than a first brightness threshold; if it is less than, adjusts the brightness value of the facial image to be processed, and when the brightness value of the first image is not less than the first brightness threshold, obtains preset color parameters, processes the facial image to be processed based on the preset color parameters, and obtains a processed image, and the pixels in the processed image are classified according to the preset color parameters; fills the processed image based on the preset color filling parameters and the classification of the pixels in the processed image, and obtains a facial feature enhanced image corresponding to the facial image to be processed, and enhances the corresponding area in the face by selecting preset color parameters of a color similar to the detected skin features such as pigmentation spots, so that skin features such as pigmentation spots in the face can be displayed more clearly and obviously, allowing users to intuitively understand the skin condition of the face.

[0075] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of a method for enhancing and displaying facial features provided in an embodiment of the present application. Figure 4 As shown, the method may specifically include:

[0076] 401. Obtain a face image to be processed.

[0077] 402. Obtain a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area.

[0078] The execution subject of the embodiment of the present application may be a facial feature enhancement display device, which may be an electronic device. In a specific implementation, the electronic device may be a terminal, which may also be referred to as a terminal device, including but not limited to a desktop computer, which may have a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that in some embodiments, the device may also be other portable devices such as a mobile phone, a laptop computer, or a tablet computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).

[0079] The above steps 401 and 402 can refer to Figure 1 The specific description of step 101 and step 102 in the illustrated embodiment will not be repeated here.

[0080] 403. Obtain a brightness value of the first image, and determine whether the brightness value is less than a first brightness threshold.

[0081] Specifically, after obtaining the above-mentioned first image, it can be detected whether the brightness value reaches the preset first brightness threshold. If it is detected that the brightness value of the first image is less than the above-mentioned first brightness threshold, the brightness can be adjusted first, that is, step 404 can be executed; if not less than, step 405 can be executed.

[0082] 404. If the brightness value of the first image is less than the first brightness threshold, adjust the brightness value of the facial image to be processed so that the brightness value of the first image corresponding to the facial image to be processed is not less than the first brightness threshold.

[0083] Among them, the above steps 401 to 404 can refer to Figure 1 The specific description of steps 101 to 104 in the illustrated embodiment will not be repeated here.

[0084] 405. When the brightness value of the first image is not less than the first brightness threshold, obtain a preset color value and a preset tolerance value, and obtain a difference between a pixel value of a pixel point in the first image and the preset color value.

[0085] 406 . Obtain target pixel points whose difference is not greater than the preset tolerance value and other pixel points whose difference is greater than the preset tolerance value respectively.

[0086] 407 . Set the pixel value of the target pixel in the first image as the adjusted color value, and set the pixel values ​​of the other pixels to 0, to obtain the processed image.

[0087] Specifically, in order to enhance some special areas of the face, the corresponding pixels can be first filtered by setting the color value. The above-mentioned preset color value can be an RGB value. The RGB color mode involved in the embodiment of the present application is a color standard in the industry. It is obtained by changing the three color channels of red (R), green (G), and blue (B) and superimposing them on each other to obtain a variety of colors. RGB represents the colors of the three channels of red, green, and blue. The image is composed of pixels, and the pixel value of each pixel of the three-channel image represents the above-mentioned RGB.

[0088] The tolerance value involved in the embodiment of the present application is the distance difference of the color difference value, which refers to the selection range set when selecting a color, and its value can be between 0-255.

[0089] The preset color value and preset tolerance value in the embodiment of the present application can be set as needed, for example, a color value close to the color of the pigmentation spot is selected, such as setting it to RGB (215, 161, 120), and the tolerance value can be set by the thresh parameter, such as thresh = 135, to obtain the target pixel point whose color value is within the selected color difference value range.

[0090] For each pixel in the image to be processed, the difference between the pixel value and the preset color value is calculated. The color tolerance involved in the embodiment of the present application is mainly for the comparison of the sample and the known standard color measurement value, so that the closeness of the sample to the standard can be judged. Specifically, a preset color tolerance formula can be obtained, and the color tolerance formula is used to calculate the difference between the pixel value and the preset color value of the pixel according to the RGB value (R value, G value, B value) of the pixel and the preset color value.

[0091] Further, it is determined whether the above difference exceeds thresh, and the pixel points that do not exceed thresh are determined as the above target pixel points, and the pixel points that exceed thresh are other pixel points; further, the pixel values ​​of other pixel points in the image are set to 0, and the pixel value of the target pixel point is adjusted according to a uniform ratio and set to the adjusted color value. Specifically, the difference between the pixel value of the target pixel point and the preset color value is recorded as m. For any of the above target pixels, the new pixel value (adjusted color value) that can be set is: 1-m / thresh*255.

[0092] Through the above steps, a processed image with classified pixels can be obtained, and then step 408 is executed.

[0093] 408. Fill the processed image according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0094] The above step 408 can also refer to Figure 1 The specific description of step 104 in the illustrated embodiment will not be repeated here.

[0095] In an optional implementation, the above step 408 specifically includes:

[0096] Normalizing the processed image to obtain a first normalized image and a second normalized image corresponding to the processed image, wherein the pixel value of the target pixel in the first normalized image is 0, and the pixel values ​​of the other pixels are 255; the pixel value of the target pixel in the second normalized image is 255, and the pixel values ​​of the other pixels are 0;

[0097] The first normalized image is filled with a preset color filling value, the second normalized image is filled with a white pixel value, and the two filled images are superimposed to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0098] Image normalization refers to the process of transforming an image into a fixed standard form by performing a series of standard processing transformations on the image. The standard image is called a normalized image. Specifically, the processed image can be normalized according to the classification of the pixels. The processing methods can be represented as mask / 255.0 and 1-mask / 255.0, respectively, where mask refers to the processed image, which can be understood as representing the pixel values ​​in the processed image with 255 or 0.

[0099] In the two normalized images, the pixel value of the target pixel in the first normalized image is 0, and the pixel values ​​of other pixels are 255; while the pixel value of the target pixel in the second normalized image is 255, and the pixel values ​​of other pixels are 0, which can be understood as complementary images.

[0100] Furthermore, the two normalized images can be filled separately. Specifically, the first normalized image is filled with a preset color filling value, and the second normalized image is filled with a white pixel value, and finally they are added to obtain a filled image, which is a facial feature enhanced image.

[0101] See for example Figure 5 A schematic diagram of image processing is shown, in which the white frame is a mosaic for protecting the privacy of the portrait, and in actual application it can be a complete face image. Figure 5 The processed image shown has been processed as in step 407, and the color area of ​​the face is uneven. For example, in the scene of enhanced display of pigment spots, the clustered area of ​​the determined target pixels is the pigment spot area, which is displayed in a lighter color in the image, such as Figure 5 The spots at a and b in the image are removed; the remaining area after removing the target pixel is the general area (non-pigmented area) corresponding to other pixels. Then, the above step 408 is performed on the processed image to obtain a face image with enhanced display of pigmented spots.

[0102] for example Figure 6 The schematic diagram of a facial feature enhanced image shown in FIG. Figure 5 The processed image shown is obtained after filling. Figure 6 The image can display the corresponding color according to the selected color value. This is only for illustration and does not reflect the color.

[0103] In one embodiment, after step 408, the method further includes:

[0104] The facial feature enhanced image is adjusted to a preset contrast and a second brightness threshold.

[0105] See also Figure 7 Another facial feature enhanced image shown, Figure 7 The image shown is in Figure 6 The effect adjustment is obtained based on the image shown, and Figure 2A or Figure 6 compared to, Figure 7 The pigment spots on the face are more obvious. Specifically, the brightness and contrast parameters with better display effect can be obtained after experimental processing of the sample image, which are used to adjust the brightness and contrast of the above-mentioned facial feature enhanced image. By adjusting the contrast and brightness at the end, the display effect of the image can be improved and the feature display can be more obvious.

[0106] The facial feature enhanced display method in the embodiment of the present application can set different color values ​​and tolerance values ​​according to different skin problems on the face to detect various skin problems on the face and have an enhanced display effect. The embodiment of the present application does not limit this.

[0107] The facial feature enhancement display method in the embodiment of the present application obtains a facial image to be processed, obtains a first image corresponding to the facial image to be processed according to facial key points in the facial image to be processed, the first image does not include a non-skin area, obtains a brightness value of the first image, determines whether the brightness value is less than a first brightness threshold, and if so, adjusts the brightness value of the facial image to be processed so that the brightness value of the first image corresponding to the facial image to be processed is not less than the first brightness threshold, and then obtains a preset color value and a preset tolerance value, and determines the brightness value of the first image according to the preset color value and the above. The preset tolerance value determines the color difference value range, obtains the above-mentioned target pixel points whose color values ​​in the above-mentioned facial image to be processed are within the above-mentioned color difference value range, obtains the above-mentioned processed image, and then fills the target pixel points in the above-mentioned processed image according to the preset color filling parameters to obtain the facial feature enhanced image corresponding to the above-mentioned facial image to be processed, wherein the color difference value range is determined by selecting the preset color value and the preset tolerance value close to the detected skin features such as pigmentation spots, and screening out specific pixels for enhancement, which can more clearly and obviously display the skin features such as pigmentation spots in the face, so that the user can intuitively understand the skin condition of the face.

[0108] Based on the description of the above-mentioned facial feature enhancement display method embodiment, the present application embodiment also discloses a facial feature enhancement display device. Figure 8 , the facial feature enhancement display device 800 comprises:

[0109] An acquisition module 810 is used to acquire a face image to be processed;

[0110] A detection module 820, configured to obtain a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area;

[0111] The brightness module 830 is used for:

[0112] Obtaining a brightness value of the first image, and determining whether the brightness value is less than a first brightness threshold;

[0113] If the brightness value of the first image is less than the first brightness threshold, adjusting the brightness value of the face image to be processed so that the brightness value of the first image corresponding to the face image to be processed is not less than the first brightness threshold;

[0114] an enhancement module 840, configured to obtain a preset color parameter when the brightness value of the first image is not less than the first brightness threshold, obtain a target pixel in the first image according to the preset color parameter, and obtain a processed image, wherein the preset color parameter is used to filter the color of the pixel in the first image;

[0115] The enhancement module 840 is further configured to fill target pixels in the processed image according to preset color filling parameters to obtain a facial feature enhanced image corresponding to the facial image to be processed.

[0116] According to one embodiment of the present application, Figure 1 and Figure 4 Each step involved in the method shown can be performed by Figure 8 The operations performed by various modules in the facial feature enhancement display device 800 shown are not described in detail here.

[0117] The facial feature enhancement display device 800 in the embodiment of the present application can obtain a facial image to be processed; obtain a first image corresponding to the facial image to be processed based on facial key points in the facial image to be processed, wherein the first image does not include a non-skin area; obtain a brightness value of the first image, and determine whether the brightness value is less than a first brightness threshold; if less than, adjust the brightness value of the facial image to be processed, and when the brightness value of the first image is not less than the first brightness threshold, obtain a preset color parameter, process the facial image to be processed according to the preset color parameter, and obtain a processed image, wherein the pixels in the processed image are classified according to the preset color parameter; fill the processed image according to the preset color filling parameter and the classification of the pixels in the processed image, and obtain a facial feature enhanced image corresponding to the facial image to be processed, and enhance the corresponding area in the face by selecting a preset color parameter of a color similar to the detected skin features such as pigment spots, so that skin features such as pigment spots in the face can be displayed more clearly and obviously, allowing the user to intuitively understand the skin condition of the face.

[0118] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides an electronic device. Fig. 9The electronic device 900 at least includes a processor 901, an input device 902, an output device 903, and a computer storage medium 904. The processor 901, the input device 902, the output device 903, and the computer storage medium 904 in the electronic device may be connected via a bus or other means.

[0119] The computer storage medium 904 can be stored in the memory of the electronic device. The computer storage medium 904 is used to store a computer program. The computer program includes program instructions. The processor 901 is used to execute the program instructions stored in the computer storage medium 904. The processor 901 (or CPU (Central Processing Unit)) is the computing core and control core of the electronic device. It is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement corresponding method flows or corresponding functions. In one embodiment, the processor 901 in the embodiment of the present application can be used to perform a series of processes, including such as Figure 1 and Figure 4 Methods in the embodiments shown, etc.

[0120] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in an electronic device for storing programs and data. It is understandable that the computer storage medium here can include both built-in storage media in electronic devices and, of course, extended storage media supported by electronic devices. The computer storage medium provides a storage space that stores the operating system of the electronic device. In addition, one or more instructions suitable for being loaded and executed by the processor 901 are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.

[0121] In one embodiment, the processor 901 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps in the above embodiment; in a specific implementation, the processor 901 may load and execute one or more instructions stored in a computer storage medium to implement the corresponding steps in the above embodiment; Figure 1 and / or Figure 4 Any steps in the method will not be repeated here.

[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0123] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the module is only a logical function division, and there may be other division methods in actual implementation, for example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0124] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0125] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a magnetic disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.

Claims

1. A method for enhancing the display of facial features, It is characterized in that include: Obtain the face image to be processed; Obtaining a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area; Obtaining a brightness value of the first image, and determining whether the brightness value is less than a first brightness threshold; If the brightness value of the first image is less than the first brightness threshold, adjusting the brightness value of the face image to be processed so that the brightness value of the first image corresponding to the face image to be processed is not less than the first brightness threshold; When the brightness value of the first image is not less than the first brightness threshold, obtaining preset color parameters, processing the face image to be processed according to the preset color parameters to obtain a processed image, and classifying pixels in the processed image according to the preset color parameters; the preset color parameters include preset color values ​​and preset tolerance values; Filling the processed image according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed; The step of processing the face image to be processed according to the preset color parameters to obtain a processed image includes: Obtain the difference between the pixel value of the pixel point in the face image to be processed and the preset color value; respectively obtain the target pixel point whose difference is not greater than the preset tolerance value, and other pixel points whose difference is greater than the preset tolerance value; set the pixel value of the target pixel point in the face image to be processed to the adjusted color value, and set the pixel values ​​of the other pixel points to 0, to obtain the processed image; The filling of the processed image according to the preset color filling parameters and the classification of the pixels in the processed image comprises: Normalizing the processed image to obtain a first normalized image and a second normalized image corresponding to the processed image, wherein the pixel value of the target pixel in the first normalized image is 0, and the pixel values ​​of the other pixels are 255; the pixel value of the target pixel in the second normalized image is 255, and the pixel values ​​of the other pixels are 0; The first normalized image is filled with a preset color filling value, the second normalized image is filled with a white pixel value, and the two filled images are superimposed to obtain a facial feature enhanced image corresponding to the facial image to be processed.

2. The method for enhancing the display of facial features according to claim 1, It is characterized in that The brightness value of the first image is a brightness value of the first image acquired through the Lab channel in the Lab mode; The step of adjusting the brightness value of the face image to be processed includes: The value of the L channel of the face image to be processed is fitted with a preset spline interpolation function to adjust the brightness value of the face image to be processed.

3. The method for enhancing the display of facial features according to claim 1, It is characterized in that The step of obtaining a first image corresponding to the face image to be processed according to the face key points in the face image to be processed includes: Determining the non-skin area in the face image to be processed according to the face key points in the face image to be processed; Obtaining a first mask according to the face image to be processed and the non-skin area, wherein the first mask is used to screen the skin area in the face image to be processed; The first image is obtained by superimposing the face image to be processed and the first mask.

4. The method for enhancing the display of facial features according to claim 1, It is characterized in that The non-skin area includes the eye area, the eyebrow area and the mouth area; The step of obtaining a first mask according to the face image to be processed and the non-skin area comprises: The pixel values ​​of the non-skin area in the face image to be processed are set to a first threshold, and the pixel values ​​of other areas in the face image to be processed are set to a second threshold, to obtain a first mask, wherein the first threshold is different from the second threshold.

5. The method for enhancing and displaying facial features according to any one of claims 1 to 4, It is characterized in that After obtaining the facial feature enhanced image corresponding to the facial image to be processed, the method further includes: The facial feature enhanced image is adjusted to a preset contrast and a second brightness threshold.

6. A facial feature enhancement display device, It is characterized in that include: An acquisition module, used for acquiring a face image to be processed; A detection module, configured to obtain a first image corresponding to the face image to be processed according to the face key points in the face image to be processed, wherein the first image does not include a non-skin area; Brightness module for: Obtaining a brightness value of the first image, and determining whether the brightness value is less than a first brightness threshold; If the brightness value of the first image is less than the first brightness threshold, adjusting the brightness value of the face image to be processed so that the brightness value of the first image corresponding to the face image to be processed is not less than the first brightness threshold; an enhancement module, configured to obtain preset color parameters when the brightness value of the first image is not less than the first brightness threshold, process the first image according to the preset color parameters to obtain a processed image, and classify pixels in the processed image according to the preset color parameters; the preset color parameters include preset color values ​​and preset tolerance values; The enhancement module is also used to fill the processed image according to preset color filling parameters and the classification of the pixels in the processed image to obtain a facial feature enhanced image corresponding to the facial image to be processed; The enhancement module is specifically used for: Obtain the difference between the pixel value of the pixel point in the face image to be processed and the preset color value; respectively obtain the target pixel point whose difference is not greater than the preset tolerance value, and other pixel points whose difference is greater than the preset tolerance value; set the pixel value of the target pixel point in the face image to be processed to the adjusted color value, and set the pixel values ​​of the other pixel points to 0, to obtain the processed image; The enhancement module is further specifically used for: Normalizing the processed image to obtain a first normalized image and a second normalized image corresponding to the processed image, wherein the pixel value of the target pixel in the first normalized image is 0, and the pixel values ​​of the other pixels are 255; the pixel value of the target pixel in the second normalized image is 255, and the pixel values ​​of the other pixels are 0; The first normalized image is filled with a preset color filling value, the second normalized image is filled with a white pixel value, and the two filled images are superimposed to obtain a facial feature enhanced image corresponding to the facial image to be processed.

7. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the facial feature enhancement display method according to any one of claims 1 to 5.

8. A computer-readable storage medium, It is characterized in that A computer program is stored, and when the computer program is executed by a processor, the processor executes the steps of the facial feature enhancement display method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Skin color enhancement processing method and device and image processing device

    CN107507144A

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

    CN107680128A