Skin condition detection method and apparatus
By using multimodal polarized light brightness maps to calculate the evaluation parameters of skin oiliness and highlight, the problem of skin condition detection, which is greatly affected by lighting and skin color, is solved, and a more accurate and robust gloss assessment is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN MEITUEVE TECH CO LTD
- Filing Date
- 2023-03-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing skin condition detection methods are greatly affected by light and skin color, resulting in poor accuracy and robustness in luster assessment.
Using multimodal parallel polarized light brightness maps and cross polarized light brightness maps, facial oil shine assessment parameters and highlight assessment parameters are calculated. Reflection state parameters are then calculated using these oil shine assessment parameters and highlight assessment parameters to reduce the influence of lighting and skin tone.
It improves the accuracy and robustness of skin condition detection, reduces the influence of light and skin color, and does not require a large amount of data collection and manual annotation, enabling a more objective assessment of facial radiance.
Smart Images

Figure CN116342549B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically, to a method and apparatus for detecting skin condition. Background Technology
[0002] Reflectance parameters are direct information for assessing facial radiance. Radiance is an important parameter for assessing skin condition. Glowing skin usually reflects light in a specular manner, while dull skin scatters light.
[0003] Most existing schemes for calculating reflective state parameters to represent gloss are based on the gloss level calculated from white light images or other single-mode images to evaluate gloss.
[0004] However, the results are greatly affected by lighting and skin color. For example, people with fair skin or in brighter environments will have better gloss in the calculated reflectance parameters, which makes the results more susceptible to irrelevant factors, resulting in poor accuracy and robustness. Summary of the Invention
[0005] The purpose of this invention is to address the shortcomings of the prior art by providing a skin condition detection method and apparatus, so that the reflectivity parameters are not affected by irrelevant factors, thereby improving the accuracy of skin condition detection.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a skin condition detection method, the method comprising:
[0008] Obtain parallel polarized light intensity maps and cross polarized light intensity maps for multiple regions of the face to be evaluated;
[0009] Based on the cross-polarized light brightness map of each region, calculate the brightness segmentation threshold corresponding to each region;
[0010] Based on the brightness segmentation threshold corresponding to each region, the gloss map of each region is extracted from the parallel polarized light brightness map of each region, wherein the gloss map of each region includes: a first target pixel with a pixel value greater than or equal to the brightness segmentation threshold corresponding to each region;
[0011] Calculate the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region;
[0012] Calculate the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region;
[0013] The reflectivity parameters of the face to be evaluated are calculated based on the gloss assessment parameters of the multiple regions and the highlight assessment parameters of the multiple regions.
[0014] Optionally, calculating the brightness segmentation threshold corresponding to each region based on the cross-polarized light brightness map of each region includes:
[0015] Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the first target brightness value with the largest number of pixels.
[0016] Starting from the first target brightness value of each region, N second target brightness values that are greater than the first target brightness value are selected from the cross-polarized light brightness map of each region, wherein the N second target brightness values increase sequentially;
[0017] If the average brightness value of the N second target brightness values is greater than or equal to the first preset brightness threshold, starting from the first second target brightness value, select N third target brightness values that are greater than the first second target brightness value from the cross-polarized light brightness map of each region, wherein the N third target brightness values increase sequentially.
[0018] If the average brightness value of the N third target brightness values is less than the first preset brightness threshold, the middle target brightness value among the N third target brightness values is determined to be the brightness segmentation threshold corresponding to each region.
[0019] Optionally, calculating the gloss evaluation parameters for each region based on the number of first target pixels in the gloss image of each region includes:
[0020] Based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions.
[0021] Optionally, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate gloss evaluation parameters for each region in multiple dimensions, including:
[0022] Based on the number of first target pixels in the gloss map of each region and the number of pixels in the parallel polarized light brightness map of each region, the reflective area ratio of each region is calculated.
[0023] The multiple dimensions of gloss assessment parameters include: the percentage of reflective area.
[0024] Optionally, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate gloss evaluation parameters for each region in multiple dimensions, including:
[0025] Perform connected component analysis on the first target pixel in the gloss map of each region to determine the number of connected components in each region;
[0026] Calculate the average size of the gloss in each region based on the number of first target pixels in the gloss map of each region and the number of connected components in each region;
[0027] The multiple dimensions of gloss evaluation parameters also include: average gloss size.
[0028] Optionally, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate gloss evaluation parameters for each region in multiple dimensions, including:
[0029] Cluster the first target pixel points in the gloss image of each region to determine the dispersion of the first target pixel points in the gloss image of each region;
[0030] Based on the dispersion and the number of first target pixels in the gloss map of each region, the gloss distribution range of each region is calculated;
[0031] The multiple dimensions of gloss assessment parameters also include: gloss distribution range.
[0032] Optionally, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate gloss evaluation parameters for each region in multiple dimensions, including:
[0033] Based on the second preset brightness threshold, determine the number of second target pixels in the glossy image of each region whose brightness values satisfy the second preset brightness threshold;
[0034] Calculate the overexposure parameters for each region based on the number of the second target pixels and the number of the first target pixels in the gloss map of each region;
[0035] The multi-dimensional gloss evaluation parameters also include: overexposure parameters.
[0036] Optionally, calculating the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region includes:
[0037] Based on the brightness values of each pixel in the parallel polarization brightness map of each region, calculate the highest brightness value in the parallel polarization brightness map of each region.
[0038] Using the pixel with the highest brightness value as the center pixel, multiple pixels are determined in multiple directions of the parallel polarization light brightness map;
[0039] Calculate the difference in brightness between the center pixel and its adjacent pixels in the plurality of directions;
[0040] The highlight evaluation parameters are determined based on the sum of the differences between multiple brightness values.
[0041] Optionally, the method further includes:
[0042] Calculate the facial shine threshold based on the brightness segmentation threshold of the cross-polarized light brightness map of the multiple regions;
[0043] Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the fourth target brightness value of a preset number of pixels in each region;
[0044] Calculate the facial dullness brightness threshold based on the fourth target brightness value of the multiple regions;
[0045] Based on the facial shine threshold, the brightness map of the parallel polarized light image corresponding to the facial parallel polarized light image of the face to be evaluated is segmented to generate a facial shine map.
[0046] Based on the facial shine threshold, the facial dullness brightness threshold, and multiple preset color values, the facial shine map is converted into a facial color map;
[0047] The facial color map and the parallel polarized light image of the face to be evaluated are fused to generate a facial oiliness effect map of the face to be evaluated.
[0048] Secondly, embodiments of this application also provide a skin condition detection device, the device comprising:
[0049] The brightness map acquisition module is used to acquire parallel polarized light brightness maps and cross polarized light brightness maps of multiple regions of the face to be evaluated;
[0050] The segmentation threshold calculation module is used to calculate the brightness segmentation threshold corresponding to each region based on the cross-polarized light brightness map of each region.
[0051] The gloss image extraction module is used to extract the gloss image of each region from the parallel polarized light brightness image of each region according to the brightness segmentation threshold corresponding to each region, wherein the gloss image of each region includes: a first target pixel with a pixel value greater than or equal to the brightness segmentation threshold corresponding to each region;
[0052] The gloss evaluation parameter calculation module is used to calculate the gloss evaluation parameters of each region based on the number of first target pixels in the gloss image of each region.
[0053] The highlight evaluation parameter calculation module is used to calculate the highlight evaluation parameters of each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region.
[0054] The reflective state parameter calculation module is used to calculate the reflective state parameters of the face to be evaluated based on the gloss evaluation parameters of the multiple regions and the highlight evaluation parameters of the multiple regions.
[0055] Optionally, the segmentation threshold calculation module includes:
[0056] The first target brightness value determination unit is used to determine the first target brightness value with the largest number of pixels based on the brightness values of each pixel in the cross-polarized light brightness map of each region.
[0057] The second target brightness value determination unit is used to select N second target brightness values that are greater than the first target brightness value from the cross-polarized light brightness map of each region, starting from the first target brightness value of each region, wherein the N second target brightness values increase sequentially.
[0058] The third target brightness value determination unit is used to select N third target brightness values that are greater than the first second target brightness value from the cross-polarized light brightness map of each region, starting from the first second target brightness value, if the average brightness value of the N second target brightness values is greater than or equal to the first preset brightness threshold.
[0059] The segmentation threshold calculation unit is used to determine the middle target brightness value among the N third target brightness values as the brightness segmentation threshold corresponding to each region if the average brightness value of the N third target brightness values is less than a first preset brightness threshold.
[0060] Optionally, the gloss evaluation parameter calculation module is specifically used to calculate the gloss evaluation parameters of each region in multiple dimensions by using multiple gloss evaluation algorithms based on the number of first target pixels in the gloss image of each region.
[0061] Optionally, the oil sheen evaluation parameter calculation module includes:
[0062] The reflective area ratio calculation unit is used to calculate the reflective area ratio of each region based on the number of first target pixels in the gloss map of each region and the number of pixels in the parallel polarized light brightness map of each region.
[0063] The multiple dimensions of gloss assessment parameters include: the percentage of reflective area.
[0064] Optionally, the oil sheen evaluation parameter calculation module includes:
[0065] A connected component analysis unit is used to perform connected component analysis on the first target pixel in the gloss map of each region to determine the number of connected components in each region.
[0066] The average size calculation unit for gloss is used to calculate the average size of gloss in each region based on the number of first target pixels in the gloss image of each region and the number of connected components in each region.
[0067] The multiple dimensions of gloss evaluation parameters also include: average gloss size.
[0068] Optionally, the oil sheen evaluation parameter calculation module includes:
[0069] The discreteness calculation unit is used to cluster the first target pixel points in the gloss map of each region and determine the discreteness of the first target pixel points in the gloss map of each region.
[0070] The gloss distribution range calculation unit is used to calculate the gloss distribution range of each region based on the dispersion and the number of first target pixels in the gloss map of each region;
[0071] The multiple dimensions of gloss assessment parameters also include: gloss distribution range.
[0072] Optionally, the oil sheen evaluation parameter calculation module includes:
[0073] The threshold determination unit is used to determine the number of second target pixels in the glossy image of each region whose brightness values satisfy the second preset brightness threshold, based on the second preset brightness threshold.
[0074] An overexposure parameter calculation unit is used to calculate the overexposure parameter of each region based on the number of the second target pixels and the number of the first target pixels in the glossy image of each region.
[0075] The multi-dimensional gloss evaluation parameters also include: overexposure parameters.
[0076] Optionally, the specular evaluation parameter calculation module includes:
[0077] The maximum brightness value calculation unit is used to calculate the maximum brightness value in the parallel polarization light brightness map of each region based on the brightness value of each pixel in the parallel polarization light brightness map of each region.
[0078] A multi-directional pixel point determination unit is used to determine multiple pixels in multiple directions of the parallel polarization light brightness map, with the pixel point of the highest brightness value as the center pixel point.
[0079] A brightness value difference calculation unit is used to calculate the difference in brightness values between adjacent pixels in the center pixel and the multiple pixels in the multiple directions;
[0080] The highlight evaluation parameter calculation unit is used to determine the highlight evaluation parameter based on the sum of the differences between multiple brightness values.
[0081] Optionally, the device further includes:
[0082] The facial shine threshold calculation module is used to calculate the facial shine threshold based on the brightness segmentation threshold of the cross-polarized light brightness map of the multiple regions.
[0083] The fourth target brightness value calculation module is used to determine the fourth target brightness value of a preset number of pixels in each region based on the brightness value of each pixel in the cross-polarized light brightness map of each region.
[0084] The facial dullness brightness threshold calculation module is used to calculate the facial dullness brightness threshold based on the fourth target brightness value of the multiple regions.
[0085] The facial shine image generation module is used to perform brightness segmentation on the facial parallel polarized light brightness image corresponding to the parallel polarized light image of the face to be evaluated based on the facial shine threshold, and generate a facial shine image.
[0086] The color conversion module is used to convert the facial oiliness map into a facial color map based on the facial oiliness threshold, the facial dullness brightness threshold, and multiple preset color values.
[0087] The fusion module is used to fuse the facial color map and the parallel polarized light image of the face to be evaluated to generate a facial oiliness effect map of the face to be evaluated.
[0088] Thirdly, embodiments of this application also provide a skin condition detection device, including: a processor, a storage medium, and a bus. The storage medium stores program instructions executable by the processor. When the skin condition detection device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the skin condition detection method as described in any of the first aspects.
[0089] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the skin condition detection method as described in any of the first aspects.
[0090] The beneficial effects of this application are:
[0091] This application provides a skin condition detection method and apparatus. On the one hand, compared with single-modal images, which are greatly affected by lighting environment and skin color, resulting in low accuracy and poor robustness, this application calculates facial oiliness assessment parameters and facial highlight assessment parameters through multimodal parallel polarization light brightness maps and cross polarization light brightness maps. The facial reflective state parameters calculated based on the facial oiliness assessment parameters and facial highlight assessment parameters can more accurately assess the skin gloss. On the other hand, compared with methods such as machine learning, which require the collection of a large amount of data and manual annotation, and whose manual gloss annotation is subjective and whose training results cannot objectively reflect the true gloss of the skin, this application, compared with machine learning, does not require too much manpower, material resources and time for data collection and manual annotation, and can more objectively assess facial gloss based on reflective state parameters. Attached Figure Description
[0092] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0093] Figure 1 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 1 ;
[0094] Figure 2 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 2 ;
[0095] Figure 3 This is a histogram of the brightness distribution corresponding to the cross-polarized light brightness map provided in the embodiments of this application;
[0096] Figure 4 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 3 ;
[0097] Figure 5 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 4 ;
[0098] Figure 6 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 5 ;
[0099] Figure 7 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 6 ;
[0100] Figure 8 A schematic diagram of the specular evaluation parameters provided in the embodiments of this application;
[0101] Figure 9 A flowchart illustrating the skin condition detection method provided in this application embodiment. Figure 7 ;
[0102] Figure 10 This is a schematic diagram of the skin condition detection device provided in the embodiments of this application;
[0103] Figure 11 This is a schematic diagram of a skin condition detection device provided in an embodiment of this application. Detailed Implementation
[0104] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments.
[0105] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0106] Furthermore, the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Additionally, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0107] It should be noted that, where there is no conflict, the features in the embodiments of this application can be combined with each other.
[0108] Before describing the skin condition detection method and apparatus provided in this application, the skin condition detection equipment used in the skin condition detection method and apparatus will be introduced first.
[0109] The skin condition detection device provided in this application embodiment can also be called a skin condition detector, which can be composed of a light source device, an image acquisition module and an image analysis module.
[0110] In some embodiments, the image acquisition module and the image analysis module may each consist of two independent devices, namely a camera device and a computer device, which are communicatively connected. The light source device provides parallel polarized light and cross-polarized light to the face to be evaluated. The camera device is used to acquire parallel polarized light images and cross-polarized light images of the face to be evaluated and send them to the computer device. The computer device executes the skin condition detection method of this application embodiment and detects the reflectivity of the face to be evaluated based on the parallel polarized light images and cross-polarized light images.
[0111] In some embodiments, the light source device, image acquisition module, and image analysis module can be composed of a smart terminal integrating camera and image analysis functions. Parallel polarized light and cross-polarized light can be provided through the light emission mode of the smart terminal's display interface. The camera module of the smart terminal is used to acquire parallel polarized light images and cross-polarized light images of the face to be evaluated, and send the parallel polarized light images and cross-polarized light images to the processor of the smart terminal. The processor executes the skin state detection method of this application embodiment and detects the reflective state of the face to be evaluated based on the parallel polarized light images and cross-polarized light images.
[0112] Based on the skin condition detection device provided in the above embodiments, this application provides a skin condition detection method.
[0113] Please refer to Figure 1 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 1 ,like Figure 1 As shown, the method may include:
[0114] S101: Obtain parallel polarization brightness maps and cross polarization brightness maps for multiple regions of the face to be evaluated.
[0115] In this embodiment, the parallel polarized light source can enhance specular reflection and weaken diffuse reflection. Since the surface oil of the skin makes the specular reflection effect significant, the parallel polarized light source can be used to obtain the parallel polarized light brightness map of the face to be evaluated. In order to detect the skin surface problems of the face to be evaluated through the parallel polarized light brightness map, without being disturbed by the deep diffuse reflection, the oiliness of the skin surface can be better observed.
[0116] Cross-polarized light sources can enhance diffuse reflection and eliminate specular reflection. Cross-polarized light sources can be used to obtain a cross-polarized light brightness map of the face to be evaluated, filtering out specular reflection interference on the skin surface, so as to observe the diffuse reflection light deep in the skin through the cross-polarized brightness map.
[0117] In one possible implementation, the process of obtaining parallel polarization brightness maps and cross polarization brightness maps of multiple regions of the face to be evaluated in step S101 may include:
[0118] Acquire parallel polarized light images of the face to be evaluated. and cross-polarized light images Feature extraction was performed on parallel polarized light images. and cross-polarized light images Determine the coordinates of facial key points; use a skin mask transformation algorithm to convert the parallel polarized light image. and cross-polarized light images They are converted into parallel polarization mask images and cross polarization mask images, respectively.
[0119] Based on the facial landmark coordinates and the parallel polarization mask, from the parallel polarization image Acquire parallel polarized light images of multiple regions Based on the facial landmark coordinates and the cross-polarized light mask, from the cross-polarized light image Acquire cross-polarized light images of multiple regions These areas can include the forehead, left cheek, and right cheek.
[0120] Parallel polarized light images of multiple regions Cross-polarized light images of multiple regions The pixel values are converted for brightness to obtain parallel polarized light brightness maps for multiple regions. Brightness diagrams of cross-polarized light in multiple regions .
[0121] For example, parallel polarized light images of multiple regions can be acquired separately. Cross-polarized light images of multiple regions The brightness values of the pixels in the L channel of the Lab color space are used to obtain parallel polarized light brightness maps of multiple regions. Brightness diagrams of cross-polarized light in multiple regions .
[0122] In some embodiments, in addition to obtaining a luminance map based on the luminance value of the L channel in the Lab color space, a luminance map can also be obtained based on the luminance value of the L channel in the HSL color space, the grayscale value of the grayscale channel in the GRAY color space, and the luminance value of the Y channel in the YCbCrC color space.
[0123] S102: Calculate the brightness segmentation threshold for each region based on the cross-polarized light brightness map of each region.
[0124] In this embodiment, the cross-polarized light brightness map for each region is shown. The brightness values of each pixel are statistically analyzed to determine the cross-polarized light brightness map for each region. The brightness value distribution results are based on the cross-polarized light brightness map of each region. Based on the brightness value distribution results, calculate the brightness segmentation threshold for each region. .
[0125] S103: Based on the brightness segmentation threshold corresponding to each region, extract the gloss map of each region from the parallel polarized light brightness map of each region, wherein the gloss map of each region includes: the first target pixel point whose pixel value is greater than or equal to the brightness segmentation threshold corresponding to each region.
[0126] In this embodiment, since parallel polarized light can enhance specular reflection for better observation of the oiliness of the skin surface, while cross-polarized light weakens specular reflection, a brightness diagram of cross-polarized light for each region is used. Corresponding brightness segmentation threshold Parallel polarized light brightness map for each region Brightness segmentation can be performed by analyzing the brightness map of parallel polarized light in each region. Determine the brightness value compared to the cross-polarized light brightness diagram Pixels with higher brightness values are obtained as pixels with significant oiliness.
[0127] Specifically, based on the brightness segmentation threshold corresponding to each region. For each region, the brightness map of parallel polarized light. Brightness segmentation is performed; specifically, the brightness segmentation method is as follows: the brightness map of parallel polarized light in each region is... The brightness value is less than the brightness segmentation threshold. The pixel value of the selected pixel is set to 0, while the pixel value of the selected pixel is kept if it is greater than or equal to the brightness segmentation threshold. The pixel values of each pixel are used to obtain the gloss map of each region. Among them, the brightness value is greater than or equal to the brightness segmentation threshold. The pixels represent the gloss map of each region. The first target pixel in the image.
[0128] S104: Calculate the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region.
[0129] In this embodiment, the gloss map of each region The first target pixel in the image corresponds to the pixel with significant shine in that region, based on the shine map of each region. The number of first target pixels is used to calculate the gloss evaluation parameters for each region using a preset gloss evaluation algorithm. .
[0130] S105: Calculate the specular evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region.
[0131] In this embodiment, the reflectivity of the skin is related not only to its oil production but also to its smoothness and fineness. The smoother and finer the skin, the smaller the brightness variation between pixels, resulting in better reflectivity and higher gloss. Conversely, the rougher and more uneven the skin, the greater the brightness variation between pixels, leading to poorer reflectivity and lower gloss. Therefore, the parallel polarized light brightness map of each region can be calculated. The brightness difference between pixels is used to calculate the highlight evaluation parameters for each region. Highlight evaluation parameters It indicates the smoothness and fineness of the skin.
[0132] S106: Calculate the reflectivity parameters of the face to be evaluated based on the gloss assessment parameters of multiple regions and the highlight assessment parameters of multiple regions.
[0133] In this implementation, steps S102-S105 described above are used to obtain gloss assessment parameters for multiple regions. And highlight evaluation parameters for multiple regions Oil gloss assessment parameters for multiple regions A weighted average was performed to obtain facial oiliness assessment parameters, and highlight assessment parameters for multiple areas were also obtained. A weighted average is performed to obtain the facial highlight assessment parameters; based on the facial oiliness assessment parameters and the facial highlight assessment parameters, the reflectivity parameters of the face to be assessed can be calculated.
[0134] The following combination Figure 2 One possible implementation of the above calculation of the brightness segmentation threshold for each region is described.
[0135] Please refer to Figure 2 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 2 ,like Figure 2 As shown, the process of calculating the brightness segmentation threshold for each region based on the cross-polarized light image of each region in S102 may include:
[0136] S121: Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the brightness value of the first target with the largest number of pixels.
[0137] S122: Starting from the first target brightness value of each region, select N second target brightness values that are greater than the first target brightness value from the cross-polarized light brightness map of each region, wherein the N second target brightness values increase sequentially.
[0138] S123: If the average number of pixels corresponding to the N second target brightness values is greater than or equal to the first preset threshold, starting from the first second target brightness value, select N third target brightness values that are greater than the first second target brightness value from the cross-polarized light brightness map of each region, wherein the N third target brightness values increase sequentially.
[0139] S124: If the average number of pixels corresponding to the N third target brightness values is less than the first preset threshold, determine the middle target brightness value among the N third target brightness values as the brightness segmentation threshold corresponding to each region.
[0140] In this embodiment, the cross-polarized light brightness map for each region is shown. The brightness values of each pixel are counted to determine the number of pixels with the same brightness value. Based on the number of pixels corresponding to each brightness value, the first target brightness value with the largest number of pixels is determined.
[0141] Starting with the first target brightness value of each region, from the cross-polarized light brightness map of each region Select N second target brightness values that are greater than the first target brightness value. The N second target brightness values are sequentially increased. Calculate the average number of pixels corresponding to the N second target brightness values. Determine if the average is less than a first preset threshold T1. If the average is greater than the first preset threshold T1, then starting from the first second target brightness value, calculate the cross-polarized light brightness map for each region. Select N third target brightness values that are greater than the first second target brightness value, and determine whether the average value is less than a first preset threshold. If the average value is greater than the first preset threshold T1, repeat the above process, continuously selecting N target brightness values and calculating the average number of pixels corresponding to them, until the average number of pixels corresponding to the N target brightness values is less than the first preset threshold T1. Then, use the median target brightness value among the N target brightness values as the brightness segmentation threshold for each region. .
[0142] In some embodiments, the cross-polarized light brightness map for each region The brightness values of each pixel are statistically analyzed to generate a cross-polarized light brightness map for each region. The corresponding brightness distribution histogram.
[0143] For example, please refer to Figure 3 This is the brightness distribution histogram corresponding to the cross-polarized light brightness map provided in the embodiments of this application, such as... Figure 3 As shown, the horizontal axis represents the cross-polarized light brightness map for each region. The brightness value distribution of each pixel is shown in the histogram. The vertical axis represents the number of pixels corresponding to different brightness values. From the brightness distribution histogram of each region, the vertical axis corresponding to the peak value is the number of pixels with the most pixels, and the horizontal axis corresponding to the peak value is the brightness value of the first target with the most pixels.
[0144] Set up a sliding window of size 1*N. Starting from the first target brightness value corresponding to the horizontal coordinate Hmax of the peak value, select N target brightness values to the right and calculate the average number of pixels corresponding to them. If the average number of pixels corresponding to the N target brightness values is greater than or equal to the first preset threshold T1, the sliding window continues to slide to the right and continuously calculates the average number of pixels corresponding to the N target brightness values within the sliding window. If the average number of pixels corresponding to the N target brightness values within the sliding window is less than the first preset threshold T1, the target brightness value corresponding to the midpoint of the sliding window is determined to be the brightness segmentation threshold.
[0145] In one possible implementation, S104 above, which calculates the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region, may include:
[0146] Based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions.
[0147] In this embodiment, to more accurately assess facial oiliness, multiple oiliness assessment parameters characterizing facial oiliness can be calculated from multiple dimensions. These parameters are calculated using multiple oiliness assessment algorithms. Specifically, multiple oiliness assessment algorithms are used to calculate the number of first target pixels in the oiliness map of each region, obtaining the oiliness assessment parameters for each region across multiple dimensions.
[0148] The following describes, with reference to several embodiments and accompanying drawings, multiple possible implementation methods for calculating the gloss evaluation parameters of each region in multiple dimensions using multiple gloss evaluation algorithms, based on the number of first target pixels in the gloss map of each region.
[0149] In a first possible implementation, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate gloss evaluation parameters for each region in multiple dimensions, which may include:
[0150] Based on the number of first target pixels in the gloss map of each region and the number of pixels in the parallel polarized light brightness map of each region, the reflective area ratio of each region is calculated; the gloss evaluation parameters in multiple dimensions include: reflective area ratio.
[0151] In this embodiment, the gloss map of each region This includes pixels with a value of 0 and pixels with a brightness value greater than or equal to the brightness segmentation threshold. The first target pixel, with gloss map of each region. The number of the first target pixels in the image represents the brightness map of the parallel polarized light in each region. The reflective area, with the parallel polarized light brightness diagram of each region. The total area of each region is determined by the number of all pixels in the region. The reflective area ratio of each region is determined by the ratio of the number of the first target pixel to the total number of all pixels.
[0152] In some embodiments, a gloss map of each region is provided. The number of first target pixels in the image represents the parallel polarization of light in each region. The reflective area, as a parallel polarized light image of each region. The total area of each region is determined by the number of all pixels in the region. The reflective area ratio of each region is determined by the ratio of the number of the first target pixel to the total number of all pixels.
[0153] For example, the reflective area ratio S1 = ( (Number of first target pixels) / ( (The number of all pixels in the image).
[0154] In other embodiments, the gloss map of each region This includes pixels with a value of 0 and pixels with a brightness value greater than or equal to the brightness segmentation threshold. The first target pixel can be used to obtain the gloss map for each region. Binarization is performed to obtain a binarized image, and the reflective area is represented by the number of non-zero pixels in the binarized image.
[0155] For the second possible implementation, please refer to Figure 4 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 3 ,like Figure 4 As shown, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions, which may include:
[0156] S141: Perform connected component analysis on the first target pixel in the gloss map of each region to determine the number of connected components in each region.
[0157] S142: Calculate the average size of the gloss in each region based on the number of first target pixels in the gloss map of each region and the number of connected components in each region; the gloss evaluation parameters in multiple dimensions also include: average size of the gloss.
[0158] In this embodiment, the gloss map of each region is shown. Binarization is performed to obtain a binarized image. A preset connected component analysis method is then used to analyze the connected components of the binarized image to determine the number of connected components in the binarized image. According to the gloss map of each area The number of first target pixels and the number of connected components Calculate the average size of the gloss spots.
[0159] For example, the average size of the glossy finish S2 = ( (Number of first target pixels) / .
[0160] For the third possible implementation, please refer to Figure 5 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 4 ,like Figure 5As shown, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions, which may include:
[0161] S143: Cluster the first target pixel in the gloss map of each region to determine the dispersion of the first target pixel in the gloss map of each region.
[0162] S144: Calculate the gloss distribution range of each region based on the dispersion and the number of first target pixels in the gloss map of each region; the gloss evaluation parameters of multiple dimensions also include: gloss distribution range.
[0163] In this embodiment, the gloss map of each region is shown. Binarization is performed to obtain a binarized image. A preset clustering algorithm is used to cluster the non-zero pixels in the binarized image to determine the cluster centers. Based on the Euclidean clustering of all first target pixels with the cluster centers, the gloss pattern of each region is determined. The dispersion of the first target pixel.
[0164] Based on the dispersion of the first target pixel and the reflective area of each region, the gloss distribution range of each region is calculated. The gloss distribution range reflects the dispersion of the gloss distribution. With a fixed reflective area, the greater the dispersion, the wider the distribution of shine and the more severe the oily skin condition.
[0165] In some embodiments, the cluster centers of non-zero pixels in the binarized image are iteratively clustered using the K-means distance algorithm with a cluster center number of K=1, and the sum of squares of the Euclidean distances between all first target pixels and the distance centers is calculated as the discreteness.
[0166] For example, the gloss distribution range S3= / ( The number of the first target pixels in the middle.
[0167] For the fourth possible implementation, please refer to... Figure 6 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 5 ,like Figure 6 As shown, based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions, which may include:
[0168] S145: Based on the second preset brightness threshold, determine the number of second target pixels in the first target pixel in the gloss map of each region whose brightness value meets the second preset brightness threshold;
[0169] S146: Calculate the overexposure parameter for each region based on the number of second target pixels and the number of first target pixels in the gloss map of each region; the multi-dimensional gloss evaluation parameters also include: overexposure parameter.
[0170] In this embodiment, a second preset brightness threshold is set, and pixels with brightness values greater than or equal to the second preset brightness threshold are identified as overexposed pixels. Specifically, this is determined based on the gloss map of each region. The brightness value of the first target pixel is used to determine the second target pixels, and the pixels whose brightness value is greater than or equal to a second preset brightness threshold are identified as second target pixels. The number of second target pixels is used to represent the parallel polarization light brightness map of each region. The overexposed area is determined by calculating the overexposed parameters of each region, i.e., the overexposed area ratio, based on the overexposed area and reflective area of each region.
[0171] For example, the second preset brightness threshold can be 255. Therefore, the pixel with a brightness value equal to 255 is determined as the second target pixel, and the overexposure parameter S4 = ( (Number of second target pixels) / ( The number of the first target pixels in the middle.
[0172] It should be noted that the L channel in the Lab color space ranges from [0, 100]. If the second preset brightness threshold ranges from [0, 255], then the gloss map of each region needs to be processed. The brightness value of the first target pixel is multiplied by 2.55 and then compared with the second preset brightness threshold.
[0173] Based on the calculation method of the gloss evaluation parameters provided in the above embodiments, the gloss evaluation parameters in multiple dimensions include at least two of the following: reflective area ratio S1, average gloss size S2, gloss distribution range S3, and overexposure parameter S4. The total gloss evaluation parameter for each region is a weighted sum of the gloss evaluation parameters in multiple dimensions.
[0174] For example, if the multiple dimensions of gloss evaluation parameters include: reflective area ratio S1, average gloss size S2, gloss distribution range S3, and overexposure parameter S4, then the total gloss evaluation parameters for each region are... ,in, Hyperparameters are set by humans.
[0175] The following describes a possible implementation of the above-described method for calculating the specular evaluation parameters for each region, in conjunction with embodiments and accompanying drawings.
[0176] Please refer to Figure 7 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 6 ,like Figure 7As shown, the process of S105 above, which calculates the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region, may include:
[0177] S151: Calculate the highest brightness value in the parallel polarized light brightness map of each region based on the brightness values of each pixel in the parallel polarized light brightness map of each region.
[0178] S152: Using the pixel with the highest brightness value as the center pixel, determine multiple pixels in multiple directions of the parallel polarized light brightness map.
[0179] S153: Calculate the difference in brightness between adjacent pixels in the center pixel and in multiple directions.
[0180] S154: Determine the highlight evaluation parameters based on the sum of the differences between multiple brightness values.
[0181] In this embodiment, to determine the smoothness / smoothness of the facial region, the brightness variation between each pixel can be calculated. Specifically, this is done based on the parallel polarized light brightness map of each region. The brightness values of each pixel in the image are used to determine the highest brightness value. The pixel corresponding to the highest brightness value is taken as the origin, and the boundaries of each region in multiple directions are taken as the endpoints. Multiple pixels are determined between the origin and the endpoints in each direction. The difference in brightness values between the origin and the adjacent points in the multiple pixels is calculated as the gradient change in the brightness diffusion process. The specular evaluation parameters are determined based on the sum of the differences in brightness values in multiple directions.
[0182] In some embodiments, please refer to Figure 8 This is a schematic diagram of the specular evaluation parameters provided in the embodiments of this application, as shown below. Figure 8 As shown, the origin The pixel corresponding to the highest brightness value in each region, with the origin as the reference point. As a starting point, with Multiple rays are generated at angular intervals, extending to the boundary of each region. The number of rays... On each ray from the origin Start towards the boundary of each region every interval The difference in brightness values is calculated based on the distance. Calculate the specular evaluation parameters based on the sum of the differences in brightness values corresponding to all rays. .
[0183] Example, highlight evaluation parameters , The scaling factor is the sum of the differences in brightness values, where a larger sum indicates a greater brightness variation between individual pixels. This is a specular evaluation parameter. The smaller the value, the worse the skin's reflectivity and the lower the gloss; the smaller the sum of the brightness values, the smaller the brightness variation between individual pixels, which is a key parameter for highlight evaluation. The larger the size, the better the skin's reflectivity and the higher its luster.
[0184] In one possible implementation, a smoothing operator can be used to smooth the parallel polarization brightness map of each region before calculating the specular evaluation parameters. After filtering, algorithms such as the extremum method or Gaussian mixture model (GMM) are used to determine the pixel with the highest brightness value in each region. The smoothing operator can be, for example, Gaussian filtering, mean filtering, or median filtering.
[0185] The skin condition detection method provided in the above embodiments has several advantages. First, compared with single-modal images, which are greatly affected by lighting environment and skin color, resulting in low accuracy and poor robustness, this application calculates facial oiliness assessment parameters and facial highlight assessment parameters using multimodal parallel polarization light brightness maps and cross polarization light brightness maps. Calculating facial reflectivity parameters based on these parameters allows for a more accurate assessment of skin gloss. Second, compared with methods like machine learning, which require collecting large amounts of data and manual annotation, and whose gloss annotations are subjective and whose training results cannot objectively reflect the true gloss of the skin, this application, compared to machine learning, does not require excessive manpower, resources, and time for data collection and manual annotation, and can more objectively assess facial gloss based on reflectivity parameters.
[0186] In one possible implementation, please refer to Figure 9 This is a flowchart illustrating the skin condition detection method provided in the embodiments of this application. Figure 7 ,like Figure 9 As shown, the method may further include:
[0187] S201: Calculate the facial shine threshold based on the brightness segmentation threshold of the cross-polarized light brightness map of multiple regions.
[0188] In this embodiment, to visualize the oiliness of the face to be evaluated, it is necessary to segment the oiliness of multiple regions using a unified facial segmentation threshold. The unified facial segmentation threshold includes: a facial oiliness threshold. and facial dullness brightness threshold Among them, facial oiliness threshold Greater than the facial dullness brightness threshold .
[0189] Specifically, the brightness segmentation thresholds corresponding to the cross-polarized light brightness maps of multiple regions can be calculated using the steps S121-S124 described above. The average value of these multiple brightness segmentation thresholds can then be used as the facial oiliness threshold. Alternatively, the maximum brightness segmentation threshold among multiple brightness segmentation thresholds can be determined as the facial oiliness threshold. .
[0190] S202: Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the fourth target brightness value of a preset number of pixels in each region.
[0191] In this embodiment, the fourth target brightness value can be the lower brightness value in the cross-polarized light brightness map of each region, which is used to represent the dark situation. According to the distribution of brightness values of each pixel in the cross-polarized light brightness map of each region, the number of pixels with the same brightness value is determined. The brightness value with a preset number of pixels is determined as the fourth target brightness value. The fourth target brightness value is used as the dark segmentation threshold of each region, wherein the fourth target brightness value is less than the first target brightness value.
[0192] S203: Calculate the facial dullness brightness threshold based on the fourth target brightness values of multiple regions.
[0193] In this embodiment, the average value of the fourth target brightness value (i.e., multiple dullness segmentation thresholds) of multiple regions is calculated, and the average value is used as the facial dullness brightness threshold. Alternatively, the minimum darkening segmentation threshold among multiple darkening segmentation thresholds can be determined as the facial darkening brightness threshold. .
[0194] In some embodiments, such as Figure 3 As shown, based on the highest point Mmax in the brightness distribution histogram of each region, the point to the left of the highest point Mmax with a vertical coordinate Mmin has a corresponding horizontal coordinate Hmin. The minimum value of Hmin in each region is used as the brightness threshold for facial dullness. .
[0195] For example, Mmin=β*Mmax, where β is an adjustable parameter with a value range of [0,1]. The best visualization effect of facial oiliness is achieved when β is 0.1.
[0196] S204: Based on the facial shine threshold, the brightness map of the parallel polarized light image of the face to be evaluated is segmented to generate a facial shine map.
[0197] In this embodiment, the parallel polarized light image of the face to be evaluated... The pixel values are converted for brightness to obtain a facial parallel polarized light brightness map, and then the facial oiliness threshold is used. The brightness map of the parallel polarized light on the face is segmented to generate a gloss map of the face. The brightness segmentation method can be referred to in S103 above, and will not be repeated here.
[0198] In some embodiments, to better present the glossy effect, a parallel polarized light image can be used as a starting point. Extract the skin area, filter out facial features such as eyebrows, eyes, and mouth, and perform brightness segmentation only on the skin area to generate a facial oiliness map that includes the skin area.
[0199] S205: Convert the facial shine map into a facial color map based on the facial shine threshold, facial dullness brightness threshold, and multiple preset color values.
[0200] In this embodiment, the facial shine threshold is used. and facial dullness brightness threshold As the brightness interpolation point corresponding to the brightness value of the first target pixel in the facial shine image, it is set with respect to the facial shine threshold. and facial dullness brightness threshold Using the corresponding RGB color values as color interpolation points, the brightness interpolation points for each pixel in the facial oiliness image are determined based on their brightness values. Then, the color interpolation points corresponding to these brightness interpolation points are determined. Finally, the brightness values of each pixel are converted to color values based on the color values of these interpolation points, thus transforming the facial oiliness image into a facial color image. .
[0201] For example, the brightness interpolation point is [0, facial shine threshold]. Facial dullness brightness threshold
[255] , color interpolation points are [C1,C2,C3,C4], if the brightness value is between 0 and the facial shine threshold. Between these points, the brightness interpolation point 0 and the facial shine threshold are... The corresponding color interpolation points are C1 and C2. Based on the RGB colors corresponding to C1 and C2, the brightness value is converted into RGB color.
[0202] S206: Fuse the facial color map and the parallel polarized light image of the face to be evaluated to generate a facial oiliness effect map of the face to be evaluated.
[0203] In this embodiment, based on facial color maps Parallel polarized light images of various regions of the face to be evaluated The corresponding position in the parallel light polarization image Each region corresponds to a facial color map of that region. Weighted fusion is performed to generate a facial oiliness effect image of the face to be evaluated. .
[0204] For example, the fusion formula can be: ρ is a custom weight.
[0205] The skin condition detection method provided in the above embodiments calculates the facial shine threshold and the facial dullness brightness threshold as brightness interpolation points, and sets the color interpolation points corresponding to the brightness interpolation points to convert the facial shine map into a facial color map, so as to fuse the parallel polarized light image and the facial color map, thereby realizing the visualization of facial shine conditions.
[0206] Based on the above method embodiments, this application also provides a skin condition detection device. Please refer to... Figure 10 This is a schematic diagram of the skin condition detection device provided in the embodiments of this application, as shown below. Figure 10 As shown, the device may include:
[0207] The brightness map acquisition module 10 is used to acquire parallel polarized light brightness maps and cross polarized light brightness maps of multiple regions of the face to be evaluated.
[0208] The segmentation threshold calculation module 20 is used to calculate the brightness segmentation threshold corresponding to each region based on the cross-polarized light brightness map of each region.
[0209] The gloss image extraction module 30 is used to extract the gloss image of each region from the parallel polarized light brightness image of each region according to the brightness segmentation threshold corresponding to each region. The gloss image of each region includes: a first target pixel with a pixel value greater than or equal to the brightness segmentation threshold corresponding to each region.
[0210] The gloss evaluation parameter calculation module 40 is used to calculate the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region.
[0211] The highlight evaluation parameter calculation module 50 is used to calculate the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region.
[0212] The reflective state parameter calculation module 60 is used to calculate the reflective state parameters of the face to be evaluated based on the gloss evaluation parameters of multiple regions and the highlight evaluation parameters of multiple regions.
[0213] Optionally, the segmentation threshold calculation module 20 includes:
[0214] The first target brightness value determination unit is used to determine the first target brightness value with the largest number of pixels based on the brightness values of each pixel in the cross-polarized light brightness map of each region.
[0215] The second target brightness value determination unit is used to select N second target brightness values that are greater than the first target brightness value from the cross-polarized light brightness map of each region, starting from the first target brightness value of each region, wherein the N second target brightness values increase sequentially.
[0216] The third target brightness value determination unit is used to select N third target brightness values that are greater than the first second target brightness value from the cross-polarized light brightness map of each region, starting from the first target brightness value, if the average brightness value of N second target brightness values is greater than or equal to the first preset brightness threshold. The N third target brightness values increase sequentially.
[0217] The segmentation threshold calculation unit is used to determine the middle target brightness value among the N third target brightness values as the brightness segmentation threshold for each region if the average brightness value of the N third target brightness values is less than the first preset brightness threshold.
[0218] Optionally, the gloss evaluation parameter calculation module 40 is specifically used to calculate the gloss evaluation parameters of each region in multiple dimensions based on the number of first target pixels in the gloss map of each region and using multiple gloss evaluation algorithms.
[0219] Optional, the gloss assessment parameter calculation module 40 includes:
[0220] The reflective area ratio calculation unit is used to calculate the reflective area ratio of each region based on the number of first target pixels in the gloss map of each region and the number of pixels in the parallel polarized light brightness map of each region.
[0221] Multiple parameters for evaluating glossiness include: percentage of reflective area.
[0222] Optional, the gloss assessment parameter calculation module 40 includes:
[0223] The connected component analysis unit is used to perform connected component analysis on the first target pixel in the gloss map of each region to determine the number of connected components in each region.
[0224] The average size calculation unit for gloss is used to calculate the average size of gloss in each region based on the number of first target pixels in the gloss map of each region and the number of connected components in each region.
[0225] The multi-dimensional parameters for evaluating shine also include: average shine size.
[0226] Optional, the gloss assessment parameter calculation module 40 includes:
[0227] The discreteness calculation unit is used to cluster the first target pixel in the gloss map of each region and determine the discreteness of the first target pixel in the gloss map of each region.
[0228] The gloss distribution range calculation unit is used to calculate the gloss distribution range of each region based on the dispersion and the number of first target pixels in the gloss map of each region;
[0229] The multi-dimensional parameters for evaluating shine also include: the range of shine distribution.
[0230] Optional, the gloss assessment parameter calculation module 40 includes:
[0231] The threshold determination unit is used to determine the number of second target pixels in the first target pixel in the oil gloss map of each region whose brightness value meets the second preset brightness threshold according to the second preset brightness threshold.
[0232] The overexposure parameter calculation unit is used to calculate the overexposure parameter of each region based on the number of second target pixels and the number of first target pixels in the gloss map of each region.
[0233] The multi-dimensional gloss assessment parameters also include: overexposure parameters.
[0234] Optional, the highlight evaluation parameter calculation module 50 includes:
[0235] The maximum brightness value calculation unit is used to calculate the maximum brightness value in the parallel polarized light brightness map of each region based on the brightness value of each pixel in the parallel polarized light brightness map of each region.
[0236] A multi-directional pixel determination unit is used to determine multiple pixels in multiple directions of the parallel polarized light brightness map, with the pixel with the highest brightness value as the center pixel.
[0237] The brightness difference calculation unit is used to calculate the difference in brightness values between adjacent pixels in the center pixel and multiple pixels in multiple directions;
[0238] The highlight evaluation parameter calculation unit is used to determine the highlight evaluation parameters based on the sum of the differences between multiple brightness values.
[0239] Optionally, the device may also include:
[0240] The facial shine threshold calculation module is used to calculate the facial shine threshold based on the brightness segmentation threshold of the cross-polarized light brightness map of multiple regions.
[0241] The fourth target brightness value calculation module is used to determine the fourth target brightness value of a preset number of pixels in each region based on the brightness value of each pixel in the cross-polarized light brightness map of each region.
[0242] The facial dullness brightness threshold calculation module is used to calculate the facial dullness brightness threshold based on the fourth target brightness value of multiple regions.
[0243] The facial oiliness image generation module is used to perform brightness segmentation on the facial parallel polarized light brightness map corresponding to the parallel polarized light image of the face to be evaluated based on the facial oiliness threshold, and generate a facial oiliness image.
[0244] The color conversion module is used to convert a facial oiliness map into a facial color map based on the facial shine threshold, facial dullness brightness threshold, and multiple preset color values.
[0245] The fusion module is used to fuse the facial color map and the parallel polarized light image of the face to be evaluated to generate a facial gloss effect map of the face to be evaluated.
[0246] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0247] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0248] Please refer to Figure 11 This is a schematic diagram of the skin condition detection device provided in the embodiments of this application, such as... Figure 11 As shown, the skin condition detection device 100 includes: a processor 101, a storage medium 102, and a bus.
[0249] Storage medium 102 stores program instructions executable by processor 101. When skin condition detection device 100 is running, processor 101 communicates with storage medium 102 via a bus, and processor 101 executes the program instructions to perform the above-described method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.
[0250] Optionally, the present invention also provides a computer-readable storage medium storing a computer program, which is executed by a processor to perform the above-described method embodiments.
[0251] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0252] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0253] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0254] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0255] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting skin condition, characterized in that, The method includes: Obtain parallel polarized light intensity maps and cross polarized light intensity maps for multiple regions of the face to be evaluated; Based on the cross-polarized light brightness map of each region, calculate the brightness segmentation threshold corresponding to each region; Based on the brightness segmentation threshold corresponding to each region, the gloss map of each region is extracted from the parallel polarized light brightness map of each region, wherein the gloss map of each region includes: a first target pixel with a pixel value greater than or equal to the brightness segmentation threshold corresponding to each region; Calculate the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region; Calculate the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region; The reflectivity parameters of the face to be evaluated are calculated based on the gloss assessment parameters of the multiple regions and the highlight assessment parameters of the multiple regions.
2. The method as described in claim 1, characterized in that, The step of calculating the brightness segmentation threshold for each region based on the cross-polarized light brightness map of each region includes: Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the first target brightness value with the largest number of pixels. Starting from the first target brightness value of each region, N second target brightness values that are greater than the first target brightness value are selected from the cross-polarized light brightness map of each region, wherein the N second target brightness values increase sequentially; If the average number of pixels corresponding to the N second target brightness values is greater than or equal to the first preset threshold, starting from the first second target brightness value, select N third target brightness values that are greater than the first second target brightness value from the cross-polarized light brightness map of each region, wherein the N third target brightness values increase sequentially. If the average number of pixels corresponding to the N third target brightness values is less than a first preset threshold, the middle target brightness value among the N third target brightness values is determined to be the brightness segmentation threshold corresponding to each region.
3. The method as described in claim 1, characterized in that, The step of calculating the gloss evaluation parameters for each region based on the number of first target pixels in the gloss map of each region includes: Based on the number of first target pixels in the gloss map of each region, multiple gloss evaluation algorithms are used to calculate the gloss evaluation parameters of each region in multiple dimensions.
4. The method as described in claim 3, characterized in that, The step involves calculating the gloss evaluation parameters for each region in multiple dimensions using multiple gloss evaluation algorithms, based on the number of first target pixels in the gloss image of each region. These parameters include: Based on the number of first target pixels in the gloss map of each region and the number of pixels in the parallel polarized light brightness map of each region, the reflective area ratio of each region is calculated. The multiple dimensions of gloss assessment parameters include: the percentage of reflective area.
5. The method as described in claim 3, characterized in that, The step involves calculating the gloss evaluation parameters for each region in multiple dimensions using multiple gloss evaluation algorithms, based on the number of first target pixels in the gloss image of each region. These parameters include: Perform connected component analysis on the first target pixel in the gloss map of each region to determine the number of connected components in each region; Calculate the average size of the gloss in each region based on the number of first target pixels in the gloss map of each region and the number of connected components in each region; The multiple dimensions of gloss evaluation parameters also include: average gloss size.
6. The method as described in claim 3, characterized in that, The step involves calculating the gloss evaluation parameters for each region in multiple dimensions using multiple gloss evaluation algorithms, based on the number of first target pixels in the gloss image of each region. These parameters include: Cluster the first target pixel points in the gloss image of each region to determine the dispersion of the first target pixel points in the gloss image of each region; Based on the dispersion and the number of first target pixels in the gloss map of each region, the gloss distribution range of each region is calculated; The multiple dimensions of gloss assessment parameters also include: gloss distribution range.
7. The method as described in claim 3, characterized in that, The step involves calculating the gloss evaluation parameters for each region in multiple dimensions using multiple gloss evaluation algorithms, based on the number of first target pixels in the gloss image of each region. These parameters include: Based on the second preset brightness threshold, determine the number of second target pixels in the glossy image of each region whose brightness values satisfy the second preset brightness threshold; Calculate the overexposure parameters for each region based on the number of the second target pixels and the number of the first target pixels in the gloss map of each region; The multi-dimensional gloss evaluation parameters also include: overexposure parameters.
8. The method as described in claim 1, characterized in that, The step of calculating the highlight evaluation parameters for each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region includes: Based on the brightness values of each pixel in the parallel polarization brightness map of each region, calculate the highest brightness value in the parallel polarization brightness map of each region. Using the pixel with the highest brightness value as the center pixel, multiple pixels are determined in multiple directions of the parallel polarization light brightness map; Calculate the difference in brightness values between adjacent pixels in the center pixel and the multiple pixels in the multiple directions; The highlight evaluation parameters are determined based on the sum of the differences between multiple brightness values.
9. The method as described in claim 1, characterized in that, The method further includes: Calculate the facial shine threshold based on the brightness segmentation threshold of the cross-polarized light brightness map of the multiple regions; Based on the brightness values of each pixel in the cross-polarized light brightness map of each region, determine the fourth target brightness value of a preset number of pixels in each region; Calculate the facial dullness brightness threshold based on the fourth target brightness value of the multiple regions; Based on the facial shine threshold, the brightness map of the parallel polarized light image corresponding to the facial parallel polarized light image of the face to be evaluated is segmented to generate a facial shine map. Based on the facial shine threshold, the facial dullness brightness threshold, and multiple preset color values, the facial shine map is converted into a facial color map; The facial color map and the parallel polarized light image of the face to be evaluated are fused to generate a facial oiliness effect map of the face to be evaluated.
10. A skin condition detection device, characterized in that, The device includes: The brightness map acquisition module is used to acquire parallel polarized light brightness maps and cross polarized light brightness maps of multiple regions of the face to be evaluated; The segmentation threshold calculation module is used to calculate the brightness segmentation threshold corresponding to each region based on the cross-polarized light brightness map of each region. The gloss image extraction module is used to extract the gloss image of each region from the parallel polarized light brightness image of each region according to the brightness segmentation threshold corresponding to each region, wherein the gloss image of each region includes: a first target pixel with a pixel value greater than or equal to the brightness segmentation threshold corresponding to each region; The gloss evaluation parameter calculation module is used to calculate the gloss evaluation parameters of each region based on the number of first target pixels in the gloss image of each region. The highlight evaluation parameter calculation module is used to calculate the highlight evaluation parameters of each region based on the brightness difference between pixels in the parallel polarized light brightness map of each region. The reflective state parameter calculation module is used to calculate the reflective state parameters of the face to be evaluated based on the gloss evaluation parameters of the multiple regions and the highlight evaluation parameters of the multiple regions.