Primary product color number auxiliary selection method, device and equipment
By obtaining the user's face images and extracting skin color characteristics, the CIEDE2000 algorithm is used to select the most matching base product in the base product database, which solves the problem of inaccurate base makeup recommendation under the influence of light, and improves the accuracy of selection and user Experience.
Patent Information
- Application Number
- CN202411287255.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-13
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-09-13
AI Technical Summary
Existing online makeup product selection methods are susceptible to light conditions, resulting in inaccurate recommendation results.
By obtaining the user's face image, performing face detection and facial area division, extracting skin color characteristics, and using the CIEDE2000 algorithm to calculate the color similarity in the pre-established base product database, selecting the most matching base product, and generating the Makeup effect display.
It improves the accuracy and credibility of color assisted selection of base makeup products, and improves user satisfaction and experience.
Smart Images

Figure CN119131866A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cosmetics auxiliary selection, and in particular to a method, device and equipment for auxiliary selection of base makeup product color numbers. Background Art
[0002] At present, in order to facilitate users to select products online, they can use online systems to try out products, such as online simulations of trying on cosmetics and trying on clothes. For the current technical implementation of online makeup trials, the system generally uses image recognition and color analysis technology to continuously optimize the recommendation effect by analyzing historical data through machine learning algorithms. Most of the current methods are based on the matching of standardized color cards. However, the color cards reflect different colors under different lighting. This method is easily affected by lighting conditions, resulting in inaccurate recommendation results. Summary of the invention
[0003] The purpose of this application is to provide a method, device and equipment for assisting in selecting the color number of a foundation product, so as to alleviate the above-mentioned technical problems existing in the prior art.
[0004] In a first aspect, an embodiment of the present application provides a method for assisting in selecting a base makeup product color number, which is applied to a terminal device, and the method includes:
[0005] In response to an auxiliary selection request triggered by a user through a foundation product color recommendation interface, obtaining a user's face image;
[0006] Performing face detection on the face image, and determining a plurality of face regions based on a preset face segmentation rule, and determining skin color features of each face region;
[0007] Based on the skin color characteristics of each facial area, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products;
[0008] Determine a target base makeup product from among the candidate base makeup products, and obtain color characteristics of the target base makeup product;
[0009] A makeup effect is generated based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and the product logo of the target base makeup product and the makeup effect are displayed correspondingly.
[0010] In some possible implementations, the method further includes obtaining the user's desired effect; and selecting one or more foundation products with the best matching color numbers from a pre-established foundation product database as candidate foundation products based on the skin color characteristics of each facial area, including:
[0011] Based on the skin color characteristics of each facial area and the desired effect, one or more foundation products with the best matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0012] In some possible implementations, obtaining the user's expected effect includes:
[0013] Providing an alternative effect selection interface, the alternative effect selection interface including multiple alternative effect options, each alternative effect option correspondingly displays a preview effect;
[0014] In response to a selection operation on a plurality of candidate effect options, an effect corresponding to the selected candidate effect option is determined as a desired effect.
[0015] In some possible implementations, the preview effect is a default effect; or the preview effect is determined based on the overall skin color characteristics of the user's facial image and the skin color adjustment values corresponding to each alternative effect option.
[0016] In some possible implementations, determining the skin color characteristics of each facial region includes:
[0017] Convert the images of each facial region from RGB color space to 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 area are calculated based on the XYZ value of the reference white point;
[0019] Calculate the individual type angle according to the target brightness value, the target red-green value and the target yellow-blue value;
[0020] Calculating a hue angle based on a target red-green hue value and a target yellow-blue hue value of the image of each facial region;
[0021] A skin color feature of each facial region is determined for the facial region image of each facial region based on the individual type angle and the hue angle.
[0022] In some possible implementations, the hue angle is calculated based on target red-green hue values and target yellow-blue hue values of the image of each facial region, including:
[0023] The hue angle HAB° is calculated according to HAB°=arctan(b / a)*180 / π;
[0024] Among them, a is the target red-green value, and b is the target yellow-blue value.
[0025] In some possible implementations, based on the skin color characteristics of each facial area, one or more foundation products with the best matching color numbers are selected from a pre-established foundation product database as candidate foundation products, including:
[0026] Using MatLab to implement the CIEDE2000 algorithm to calculate the similarity between the skin color features of the facial area and the color numbers of the base makeup products in a pre-established base makeup product database;
[0027] Based on the similarity, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0028] In a second aspect, a makeup product color number auxiliary selection device is provided. Applied to a terminal device, the device comprises:
[0029] An acquisition module, configured to acquire a user's face image in response to an auxiliary selection request triggered by the user through a foundation product color recommendation interface;
[0030] An extraction module, used to perform face detection on the face image, and determine a plurality of face regions based on a preset face segmentation rule, and determine a skin color feature of each face region;
[0031] A matching module, for selecting one or more base makeup products with the best matching color numbers from a pre-established base makeup product database as candidate base makeup products based on the skin color characteristics of each facial area;
[0032] A determination module is used to determine a target base makeup product from candidate base makeup products and obtain color characteristics of the target base makeup product;
[0033] A generation module is used to generate a makeup effect based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and to display the product logo of the target base makeup product and the makeup effect accordingly.
[0034] In some possible implementations, the matching module is specifically used to:
[0035] Obtain the user's expected effect;
[0036] Based on the skin color characteristics of each facial area and the desired effect, one or more foundation products with the best matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0037] In some possible implementations, the matching module is specifically used to:
[0038] Providing an alternative effect selection interface, the alternative effect selection interface including multiple alternative effect options, each alternative effect option correspondingly displays a preview effect;
[0039] In response to a selection operation on a plurality of candidate effect options, an effect corresponding to the selected candidate effect option is determined as a desired effect.
[0040] In some possible implementations, the preview effect is a default effect; or the preview effect is determined based on the overall skin color characteristics of the user's facial image and the skin color adjustment values corresponding to each alternative effect option.
[0041] In some possible implementations, the extraction module is specifically used to:
[0042] Convert the images of each facial region from RGB color space to 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 area are calculated based on the XYZ value of the reference white point;
[0044] Calculate the individual type angle according to the target brightness value, the target red-green value and the target yellow-blue value;
[0045] Calculating a hue angle based on a target red-green hue value and a target yellow-blue hue value of the image of each facial region;
[0046] A skin color feature of each facial region is determined for the facial region image of each facial region based on the individual type angle and the hue angle.
[0047] In some possible implementations, the extraction module is specifically used to:
[0048] The hue angle HAB° is calculated according to HAB°=arctan(b / a)*180 / π;
[0049] Among them, 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 to:
[0051] Using MatLab to implement the CIEDE2000 algorithm to calculate the similarity between the skin color features of the facial area and the color numbers of the base makeup products in a pre-established base makeup product database;
[0052] Based on the similarity, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0053] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the method for assisting in selecting the color number of a foundation product according to any of the aforementioned embodiments.
[0054] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method for assisting in selecting the color number of a foundation product according to any of the aforementioned implementations.
[0055] The present application provides a method, device and equipment for auxiliary selection of foundation product color numbers. The method obtains a user's face image in response to an auxiliary selection request triggered by the user through a foundation product color number recommendation interface; performs face detection on the face image, and determines multiple facial areas based on preset facial segmentation rules, and determines the skin color characteristics of each facial area; based on the skin color characteristics of each facial area, selects one or more foundation products with the most matching color numbers as alternative foundation products in a pre-established foundation product database; determines a target foundation product from the alternative foundation products, and obtains the color characteristics of the target foundation product; generates a makeup effect based on the color characteristics of the target foundation product and the skin color characteristics of each facial area, and displays the product logo of the target foundation product and the makeup effect accordingly; based on the matching of the precisely extracted skin color characteristics with the similarity of the foundation color number, the accuracy and credibility of the auxiliary selection of foundation product color numbers are improved, thereby improving the user satisfaction and experience of foundation product recommendations. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0057] Figure 1 A flow chart of a base makeup product color number auxiliary selection method provided in an embodiment of the present application;
[0058] Figure 2 A schematic diagram of facial area division provided in an embodiment of the present application;
[0059] Figure 3 A flowchart of a specific base makeup product color number auxiliary selection method provided in an embodiment of the present application;
[0060] Figure 4 A structural diagram of a base makeup product color number auxiliary selection device provided in an embodiment of the present application;
[0061] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0063] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0064] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0065] The present application embodiment provides a method for assisting in selecting the color number of a base makeup product. Figure 1 As shown, applied to a terminal device, the method mainly includes the following steps:
[0066] S110, in response to an auxiliary selection request triggered by the user through a foundation product color recommendation interface, obtaining a user's face image.
[0067] Among them, users can make auxiliary selections of foundation products through terminal devices. The terminal device can be a dedicated device or a personal device such as a mobile phone or tablet computer. The terminal device can be installed with corresponding applications to implement the various steps and functions of this solution.
[0068] The terminal device may provide a makeup product color recommendation interface, which may include an auxiliary selection control, through which an auxiliary selection request may be triggered. The auxiliary selection request may also be triggered by a specific operation, such as double-clicking, a specific sliding track, and the like.
[0069] After the auxiliary selection request is determined, a local face image may be obtained, or a camera device may be called to take a photo to obtain the face image of the current user.
[0070] S120, performing face detection on the face image, and determining a plurality of face regions based on a preset face segmentation rule, and determining a skin color feature of each face region;
[0071] The preset face segmentation rules may include multiple ones. As an example, see Figure 2As shown, the face feature point model can be used to perform face detection on the face image, locate the key points, and intercept the symmetrical area of the cheek as the first area, the facial T zone (i.e., forehead and chin) as the second area, the area around the eyes and lips as the third area, and the rest as the fourth area.
[0072] Determining the skin color characteristics of each facial region may include multiple implementations. As an example, the image of each facial region may be converted 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; the individual type angle is calculated based on the target brightness value, target red-green value, and target yellow-blue value; the hue angle is calculated based on the target red-green value and target yellow-blue value of the image of each facial region; and the skin color characteristics of each facial region are determined for the facial region image of each facial region based on the individual type angle and the hue angle.
[0073] In practical applications, the individual type angle ITA is used to characterize the degree of skin whitening, and the hue angle HAB is used to characterize the degree of skin redness and yellowness.
[0074] Among them, calculating the hue angle based on the target red-green hue values and the target yellow-blue hue values of the image of each facial area can specifically include: calculating the hue angle HAB° according to HAB°=arctan(b / a)*180 / π, wherein a is the target red-green hue value, and b is the target yellow-blue hue value.
[0075] S130, based on the skin color characteristics of each facial area, select one or more foundation products with the best matching color numbers from a pre-established foundation product database as candidate foundation products.
[0076] It can collect various liquid foundation products and record the color information of each product, including natural, fair and dark tones, and establish a base makeup product information database.
[0077] As an example, the similarity between the skin color feature and each color number in the database may be determined, and one or more most similar foundation products may be selected as candidate foundation products.
[0078] As another example, the user's desired effect may be obtained; based on the skin color characteristics of each facial area and the desired effect, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0079] Among them, an alternative effect selection interface can be provided, which includes multiple alternative effect options, each alternative effect option corresponding to a preview effect; in response to a selection operation among the multiple alternative effect options, an effect corresponding to the selected alternative effect option is determined as the expected effect.
[0080] In some embodiments, the preview effect is a default effect; or the preview effect is determined based on the overall skin color characteristics of the user's facial image and the skin color adjustment values corresponding to each alternative effect option.
[0081] In some embodiments, a 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 and the color numbers in the database can be determined, and one or more most similar foundation products can be selected as alternative foundation products.
[0082] In order to build a more sophisticated foundation product selection system, by collecting and analyzing the user's skin color data, skin quality information and historical purchase records, the system can automatically learn and predict the user's foundation preferences, thereby providing users with more personalized product recommendations.
[0083] This solution can also be an interactive makeup trial platform. Users only need to upload their own photos, and the system can use advanced image processing technology to simulate the effects of different makeup products on their faces in real time. This intuitive and immediate feedback will greatly enhance the user's shopping experience and help them easily find the makeup products that best suit them.
[0084] To further enhance the user experience, customized skin color analysis services can also be provided. Using high-precision skin color detection technology, the system can accurately analyze the skin color characteristics of different areas of the user's face and recommend the most suitable foundation color accordingly. At the same time, the database will be updated regularly to ensure that the recommended products are always consistent with market trends.
[0085] In some embodiments, MatLab can be used to implement the CIEDE2000 algorithm to calculate the similarity between the skin color features of the facial area and the color numbers of foundation products in a pre-established foundation product database; based on the similarity, one or more foundation products with the most matching color numbers are selected in the pre-established foundation product database as alternative foundation products.
[0086] S140, determining a target base makeup product from the candidate base makeup products, and obtaining a color feature of the target base makeup product;
[0087] If there are multiple candidate base makeup products, the user can select one or more as target base makeup products. The color characteristics of the target base makeup products can be obtained from a pre-established base makeup product database.
[0088] S150, generating a makeup effect based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and displaying the product logo of the target base makeup product and the makeup effect accordingly.
[0089] The partial least squares method can be used to predict the makeup effect after superimposing the skin color features extracted from various parts of the face with the color features of the target foundation product.
[0090] The makeup effect prediction model established by partial least squares method may include the following steps 2-1 to 2-6 during implementation:
[0091] Step 2-1, constructing a first variable matrix based on makeup influencing factors; wherein the makeup influencing factors include skin color brightness, skin color redness, and skin color yellowness before makeup.
[0092] Step 2-2, determining a second variable matrix using the after-makeup individual type angle ITA value and the after-makeup hue angle HAB value.
[0093] Step 2-3, sequentially extracting the target component pairs corresponding to the first variable matrix and the second variable matrix; wherein the target component pairs are multiple groups;
[0094] Step 2-4, calculating the score vector of the target component pair, and calculating the correlation degree of the target component pair based on the inner product of the score vector; wherein the correlation degree satisfies a preset correlation threshold;
[0095] Step 2-5, establishing a regression model of the relative score vector of the first variable and the second variable, and determining the regression coefficient;
[0096] Step 2-6, constructing a least squares estimate based on the least squares estimate of the regression coefficient to obtain a makeup effect prediction model based on the individual type angle ITA and the hue angle HAB. Specifically, constructing a partial least squares equation based on the least squares estimate of the regression coefficient to obtain a makeup effect prediction model based on the individual type angle ITA and the hue angle HAB includes:
[0097] The partial least squares equation constructed based on the least squares estimation of the regression coefficient is:
[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, and the partial least squares equations related to multiple components are determined to obtain a makeup effect prediction model based on the individual type angle ITA and the hue angle HAB.
[0100] Figure 3 A flowchart of a specific method for assisting in selecting the color number of a base makeup product is shown. When the method is implemented, the following steps may be included:
[0101] Step 1: Recruit volunteers and collect image data. Before shooting, the volunteers need to keep their faces clean, and use VISIA-CR to collect facial images under standard light source 2 to build a face dataset for skin color detection;
[0102] Step 2: Record the color number and texture of the foundation, including natural, fair and dark shades. Collect the Lab value, ITA value, hue, chroma and brightness of the sample.
[0103] Step 3: Use the facial feature point model to perform face detection based on the face image, locate key points, and intercept the symmetrical area of the forehead and cheek as the first area, the area around the eyes and lips as the second area, and the rest as the third area. And label the partitioned data accordingly;
[0104] Step 4: Preprocess the data sets in 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, to facilitate reasonable weight distribution.
[0105] Step 5: Extract skin color from each area image.
[0106] Among them, the facial image is converted from the RGB color space to the LAB color space, and a specific color analysis calculation is performed based on the L, a, and b values in the LAB color space to extract the 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 achieved by calling the cv2.cvtColor() function in the OpenCV library and specifying the conversion mode as cv2.COLOR_RGB2LAB.
[0109] 2. Calculation in LAB color space:
[0110] In the LAB color space, the average values of L (brightness), a (redness and greenness), and b (yellowness and blueness) are calculated for each facial region. These values reflect the brightness and color characteristics of each part 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 brightness 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 conversion formula; otherwise, the L value is calculated using the linear conversion 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 a and b values:
[0116] The a and b values are calculated by comparing the ratios of X, Y, and Z relative to the reference white point, where X, Y, and Z are the three primary color components of the color, and 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 ratio of b* and a* relative to L*, and using the inverse tangent function to calculate the angle.
[0121] ITA°={arctan[(L-50) / b]}*180 / π.
[0122] 6. Calculation of HAB value:
[0123] The hue angle HAB° is calculated according to HAB°=arctan(b / a)*180 / π;
[0124] Among them, 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 L value) are actually based on the CIE 1931XYZ color system, and may need to be adjusted according to specific circumstances in actual application.
[0126] Step 6: Use MatLab to implement the CIEDE2000 algorithm to calculate the similarity between the skin color and each color number in the database.
[0127] ① Define a function named ciede2000 that accepts two parameters Lab1 (skin color) and Lab2 (sample) and returns the dE00 value, which is the CIEDE2000 color difference between the two colors.
[0128] ② Extract L, a, and b values from the input Lab1 and Lab2 respectively for subsequent color distance calculation.
[0129] ③Calculate the chromaticity compensation factor G, which is used to adjust the value of the a component to reduce the impact 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 excessive penalties for high-chroma red.
[0130] ④ 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] ⑤ Calculate the brightness difference deltaLPrime, the chromaticity difference deltaCPrime, and the hue difference deltahPrime. Use trigonometric functions to calculate the length of the hue difference deltaHPrime.
[0132] ⑥ Calculate and adjust the brightness LPrime, chroma CPrime and hue hPrime.
[0133] ⑦ Calculate the final CIEDE2000 color difference value ΔE00. Filter the foundation color 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 color and the foundation color. If the ΔE00 value is relatively low, select several closest color numbers.
[0134] Step 7: Predict the effect after superimposing the skin color extracted from each part of the face with the selected foundation color number, and use partial least squares method to establish a predicted makeup effect.
[0135] ① Analyze the factors xi (i.e. makeup influencing factors) that affect the ITA° data after makeup, and organize the data of n makeup influencing factors into an independent variable matrix X (i.e. the first variable matrix). Among them, x includes the brightness (L*), redness (A*), yellowness (B*) of the skin color before makeup, the colorimetric parameters ITA° and hue (HUE) based on the L*a*b* color system, the brightness (L*), redness (A*), yellowness (B*), individual type angle ITA°, and hue (HUE) of the selected samples.
[0136] ② Define the after-makeup ITA value and after-makeup HAB value as the dependent variable Y 1 , Y 2 , through Y 1 and Y 2 Get the second variable matrix.
[0137] Extract the first pair of components u of the two groups of X and Y variables respectively 1 and v1 , so that the correlation is maximized. 1 is the set of independent variables X = [x 1 , ...x m ] T The linear combination of 1 is the set of independent variables Y = [y 1 ,y 2 ] T Linear combinations of
[0138] ③ Set the parameters to determine the maximum number of principal components to 5.
[0139] ④Maximize the covariance matrix. Use the score vector The inner product calculation maximizes the correlation between u1 and v1.
[0140]
[0141] ⑤Use the Lagrange multiplier method to find the unit vector p 1 With r 1 , so that 1 reach the maximum;
[0142]
[0143] ⑥ From the standardized observation data matrices X and Y of the two sets of variables, the score vector of the first pair of components can be calculated.
[0144]
[0145] Establish the regression model of Yi on u1 and the regression model of Xi on u1, assuming that the regression model is:
[0146]
[0147] θ, σ are the parameter vectors in the many-to-one regression model, and A1, B1 are the residual matrices.
[0148] The least squares estimates of the regression coefficients θ and σ are:
[0149]
[0150] Replace A and B with the residuals A1 and B1, and repeat the above steps until the absolute value of the elements in the residual matrix is approximately 0. Each time, a σ 1 ,θ 1 .
[0151] ⑦ Repeat the above steps to get r components
[0152]
[0153] will u1 Substituting the above equations into the partial least squares equation, we get the prediction model of ITA and HAB.
[0154] Based on the above method embodiment, the present application embodiment also provides a base makeup product color number auxiliary selection device, see Figure 4 As shown, the device mainly includes the following parts:
[0155] The acquisition module 401 is used to acquire a user's face image in response to an auxiliary selection request triggered by the user through the foundation product color recommendation interface;
[0156] Extraction module 402, used for performing face detection on the face image, and determining a plurality of face regions based on a preset face segmentation rule, and determining skin color features of each face region;
[0157] A matching module 403 is used to select one or more foundation makeup products with the best matching color numbers from a pre-established foundation makeup product database as candidate foundation makeup products based on the skin color characteristics of each facial area;
[0158] A determination module 404 is used to determine a target base makeup product from candidate base makeup products and obtain color characteristics of the target base makeup product;
[0159] The generating module 405 is used to generate a makeup effect based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and to display the product logo of the target base makeup product and the makeup effect accordingly.
[0160] In some embodiments, the matching module 403 is specifically used to:
[0161] Obtain the user's expected effect;
[0162] Based on the skin color characteristics of each facial area and the desired effect, one or more foundation products with the best matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0163] In some embodiments, the matching module 403 is specifically used to:
[0164] Providing an alternative effect selection interface, the alternative effect selection interface including multiple alternative effect options, each alternative effect option correspondingly displays a preview effect;
[0165] In response to a selection operation on a plurality of candidate effect options, an effect corresponding to the selected candidate effect option is determined as a desired effect.
[0166] In some embodiments, the preview effect is a default effect; or the preview effect is determined based on the overall skin color characteristics of the user's facial image and the skin color adjustment values corresponding to each alternative effect option.
[0167] In some embodiments, the extraction module 402 is specifically used to:
[0168] Convert the images of each facial region from RGB color space to LAB color space;
[0169] In the LAB color space, the target brightness value, target red-green value, and target yellow-blue value corresponding to each facial area are calculated based on the XYZ value of the reference white point;
[0170] Calculate the individual type angle according to the target brightness value, the target red-green value and the target yellow-blue value;
[0171] Calculating a hue angle based on a target red-green hue value and a target yellow-blue hue value of the image of each facial region;
[0172] A skin color feature of each facial region is determined for the facial region image of each facial region based on the individual type angle and the hue angle.
[0173] In some embodiments, the extraction module 402 is specifically used to:
[0174] The hue angle HAB° is calculated according to HAB°=arctan(b / a)*180 / π;
[0175] Among them, a is the target red-green value, and b is the target yellow-blue value.
[0176] In some embodiments, the matching module 403 is specifically used to:
[0177] Using MatLab to implement the CIEDE2000 algorithm to calculate the similarity between the skin color features of the facial area and the color numbers of the base makeup products in a pre-established base makeup product database;
[0178] Based on the similarity, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
[0179] The implementation principle and technical effects of the foundation product color number auxiliary selection device provided in the embodiment of the present application are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the embodiment of the foundation product color number auxiliary selection device, reference may be made to the corresponding contents in the aforementioned foundation product color number auxiliary selection method embodiment.
[0180] The present application also provides an electronic device, such as Figure 5As shown, it is a schematic diagram of the structure of the electronic device, wherein the electronic device 100 includes a processor 51 and a memory 50, the memory 50 stores computer executable instructions that can be executed by the processor 51, and the processor 51 executes the computer executable instructions to implement any of the above-mentioned base makeup product color number auxiliary selection methods.
[0181] 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 .
[0182] Among them, the memory 50 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 53 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 52 can 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 an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0183] The processor 51 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 51. The above processor 51 can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor 51 reads the information in the memory and completes the steps of the base makeup product color number auxiliary selection method of the aforementioned embodiment in combination with its hardware.
[0184] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned foundation product color number auxiliary selection method. The specific implementation can be found in the aforementioned method embodiment, which will not be repeated here.
[0185] The computer program product of the method, device and equipment for assisting in selecting the color number of foundation products provided in the embodiments of the present 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 previous method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0186] Unless otherwise specifically stated, the relative steps, numerical expressions and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0187] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0188] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0189] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0190] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for assisting in selecting the color number of a base makeup product, characterized in that: Applied to a terminal device, the method comprises: In response to an auxiliary selection request triggered by a user through a foundation product color recommendation interface, obtaining a user's face image; Performing face detection on the face image, and determining a plurality of face regions based on a preset face segmentation rule, and determining skin color features of each face region; Based on the skin color characteristics of each facial area, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products; Determine a target base makeup product from among the candidate base makeup products, and obtain color characteristics of the target base makeup product; A makeup effect is generated based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and the product logo of the target base makeup product and the makeup effect are displayed accordingly.
2. The method according to claim 1 further comprises: obtaining the user's desired effect; the step of selecting one or more base makeup products with the best matching color numbers from a pre-established base makeup product database as candidate base makeup products based on the skin color characteristics of each facial area comprises: Based on the skin color characteristics of each facial area and the desired effect, one or more foundation products with the best matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
3. The method according to claim 2, characterized in that The obtaining of the user's expected effect includes: Providing an alternative effect selection interface, the alternative effect selection interface including multiple alternative effect options, each alternative effect option correspondingly displays a preview effect; In response to a selection operation on a plurality of candidate effect options, an effect corresponding to the selected candidate effect option is determined as a desired effect.
4. The method according to claim 3, characterized in that The preview effect is a default effect; or the preview effect is determined based on the overall skin color characteristics of the user's facial image and the skin color adjustment values corresponding to each alternative effect option.
5. The method according to claim 1, characterized in that The skin color characteristics that determine each facial area include: Convert the images of each facial region from RGB color space to 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 area are calculated based on the XYZ value of the reference white point; Calculate the individual type angle according to the target brightness value, the target red-green value and the target yellow-blue value; Calculating a hue angle based on a target red-green hue value and a target yellow-blue hue value of the image of each facial region; A skin color feature of each facial region is determined for the facial region image of each facial region based on the individual type angle and the hue angle.
6. The method according to claim 5, characterized in that The hue angle is calculated based on the target red-green hue value and the target yellow-blue hue value of the image for each facial region, including: The hue angle HAB° is calculated according to HAB°=arctan(b / a)*180 / π; Among them, a is the target red-green value, and b is the target yellow-blue value.
7. The method according to claim 1, characterized in that Based on the skin color characteristics of each facial area, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products, including: Using MatLab to implement the CIEDE2000 algorithm to calculate the similarity between the skin color features of the facial area and the color numbers of the base makeup products in a pre-established base makeup product database; Based on the similarity, one or more foundation products with the most matching color numbers are selected from a pre-established foundation product database as candidate foundation products.
8. A makeup product color number auxiliary selection device, characterized in that: Applied to a terminal device, the device comprises: An acquisition module, configured to acquire a user's face image in response to an auxiliary selection request triggered by the user through a foundation product color recommendation interface; An extraction module, used to perform face detection on the face image, and determine a plurality of face regions based on a preset face segmentation rule, and determine a skin color feature of each face region; A matching module, for selecting one or more base makeup products with the best matching color numbers from a pre-established base makeup product database as candidate base makeup products based on the skin color characteristics of each facial area; A determination module is used to determine a target base makeup product from candidate base makeup products and obtain color characteristics of the target base makeup product; A generation module is used to generate a makeup effect based on the color characteristics of the target base makeup product and the skin color characteristics of each facial area, and to display the product logo of the target base makeup product and the makeup effect accordingly.
9. An electronic device, characterized in that: It comprises a processor and a memory, wherein 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 number auxiliary selection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the method for assisting in selecting the color number of a foundation product according to any one of claims 1 to 7.
Citation Information
Patent Citations
Cosmetic simulation control method and device, computer equipment and storage medium
CN109685713A
Cosmetic scheme recommendation method and system
CN115577183A
Matching cosmetics and skin care products based on skin color and skin state scans
CN118215431A
Method for analyzing hair and predicting achievable hair dyeing ending colors
WO2001087245A2
Cited By
Skin color quantification and management method and system, electronic equipment and storage medium
CN120355636A
