Method, device and equipment for assisting in selecting a shade of a foundation product
By segmenting facial regions and analyzing skin tone features in user facial images, and combining this with a database of foundation products, the lighting dependence problem of online foundation shade recommendations has been solved, enabling more accurate foundation product recommendations and personalized services.
Patent Information
- Application Number
- CN202411287255.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Current online methods for recommending foundation product shades are easily affected by lighting conditions, leading to inaccurate recommendations.
By acquiring the user's facial image, face detection and facial region segmentation are performed. Skin tone features are determined using preset facial segmentation rules. Combining the LAB color space and CIEDE2000 algorithm, the most matching base makeup product is selected from the base makeup product database, and a makeup effect display is generated.
It improves the accuracy and reliability of assisting in the selection of base makeup product shades, thereby enhancing user satisfaction and the shopping experience.
Smart Images

Figure CN119131866B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cosmetic auxiliary selection technology, and in particular to a method, apparatus and equipment for auxiliary selection of base makeup product shade. Background Technology
[0002] Currently, to facilitate online product selection, users can try out products through online systems, such as makeup trials and clothing try-ons. For the current technology behind online makeup trials, systems typically utilize image recognition and color analysis techniques, employing machine learning algorithms to analyze historical data and continuously optimize recommendations. Most current methods are based on matching standardized color charts; however, color charts reflect different colors under different lighting conditions, making this method susceptible to the influence of lighting conditions and leading to inaccurate recommendations. Summary of the Invention
[0003] The purpose of this application is to provide a method, apparatus, and device for assisting in the selection of base makeup product shades, so as to alleviate the aforementioned technical problems existing in the prior art.
[0004] In a first aspect, embodiments of this application provide a method for assisting in the selection of base makeup product shades, applied to a terminal device, the method comprising:
[0005] In response to a user's assistive selection request triggered by the foundation product shade recommendation interface, obtain the user's facial image;
[0006] Face detection is performed on the face image, and multiple facial regions are determined based on preset facial segmentation rules, as well as the skin color features of each facial region.
[0007] Based on the skin tone characteristics of each facial region, one or more foundation products with the best matching shade are selected as alternative foundation products from a pre-established foundation product database.
[0008] Identify the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product;
[0009] The makeup effect is generated based on the color characteristics of the target base makeup product and the skin tone characteristics of each facial area, and the product logo of the target base makeup product and the makeup effect are displayed accordingly.
[0010] In some possible implementations, this also includes obtaining the user's desired effect; the step of selecting one or more foundation products with the best matching shade from a pre-established foundation product database as candidate foundation products based on the skin tone characteristics of each facial region includes:
[0011] Based on the skin tone characteristics of each facial area and the desired effect, one or more foundation products with the best matching shade are selected as candidate foundation products from a pre-established foundation product database.
[0012] In some possible implementations, obtaining the user's desired effect includes:
[0013] An alternative effect selection interface is provided, which includes multiple alternative effect options, and each alternative effect option displays a preview effect;
[0014] In response to a selection operation among multiple alternative effect options, the effect corresponding to the selected alternative effect option is determined as the desired effect.
[0015] In some possible implementations, the preview effect is the default effect; or the preview effect is determined based on the total skin tone features of the user's facial image and the skin tone adjustment values corresponding to each alternative effect option.
[0016] In some possible implementations, determining the skin color features of individual facial regions includes:
[0017] Convert the images of each facial region from the RGB color space to the LAB color space;
[0018] In the LAB color space, the target brightness value, target red-green value, and target yellow-blue value corresponding to each facial region are calculated based on the XYZ value of the reference white point.
[0019] Calculate the individual type angle based on the target brightness value, target red-green hue value, and target yellow-blue hue value;
[0020] The hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region.
[0021] Based on the individual type angle and the hue angle, the skin color features of each facial region are determined from the facial region images of each facial region.
[0022] In some possible implementations, the hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region, including:
[0023] according to The hue angle HAB° was calculated.
[0024] Where a is the target red-green value and b is the target yellow-blue value.
[0025] In some possible implementations, based on the skin tone characteristics of each facial region, one or more foundation products with the best matching shade are selected as candidate foundation products from a pre-established foundation product database, including:
[0026] The CIEDE2000 algorithm was implemented using MatLab to calculate the similarity between the skin color features of the facial region and the shades of foundation products in a pre-established foundation product database.
[0027] Based on the similarity, one or more foundation products with the most matching shades are selected as candidate foundation products from a pre-established database of foundation products.
[0028] Secondly, a device for assisting in selecting the shade of a base makeup product is provided. Applied to a terminal device, the device includes:
[0029] The acquisition module is used to acquire the user's facial image in response to the auxiliary selection request triggered by the user through the base makeup product shade recommendation interface;
[0030] The extraction module is used to perform face detection on the face image, and determine multiple facial regions based on preset facial segmentation rules, as well as determine the skin color features of each facial region.
[0031] The matching module is used to select one or more foundation products with the most matching shades from a pre-established foundation product database as candidate foundation products based on the skin tone characteristics of each facial area.
[0032] The determination module is used to identify the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product.
[0033] The generation module is used to generate a makeup effect based on the color features of the target base makeup product and the skin tone features of each facial area, and to display the product identifier of the target base makeup product and the makeup effect accordingly.
[0034] In some possible implementations, the matching module is specifically used for:
[0035] Obtain the user's expected results;
[0036] Based on the skin tone characteristics of each facial area and the desired effect, one or more foundation products with the best matching shade are selected as candidate foundation products from a pre-established foundation product database.
[0037] In some possible implementations, the matching module is specifically used for:
[0038] An alternative effect selection interface is provided, which includes multiple alternative effect options, and each alternative effect option displays a preview effect;
[0039] In response to a selection operation among multiple alternative effect options, the effect corresponding to the selected alternative effect option is determined as the desired effect.
[0040] In some possible implementations, the preview effect is the default effect; or the preview effect is determined based on the total skin tone features of the user's facial image and the skin tone adjustment values corresponding to each alternative effect option.
[0041] In some possible implementations, the extraction module is specifically used for:
[0042] Convert the images of each facial region from the RGB color space to the LAB color space;
[0043] In the LAB color space, the target brightness value, target red-green value, and target yellow-blue value corresponding to each facial region are calculated based on the XYZ value of the reference white point.
[0044] Calculate the individual type angle based on the target brightness value, target red-green hue value, and target yellow-blue hue value;
[0045] The hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region.
[0046] Based on the individual type angle and the hue angle, the skin color features of each facial region are determined from the facial region images of each facial region.
[0047] In some possible implementations, the extraction module is specifically used for:
[0048] according to The hue angle HAB° was calculated.
[0049] Where a is the target red-green value and b is the target yellow-blue value.
[0050] In some possible implementations, the matching module is specifically used for:
[0051] The CIEDE2000 algorithm was implemented using MatLab to calculate the similarity between the skin color features of the facial region and the shades of foundation products in a pre-established foundation product database.
[0052] Based on the similarity, one or more foundation products with the most matching shades are selected as candidate foundation products from a pre-established database of foundation products.
[0053] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the base makeup product color auxiliary selection method of any of the foregoing embodiments.
[0054] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to implement the base makeup product color-assisted selection method of any of the foregoing embodiments.
[0055] The method, apparatus, and device for assisting in the selection of base makeup product shades provided in this application involve the following steps: The method responds to a user's request for assistance triggered by a base makeup product shade recommendation interface by acquiring the user's facial image; performing face detection on the facial image and determining multiple facial regions and their skin tone features based on preset facial segmentation rules; selecting one or more base makeup products with the most matching shades from a pre-established base makeup product database as candidate products based on the skin tone features of each facial region; determining a target base makeup product from the candidate products and acquiring its color features; generating a makeup effect based on the color features of the target base makeup product and the skin tone features of each facial region, and displaying the product identifier of the target base makeup product and the makeup effect accordingly; and improving the accuracy and reliability of the base makeup product shade assistance selection based on the similarity matching between the accurately extracted skin tone features and the foundation shade, thereby enhancing user satisfaction and experience with base makeup product recommendations. Attached Figure Description
[0056] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0057] Figure 1 A flowchart illustrating a method for assisting in the selection of base makeup product shades, provided in an embodiment of this application;
[0058] Figure 2 A schematic diagram of facial region division provided in an embodiment of this application;
[0059] Figure 3 A flowchart illustrating a specific method for assisting in the selection of base makeup product shades, provided in this application embodiment;
[0060] Figure 4 A structural diagram of a base makeup product shade selection aid provided in this application embodiment;
[0061] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0063] 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.
[0064] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0065] This application provides a method for assisting in the selection of base makeup product shades. See also... Figure 1 As shown, this method, applied to terminal devices, mainly includes the following steps:
[0066] S110, in response to an auxiliary selection request triggered by the user through the base makeup product shade recommendation interface, obtains the user's facial image.
[0067] Users can use a terminal device to assist in selecting base makeup products. This terminal device can be a dedicated device or a personal device such as a mobile phone or tablet. The terminal device can have a corresponding application installed to realize the various steps and functions of this solution.
[0068] This terminal device can provide a foundation product shade recommendation interface. This interface may include auxiliary selection controls, which can be used to trigger auxiliary selection requests. Auxiliary selection requests can also be triggered by specific actions, such as double-clicking or specific swipe paths.
[0069] After confirming the assisted selection request, a local facial image can be obtained, or a camera device can be invoked to take a picture and obtain the current user's facial image.
[0070] S120, perform face detection on the face image, and determine multiple face regions based on preset face segmentation rules, and determine the skin color features of each face region.
[0071] Preset facial segmentation rules can include a variety of methods. See [example example] for details. Figure 2As shown, a facial feature point model can be used to detect faces in facial images, locate key points, crop the symmetrical area of the cheek as the first region, the T-zone of the face (i.e., forehead and chin) as the second region, the area around the eyes and lips as the third region, and the rest as the fourth region.
[0072] Determining the skin tone features of each facial region can be achieved in various ways. As an example, the images of each facial region can be converted from the RGB color space to the LAB color space. In the LAB color space, the target luminance value, target red-green hue value, and target yellow-blue hue value corresponding to each facial region are calculated based on the XYZ values of a reference white point. An individual type angle is calculated based on these values. A hue angle is calculated based on the target red-green hue value and target yellow-blue hue value of each facial region image. The skin tone features of each facial region are then determined based on the individual type angle and the hue angle.
[0073] In practical applications, the Individual Type Angle (ITA) is used to characterize the brightness of the skin, while the Hue Angle (HAB) is used to characterize the redness or yellowness of the skin.
[0074] Specifically, calculating the hue angle based on the target red-green and target yellow-blue values of the image for each facial region can include: according to The hue angle HAB° is calculated, where a is the target red-green hue value and b is the target yellow-blue hue value.
[0075] S130 selects one or more foundation products with the most matching shade from a pre-established foundation product database based on the skin tone characteristics of each facial area.
[0076] It can collect information on various foundation products and record the shade information for each product, including natural, fair, and dark shades, and build a database of base makeup product information.
[0077] As an example, one can determine the similarity between skin tone features and various shades in the database, and select one or more of the most similar foundation products as candidate foundation products.
[0078] As another example, the user's desired effect can be obtained; based on the skin tone characteristics of each facial area and the desired effect, one or more foundation products with the best matching shade can be selected as alternative foundation products from a pre-established foundation product database.
[0079] The interface can provide an alternative effect selection interface, which includes multiple alternative effect options, each of which displays a preview effect; in response to the selection operation among the multiple alternative effect options, the effect corresponding to the selected alternative effect option is determined as the desired effect.
[0080] In some embodiments, the preview effect is the default effect; or the preview effect is determined based on the total skin tone features of the user's facial image and the skin tone adjustment values corresponding to each alternative effect option.
[0081] In some embodiments, the skin tone adjustment value can be determined based on the effect, and the similarity between the skin tone feature and the skin tone adjustment value after superposition and each color number in the database can be determined. One or more of the most similar base makeup products can be selected as candidate base makeup products.
[0082] To build a more sophisticated base makeup product selection system, the system can automatically learn and predict users' base makeup preferences by collecting and analyzing their skin tone data, skin type information, and historical purchase records, thereby providing users with more personalized product recommendations.
[0083] This solution can also be an interactive makeup try-on platform. Users simply upload their photos, and the system uses advanced image processing technology to simulate the effects of different foundation products on their face in real time. This intuitive and instant feedback will greatly enhance the user's shopping experience, helping them easily find the foundation products that best suit them.
[0084] To further enhance the user experience, customized skin tone analysis services are also available. Utilizing high-precision skin tone detection technology, the system can accurately analyze the skin tone characteristics of different areas of the user's face and recommend the most suitable foundation shade accordingly. Furthermore, the database will be updated regularly to ensure that the recommended products remain aligned with market trends.
[0085] In some embodiments, the CIEDE2000 algorithm can be implemented in MatLab to calculate the similarity between the skin tone features of the facial region and the shades of foundation products in a pre-established foundation product database; based on the similarity, one or more foundation products with the most matching shades are selected as candidate foundation products from the pre-established foundation product database.
[0086] S140, Identify the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product;
[0087] If there are multiple foundation products to choose from, users can select one or more as their target foundation product. The color characteristics of the target foundation product can be obtained from a pre-established foundation product database.
[0088] S150, based on the color characteristics of the target base makeup product and the skin tone characteristics of each facial area, generate a makeup effect and display the product logo of the target base makeup product and the makeup effect accordingly.
[0089] To predict the effect of superimposing the skin color features extracted from various parts of the face with the color features of the target base makeup product, partial least squares method can be used to establish a predicted makeup effect.
[0090] The above-mentioned makeup effect prediction model established by partial least squares method may include the following steps 2-1 to 2-6 in its specific implementation:
[0091] Step 2-1: Construct the first variable matrix based on the makeup influencing factors; where the makeup influencing factors include skin brightness, skin redness, and skin yellowness before makeup application.
[0092] Step 2-2: Determine the second variable matrix by combining the individual type angle (ITA) and hue angle (HAB) values after makeup.
[0093] Steps 2-3: Extract the target component pairs corresponding to the first variable matrix and the second variable matrix in sequence; where there are multiple target component pairs.
[0094] Steps 2-4: Calculate the score vector of the target component pair, and calculate the correlation degree of the target component pair based on the inner product of the score vectors; wherein, the correlation degree satisfies the preset correlation threshold.
[0095] Steps 2-5: Establish a regression model for the relative score vectors of the first and second variables, and determine the regression coefficients;
[0096] Steps 2-6 involve constructing a least squares estimate based on the least squares estimation of the regression coefficients, resulting in a makeup effect prediction model based on the Individual Type Angle (ITA) and Hue Angle (HAB). Specifically, a partial least squares equation is constructed based on the least squares estimation of the regression coefficients to obtain the makeup effect prediction model based on the Individual Type Angle (ITA) and Hue Angle (HAB), including:
[0097] The partial least squares equations constructed based on the least squares estimation of the regression coefficients are as follows:
[0098]
[0099] Calculations are performed one by one based on the residual matrix until the absolute value of the elements in the residual matrix is approximately 0. Multiple component-related partial least squares equations are determined, and a makeup effect prediction model based on individual type angle (ITA) and hue angle (HAB) is obtained.
[0100] Figure 3 A flowchart illustrating a specific method for assisting in the selection of base makeup product shades is shown. This method, when implemented, may include the following steps:
[0101] Step 1: Recruit volunteers and collect image data. Volunteers must keep their faces clean before shooting. Facial images are collected using VISIA-CR under standard light source 2 to construct a face dataset for skin color detection.
[0102] Step 2: Record the foundation shade and texture, including natural, fair, and dark shades. Collect the sample's Lab value, ITA value, hue, chroma, and brightness.
[0103] Step 3: Based on the face image, perform face detection using a facial feature point model, locate key points, and extract the symmetrical areas of the forehead and cheeks as the first region, the area around the eyes and lips as the second region, and the rest as the third region. Then, label the partitioned data accordingly.
[0104] Step 4: Perform preprocessing operations on the datasets of the first, second, and third regions, including data cleaning, removing outliers, missing values, or erroneous data, and standardizing the original data, including subtracting the mean and scaling the variance, in order to allocate weights reasonably.
[0105] Step 5: Extract skin color from each region of the image.
[0106] Specifically, facial images are converted from the RGB color space to the LAB color space, and specific color analysis calculations are performed based on the L, a, and b values in the LAB color space to extract skin color features.
[0107] 1. Color space conversion:
[0108] First, the facial image needs to be converted from the RGB color space to the LAB color space. This can be done by calling the cv2.cvtColor() function in the OpenCV library and specifying the conversion mode as cv2.COLOR_RGB2LAB.
[0109] 2. Calculations in the LAB color space:
[0110] In the LAB color space, the average values of L (luminance), a (red-green hue), and b (yellow-blue hue) are calculated for each facial region. These values reflect the brightness and color characteristics of different parts of the image.
[0111] 3. L value calculation:
[0112] For the L value, there are two paths depending on whether the ratio of the original luminance Y to the reference white point Yn is greater than a threshold (0.008856). If it is greater than this threshold, the L value is calculated using the cube root transformation formula; otherwise, the L value is calculated using the linear transformation formula.
[0113] L=116×(Y / Yn)1 / 3-16, when Y / Yn>0.008856;
[0114] L=903.3×(Y / Yn), when Y / Yn≤0.008856.
[0115] 4. Calculation of values a and b:
[0116] The values of a and b are calculated by comparing the ratios of X, Y, and Z relative to the reference white point. Here, X, Y, and Z are the three primary color components, while Xn, Yn, and Zn are the XYZ values corresponding to the reference white point.
[0117] a=500×((X / Xn)1 / 3-(Y / Yn)1 / 3);
[0118] b=200×((Y / Yn)1 / 3-(Z / Zn)1 / 3);
[0119] 5. ITA° calculation:
[0120] ITA° (Individual Typology Angle) is used to measure skin tone. It is determined by calculating the ratios of b* and a* relative to L*, and the angle is calculated using the arctangent function.
[0121] .
[0122] 6. HAB value calculation:
[0123] according to The hue angle HAB° was calculated.
[0124] Where a is the target red-green value and b is the target yellow-blue value.
[0125] Some of the formulas here (such as the calculation of the L value) are actually based on the CIE 1931 XYZ color system, and may need to be adjusted according to specific circumstances in practical applications.
[0126] Step 6: Use MatLab to implement the CIEDE2000 algorithm to calculate the similarity between skin color and various color codes in the database.
[0127] (1) Define a function named CIEDE2000. This function takes two parameters, Lab1 (skin color) and Lab2 (sample), and returns the dE00 value, which is the CIEDE2000 color difference between the two colors.
[0128] (2) Extract the L, a, b values from the input Lab1 and Lab2 respectively, for subsequent color distance calculation.
[0129] (3) Calculate the chromaticity compensation factor G, which is used to adjust the value of the a component to reduce the influence of chromaticity on the overall color difference calculation. The chromaticity compensation factor G is part of the CIEDE2000 formula and is used to adjust the a* component in the CIELab color space to better simulate the human visual system's perception of color differences. Specifically, G is introduced to reduce the excessive penalty for high-chroma red.
[0130] (4) Adjust the a component according to the chromaticity compensation factor G to generate a1Prime and a2Prime. Calculate the adjusted chromaticity C1Prime, C2Prime and hue h1Prime, h2Prime. Use the atan2 function to calculate the angle and convert it from radians to degrees.
[0131] (5) Calculate the luminance difference deltaLPrime, the chromaticity difference deltaCPrime, and the hue difference deltaahPrime. Use trigonometric functions to calculate the length of the hue difference deltaHPrime.
[0132] (6) Calculate and adjust the brightness LPrime, chromaticity CPrime and hue hPrime.
[0133] (7) Calculate the final CIEDE2000 color difference value ΔE00. Select the foundation shade with the smallest color difference. The smaller the ΔE00 value, the closer the two colors are, and the higher the match between the user's skin tone and the foundation shade. If the ΔE00 value is relatively low, select several of the closest shades.
[0134] Step 7: Predict the effect of overlaying the extracted skin tones from different parts of the face with the selected foundation shade, and use partial least squares method to establish the predicted makeup effect.
[0135] (1) Analyze the factors that affect ITA° data after makeup application. i (That is, the makeup influencing factors), organize the data of the n makeup influencing factors into an independent variable matrix X (that is, the first variable matrix). Where x includes the skin brightness (L*), redness (A*), yellowness (B*) of the skin before makeup, the colorimetric parameter ITA° based on the L*a*b* color system, hue (HUE), the brightness (L*), redness (A*), yellowness (B*) of the selected sample, individual type angle ITA°, and hue (HUE).
[0136] (2) Define the ITA value and HAB value after makeup as dependent variables Y1 and Y2, and obtain the second variable matrix through Y1 and Y2.
[0137] Extract the first pair of components u1 and v1 from the two sets of variables X and Y respectively to maximize the correlation. u1 is the set of independent variables X=[x1,……,x...]. m ]T A linear combination, where v1 is the set of independent variables Y=[y1,y2]. T A linear combination of;
[0138] (3) Set the parameters to determine the maximum number of principal components to 5.
[0139] (4) Maximize the covariance matrix. Use the score vector The inner product calculation maximizes the correlation between u1 and v1.
[0140]
[0141]
[0142] (5) Use the Lagrange multiplier method to find the unit vector. and This maximizes r1;
[0143]
[0144] (6) The score vector of the first pair of components can be calculated from the standardized observation data matrices X and Y of the two sets of variables.
[0145]
[0146] Establish Y i The regression model for u1 and X i For the regression model of u1, the regression model is assumed to be:
[0147]
[0148] These are the parameter vectors in the many-to-one regression model, and A1 and B1 are the residual matrices.
[0149] Regression coefficient The least squares estimate is:
[0150]
[0151] Replace A and B with residuals A1 and B1, and repeat the above steps until the absolute values of the elements in the residual matrix are approximately 0. Each iteration yields a result. .
[0152] (7) Repeat the above steps to obtain r components.
[0153]
[0154] Substituting u1 into the equation yields the partial least squares equation, from which the prediction models for ITA and HAB are derived.
[0155] Based on the above method embodiments, this application also provides a base makeup product shade auxiliary selection device, see [link to relevant documentation]. Figure 4 As shown, the device mainly includes the following parts:
[0156] The acquisition module 401 is used to acquire the user's facial image in response to the auxiliary selection request triggered by the user through the base makeup product shade recommendation interface;
[0157] The extraction module 402 is used to perform face detection on the face image, and determine multiple facial regions based on preset face segmentation rules, as well as determine the skin color features of each facial region.
[0158] The matching module 403 is used to select one or more foundation products with the most matching shades from a pre-established foundation product database as alternative foundation products based on the skin tone characteristics of each facial region.
[0159] The determination module 404 is used to determine the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product;
[0160] The generation module 405 is used to generate a makeup effect based on the color features of the target base makeup product and the skin tone features of each facial area, and to display the product identifier of the target base makeup product and the makeup effect accordingly.
[0161] In some embodiments, the matching module 403 is specifically used for:
[0162] Obtain the user's expected results;
[0163] Based on the skin tone characteristics of each facial area and the desired effect, one or more foundation products with the best matching shade are selected as candidate foundation products from a pre-established foundation product database.
[0164] In some embodiments, the matching module 403 is specifically used for:
[0165] An alternative effect selection interface is provided, which includes multiple alternative effect options, and each alternative effect option displays a preview effect;
[0166] In response to a selection operation among multiple alternative effect options, the effect corresponding to the selected alternative effect option is determined as the desired effect.
[0167] In some embodiments, the preview effect is the default effect; or the preview effect is determined based on the total skin tone features of the user's facial image and the skin tone adjustment values corresponding to each alternative effect option.
[0168] In some embodiments, the extraction module 402 is specifically used for:
[0169] Convert the images of each facial region from the RGB color space to the LAB color space;
[0170] In the LAB color space, the target brightness value, target red-green value, and target yellow-blue value corresponding to each facial region are calculated based on the XYZ value of the reference white point.
[0171] Calculate the individual type angle based on the target brightness value, target red-green hue value, and target yellow-blue hue value;
[0172] The hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region.
[0173] Based on the individual type angle and the hue angle, the skin color features of each facial region are determined from the facial region images of each facial region.
[0174] In some embodiments, the extraction module 402 is specifically used for:
[0175] according to The hue angle HAB° was calculated.
[0176] Where a is the target red-green value and b is the target yellow-blue value.
[0177] In some embodiments, the matching module 403 is specifically used for:
[0178] The CIEDE2000 algorithm was implemented using MatLab to calculate the similarity between the skin color features of the facial region and the shades of foundation products in a pre-established foundation product database.
[0179] Based on the similarity, one or more foundation products with the most matching shades are selected as candidate foundation products from a pre-established database of foundation products.
[0180] The foundation product color selection auxiliary device provided in this application has the same implementation principle and technical effect as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the embodiment of the foundation product color selection auxiliary device can be referred to the corresponding content in the aforementioned foundation product color selection auxiliary method embodiment.
[0181] This application also provides an electronic device, such as... Figure 5 The diagram shows the structure of the electronic device 100, which includes a processor 51 and a memory 50. The memory 50 stores computer-executable instructions that can be executed by the processor 51. The processor 51 executes the computer-executable instructions to implement any of the above-mentioned methods for assisting in the selection of base makeup product shades.
[0182] exist Figure 5 In the illustrated embodiment, the electronic device further includes a bus 52 and a communication interface 53, wherein the processor 51, the communication interface 53, and the memory 50 are connected via the bus 52.
[0183] The memory 50 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 53 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 52 may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 52 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0184] The processor 51 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 51 or by instructions in software form. The processor 51 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory. The processor 51 reads the information in the memory and, in conjunction with its hardware, completes the steps of the base makeup product color-assisted selection method described in the aforementioned embodiment.
[0185] This application also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the aforementioned method for assisting in the selection of base makeup product shades. For specific implementation details, please refer to the foregoing method embodiments, which will not be repeated here.
[0186] The computer program product of the base makeup product color selection auxiliary method, apparatus and device provided in the embodiments of this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0187] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application.
[0188] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. 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.
[0189] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0190] In the description of this application, it should also be noted that, unless otherwise expressly specified and limited, the terms "set up," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0191] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for assisting in the selection of base makeup product shades, characterized in that, Applied to a terminal device, the method includes: In response to a user's assistive selection request triggered by the foundation product shade recommendation interface, obtain the user's facial image; Face detection is performed on the face image, and multiple face regions are determined and weights are assigned based on preset face segmentation rules, as well as the skin color features of each face region are determined; wherein, each face region includes: a first region, a second region, a third region and a fourth region, the symmetrical area of the cheek is the first region, the T-zone of the face is the second region, the area around the eyes and lips is the third region, and the rest is the fourth region. The system obtains the user's desired effect and, based on the skin tone features of each facial region and the desired effect, selects one or more foundation products with the best matching shade from a pre-established foundation product database as candidate foundation products. The shade matching degree is determined based on brightness difference, color difference, and hue difference. A candidate effect selection interface is provided, including multiple candidate effect options, each with a corresponding preview effect. In response to a selection operation among the multiple candidate effect options, the effect corresponding to the selected candidate effect option is determined as the desired effect. The preview effect is determined based on the user's total skin tone features in their facial image and the skin tone adjustment values corresponding to each candidate effect option. Identify the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product; Based on the color features of the target base makeup product and the skin color features of each facial area, a makeup effect prediction model is used to generate a makeup effect, and the product identifier of the target base makeup product and the makeup effect are displayed accordingly. The makeup effect prediction model is established using partial least squares method, including: A first variable matrix is constructed based on makeup influencing factors; wherein, the makeup influencing factors include skin brightness, skin redness and yellowness before makeup application, as well as ITA value and HUE value, and the brightness, redness and yellowness, as well as ITA value and HUE value of the selected base makeup sample; The second variable matrix was determined based on the post-makeup ITA and post-makeup HAB values; Extract the target component pairs corresponding to the first variable matrix and the second variable matrix in sequence; there are multiple sets of target component pairs. Calculate the score vector of the target component pair, calculate the correlation of the target component pair based on the inner product of the score vectors, and maximize the correlation of the target component pair by maximizing the covariance matrix; Establish a regression model of the first variable matrix and the second variable matrix relative to the score vector, and determine the regression coefficients; Based on the least squares estimation of the regression coefficients, a partial least squares equation is constructed to obtain a makeup effect prediction model based on ITA and HAB values. Specifically, a regression model is established for the first and second variables relative to the score vector, and the regression coefficients are determined. A partial least squares equation is constructed based on the least squares estimate of the regression coefficients to obtain a makeup effect prediction model based on ITA and HAB values, including: Establish the dependent variable Y in the second variable matrix i For the set of independent variables The regression model and the independent variable X in the first variable matrix i For the set of independent variables Regression model: These are the regression coefficients in a pairwise regression model. , It is a residual array; Based on regression coefficients The partial least squares equation is: Using the residual matrix , Replace A and B, and repeat the above steps until the absolute values of the elements in the residual matrix are approximately 0. Each iteration yields a pair of regression coefficients. ; Repeat the above steps to obtain One component; Will Substituting these values yields the partial least squares equation, which leads to a makeup effect prediction model based on ITA and HAB values. Specifically, based on the skin tone characteristics of each facial region and the desired effect, one or more foundation products with the best matching shade are selected as candidate foundation products from a pre-established foundation product database, including: Based on the desired effect, a skin tone adjustment value is determined. After the skin tone features are superimposed with the skin tone adjustment value, the CIEDE2000 algorithm is implemented in MatLab to calculate the similarity with each shade in the base makeup product database. Based on the similarity, one or more base makeup products with the most matching shades are selected from the pre-established base makeup product database as candidate base makeup products.
2. The method according to claim 1, characterized in that, Determining the skin color characteristics of each facial region includes: Convert the images of each facial region from the RGB color space to the LAB color space; In the LAB color space, the target brightness value, target red-green value, and target yellow-blue value corresponding to each facial region are calculated based on the XYZ value of the reference white point. Calculate the individual type angle based on the target brightness value, target red-green hue value, and target yellow-blue hue value; The hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region. Based on the individual type angle and the hue angle, the skin color features of each facial region are determined from the facial region images of each facial region.
3. The method according to claim 2, characterized in that, The hue angle is calculated based on the target red-green and target yellow-blue values of the image for each facial region, including: according to The hue angle HAB° was calculated. Where a is the target red-green value and b is the target yellow-blue value.
4. A device for assisting in selecting the shade of a base makeup product, characterized in that, Applied to a terminal device, the device includes: The acquisition module is used to acquire the user's facial image in response to the auxiliary selection request triggered by the user through the base makeup product shade recommendation interface; The extraction module is used to perform face detection on the face image, and determine multiple facial regions and assign weights based on preset facial segmentation rules, as well as determine the skin color features of each facial region; wherein, each facial region includes: a first region, a second region, a third region and a fourth region, the symmetrical area of the cheek is the first region, the T-zone of the face is the second region, the area around the eyes and lips is the third region, and the rest is the fourth region. A matching module is used to obtain the user's desired effect and, based on the skin tone features of each facial region and the desired effect, select one or more foundation products with the most matching shades from a pre-established foundation product database as candidate foundation products; wherein, the shade matching degree is determined based on brightness difference, color difference, and hue difference; and, a candidate effect selection interface is provided, which includes multiple candidate effect options, each of which displays a preview effect; in response to a selection operation among the multiple candidate effect options, the effect corresponding to the selected candidate effect option is determined as the desired effect; the preview effect is determined based on the total skin tone features of the user's facial image and the skin tone adjustment values corresponding to each candidate effect option; The determination module is used to identify the target base makeup product from the candidate base makeup products and obtain the color characteristics of the target base makeup product. The generation module is used to generate a makeup effect based on the color features of the target base makeup product and the skin color features of each facial area using a makeup effect prediction model, and to display the product identifier of the target base makeup product and the corresponding makeup effect. The generation module is further configured to establish the makeup effect prediction model using partial least squares method, including: A first variable matrix is constructed based on makeup influencing factors; wherein, the makeup influencing factors include skin brightness, skin redness and yellowness before makeup application, as well as ITA value and HUE value, and the brightness, redness and yellowness, as well as ITA value and HUE value of the selected base makeup sample; The second variable matrix was determined based on the post-makeup ITA and post-makeup HAB values; Extract the target component pairs corresponding to the first variable matrix and the second variable matrix in sequence; there are multiple sets of target component pairs. Calculate the score vector of the target component pair, calculate the correlation of the target component pair based on the inner product of the score vectors, and maximize the correlation of the target component pair by maximizing the covariance matrix; Establish a regression model of the first variable matrix and the second variable matrix relative to the score vector, and determine the regression coefficients; Based on the least squares estimation of the regression coefficients, a partial least squares equation is constructed to obtain a makeup effect prediction model based on ITA and HAB values. Specifically, a regression model is established for the first and second variables relative to the score vector, and the regression coefficients are determined. A partial least squares equation is constructed based on the least squares estimate of the regression coefficients to obtain a makeup effect prediction model based on ITA and HAB values, including: Establish the dependent variable Y in the second variable matrix i For the set of independent variables The regression model and the independent variable X in the first variable matrix i For the set of independent variables Regression model: These are the regression coefficients in a pairwise regression model. , It is a residual array; Based on regression coefficients The partial least squares equation is: Using the residual matrix , Replace A and B, and repeat the above steps until the absolute values of the elements in the residual matrix are approximately 0. Each iteration yields a pair of regression coefficients. ; Repeat the above steps to obtain One component; Will Substituting these values yields the partial least squares equation, which leads to a makeup effect prediction model based on ITA and HAB values. The matching module is used to determine the skin tone adjustment value based on the desired effect, and after determining the skin tone features and the skin tone adjustment value are superimposed, use MatLab to implement the CIEDE2000 algorithm to calculate the similarity with each color number in the base makeup product database, and select one or more base makeup products with the most matching color number as candidate base makeup products from the pre-established base makeup product database based on the similarity.
5. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the base makeup product shade selection method according to any one of claims 1 to 3.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the base makeup product color-assisted selection method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Cosmetic scheme recommendation method and system
CN115577183A
Method for analyzing hair and predicting achievable hair dyeing ending colors
WO2001087245A2