Systems and methods for creating topical formulations with improved image capture - Patents.com

The method addresses high user interaction time and environmental light interference in cosmetic formulation systems by using a device's optical display to enhance calibration and color accuracy through machine learning, optimizing the image capture process.

JP7539917B2Active Publication Date: 2024-08-26SHISEIDO CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2021559441
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2019-12-20
Filing Date
2020-04-03
Publication Date
2024-08-26
Estimated Expiration
2040-04-03

AI Technical Summary

Technical Problem

Existing methods for capturing user optical data for cosmetic formulations require high user interaction time and suffer from calibration and color accuracy issues due to environmental light interference.

Method used

A method that includes displaying an image of a user's body part on a device's optical display, determining the image's position and lighting environment acceptability, and using machine learning to process the image data for improved color accuracy, employing techniques such as inverse rendering and machine learning models to correct for lighting conditions.

Benefits of technology

Enhances the calibration and optical data collection process, improving color accuracy and reducing user interaction time by using the device's optical display as a controlled light source and applying machine learning to compensate for environmental lighting variations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007539917000008
    Figure 0007539917000008
  • Figure 0007539917000006
    Figure 0007539917000006
  • Figure 0007539917000009
    Figure 0007539917000009
Patent Text Reader

Abstract

A method is described that includes displaying a body part image of a user on an optical display of a device used by a user. The device can include an image sensor, and the body part image can be sensed by the sensor. The method includes determining whether a position of the body part image relative to the sensor is acceptable for enabling recording of the body part image, determining whether a lighting environment associated with the sensor is acceptable for enabling recording of the body part image, recording the image using the sensor to provide a recorded image having image data, processing the recorded image to determine lighting model data associated with the lighting environment, and determining reflectance and color characteristics associated with the body part based on the recorded image and the lighting model data. In one embodiment, the optical display includes a light source, and if the lighting environment is unacceptable for recording, the method instructs the user to modify the lighting environment so that illumination of the body part is less than about 2% of illumination provided by the light source, illuminates the body part with a constant white light using the light source, and positions the illuminated body part relative to the sensor to determine whether recording of the body part image is possible by displaying the body part on the optical display and positioning it from the perspective of the sensor. Processing the image in this case can include direct calculation to determine the lighting model.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001] This application claims the benefit under 35 U.S.C. § 119 of U.S. Provisional Patent Applications Nos. 62 / 831,667, 62 / 859,676, and 62 / 951,970, each filed April 9, 2019, entitled "System and Method For Creation Of Topical Agents With Improved Image Capture," the entire disclosures of which are incorporated herein by reference. [Technical Field]

[0002] The field of the invention relates generally to image analysis and topical agent formulations, and more particularly to systems and methods for determining customized or selected cosmetic formulations based on color facial images using improved image capture techniques. [Background technology]

[0003] For example, there is a need in the art for a method for providing custom or selected topical agents, such as cosmetics, based on a determination of an individual's specific needs using advanced image analysis technology. Accordingly, systems and methods have been developed that address these issues and allow users to capture accurate and reproducible color samples using a mobile device. Methods for creating formulations for aesthetic and protective topical agents optimized for a specific user and providing the resulting product to the user have been developed by the applicant herein and are disclosed in U.S. Pat. Nos. 8,933,994, 9,122,918, and 9,122,919 and / or U.S. Patent Application Publication Nos. 2018 / 0189853 and 2018 / 0260871 ("Background Patents"), each of which is incorporated herein by reference in relevant portions. Implementations of these and other systems are currently used in the industry and are available on the market. Companies such as MATCHCo. offer full-stack solutions for manufacturing such agents. The systems and methods disclosed in these patents not only enable the practical manufacture of these aesthetic agents, but also have many advantages in their ability to characterize the characteristics of a given user, use these characteristics to derive or recommend user-specific cosmetic formulations, and provide modified cosmetic formulations based on initial formulations through user interaction and feedback. Thus, new formulations may be specifically formulated, selected, and / or modified based on such systems for individual users.

[0004] Systems such as those described in the background patents disclose techniques that use a device having an image sensor, which may be a handheld device such as a mobile phone, to measure facial regions, capture images, and interactively guide a user through user interaction and processing of the resulting images, resulting in the determination and ultimate production of a custom topical product, such as a cosmetic product. However, the user performance requirements, including user interaction time, associated with such techniques can be relatively high. For example, some previous methods required the continuous collection of data from multiple facial regions to calibrate the device sensor to obtain the most accurate image data. These performance requirements can reduce adoption rates by end users. Therefore, there is a need for an optimized method for the interactive capture of image data.

[0005] There are several existing techniques for capturing user optical data for multiple facial regions simultaneously (i.e., in a single image capture). The simplest way to capture a user's optical image data is for the user to take a self-portrait or "selfie" image of themselves. This image data can be enhanced by machine vision services commonly available in operating systems for handheld devices with cameras and interactive displays. Furthermore, such image data may be augmented with a collection of three-dimensional (3D) surface data. Machine vision services available in operating systems to augment handheld devices with optical systems that record 3D surface data are becoming increasingly common. Furthermore, existing devices commonly provide services for tracking specific regions of a user's face, called facial landmarks. These landmarks can be associated with, mapped to, or used to generate a 3D surface by methods well known to those skilled in the art.

[0006] However, while the use of selfies is known, there remains a need in the art to improve the calibration and optical and camera data collection processes and resulting color accuracy to account for the effects of ambient light sources that can interfere with accurate and calibrated images. Summary of the Invention

[0007] The present invention includes several embodiments aimed at improving the calibration and optical and camera data collection process and the resulting color accuracy, including taking into account the effects of ambient light sources that may interfere with an accurate and calibrated image. Exemplary embodiments of the invention are summarized herein.

[0008] In one embodiment, the present invention provides a method for displaying an image of a body part of a user on an optical display of a device used by the user, the device comprising an image sensor, and the image of the body part of the user being sensed by the sensor; The method includes determining whether a position of a body part image relative to a sensor is acceptable to enable recording of an image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of an image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded image to determine lighting model data associated with the lighting environment; and determining reflectance and color characteristics associated with the user's body part based on the recorded image and the lighting model data.

[0009] In one embodiment of the method, determining whether the position of the body part relative to the sensor is acceptable for recording an image of the body part may include displaying a colored light on the optical display.

[0010] In a further embodiment of the method, determining whether the position of the body part relative to the sensor is acceptable for recording an image of the body part may include displaying an illuminated outline of the body part on the optical display.

[0011] Additionally, the method may include determining whether a position of the body part relative to the sensor is acceptable for recording an image of the body part by activating a tactile or audible indicator on the device.

[0012] In another embodiment of the method, determining whether the lighting environment is acceptable for recording an image of the body part may include displaying colored light on the optical display.

[0013] Further included in a method herein is that determining that the lighting environment is acceptable for recording an image of the body part may include displaying an illuminated outline of the body part.

[0014] In another embodiment of the method, determining that the lighting environment is acceptable for recording an image of the body part may include activating a tactile or audible indicator on the device.

[0015] In this method, determining the lighting model may include measuring exposure data associated with the device, determining data describing a relationship between a light source on the device and an aperture of an image sensor, determining data describing a relationship between the lighting environment and the image sensor, and determining data describing a relationship between the image sensor, the light source, and the surface of the body part.

[0016] The method may also further include determining a customized cosmetic formulation based in part on the reflectance and color properties.

[0017] In the methods herein, various processing of the recorded images can be used for different lighting environments. Exemplary embodiments include: the optical display includes a light source; illumination of the body part by the lighting environment is less than about 2% of illumination provided by the light source; and processing the recorded images to determine the illumination model data can include direct calculation. The optical display may include a light source; illumination of the body part by the lighting environment may be about 2% to 10% of illumination provided by the light source; and processing the recorded images to determine the illumination model data can include performing image filtering. The optical display may include a light source; illumination of the body part by the lighting environment may be about 10% to 25% of illumination provided by the light source; and processing the recorded images to determine the illumination model data can include performing statistical estimation of bilateral symmetry. Further, the optical display may include a light source; illumination of the body part by the lighting environment may be about 25% to 40% of illumination provided by the light source; and processing the recorded images to determine the illumination model data can include using machine learning techniques.

[0018] In a further embodiment, the optical display may include a light source, and if it is determined that the lighting environment associated with the sensor is unacceptable for recording a representation of the body part, then the method includes instructing the user to modify the lighting environment so that illumination of the body part is less than about 2% of illumination provided by the light source; illuminating the body part with a constant white light using the light source; and determining whether the illuminated body part is positioned relative to the sensor to enable recording of an image of the body part by displaying an outline of the user's body part on the optical display to position the body part within a field of view of the sensor. and processing the recorded images to determine the illumination model data may comprise direct calculation.

[0019] The method also includes a system including one or more processors and a non-transitory memory and machine-readable instructions stored in the memory, which when executed by the one or more processors, causes the system to: display an image of a body part of a user on an optical display of a device used by the user, the device including an image sensor, and the image of the body part of the user being sensed by the sensor; and determine whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; The system may include an embodiment that performs operations including determining whether a lighting environment associated with a sensor is acceptable to enable recording of an image of a body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded image to determine lighting model data associated with the lighting environment; and determining reflectance and color characteristics associated with the user's body part based on the recorded image and the lighting model data.

[0020] Also included in this specification is a method including: (a) illuminating a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of the device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device, the representation of the body part including an outline associated with the body part, the representation allowing the user to position the body part within the optical display; (c) recording an image of the body part sensed by the image sensor; (d) recording data describing characteristics of the optical display including the known intensity and color of the illumination light and characteristics of the image sensor including an exposure setting of the image sensor; and (e) determining a surface color of the body part based on data associated with the recorded image of the body part, the data describing the characteristics of the optical display, and the data describing the characteristics of the image sensor.

[0021] In one embodiment of the method, the method further comprises determining a distance from the image sensor to a surface of the body part, the distance being further used to determine a surface color of the body part. In another embodiment, determining the surface color of the body part includes comparing data associated with the recorded image of the body part with data describing characteristics of the optical display and data describing characteristics of the image sensor. The method may further include calibrating the exposure sensitivity of the illumination source and the image sensor using data from the recorded image of the illumination source reflected in a mirror. In such an embodiment, the surface color of the body part may be determined by processing the distance from the image sensor to the surface of the body part, the data associated with the recorded image of the body part, the data describing characteristics of the optical display, and the data describing characteristics of the image sensor using a network of weighting functions.

[0022] Also included herein is a system including one or more processors and non-transitory memory and machine-readable instructions stored in the memory that, when executed by the one or more processors, cause the system to perform operations including: (a) illuminating a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of the device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device, the representation of the body part including an outline associated with the body part, the representation allowing the user to position the body part within the optical display; (c) recording an image of the body part sensed by the image sensor; (d) recording data describing characteristics of the optical display including the known intensity and color of the illumination light and characteristics of the image sensor including an exposure setting of the image sensor; and (e) determining a surface color of the body part based on data associated with the recorded image of the body part, the data describing the characteristics of the optical display, and the data describing the characteristics of the image sensor.

[0023] Also included herein is a method including: displaying an image of a user's body part on an optical display of a device used by the user, the device including an image sensor, the image of the user's body part being sensed by the sensor; recording a first version and a second version of the image of the body part using the sensor to provide an associated recorded high dynamic range image, wherein display illumination on the optical display of the device is set to white to record the first version of the image and display illumination on the optical display of the device is set to black to record the second version of the image; removing at least a portion of the illumination of the second version of the image from the first version of the image to create a third version of the image; processing data associated with the third version of the image to create a three-dimensional model of the body part, the three-dimensional model being associated with a series of vertices, each vertex being associated with a color; correcting the color associated with each of the vertices taking into account a distance from the sensor to the body part and an angle from the sensor to the body part to determine corrected color vertices; and processing the corrected color vertices using a machine learning model to estimate color characteristics of the body part.

[0024] In some embodiments, the method may further include operating the image sensor in a self-portrait mode using the application. The method may further include controlling settings of the device having the image sensor using the application. In one embodiment of the method, the method may further include capturing the first version of the image in a dark indoor lighting environment and illuminating the optical display with white light.

[0025] In some embodiments, the method may further include storing a third version of the image in a face data format. Each vertex may include one or more of a label associated with the vertex's position on the body part, an RGB color obtained from the third version of the image, a depth of the vertex obtained from the image sensor's depth data, a spatial position of the vertex relative to the image sensor's viewpoint, and a projected normal position of the vertex relative to the image sensor's viewpoint. In one embodiment of this method, the method may further include a preprocessing step of correcting color based on device type using image data from the device.

[0026] In this method, the machine learning model can include a color correction learning model, and the method further includes correcting for device type while training the complexion color model and including images from different types of devices, including devices with image sensors, as training data for the complexion color model. The training data for use with the machine learning model can be smoothed and filtered before training the machine learning model.

[0027] The method further includes constructing and training the machine learning model using training data from the subject, where the training data may include one or more of survey data, self-reported data from the subject, a reference photograph of the subject along with a color chart, skin color data from the subject measured by a spectrophotometer in at least one facial region used as a ground truth measurement, and facial image data from the user, where the at least one facial region is selected from the wrist, forehead, right cheek, left cheek, right jaw line, left jaw line, and décolleté.

[0028] The training data in the method, which is skin color data from at least one facial region used for ground truth measurement, may be combined into a single CIELAB color using a component median method, and the single CIELAB color for each facial region may be used as an input to a machine learning model, and the output of the machine learning model may be a uniform color of a cosmetic product for the face.

[0029] Alternatively, the training data, which is skin color data from at least one facial region used for ground truth measurement in the method, may be combined using a composite method in which the skin color data from at least one region is linearly weighted across at least one facial region to determine which of the at least one region best matches a single CIELAB value for skin color in the ground truth dataset. In this embodiment, in the machine learning model, the CIELAB vector for each of the at least one facial region is the model's input, and the ground truth color CIELAB single vector is the model's output. The linear weighting may be calculated as a result of a normalized multivariate linear regression. The machine learning model may include a ground truth dataset having ground truth data captured in summer and ground truth data captured in winter. [Brief explanation of the drawings]

[0030] The foregoing summary, as well as the following detailed description of preferred embodiments of the present invention, will be better understood when read in conjunction with the accompanying drawings. For the purpose of illustrating the invention, there are shown in the drawings embodiments that are presently preferred. It should be understood, however, that the invention is not limited to the precise arrangements and instrumentalities shown. In the drawings, like reference characters generally refer to the same parts throughout the different views. Moreover, the drawings are not necessarily to scale, emphasis instead generally being placed upon illustrating the principles of the invention.

[0031] [Figure 1] FIG. 10 illustrates a rendering of detected facial landmarks. [Figure 2] FIG. 1 illustrates an exemplary optical display that combines line indication and illumination. [Figure 3] FIG. 10 illustrates an exemplary optical display with feedback to the user indicating poor user positioning during a self-portrait scan. [Figure 4] FIG. 10 illustrates a depth map of a face region. [Figure 5]FIG. 1 illustrates a rendering of the geometry of a face region derived from facial landmark detection. [Figure 6] FIG. 1 illustrates subdivision geometry from a geometry frame with depth sampling. [Figure 7] FIG. 10 illustrates a sample plane of a face region that can be used in an illumination model. [Figure 8A] 3 is a flowchart of exemplary method steps for using the optimized image capture techniques of the present invention. [Figure 8C] 3 is a flowchart of exemplary method steps for using the optimized image capture techniques of the present invention. [Figure 8B] 1 is a high-level exemplary system architecture that may be used in connection with embodiments of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0032] The following describes embodiments of the present invention, and with respect to the underlying systems and methods, the disclosures of background patents are incorporated by reference, in relevant part, to define prior systems and methods useful for use in the present invention.

[0033] The invention and its embodiments described herein provide an optical display (such as an illuminated liquid crystal display) for providing feedback to a user while also serving as a means to illuminate the user with a known amount of light to measure the complexion of the facial region. Thus, in addition to facial landmark tracking and facial surface reconstruction, embodiments provide a form of controlled illumination for building a model of a unique lighting environment for use in parallel optical data capture (i.e., several forms of optical data can be captured at once). As used herein, the term "illumination model," or reference to modeling a lighting environment, refers to a mathematical model of the physical propagation of light provided by an illumination source, its interaction with physical surfaces, and its subsequent perception by an optical system. Such a model can be reduced to practical use as data and code and used to provide information about the image data.

[0034] Additionally, the captured data and constructed lighting models can be used herein to train a machine learning system. Additionally, the real-time captured data, constructed lighting models can be processed by the trained machine learning system to provide detailed complexion data (i.e., CIE l*a*b*, CIELAB colors), complexion feature data (e.g., wrinkles, freckles, acne, birthmarks), and provide manufacturing instructions for interactive creation, modification, and manufacturing of custom topicals.

[0035] The embodiments of the invention disclosed herein also enable parallel collection of light reflectance data from multiple facial regions of a user using optimized techniques, as described in more detail herein.

[0036] By way of background, accurate recording of color (i.e., measuring and storing data) using a sensor / camera in an optical device to record an image requires that the physical properties of the sensor, lighting, and physical environment be controlled, known, or modeled.

[0037] As used herein, optical data refers to data captured by a sensor and processed by an optical system of lenses to focus a real image onto an array of light-sensing means, such as a charge-coupled device (CCD). The output of the optical system is an image composed of color or grayscale channels. Optical data can include other data captured by optical systems, including cameras, that use other sensing methods. For example, depth data can be sensed using optical systems that use multiple cameras and timed or structured light output, such as those used in time-of-flight sensors and depth systems that use structured light.

[0038] The physical characteristics of the sensor are determined by reading the optical stream (e.g., optical data that may include color images, depth data represented in an image array, and camera settings represented, for example, in Exchangeable Image File Format (EXIF) or Tag Image File Format (TIFF) format) or data embedded in the associated hardware via the operating system. The embedded data may include data in a data stream (e.g., a serial stream of data available to an application programming interface (API) within the device's operating system (OS)) primarily consisting of raw or compressed image data that includes additional information about the data stream. The embedded data may include, but is not limited to, the exposure time used for image capture, the aperture of the lens system used for image capture, the sensitivity (ISO) of the image recording device used for image capture, the location of the image capture in GPS coordinates, and the make and model of the imaging device.

[0039] Illumination, as used herein, refers to sources of visible light that can include local area sources (such as lamps), diffuse area sources (such as light panels), and long distance sources (such as light from the sun and moon).

[0040] As used herein, physical environment refers to an indoor space (such as a room in a house or the interior of a car or vehicle) or an outdoor space, including the color and reflectance of surfaces proximate to the activity being performed in connection with image capture.

[0041] As described more fully herein, the relationship between the sensor, light, and target surface reflectance can be sensed and modeled using data provided by the device / camera's 3D sensing capabilities. Alternatively, the relationship can be sensed and modeled using techniques that recognize facial landmarks and fit these landmarks to the user's image (e.g., geometric data fitting techniques using mathematical methods). Such techniques can be provided by the device's operating system's computer vision algorithms or other available sources, including open source projects such as STASM, OpenCV, or industry APIs such as Apple's ARKit or Google's Vision API. Lighting and user interaction can be controlled using the device's optical display, as described more fully herein.

[0042] The embedded data (i.e., ISO, shutter time, and aperture) that is the exposure data of the light sensor can be obtained in several ways. In one exemplary embodiment, the exposure data embedded in the camera data stream is monitored to determine the sensor's exposure value. In another embodiment, the system sets the camera's shutter timing and ISO sensitivity to a particular setting. In either case, the amount of light in the scene can be measured using the exposure data.

[0043] The relationship between the light source (e.g., a "flash," or illumination from an optical display while taking a self-portrait / selfie) and the camera (i.e., their geometric relationship / placement (6 degrees of freedom), position (xyz), and orientation (yaw, pitch, rotation or spin about an axis) relative to one another) can be determined by measuring the relative position and orientation of the light source and the aperture of the camera system. This data may be measured and stored in a data source for later use.

[0044] The relationship between the ambient light source and the camera (i.e., the same geometric relationship as before) also needs to be determined and may vary depending on the local illumination (lighting environment) and its corresponding radiosity mapping in the physical environment with respect to the camera aperture. For dim / dark indoor situations, determining the relationship between the ambient light's location, orientation, and subsequent contribution to the camera may be as simple as detecting when the exposure information in the embedded image data indicates that the intensity of such additional light is small. In situations with low ambient light, direct calculation of measured surface color can be simplified. A low-light environment is, for example, one in which the total contribution of ambient or other ambient lighting sources is less than approximately 2% of the human-perceivable luminance or chromatic variance as measured by the CIELAB colors found for surface reflectances, which are designed to be an approximation of human perception of luminance and color using the standard observer model.

[0045] Such a direct calculation can be performed by solving the radiosity equations, which allow the skin color to be resolved as a physical system, given that the relative positions of the camera, skin surface, and light are known, the amount of light is known (i.e., there are no other light sources than the display), and the camera exposure is known.

[0046] A dark indoor environment simplifies the overall process of solving the illumination model (i.e., the absence of external light removes the problem of solving for unknown variables), but introduces other complications, as we will explain here.

[0047] Many handheld devices include a camera system and the ability to interact with the device using an optical display. Optical displays on handheld devices have continued to improve in resolution, brightness, and color quality over time. The improved brightness and color fidelity of these devices allows them to function as a lighting and display system. This use is well known and is often used by embedded software on the device to function as a "flash" or fill light within the camera code interface. It is also common to show the real-time output of the camera on such an optical display as feedback to the user taking a selfie. However, during such real-time feedback, the display cannot be used as a light source in a dark indoor environment. This is because displaying an image on a display screen of a person in a dark room attenuates the light displayed on the screen. The light displayed on the screen is dim and does not illuminate the subject of the selfie. The lack of lighting in a dark room makes it difficult, if not impossible, to properly position the user's face for a selfie.

[0048] Certain aspects of the present invention help solve this problem. In one embodiment, an optical display is used both for feedback and as a light source in a dark indoor environment, including indicating on the optical display where an image sensor is positioned so that the body part that is the subject of a selfie scan can be automatically detected, for example, using the facial landmark detection techniques described herein, where the optical display illuminates the body part with a greater luminous flux than other light sources. More specifically, the handheld device can be programmed to show the user a representation of themselves as an outline, line drawing, or other sparse rendering with constant / near-constant brightness (such as lighting from a phone's light source display) on a white background (as described in more detail below). Such rendering can be achieved in several ways. In one embodiment, image processing algorithms used to find edges, such as Canny edge detection, can be used to find facial edges. These edges can be shown as bright lines on a white background. This allows the device to give the user positioning feedback while providing near-constant / continuous lighting.

[0049] Next, we describe how to create a line drawing / sparse rendering representation of the user's face. A facial feature detection algorithm (e.g., provided by the machine vision service of the handheld device operating system or a facial feature detection API, as mentioned above) can be used to find key points on the user's face (as shown in Figure 1). The software knows the facial points. New points can be added using their proportional relationship to existing points. The dots are then connected to create a line drawing. These points can be used to construct a pale yellow line drawing on a white background (as shown in Figure 2), allowing the system to provide positioning feedback to the user while providing near-constant illumination. This rendering can indicate the user's position within the frame, allowing the user to properly position their self-portrait. In this way, the optical display can be used as a light source in dark indoor environments and as feedback for positioning and alignment.

[0050] Additionally, in certain embodiments, most applicable when the room has at least some light, renderings may change to display when the user positions the camera at an optimal close position and distance. Optimal user positioning may be determined by several factors. One factor is the user's distance from the camera. For example, at a very close distance, not all necessary user features may be visible, user features may be out of focus, and / or algorithms used to identify facial landmark locations may fail. If the user is too far from the camera, the number of pixels representing the user's features may decrease, potentially impairing data collection. If the user is not centered within the image area, important user features may be cropped. If the user's head is turned to the side, that user orientation may obscure certain features.

[0051] In one embodiment, the rendering may be a line drawing describing the outline of the face when the phone is in position, and an oval surrounding the face when it is not. More specifically, facial feature detection software can detect the location of facial landmarks to determine whether the user's facial features are visible in the frame and acceptable for recording the image. If the facial features are not all visible in the image frame, an oval is rendered.

[0052] In another exemplary embodiment, the rendering may show a thin, straight edge of the face when the phone is in the appropriate position (as shown in FIG. 2 ), and change to a low-contrast, bright video rendering of the user when it is not (as shown in FIG. 3 ). In some embodiments, as described in the following sections, the low ambient and environment light requirements are relaxed, and the entire lighting environment is solved for using additional calculations using Newton's method. However, even in such embodiments, providing user feedback through an optical display using the method described in the previous paragraph is still useful, as direct illumination by the optical display may still be required even in situations where there is more ambient / environmental light.

[0053] In a bright room environment, finding the relationship between the camera and the ambient light source can be more complex to account for greater ambient lighting. One exemplary solution involves capturing multiple images using multiple light sources to adjust the calculated surface color. In this embodiment, an image is recorded by a user using the "selfie" method described above, where the color of the optical display is a known, calibrated white. In one embodiment, the color and brightness of the screen are measured for a given phone model and used as constants. In another embodiment, if the color and brightness of the screen of a given phone model are too variable to be considered constant, the white screen may be calibrated by having the user take a photo of themselves in a mirror. That image can be used to calibrate the phone's white screen; i.e., the white light in the image can be measured and therefore made known. Techniques for implementing this step are described in an example background patent and are further described herein. For example, in one exemplary embodiment, a user is prompted by a series of user interface screens to point the display of their handheld device at a common mirror. The camera / phone exposure settings are set to known values. The user is prompted to press a user interface element to record an image of the screen with the handheld device's front camera. Software on the handheld device uses the recorded image, known exposure settings, the type of handheld device, and the size and recorded luminance of the bright display in the image to calibrate the display's illumination and camera's exposure sensitivity. This calibration information can then be used to improve the calculation of complexion by adjusting the white point for color transformations using the found color to display illumination luminance and camera's exposure characteristics.

[0054] Returning now to one method for accounting for ambient lighting in a bright indoor environment, after a selfie is taken, the color of the optical display light source is changed (e.g., to yellow) and an image is recorded. The color (e.g., yellow-illuminated) image is used to detect areas of the image with illuminated colors of different frequencies (i.e., colors other than yellow). This information is used to remove the ambient light from the first (i.e., white-calibrated) image.

[0055] Describing this embodiment in more detail, software on the handheld device displays a series of distinct background colors on the optical display, and an image is recorded for each distinct light source. One of these light sources may be the strongest yellow, as defined by the sRGB standard (R=1, G=1, B=0). Another light source may be white, as defined by the sRGB standard (R=1, G=1, B=1). The following steps may then be performed by the software to detect and remove ambient light: 1. Non-yellow (blue) regions of the user's image with a yellow light source are found. 2. These regions are processed to remove exposure saturation artifacts, which are achieved by attenuating highly exposed regions. 3. These regions are processed to remove noise, which may be achieved by applying a median image filter. 4. These found regions are used to attenuate the exposure of the user's image with a white light source. 5. The resulting corrected image may be used to refine the subsequent calculation of surface color. Exposure saturation artifacts, in this context, are very bright reflections that appear pure white in the recorded image. These may be detected, located, and removed using a histogram of brightness. In this regard, removing noise can be performed by applying a component median filter of radius 1.0 to the captured image using known techniques.

[0056] In a bright room environment, the handheld device can be programmed to provide one indication that image data may be collected and another indication if it may not. For example, in one embodiment, if the embedded exposure data read from the camera data stream indicates that the ambient light environment is too bright or otherwise unacceptable for the optical display to be the user's primary light source, an indication may be provided (e.g., a red dot, as shown in the upper left corner of the display in FIG. 3), but if the embedded exposure indicates that the ambient light environment is sufficiently dark and the lighting environment is acceptable for the optical display to be the user's primary light source, a different indication may be provided (e.g., a green dot, as shown in the upper left corner of FIG. 2). In other embodiments, the indicator is not visual, but rather audible or tactile.

[0057] To explain this embodiment in more detail, ambient, environmental, and other light sources other than the optical display may be considered "too bright" if their combined contribution exceeds that of the optical display, making it difficult for a software algorithm or method to accurately resolve the surface reflectance of a desired area of ​​a user's complexion. More or less light may be acceptable or tolerable depending on the available technology used to account for such light; i.e., directly solving an illumination model is very sensitive to ambient light, while a machine learning system may be trained to ignore much more ambient light. For example, in embodiments where reflectance is resolved directly (e.g., by inverse rendering techniques not aided by image filtering, additional statistical or machine learning techniques, as described elsewhere herein), the amount of illumination required other than that provided by the optical display may be very small. For example, because this additional illumination directly affects the tolerance of the found complexion measurement, the additional or ambient illumination falling on the complexion surface being measured may be required to be less than approximately 2% of the illumination provided by the optical display (i.e., the amount of ambient light allowed from light sources other than the display as a percentage of the light output from the display when it strikes the skin).

[0058] In another embodiment, where ambient or other additional lighting may be attenuated by the image filtering described above, the additional or ambient lighting impinging on the complexion surface being measured may be required to be less than about 10% of the lighting provided by the optical display.

[0059] In yet another embodiment, which adds statistical techniques to estimate the allowable distribution of reflected light for facial regions and statistical estimation of the symmetry of facial reflectance under known illumination, additional or ambient illumination falling on the measured facial surface may be required to be less than approximately 25% of the illumination provided by the optical display. For example, since the light from the optical display is approximately centered and facial features are being detected, it may be useful to compare the illumination of facial regions using symmetry (assuming humans are approximately symmetrical). If there is a significant difference in the reflected color found between the left and right sides of the face, the difference can be used to detect the ambient light on the bright side of the face.

[0060] In further embodiments that use a machine learning system trained with a wide range of possible complexions, illumination, and ambient inputs to adjust the output of the foregoing embodiments, the additional or ambient illumination impinging on the complexion surface being measured may be required to be less than about 40% of the illumination provided by the optical display. In these embodiments, the required limit on additional or ambient illumination is tested and known, and the amount of additional illumination can be detected by monitoring the output of data embedded in the image data stream.

[0061] The physical relationship between the sensor, light source, and target surface also needs to be determined (the same physical relationship as before). In one embodiment, the optical display (which is the light source in the self-portrait / selfie mode of operation) is in a fixed position relative to the optical sensor / camera. The system can determine the type of device being operated on and use this relationship (i.e., the physical distance and orientation of the display relative to the camera, which does not change for a given phone model) to determine the physical relationship between the sensor / camera and the light source. To determine the relationship between the sensor and light source and the target surface, the various depths of the target surface must be determined. In one embodiment, a handheld device (e.g., a smartphone) has a sensor that measures depth as an array.

[0062] Figure 4 shows the depth output of such an array as a grayscale image. In Figure 4, lighter areas are closer to the camera aperture and darker areas are further away. It will be understood that each shade of gray represents a fixed, calibrated distance from the camera aperture and can therefore be used to construct a 3D surface associated with the optical image. In this way, the relationship between the target surface and the camera is determined. In another embodiment, machine vision techniques are used to find facial landmarks on the image (e.g., using an API, as described above). Figure 1 shows two-dimensional (2D) points output from a handheld device using operating system services for facial feature landmark tracking. The points are connected by lines in the order of the array. Figure 5 shows the points from Figure 1 augmented using a fitting algorithm to construct a graph of nodes and arcs to form a set of connected 3D polytopes. The data structure used to hold this graph is called a winged edge model. The fitting algorithm used in this example uses the found facial landmarks to determine new positions on a pre-created graph, and the positions are found by a system using substitution, scaling, interpolation, and extrapolation. There are known algorithms that can be used to perform such fitting. For example, singular value decomposition can be used to construct uniform projection matrices for a subset of landmarks, and these matrices can be used to map sections of the winged edge model to landmark locations. A depth map such as that shown in FIG. 4 can be used to apply sensed depth locations to the transformed winged edge model. FIG. 6 shows a winged edge model smoothed using selective subdivision. Such subdivision techniques are known. The distance of these surfaces to the camera can then be determined, i.e., the depth of the face region is measured with reference to the camera aperture.

[0063] Further details of the above process will now be described. More specifically, the following description, including the pseudocode referenced below, provides exemplary steps for creating a facial polygon structure from facial landmarks.

[0064] Facial landmarks are read from the output of facial landmark detection software, such as that referenced previously. Figure 1 shows the numbered input vertices. The number associated with each vertex shall be called its index. The facial region polygon is defined by the index. For example, use indices 1...65 in Figure 1. Zero-based counting is used, so in this example, the indices in the code range from 0...64. Additional vertices are used to construct the polygon. These additional vertices are synthesized using weighted interpolation and extrapolation. synthLinearPoint interpolates a new vertex using the weights and two input vertices. synthTriPoint extrapolates a new vertex using the perpendicular normal of two points, the centroid of two points, and a weight to position the new vertex. synthQuadPoint extrapolates a new vertex using the perpendicular normals of two points, the position of the third point, and a weight to position the new vertex.

[0065] Each new vertex is composited using the pseudocode synthUVs() 65...92.

[0066] The winged edge model is created by traversing the gFaceRegionsRegions in order. An exemplary winged edge model is shown with reference to Figure 5. Methods for creating this model are known and are described, for example, in "Winged Edge Polyhedron Representation," Bruce G. Baumgart, Stanford University, Artificial Intelligence Project (1972), which is incorporated herein by reference.

[0067] The winged edge model is then subdivided. Exemplary subdivision techniques are known and are described, for example, in "Subdivision Surfaces in Character Animation" by Tony DeRose, Michael Kass, and Tien Truong (SIGGRAPH '98), which is incorporated herein by reference.

[0068] The camera's 4x4 projection matrix is ​​calculated using known values ​​based on the type and model of the device being used. For each vertex in the subdivision surface, the corresponding point in the depth map is sampled, a scale correction for the depth representation is applied, the vertex's z-depth value is set, and the vertex is unprojected using the inverse of the 4x4 projection matrix. For each polygon in the subdivision surface, a color is sampled from the visible light photographic image. An example output of this process is shown in Figure 7.

[0069] The following represents code that can be used to carry out the above process:

[0070] The following provides a definition of a face region polygon, where the first number is the vertex polygon number, followed by the numbered indices of the facial landmark vertices. Vertex indices above 65 are synthesized by weighted interpolation. int32 gRightEyeRegion[]={ 3,16,17,64, 3,17,18,64, 3,18,19,64, 3,19,20,64, 3,20,21,64, 3,21,22,64, 3,22,23,64, 3,23,16,64, 0 }; int32 gRightEyeTopRegion[]={ 4,4,17,16,59, 4,4,5,18,17, 4,5,6,19,18, 4,6,7,20,19, 3,7,50,20, 0 }; int32 gRightCheekUpperRegion[]={ 4,16,23,66,59, 4,23,22,68,66, 4,22,21,67,68, 4,21,20,50,67, 3,50,49,67, 0 }; int32 gRightCheekLowerRegion[]={ 4,66,68,72,57, 4,68,67,71,72, 4,67,49,48,71, 0 }; int32 gRightJawRegion[]= { 3,29,72,71, 3,71,75,29, 4,71,48,47,75, 4,30,29,75,77, 4,77,75,47,46, 0 }; int32 gLeftEyeRegion[]={ 3,8,9,63, 3,9,10,63, 3,10,11,63, 3,11,12,63, 3,12,13,63, 3,13,14,63, 3,14,15,63, 3,15,8,63, 0 }; int32 gLeftEyeTopRegion[]={ 3,8,40,0, 4,0,1,9,8, 4,1,2,10,9, 4,2,3,11,10, 4,3,51,12,11, 0 }; int32 gLeftCheekUpperRegion[]={ 4,12,51,93,13, 4,13,93,70,14, 4,14,70,69,15, 4,15,69,40,8, 3,40,69,41, 0 }; int32 gLeftCheekLowerRegion[]={ 4,41,69,73,42, 4,69,70,74,73, 4,70,93,53,74, 0 }; int32 gLeftJawRegion[]= { 3,33,76,73, 3,73,74,33, 4,73,76,43,42, 4,33,32,78,76, 4,76,78,44,43, 0 }; int32 gForeheadRegion[]= { 4,82,86,0,40, 4,86,88,1,0, 4,88,84,2,1, 4,84,90,3,2, 4,90,80,65,3, 4,80,89,4,65, 4,89,83,5,4, 4,83,87,6,5, 4,87,85,7,6, 4,85,81,50,7, 0 }; int32 *gFaceRegionsRegion[]= { gRightEyeRegion, gRightEyeTopRegion, gRightCheekUpperRegion, gRightCheekLowerRegion, gRightJawRegion, gLeftEyeRegion, gLeftEyeTopRegion, gLeftCheekUpperRegion, gLeftCheekLowerRegion, gLeftJawRegion, gForeheadRegion, gNoseBridgeRegion, gNoseRegion, gUpperMouthRegion, gUpperLipRegion, gLowerLipRegion, gChinRegion, NULL }; char *gFaceRegionNames[]={ “RightEye”, “RightEyeTop”, “RightCheekUpper”, “RightCheekLower”, “RightJaw”, “LeftEye”, “LeftEyeTop”, “LeftCheekUpper”, “LeftCheekLower”, “LeftJaw”, “Forehead”, “NoseBridge”, “Nose”, “UpperMouth”, “Upper Lip”, “Lower Lip”, “Chin” };

[0071] The following computes the fourth vertex from three vertices and their weights: Vec2f synthQuadPoint(int32Dex0,int32Dex1,int32Dex2,real32 scale) { Vec2f diff=uvs[dex2]-uvs[dex0]; Vec2f perpDiff(diff.y,-diff.x); perpDiff *=scale; Vec2f result=uvs[dex1]+perpDiff; return(result); }

[0072] The following computes a third vertex from two vertices and their weights: Vec2f synthTriPoint(int32Dex0,int32Dex1,real32 t,real32 scale) { Vec2f diff=uvs[dex1]-uvs[dex0]; Vec2f perpDiff(diff.y,-diff.x); Vec2f midPoint=(diff*t)+uvs[dex0]; perpDiff *=scale; Vec2f result=midPoint+perpDiff; return(result); }

[0073] The following interpolates a vertex from two vertices and weights: Vec2f synthLinearPoint(int32 dex0,int32 dex1,real32 scale) { Vec2f result=((uvs[dex1]-uvs[dex0])* scale)+uvs[dex0]; return(result); }

[0074] The following synthesizes all additional vertices from the original landmark vertices: void synthUVs(real32 foreheadScale) { if(uvs.size()==65) { uvs.resize(95); uvs

[65] =synthLinearPoint(3,4,0.5f); / / mid brow uvs

[66] =synthQuadPoint(57,58,59,0.2f); / / right nose-cheek uvs

[93] =synthQuadPoint(51,52,53,0.2f); / / left nose-cheek uvs

[94] =synthLinearPoint(62,61,0.50f); uvs

[67] =synthLinearPoint(49,66,0.30f); / / right cheek0 uvs

[68] =synthLinearPoint(49,66,0.65f); / / right cheek1 uvs

[69] =synthLinearPoint(41,93,0.30f); / / left cheek0 uvs

[70] =synthLinearPoint(41,93,0.65f); / / left cheek1 uvs

[71] =synthLinearPoint(48,57,0.35f); / / right lower cheek0 uvs

[72] =synthLinearPoint(48,57,0.7f); / / right lower cheek1 uvs

[73] =synthLinearPoint(42,53,0.35f); / / left lower cheek0 uvs

[74] =synthLinearPoint(42,53,0.7f); / / left lower cheek1 uvs

[75] =synthLinearPoint(47,29,0.5f); / / right jaw uvs

[76] =synthLinearPoint(43,33,0.5f); / / left jaw uvs

[77] =synthLinearPoint(46,30,0.45f); / / right chin uvs

[78] =synthLinearPoint(44,32,0.45f); / / left chin uvs

[79] =synthLinearPoint(45,31,0.6f); / / mid chin uvs

[80] =synthLinearPoint(45,60,1.0f+foreheadScale); / / top forehead Vec2f rightHeadWidth=uvs

[50] -uvs

[60] ; Vec2f leftHeadWidth=uvs

[40] -uvs

[60] ; Vec2f templeMid= synthLinearPoint(60,80,0.6f); uvs

[81] =templeMid+rightHeadWidth; / / right temple uvs

[82] =templeMid+leftHeadWidth; / / left temple uvs

[83] =synthTriPoint(80,81,0.45f,-0.15f); / / right mid arc uvs

[84] =synthTriPoint(80,82,0.45f,0.15f); / / left mid arc uvs

[85] =synthTriPoint(81,83,0.45f,0.10f); / / fill right uvs

[86] =synthTriPoint(82,84,0.45f,-0.10f); / / fill left uvs

[87] =synthTriPoint(85,83,0.5f,0.10f); / / fill right uvs

[88] =synthTriPoint(86,84,0.5f,-0.10f); / / fill left uvs

[89] =synthTriPoint(80,83,0.50f,-0.01f); / / fill right uvs

[90] =synthTriPoint(84,80,0.50f,-0.01f); / / fill left uvs

[91] =synthQuadPoint(55,56,57,0.45f); / / right nostril uvs

[92] =synthQuadPoint(53,54,55,0.45f); / / left nostril } }

[0075] The aggregate data collected in the above manner is referred to herein as filtered data. The filtered data can be used to solve the illumination model.

[0076] Next, we describe a method for solving the lighting model. The sensor / camera exposure can be characterized by reading embedded data in the image stream or by setting the exposure settings of one or more front cameras on a handheld device, as described above. The physical relationship between the sensor, light source, and measured surface can be determined, as described above. The light source can be controlled by coupling an optical display for use as controlled lighting, as described above. This information can be used to approximate the lighting model of the scene as seen by the camera. The general problem of solving the lighting model to find the reflectance, color, and surface properties of found geometry from a known scene with additional lighting and geometry data is known as inverse rendering. The more is known about a particular scene, the more accurate the derived lighting model and the measured surface properties of the found geometry will be. Inverse rendering is a known technique and is described in more detail in Patow and Pueyo, "A Survey of Inverse Rendering Problems," Computer Graphics Forum, P 663-687, V 22, N 4, https: / / doi.org / 10.1111 / j.1467-8659.2003.00716.x (2003), which is incorporated herein by reference.

[0077] In one embodiment, the primary illumination source is known, and the facial orientation and key planes are found by sampling colors from a color image captured from a selfie scan. The results of this sampling are shown in FIG. 7. Inverse rendering techniques can be used to solve for the reflectance and color properties of one or more planes of the surface shown in FIG. 7. In one embodiment, an optimized inverse rendering technique used to solve for these properties is described in Boivin and Gagalowicz, "Inverse Rendering from a Single Image," Dynamic Graphics Project, University of Toronto, Canada, Mirages Project, INRIA-Rocquencourt, France, www.dgp.toronto.edu / ~boivin / pubs / cgiv2002.pdf (2002), which is incorporated herein by reference.

[0078] A given technique is chosen to solve for reflectance and color properties based on how well it matches the particular set of knowns and unknowns present in the problem being solved. There are two main classes of inverse rendering: "direct" methods, which can be used when ambient light is low or there are few unknowns, and "indirect" methods, which can be used when there are more unknowns, e.g., more ambient light.

[0079] The inverse rendering technique uses the existing image, the found geometry, and the dominant illumination to estimate initial values ​​for surface reflectance. The algorithm then minimizes the error between the synthetic rendering and the captured image, iterating through the most likely changes in surface reflectance parameters to reduce the error. As used herein, synthetic rendering refers to using computer graphics techniques to render something that does not exist. In this context, since we have a 3D model and known lighting and camera characteristics, we can synthesize what we think we will see and compare it to what is actually there. Variables (skin surface color, skin shine, etc.) can then be changed until the rendering matches the actual facial surface. The model is solved iteratively (e.g., using Newton's method). If there are more unknowns (such as additional lights), they must also be approximated, making the problem more difficult and complex to solve. This technique produces results accurate enough to determine the color and surface properties of discrete regions of the face when the optical display of the handheld device is the dominant light source, or when additional light sources can be corrected for / accounted for by the method described herein. In environments with more ambient or direct light, additional processing may be required to reduce the error.

[0080] In one exemplary embodiment, inverse rendering techniques are used to determine surface reflectance, although other techniques known in the art may also be used.

[0081] For example, in another embodiment, the surface and reflectance characteristics of complexions can be solved using a relative light transport model. The transport model consists of an undirected graph of connections between surfaces found by the scan, the optical display's light field, and the camera or imaging device. Each node in the graph is a surface field, a light field, or a camera viewpoint. Arcs in the graph connect each node and contain a portion of the radiant transfer between each node. For simplicity, the connecting arcs may be limited to surface nodes that connect to adjacent surface nodes, the optical display, and the camera. The relative change in color and luminance of each surface is determined by their difference from the local average of adjacent surface nodes. Each surface node in the transport graph is tagged with its location on the surface. Local regions of the transport graph are graded for the amount of error they contain when compared to a radiometric calculation of the physical light transfer of a known graph. Regions with low error are compared to similarly tagged predetermined relative transport graphs from example complexions. The contribution of known complexions is solved using a support vector machine.

[0082] In a further alternative embodiment, the surface reflectance of surfaces from the captured image can be resolved using a global illumination model. The global illumination model assumes that most regions of the face are illuminated by the same illumination model, allowing for generalization and reduced complexity of the model. In one approach, the recorded scanned colors of each face surface are mapped to a sphere. The mapping is performed using the orientation of the surface patches or planes to find a matching orientation on the sphere. In one embodiment, the colors of each sphere region are aggregated using an average. In another embodiment, they are collected and sorted to calculate a component median. The position of the sphere is determined by a weighted average of each contributing surface based on convexity. The diameter of the sphere is determined by the weighted extent of the contributing surfaces. The region of the sphere with the highest specular reflection is determined by comparing the known position of the optical display, the known position of the camera, and the angle and position of each region of the sphere, where the incident light angle matches the incident viewing angle for that region's surface. The region of the sphere with the highest diffuse reflection is found, where the surface most fully faces the light of the optical display. Initial values ​​for diffuse reflectance, specular reflectance, and ambient reflectance can be solved using an illumination model (e.g., the Phong Illumination model known and described in Bui Tuong Phong, "Illumination for Computer Generated Pictures," Communications of ACM 18 (1975), no. 6, 311-317, which is incorporated herein by reference). Model reflectance values ​​for each region of the sphere are calculated. Each region of the sphere is graded based on its distance from the modeled color. Regions of the sphere that exceed an error threshold may be marked for use in modeling ambient lighting. Regions of the sphere within the tolerance range can be used to refine the predicted color and surface properties / reflectance of the user's complexion.

[0083] Further details of the Global Lighting Model will now be described. In one such embodiment, data regarding the lighting and surface of an object captured using a device / camera can be found by iteratively approximating this lighting and surface data using a rendering technique that uses a set of functions implemented as code running on a digital computer. The set of functions and their flow are referred to herein as the GlobalLightingModel. The input (InputData) to the GlobalLightingModel includes: -A digital image of the user captured using a camera / device (referred to herein as an ImageMap) in the form of a two-dimensional array of pixels coded as red, green, and blue values ​​in a color space known as sRGB. The captured depth image associated with the captured digital image (herein referred to as the DepthMap) is in the form of a two-dimensional array of depth values, which are linear representations of the camera's distance to the corresponding pixel in the ImageMap. - Winged edge polygonal model as described herein. - The exposure settings (i.e., ISO, shutter speed, and aperture) used in connection with the capture of the user's digital image. - The position of the camera aperture relative to the center of the illuminated area of ​​the display (referred to herein as PositionData). - The size of the illuminated portion of the display (referred to herein as IlluminationData). - Calibrated light characteristics of the illuminated portion of the display for the model of device used to capture the image. -The response curve of the CCD of the camera / device used to capture the ImageMap is calibrated to the model of the device and provided in SI units (referred to herein as ImageLightCurve). The curve is represented as a 0...0x0001000 array of discrete values ​​to provide direct lookup of 16-bit pixel values. -ImageToCamera transform is a 4x4 transformation matrix that converts depth map x,y,depth pixels into x,y,z vectors with the camera aperture point at 0,0,0. The -LightToCamera transform is a 4x4 transformation matrix that converts the Display Illuminant pixel UV to an x, y, z vector where the camera aperture point is 0,0,0. -LightSI is the constant SI light source value for the device model. The intermediate data is constructed for use in iteratively approximating the illumination and surface data in an image map associated with a captured digital image.

[0084] The intermediate data representing the three-dimensional surface characteristics of the InputData is called a SurfaceMap. In one embodiment, the SurfaceMap is constructed using a series of steps including: The ImageMap and DepthMap are resampled and combined to form a two-dimensional array of structures containing Red, Green, Blue, Depth, and Mask values, referred to herein as the SurfaceMap. A MedianFilter is applied to the DepthMap to remove noise. The size of the SurfaceMap is determined, which is typically twice the width and height of the DepthMap dimensions. The SurfaceMap is allocated. The DepthMap is scaled using bicubic interpolation to fit the SurfaceMap. The depth components of the SurfaceMap are set to the DepthMap values. The ImageMap is converted from sRGB to linear RGB, which is converted by lookup to SI units using an ImageLightCurve. A Gaussian filter is applied to the SurfaceMap, using the inverse of the scaling factor *1.5 as the theta of the Gaussian function. The ImageMap is scaled using point sampling to fit the SurfaceMap. The red, green, and blue components of the SurfaceMap are set to the ImageMap values. All Mask components of the SurfaceMap are set to 0. The polygons in the model that represent the surface to be approximated are tagged. Because the model is constructed from facial feature detection, these polygons will be the same for all instances in the input data. The tagged polygons in the model are rendered into the Mask component of the SurfaceMap, such that their mask regions are set to a value of 1.

[0085] The intermediate data representing the three-dimensional surface characteristics of the SurfaceMap as a GlobalLightingModel is referred to herein as a SphereMap. The SphereMap, in one embodiment, is constructed using a series of steps, including: The SurfaceMaps are resampled and combined to form a two-dimensional array of SphereMapValue structures containing Red, Green, Blue, Depth, and Accum values. This is referred to herein as the SphereMap. The size of the SphereMap is determined. This is typically a square with powers of two for width and height. This is chosen to be small enough to provide sufficient angular resolution for the model, but not so large that there are few samples from the input SurfaceMap. In the exemplary embodiment, the size is 256x256. The SphereMap is allocated. For each pixel in the SurfaceMap, If (SurfaceMap[thisPixel] ].Mask=1), Triangles with 3d vertices are constructed using adjacent pixels. Vertex 0 is this pixel. Vertex1 is the pixel in the right column. Vertex2 is the pixel in the right column and bottom row. The vertices of the triangle are transformed into camera space. Vertex0=ImageToCamera * Vertex0… The normals of the triangle are found. Normals are scaled to 128.0. The normal is offset by 128,128. The U and V indices are set, U=Nx, V=Ny For SphereMap U,V pixels: SphereMap[V][U].Red+=SurfaceMap[thisPixel] ].Red SphereMap[V][U].Green+=SurfaceMap[thisPixel] ].Green SphereMap[V][U].Blue+=SurfaceMap[thisPixel] ].Blue SphereMap[V][U].Depth+=SurfaceMap[thisPixel] ].Depth SphereMap[V][U].Accum+=1 For each pixel in the SphereMap, If(SphereMap[thisPixel].Accum > 0) SphereMap[V][U].Red / =SphereMap[V][U].Accum SphereMap[V][U].Green / =SphereMap[V][U].Accum SphereMap[V][U].Blue / =SphereMap[V][U].Accum SphereMap[V][U].Depth / =SphereMap[V][U].Accum SphereMap[V][U].Accum / =SphereMap[V][U].Accum

[0086] The intermediate data that represents the location of a screen region in camera space is called a LightMap. In one embodiment, a LightMap is constructed using steps that include the following: A LightMap is a two-dimensional array of 3D vertices. The height and width of the LightMap have the same aspect ratio as the display illuminant of the device model used to populate the ImageMap. The height and width of the LightMap are calculated as follows: LightMap width=((DisplayWidth in MM)+2.5) / 5; LightMapHeight=((DisplayHeight in MM)+2.5) / 5; LightMap is assigned. LightMap pixels are set: LightMap[V][U].xyz=(V,U)* LightToCamera.

[0087] The data output from GlobalLightingModel (output data) is SynthSphereMap - a 2D array of structures containing red, green, and blue values ​​as SI units CIELAB SurfaceColor - SphereMap Set to the average value of those pixels in the SphereMap that are 16 pixels away from the UV {128,128} SpecularGamma=1.8 SpecularScale=0.23 ErrorTerm=Infinity MaxIteration=1000 MinError=0.02

[0088] In one exemplary embodiment, the functionality used by the rendering techniques described herein includes: GetSpherePixelNormal(REAL u,REAL v)-> {a,b,c} { a=(u-128) / 128 b=(v-128) / 128 c=sqrt(1.0-(a*a+b*b)) return({a,b,c} } RGBsiToCIELAB(RGB rgb)->{lab} { return(XYXtoLAB(LinRGBtoXYX(SiToLinRGB(rgb)))) } CIELABtoRGBsi(RGB rgb)->{lab} { return(LinRGBToRGBsi(XYZ(ToLinRGB(LABToXYZ(rgb)))) } BlinnPhong(SphereMapValue v,SI light,RGBsi rgb)-> {rgb} { toLight=light-v.xyz; d=length(toLight) lightNormal=normalize(toLight) surfaceNormal=GetSpherePixelNormal(v.uv) halfVector=normalize(surfaceNormal+lightNomal) falloff=1.0 / (d*d) specular=dot(halfVector,{0,0,1}) specular=pow(specular,SpecularGamma) specular=specular * SpecularScale specular=specular * falloff diffuse=dot(lightNormal,surfaceNormal)* falloff return((rgb * diffuse)+(specular * LightColor)) } AdjustSpecular(SpecularAmount,AccumRGBError)->SpecularAmount { error=average(AccumRGBError) SpecularAmount+=error * 0.1 return(SpecularAmount) }

[0089] The iterative loop for generating the output data is referred to herein as solving the illumination model, and is bounded by the ErrorTerm and MaxIteration conditions as follows: 1.testRGB=CIELABtoRGBsi(SurfaceColor) 2.While(MaxIteration > 0 and ErrorTerm > MinError) a.Render SynthSphereMap For every pixel in the i.SphereMap 1.For every pixel in the SphereMap a.If(SphereMap.accum>0) i. For every pixel in the lightmap 1.SynthSphereMap[currentPixel]=BlinnPhong(SphereMap[currentPixel,LightMap,testRGB) b.Compare SphereMap and SynthSphereMap i.RGBsi AccumRGBError=0; ii.AccumCount=0 iii.For every pixel in the SphereMap 1.If(SphereMap.accum>0) a.AccumCount++ b.AccumRGBError+=SphereMap[currentPixel].rgb-SynthSphereMap[currentPixel].rgb) iv. In the case of AccumCount 1.AccumRGBError=AccumRGBError / AccumCount v.Other 1. Error, no data in SphereMap c.If(length(AccumRGBError) <ErrorTerm) i.ErrorTerm=length(AccumRGBError) d.MaxIteration--. e.testRGB=testRGB+(AccumRGBError*0.1) 3.SurfaceColor=RGBsiToCIELAB(testRGB)

[0090] In this example, SpecularAmount is unaffected, but this can be resolved by adding an additional iteration loop: for example, step 1 can be replaced by saving SpecularGamma, then performing steps 2.a...2.d, and step 2.e can be replaced by SpecularAmount = AdjustSpecular(SpecularAmount, AccumRGBError).

[0091] In another embodiment, ambient light may be filtered from the SphereMap by determining the average error between the SphereMap and the SynthSphereMap and eliminating pixels that have an error greater than twice the average error.

[0092] In another embodiment, ambient light may be filtered from the spherical map by comparing regions of the map across the side hemispheres (i.e., where u=128-30 and where u=128+30). Bright pixels found during this comparison may be rejected.

[0093] The resolved output of the inverse rendering or other technique is the surface color and reflectance of multiple facial regions. The color and reflectance can be configured as CIELAB color and specular reflectance amounts. As disclosed in the background patent, the CIELAB color and specular reflectance can be configured as search keys that can be used to find and resolve mixtures or proportions of individual topical agents that can be combined to produce custom cosmetic products.

[0094] There are limitations imposed by directly solving a physical lighting model. For example, the Bovin and Gagalowicz technique works well when the number of variables to solve is relatively small. The number of unknowns introduced into the lighting model by additional light sources of unknown color presents difficult solution time and resolution challenges. However, it is possible to assemble a hybrid system that improves the performance of the Bovin and Gagalowicz technique by training a machine learning (ML) system on which solution paths are most likely and using these to guide the inverse rendering technique. In one embodiment, the solution paths of the inverse rendering algorithm can be enhanced by training a hidden Markov model to select specific state transitions.

[0095] Referring now to the use of the ML system in more detail, ML models for outputting color and surface reflectance for multiple facial regions can be trained using the filtered data. In an exemplary embodiment, the ML system is divided into components that resolve intermediate representations of the user's complexion. One component may be trained to resolve CIELAB colors for known regions of the face. Another component may be trained to resolve surface reflectance caused by sebum content in the upper layers of the epidermis. The outputs of these components can be used to generate search keys to derive mixtures and create custom topical formulations.

[0096]

[0013] Describing this embodiment in more detail, the training data may include filtered data captured using multiple handheld device types, with a set of users having multiple complexion characteristics. Each unit of filtered data used to train the system may be labeled and associated with a particular handheld device, a particular user, and a quantitative measure of each user's complexion. These measurements may include, but are not limited to: (1) color spectrum of various facial regions, (2) CIELAB colors of various facial regions, and (3) reflectance characteristics of various facial regions.

[0097] In one embodiment, a data collection process is used to collect and organize data for training an ML system. This process includes the following series of steps: 1. Reference subject casting enrollment; 2. Reference subject cohort identification; 3. Reference subject training data collection session; 4. Training data analysis; 5. Training data structuring; 6. ML training; and 7. ML validation.

[0098] Reference subject casting capture seeks to reach and engage a wide variety of subjects with a wide variety of complexion types and characteristics. These types include, but are not limited to, various complexion tones from dark to light, warm to cool, various sebum contents, various sun exposure responses, and / or various skin artifacts and localized pigmentation. Subjects are interviewed and undergo spectrophotometer scans of various complexion areas, including, but not limited to, the wrist, forehead, cheeks, upper jaw, lower jaw, lower neck, and upper chest regions. Measurements or estimates of hair and eye color, as well as pore size and complexion sebum content, are noted. Photographs of the skin areas are taken. This initial data is structured and placed into a data store.

[0099] Reference subject cohort identification seeks to identify key individuals from a reference subject cast that may represent a cohort or group of reference subjects. Cohort identification can be performed initially by k-value clustering based on an n-dimensional vector consisting of CIELAB color and sebum content. Other components of the vector may include pore size and the frequency of skin artifacts such as freckles or blemishes. The cohort list can be further filtered by removing outliers based on statistical measures.

[0100] The baseline training data collection session attempts to collect data in a format useful for developing a training set for the ML network. Excess data is collected for validation purposes. For training, it collects baseline training data in the form of scan data acquired by handheld devices and associated software. Several such scans may be taken with a variety of different devices. It collects complexion surface data associated with the handheld device scan data. The complexion surface data includes the CIELAB color of each complexion area output by the ML system, as well as sebum levels, the location and type of small skin artifacts such as freckles, age spots, and acne, eye color, hair color, the location and type of larger complexion artifacts such as wrinkles, dark patches or circles, and variations in skin color or tone. This data can be collected, for example, by discrete scans, photomicrographs, high-resolution photography, or high-resolution 3D scans.

[0101] Training data structuring attempts to organize and structure data from a reference subject training data collection session into a format capable of training a selected ML system. In one embodiment, this is accomplished by first processing scan data from a handheld device and associated software. Each scan is converted into a winged edge model as described above. The winged edge model includes the 3D position of the surface relative to the camera and optical display light source. The model also includes a key set of 2D coordinates, called UV coordinates, that are consistent across all trained winged edge models for this training (all similar in structure and forming a standard). The model also includes CIELAB colors accumulated from one or more images collected by the software on the handheld device. The resolved illumination model is associated with the winged edge model and used to resolve an initial approximation of the surface reflectance of each polytope in the winged edge model. After the input, the desired training output for each polytope in the winged edge model is added. This output includes, but is not limited to, a spectrophotometer CIELAB data scan of the region, the sebum content of the region, the location and type of small skin artifacts, and the location and type of larger skin artifacts within the region. It also includes a series of image maps. These maps are keyed to the UV coordinates of the winged edge model. Each map contains various labeled image regions that describe large and small skin artifacts, including, but not limited to, freckles, sunspots, acne, skin discolorations, wrinkles, and blackheads.

[0102] ML Training seeks to aid in the development of ML graphs and a set of key coefficients, weights, or constants within these graphs to convert inputs of handheld device scan data (i.e., after conversion to a winged edge model containing the full set of input data as described above) into output data consisting of a winged edge model containing information for each polytope region that contains a subset of the collected training data output described above. In one embodiment, the ML system is implemented as a model in TensorFlow (https: / / www.tensorflow.org / ). Through a graph network implemented in TensorFlow, the weights, constants, and coefficients of the ML network are set during the training process to output an ordered set of polytopes (each polytope with relative 3D data) from the standardized winged edge model, filtered CIELAB colors from the recorded image, estimated reflected CIELAB colors from the resolved illumination model, and an error metric for the resolved surface reflectance.

[0103] ML validation attempts to verify or prove that the training of each ML network produced by ML Training provides outputs within a certain tolerance range. During this process, additional data collected during the baseline training data collection session is used as input to the ML system. The outputs are compared against the collected output data to find the system's tolerances. If the system is within tolerance, the ML system can be packaged and deployed. If the system is not within tolerance, ML Training is restarted, modifications are made to the structure of the ML graph, and the graph is retrained.

[0104] After initial training, the ML system, in some embodiments, may no longer be trained, or the network may undergo intermittent training using various techniques known to those skilled in the art. After training, in some embodiments, the ML system may be validated using a separate set of known training data. The ML system may then be used in a service residing on a server or on a handheld device to process user data into an output of CIELAB data for specific facial regions (as described below with reference to FIG. 8B).

[0105] In the described embodiment, each component of the ML system can be trained in this manner. In such an embodiment, the CIELAB and sebum level outputs of two separate ML networks can be connected as inputs to an ML system trained to output a particular product formula.

[0106] In another exemplary embodiment, the ML component can take CIELAB color, sebum content, and cosmetic characteristics and resolve component proportions for a custom topical or mixture, replacing one or more of the methods in the background patents that use search keys to resolve mixtures.

[0107] ML systems may consist of additional processing stages that feed input and training data into a distributed network of nodes connected to inputs, outputs, and training inputs. Each node has a weight or set of weights and an associated nonlinear function that can trigger a signal to its output. The hierarchy of nodes can have many levels. Training inputs may be constructed to allow weights to be adjusted based on input and output states. Nodes may be constructed in a manner known as a neural network or a Markov model. Inputs may be directly connected to data inputs, or input connections may pass through additional logic before entering the network so that the network's width is much greater than a discrete number of inputs, or some inputs may be limited in width. The width and depth of the network may be automatically configured based on output quality based on training results.

[0108] Once the ML system is trained, it can be used to process user data interactively collected on a handheld device into manufacturing instructions for a topical agent that can be customized or selected for the end user. Thus, for example, a user can take a photo using a phone, which can include software that performs certain processing as described herein (e.g., 3D model fitting and data preprocessing), and the phone can then send the 3D model with points (both skin and other parts of the face, such as eyes and lips) and associated colors to a server. The ML system running on the server then determines the lighting model and complexion color for each area of ​​the face (e.g., skin color, hair color, lip color) like a map.

[0109] 8A and 8B show a method 800 and a high-level system architecture 870, respectively, illustrating steps and components associated with user activity and data flow in an exemplary embodiment. In step 801, a user runs a software application on their handheld device 850.

[0110] In step 802, the application presents a display on the optical display 851 of the handheld device 850 showing a line drawing of the user depicting their position in real time (e.g., as shown in FIG. 2 ). The optical display 851 acts as a continuous source of illumination (e.g., in dark environments) and helps the user properly position their face within the optical display 851.

[0111] In step 803, the application determines whether the lighting in the environment and the position of the user's face are acceptable for capturing a high-quality image. In particular, the device may be programmed to detect acceptable levels of ambient or additional light and notify the user to move to a darker location. The exposure data stored in the image data stream may be compared to the expected exposure due to illumination by the optical display, and an approximation of the amount of additional illumination may be calculated. The user interface / device may respond to the user that a given environment is suitable or unsuitable for scanning, and the application may indicate that the user should move to a location with less light (e.g., as shown in FIG. 3) or that the room lighting is acceptable for scanning (e.g., as shown in FIG. 2) by changing the color of an indicator on the optical display 851 or other indicator (visual, auditory, or tactile).

[0112] As a further example, the application may indicate that the user should move the handheld device to center their image on the screen, and indicate that this is complete by changing the display rendering (e.g., as shown in Figures 2 and 3, Figure 2 shows an illuminated line display of the user's face outline and facial feature outlines, and Figure 3 shows a circle indicating that the face position is not optimal for taking a photo).

[0113] Pressing a button on the handheld device 850 captures an image in step 804. The image may include multiple images (e.g., one button press captures multiple images) and associated data such as depth data, facial landmark data, and color image data. In step 805 (further shown and described in FIG. 8C), the data may be filtered and used to derive an illumination model, as described above, and sent to the computer server 852 in step 806. In step 807, the computer server 852 may use the illumination model and processing techniques such as inverse rendering to solve for the reflectance and color characteristics of one or more planes of the face.

[0114] An exemplary method for obtaining filtered data (step 805) will now be described with reference to FIG. 8C. It is particularly noted that the order of steps shown in this exemplary method is not limiting. According to embodiments of the present invention, steps may be performed in an order different from that shown and described. In step 810, exposure data for an optical sensor in handheld device 850 is determined (e.g., from data embedded in the camera image data stream or set). In step 811, the relationship between the light source and the aperture of the sensor / camera of handheld device 850 is measured. Such data may be determined for a variety of different types of handheld devices 850 and stored or made available to server 852 for use in processing. In step 812, the relationship between the ambient light source and the sensor / camera is determined. As described in steps 802 and 803 above, techniques for obtaining proper lighting and positioning / alignment of the user can be used to determine data reflecting this relationship. In step 813, the relationship between the sensor / camera, the light source (determined in step 811), and the target surface is determined, and a 3D model of the target surface can be constructed according to the techniques described above. Using the data from steps 810, 811, 812 and 813, an illumination model of the scene seen by the camera can be determined (eg, approximated or derived) in step 814.

[0115] In some embodiments, the processing techniques used by server 852 (step 807) may be enhanced using an ML system, as described above. Intermediate results of the ML system may provide complexion data, which may be transmitted to handheld device 850 for viewing by the user.

[0116] After the steps described with reference to Figures 8A, 8B, and 8C, the process can proceed in a manner described in one or more of the background patents to order and manufacture a topical agent (e.g., a customized or selected cosmetic product) for a user.

[0117] Next, an exemplary embodiment including alternative aspects of the present invention will be described. As with the previous embodiment, the goal is to determine an end user's skin tone ID using an image captured by the end user's handheld device, e.g., a mobile phone. The challenge is to consider the lighting environment in which the end user is present. As with the other embodiments described above, in this embodiment, the display screen of a device, e.g., a handheld device or phone, is used as a calibrated light source in a dark indoor environment, e.g., a low-light environment, and a selfie scan can be taken with the front-facing camera as the capture device. A depth sensor (face depth sensor) built into the device software to determine the depth of the body part detected to capture the image, e.g., the depth of the face or facial region, can be used to provide a measurement of the distance from the device screen to the surface of the image target, e.g., the face. Using the known calibrated light source (display screen) and the selfie scan data including facial surface distance data, the facial complexion (i.e., skin tone ID) can be calculated.

[0118] An example is described below. The end user is placed in a dark indoor environment with little or no ambient lighting, preferably a dark environment available to the end user, such as a room without windows or with shades and / or curtains drawn, and light sources such as lamps or computing devices turned off. The end user opens an application previously downloaded to a handheld device, such as a mobile phone, and the application operates to open the camera on the mobile phone in selfie mode (i.e., "selfie scan" mode). In a preferred embodiment, the application detects whether the room is dark enough to proceed and determines the user's skin color ID that is sufficiently close to their actual skin color ID within a predetermined tolerance. If the room is not dark enough, the end user is notified (using methods described previously herein or other methods known in the art) and is instructed to move to or create a darker environment. If the room is sufficiently dark, the handheld device's display is illuminated with white light automatically, or optionally by first providing the user with an indication of a sufficiently dark lighting environment (also described previously herein).

[0119] In an exemplary embodiment, the white light is a rectangular shape that fills all or nearly all of the handheld device display screen. In some embodiments, the white light is automatically displayed when the application detects an appropriately darkened room. A selfie image of the end user is then captured with a camera on the handheld device. This image is referred to herein as the illuminance image. The only light source from the handheld device used to capture the illuminance image is the white light display. Illuminance image capture in a dark indoor environment, if dark enough, may be sufficient to estimate the end user's skin color ID.

[0120] However, in reality, some ambient light is present (e.g., from a computer monitor, the space beside a door bottom or window shade, etc.). This ambient light must be taken into account in order to obtain the most accurate estimate of skin tone ID possible. Therefore, in a preferred embodiment, a second image of the end user is captured using a camera on the handheld device. This second image, referred to as the ambient image, is captured without illumination from the handheld device and therefore includes only light from ambient light sources. As described more fully below, light present in the ambient image is removed from the illuminance image, thereby accounting for ambient light and leaving only known lighting conditions in the end user's image. Based on these known lighting conditions, as well as other data points described more fully herein, a more accurate prediction of the end user's skin tone ID can be made.

[0121] In a preferred embodiment, the illuminance image and the ambient image are taken in close proximity to each other in time to avoid end-user movement between image captures.

[0122] Further details of exemplary embodiments will now be described. As with the other embodiments described above, software resident on the device / phone itself can be used to control certain functions, such as acquiring a 3D image of the end user including the distance from a target (e.g., the end user's facial surface at various points) to the device's camera aperture. Additionally, other software may be in the form of an application downloaded to the device / phone. Such downloaded software applications may control the device display screen and camera settings, image capture, and / or data processing of the image data, including: Controlling the setup of the device camera application programming interface (API), which controls low-level settings of the camera, such as exposure settings, frame size, color and depth (3D data) settings, and which camera on the device should be used (if more than one camera is present); Controls the configuration of a Computer Vision API configuration, which provides a set of functions that take image data from a camera and return high-level data in return (e.g., takes data representing an image of a face and returns a list of 2D image points that correspond to specific facial features); -Initializing the view for the selfie scan display; - Providing ambient light notifications (e.g., notifications that the environment is too bright for selfie scanning); Signaling the user to adjust the capture scene for optimal data collection (e.g., instructing the user to adjust the distance between the capture object and the user); - Controlling the image capture process (e.g., timing, display lighting, and exposure settings); -performing functions related to the processing of image data; - storing error information and providing warnings.

[0123] In this exemplary embodiment, in a dark indoor environment, when a user opens the application, a line drawing of the user's face may be created and displayed, as described above, allowing the user to properly align their face. However, in this embodiment, instead of using a yellow light source as described above, the image is shown without illumination. As described above, a series of images of the end user's face are captured. In a preferred embodiment, the captured images are high dynamic range (HDR) images. HDR technology is commonly known in the art and uses standard methods to combine multiple images taken with different exposure settings into a single high dynamic range image that shows much more clearly and clearly the details than non-HDR images. HDR images are captured using a set of exposures at predetermined calibrated values. The exposure settings used to create the HDR images described herein are unique in that they are determined by device model calibration to represent the lighting range provided by the device's display (illuminance image) and by the ambient light encountered during use (ambient image).

[0124] Typically, HDR images are collected by requesting a series of batch images using a programming interface provided by the device / phone's operating system. Using such an interface, several images can be taken rapidly, one after the other, at different specified exposures. For example, it is possible to request a set of images with the same shutter speed and aperture but different ISO settings be taken rapidly, one after the other. ISO settings can be selected to cover a wide range of illumination levels. For example, a first ISO setting can be selected to provide the best exposure using the light from the device's display screen. A second ISO setting can be selected to provide the best exposure when the ambient light is twice as bright as the light from the device's display. A third ISO setting can be selected to provide the best exposure for illumination that is four times brighter than the first setting. This final exposure can be used to measure ambient light that is three times brighter than the device's display. The response curve of the device's CCD to a single exposure (e.g., the first setting) is such that illumination exceeding the device's display light saturates and cannot be accurately measured. Examining the CCD response to images at the exposures described above allows for the measurement of larger illumination amplitudes.

[0125] To further understand this example, the disclosure herein refers to a "luminance image" and an "ambient image."

[0126] The ambient image is an image captured with the device's display illumination set to black using exposure settings locked to a predetermined calibrated value. As mentioned above, a series of three images can be acquired to provide HDR. These can be recorded using the same set of exposure settings used in the luminance image.

[0127] The luminance image is an image captured with the device's display illumination set to white using the exposure setting set to autoexposure, referred to herein as the primary scan. This provides a reference image that can be adapted to a wide variety of lighting conditions. As described above, a series of images can be acquired to provide HDR, and these can be recorded using the same set of exposure settings used for the ambient image. Depth data (i.e., the distance from the device sensor to the target surface) is recorded for the luminance image scan.

[0128] The exposure settings used for the ambient and luminance images can be determined by calibrating a given device model. For example, a given device model has a known amount of light emitted when the screen is set to display a white field and when the device is set to full brightness. This light amount can be measured, and the camera exposure that best illuminates the user's complexion at a common distance can be determined. The device OS allows the system / software application to determine which model of device is being used, and the calibration settings for that device model can be retrieved from a data store previously determined in the manner described above. Images captured using exposure settings locked to these predetermined calibration values, with the display illumination on the device set to black, provide a reference image (ambient image) that shows only ambient light. Depth data (i.e., the distance from the device sensor to the target surface) is recorded for the ambient image scan.

[0129] A series of HDR images for ambient and luminance allows the software application to detect light over a wider range. In one embodiment, the ambient and luminance images can be processed using the following steps:

[0130] The three ambient images are combined into a single HDR image. This can be achieved by correcting each image for the CCD's response curve. Then, for each corresponding pixel in each image, the R, G, and B values ​​are scaled by an exposure factor (e.g., 1x for the first, 2x for the second, 3x for the third). These values ​​are added, and the result is stored with increased numerical resolution. For example, if each input R, G, and B channel is represented by an unsigned 8-bit value, it can be stored as a 16-bit value.

[0131] The three luminance images are combined into a single HDR image as described in connection with the ambient image.

[0132] The HDR ambient image can be subtracted from the HDR luminance image to yield a "corrected luminance image." The resulting corrected luminance image accounts for ambient light by removing it. In this embodiment, the removed ambient light can be brighter than the light illuminating the subject's complexion from the display on the device. This is possible by recording each image using HDR imaging.

[0133] Data relating to the corrected luminance image is stored in a face data format (e.g., structured and represented in a winged edge model, as referenced in detail above), which includes a series of vertices, each consisting of a 2D point that maps to a facial landmark in the captured image, and a 3D point that is also constructed as described in detail above.

[0134] Each vertex is associated with a color. In one embodiment, the color of a vertex of a winged edge model can be found by the following steps:

[0135] As previously mentioned, the winged edge model can be subdivided into finer structures. The model can be subdivided in this manner so that the average polygon in the model represents an approximate area of ​​the subject's complexion, such as a quarter of a square centimeter. Other subdivision scales may be used within the scope of the present invention.

[0136] The pixel colors of the corrected luminance image are sampled for each polygon in the model. In one embodiment, this sampling is performed by inverse rendering. For example, for each pixel that may be rendered to describe a polygon, the R, G, B data for that pixel is accumulated as an average. This data is collected and stored at a higher resolution than the original pixel data. For example, if the R, G, B data is represented as 16-bit unsigned integers, the data may be accumulated as 64-bit double-precision floating-point numbers and stored with each polygon in the model.

[0137] The R, G, and B color values ​​for each vertex of the winged edge model can be determined by using the links in the winged edge data structure to accumulate the colors of each polygon linked to that vertex. The R, G, and B values ​​can then be stored with each vertex in the model.

[0138] In some embodiments, the color resolution represented by the vertices in the model may be all that is needed. For example, for measuring complexion, sampling 0.5 centimeter patches may be sufficient. For other applications, such as determining the location of specific skin artifacts such as freckles, birthmarks, or wrinkles, higher resolution may be required, and selected portions of the corrected luminance image may be stored along with the winged edge model.

[0139] As previously mentioned, the winged edge model is constructed using facial landmarks, so each vertex and polygon in the segmentation model maintains a unique position relative to these facial landmarks. Furthermore, the same level of segmentation can be performed for each subject whose image was recorded, resulting in the same structural link (i.e., polygons to vertices and edges) as long as the facial landmarks are found. It is possible to know that a given polygon always falls, for example, on the tip of the nose or the center of the left cheek. This allows each vertex associated with a color sample to be labeled by its location. For example, all vertices that make up a particular region of the forehead can be labeled and positioned. In this way, it is possible to traverse the winged edge model and obtain color measurements for known facial locations.

[0140] Thus, each vertex of the winged edge model may include a label indicating the part of the face it represents, an RGB color accumulated from the calibrated luminance image, a Z depth obtained from the depth map of the device's 3D camera, the X, Y, Z position of the vertex relative to the handheld device's camera viewpoint, and the vertex's normals A, B, C relative to the handheld device's camera viewpoint.

[0141] In addition to the data represented by the winged edge model, the systems and methods described herein can use pre-calculated data, such as calibration data, which is data that does not change from scan to scan and represents other constants, such as the physical characteristics of the scanning device, the range of reflectance of human skin, and constants for system operation. In some embodiments, these can include shutter timing for a particular model of handheld device, which can be used in specifying a series of exposures for HDR imaging, as described above; an acceptable amount of signal to noise, represented by the ratio of light emitted from the device's display for illumination to the amount of light detected in the HDR ambient image; an absolute amount of light in metric units used as a threshold for triggering state transitions to and from ambient image capture; and a CCD color response curve for a particular model of handheld device.

[0142] Data including winged edge models may be encoded for transmission, for example using the GL Transmission Format (GLTF), which allows efficient transmission and loading of 3D images and models by applications by minimizing both the size of the assets and the runtime processing required to deploy and use such assets.

[0143] The facial model data GLTF file can then be sent from the device / phone to a remote server or computing service using an encrypted transfer protocol (e.g., HTTPS) and stored in a repository. For example, AWS S3, an Amazon Web Services Simple Storage Services repository, can be used for this purpose. Using this storage service has several advantages. For example, it allows transmission of facial model data to and from the service to be encrypted. The service provides storage of facial model data sent from the handheld device and supports various operating systems used by handheld devices. The service allows access to the facial model data for further processing and other transactions resulting in the production of custom cosmetics and customer support. The service also allows private intranet access in a secure manner.

[0144] Once transmitted to a computing service (e.g., a remote cloud-based server), the facial model data is processed. The processing of the data can be performed using a service, such as the AWS Lambda service, that allows applications to respond quickly to new information.

[0145] Next, we will describe how to process the face model data. In some embodiments, the pre-processing step can include color correction to account for the device itself (i.e., the screen and front-facing camera). The device type is identified from the image data, and exposure (i.e., white point and color bias) is corrected for the specific device type (e.g., phone model).

[0146] In other embodiments, color correction taking into account device type is incorporated while training the complexion model (e.g., the training data includes images taken with different device / model types, and the machine learning engine takes the differences into account during the training process), in which case no separate pre-processing step is required.

[0147] Next, a correction is performed on the color of each vertex to account for the depth data, e.g., the distance of the device display light to the surface of the image target (e.g., a face). Based on a 3D model of the image, a lighting equation is used to calculate distance attenuation. Also, lighting contributions based on angle attenuation are removed. More specifically, the illumination of a surface becomes darker as it becomes more oblique to the light. To account for this, a cosine attenuation is calculated using the 3D model and lighting equation.

[0148] Below we provide a more detailed description of pre-processing / filtering of vertex data that may be used in some embodiments before such data is used as input to a machine learning system. 1. Color can be corrected based on the response curve of the particular model of handheld device used to record the image of the human subject, which corrects for the CCD response. 2. Cosine or angle attenuation is based on the orientation of the vertex's surface normal relative to the device's display and the device's camera. Vertices that rotate at an oblique angle relative to the camera can be filtered or removed. 3. Light amplitude falloff based on the device display and the distance of the vertex from the device's camera. 4. Illumination-based vertex color correction to remove ambient lighting.

[0149] The implementation of each of the aforementioned processing steps may vary according to alternative embodiments of this methodology. For example, amplitude falloff may be modeled as a falloff over distance from a point source or as a falloff over distance from a surface representing the geometry of the device's display area. However, the basic order of filtering is constant, since it is derived from the inverse of the transmission of information as light. In particular, light exits the display, is reflected by the complexion areas represented by vertices, and is received by the camera. Filtering is then performed by correcting for the camera, correcting for the surface orientation (including filtering for tilt angle), and correcting for the distance traveled back to the light. It will be understood that, since any set of mathematical equations can be simplified to solve, each filtering function can be considered in combination for simplicity or speed of operation. In all embodiments, such filtering of the data to account for the image capture process is performed before using the data as input to the machine learning engine.

[0150] In one embodiment, a distance-squared falloff is used according to the following formula: FallCorrectedLum=Lum *(Magnitude(vertex.XYZ)2).

[0151] The inverse rendering formula for cosine falloff can be applied: In one embodiment, a point light source with infinite falloff is used according to the following formula: CosCorrectedLum=FallCorrectedLum *(1.0 / Dot(vertex.ABC,light.Normal)).

[0152] The data is then processed using a machine learning engine, referred to herein as a complexion model. The machine learning model must first be built and trained using data related to the subject. The data used to train the model can come from a variety of sources, including survey data self-reported by the subject, reference photos of the subject accompanied by a color chart, the subject's skin color measured by a spectrophotometer in several areas of the subject's face (e.g., forehead, cheeks (left and right), chin (left and right), and décolleté) used as ground truth measurements, and facial image data obtained using the selfie scanning technology described herein.

[0153] The cohort of subjects is selected in a manner that best suits the needs of a particular application. In one embodiment, the design of complexion data collection for training a machine learning system uses the following steps: Identify a large cohort of subjects. This cohort may be found through agency listings, advertisements, or other methods. Measure the complexion characteristics of this large cohort. This can be done using a reflectance spectrophotometer. Readings can be taken on specific facial regions such as the wrist, forehead, cheeks, jawline, and décolleté. The following data can be stored, for example, for each subject: the subject's name; spectrophotometer data, which can be converted and stored as CIELAB data; data for the wrist, forehead, cheeks, jawline, and décolleté, which can be stored; and area data, which can be combined into a single CIELAB color using a component median operation and stored as the subject's complexion. The data from the large cohort can be processed into a test cohort. This can be done to improve color sampling, simplify testing, and for operational efficiency. In one embodiment, the large cohort is processed using k-value clustering. Clustering may be done so that the center of each cluster is 3.0 DeltaE 2000 from the others.

[0154] The quality and quantity of the training dataset greatly influences the performance of the resulting model.

[0155] This data is used to build and train a model, for example a tensorflow model as described in the paragraph above.

[0156] Now, model training will be described in more detail. In one embodiment, an LCD display panel with known brightness is used to calibrate ambient light to generate a portion of the training data for the machine learning model. Such data can be collected in the following manner: Each subject records a series of selfie scans using a predetermined set of instructions. In an exemplary embodiment, three scans are recorded with different amounts of known ambient light. The amount of ambient light is known using the following technique: An LCD display panel with known brightness is placed two meters away from the subject for these sessions. Computer software causes the LCD display panel to display PNG images that attenuate the light emitted by the series of LCD displays. Each PNG image covers the entire display when displayed. PNG images are flat, one-color images; that is, each pixel in the image has the same value. PNG images are 8-bit RGB-encoded images. An 8-bit image appears black when R, G, B = {0, 0, 0}. An 8-bit image appears dark gray when R, G, B = {80, 80, 80}. An 8-bit image appears medium gray when R, G, B = {116, 116, 116}. The luminance emitted by the LCD display for each PNG image was recorded at a distance of 2 meters. The subject underwent three scans, each illuminated with a different PNG image, thereby producing a known ambient light.

[0157] In general, the training process uses a dataset (pairs of selfie scan data (GLTF) and ground truth measurements) to refine weights for the complexion model. For each facial region (i.e., forehead, left cheek, left chin, décolleté, right chin, and right cheek, each represented by a set of vertices), weights for patches within the facial region are trained using spectrophotometric CIELAB ground truth data, using the set of corrected vertex colors (see above) as input. Curve fitting weights for each skin region are trained.

[0158] Continuing the description of the process for building and training a machine learning model, the model's inputs are determined. In this embodiment, specific labeled vertices of the winged edge model are used as inputs. The RGB values ​​of each vertex are converted to CIE l*a*b color space. Input channels are constructed from all vertices with specific labels. The model's output is determined based on the application's needs and training data. For example, the output channel may be specified as a single CIE l*a*b color representing the complexion of a facial region. The training input channel is specified as a single CIE l*a*b color collected using a spectrophotometer scan of the facial region. The model design can take the form of a neural network model. Reducing relatively large vector inputs to smaller vector outputs is well suited to certain forms of neural networks. Platforms exist to reliably execute these types of models and scale them to be useful for large-scale production systems. The model's depth and connectivity are determined based on the complexity of the inputs. The model is trained using a wide variety of scanned inputs. Random training data is reserved for testing. The model is evaluated using test data. Variations in filters, depth, and connectivity are tested and optimized. A second stage of machine learning can be applied to the output of the first stage, described below. An end use may require that a single color be provided that can be used to formulate a cosmetic product that provides a uniform color for a user's complexion. In one embodiment, the color can be calculated by taking the component medians of the regional color output from the first stage of machine learning.

[0159] In other embodiments, it may be desirable to train a second stage of machine learning to provide color recommendations for a single cosmetic product. The training data for this may be the component medians of the training inputs for the first stage or a uniform color designated by a makeup artist. In one embodiment, the second-stage machine learning network is constructed and trained in the following manner: Model inputs are determined. In this embodiment, the CIE l*a*b color output for each facial region provided by the first stage of machine learning is used. The inputs consist of CIE l*a*b color and facial region label, or input location, which form a large vector input. The model output is determined based on the needs of the application and the training data. A single CIE l*a*b color designating a uniform color for the facial cosmetic product is output. The training data is a filtered set of recommendations by a makeup artist. Smoothing may be applied to a set of similar training inputs. Component median filtering may be applied to a set of similar training inputs. The makeup artist training input may be combined with spectrophotometer scans based on additional artist input. A neural network model may be used because emulating artistic choices is a known use of neural networks. Platforms exist to reliably execute these types of models and scale them to be useful for large-scale production systems. The depth and connectivity of the model can be based on previous network models designed for aesthetic selection. The model is trained using a wide variety of scan inputs. For example, selecting a distributed cluster of subjects from a large cohort representing a geographic region provides a wide variety of complexion types. Collecting input data from several sessions of makeup artists' aesthetic color choices, preferably with similar but different groupings of people, at different times, provides a larger dataset that will capture the makeup artist's intent more accurately than a smaller set. Selecting a handheld device model then collects data using many of these devices, rather than just a single device, to provide a better sampling of the model's lighting and exposure characteristics.

[0160] In one embodiment, determining the color of a single cosmetic product from a set of color matches for facial locations can be implemented in the following steps: A series of tests are performed on a sample set of subjects with various complexion types, as described above. A scan is performed on each subject. The CIELAB color median component values ​​for each facial region are calculated as CIELAB inputs. A cosmetic formula is found using the CIELAB inputs and methods disclosed in other patents, such as the applicant's background patents. The formula is created and applied to the subject by a makeup artist. The makeup artist either approves the match or suggests a color correction. If approved, the measured and approved colors are recorded and stored. If not approved, a color correction is applied to the CIELAB color, and the test is repeated. A curve fit is performed based on the CIELAB L* components for the difference between the measured and approved colors. If a function is found that matches the makeup artist's intent, the function can be used to adjust the CIELAB color median component values ​​for each facial region. In some cases, this function may provide a bias towards slightly lighter L* values, a decrease in A* values, and a slight increase in B* values ​​in some parts of the L* mapping curve. If the aesthetic options are not clearly compatible using curve fitting, a machine learning system can be built based on the CIELAB colors of each facial region as input and makeup artist-approved colors as training data.

[0161] An alternative embodiment to the component median approach for approximating the CIELAB color of an individual's skin tone is a composite approach. Using the component median-based approach described above, typically, each of multiple facial regions (e.g., preferred regions such as the forehead, left cheek, left chin, décolleté, right chin, and right cheek) outputs a single CIELAB color for each region. The median values ​​of each of the CIE l*, a*, and b* channels are then used to output a single l*, a*, and b* channel value, and a per-channel median calculation is used to represent the entire face. This median calculation is then used to represent the user's skin tone as an estimate compared to ground truth. In one approach, this data is obtained from a spectrophotometer.

[0162] Alternatively, a composite approach may involve linear weighting across multiple regions, such as the six preferred regions described above, to achieve a better match to the ground truth. The composite approach allows for greater depth in determining which of the six regions provides a better representation of the single CIELAB value that best matches the ground truth skin tone representation. This is done by constraining the weighting, i.e., limiting the weights to 1, thus creating a method that allows for direct observation of which regions contribute most and least to the final output. Using multiple regions and a composite approach, linear weighting can be calculated from a multivariate linear regression with regularization across a dataset of human models, using the CIELAB vectors for each of the facial regions as inputs and the ground truth color CIELAB single vector (e.g., from a spectrophotometer) as output.

[0163] Multivariate linear regression may be used to calculate the weight for each skin region (e.g., using the six preferred regions above). Furthermore, θ normalization can be performed using the normal equation to make the weights sum to 1, which is given by:

number

number

number

[0164] θ is the weighting value (i.e., the linear weight indicating the influence of each of the six regions, where 0 means no influence and 1 means total influence, and the value ranges from [0, 1]).

[0165] λ is a regularization parameter,

number

[0166] Using the above example regions, it is clear that the décolleté region indeed expresses a much higher weighting level than other regions, resulting in a more accurate alignment with ground truth color. This result also coincides with the intuition and observations of makeup artists in that this region is typically used by makeup artists as the primary basis for color in assessing skin tone.

[0167] Additionally, a hybrid approach can be used to adapt the weightings based on other external factors that determine skin tone, such as seasonal variations. If one dataset is acquired during the winter months and another dataset is acquired during the summer months, there may be subtle but important differences in the weightings to properly identify a user's skin tone. In that case, an additional source of data that can be fed into the model is likely sun exposure based on an individual's geography, outdoor lifestyle, etc.

[0168] The training data for the dataset may need to be smoothed by applying a Gaussian filter to the difference between the component medians or the composite results of the CIELAB colors and the makeup artist-approved colors for each facial region. For example, using the component medians, the smoothed delta is added to the component medians, which is then used as the training input. This process can be represented as follows: 1. The training data is smoothed and filtered. a. List A will be the makeup artist's approved colors. b. Let ListM be the median values ​​of the CIELAB color components of each face region. c.Let ListT be the training data result. i.ListT=Gaussian(ListA-ListM)+ListM 2. The ML system is trained using the filtered data. 3. Validate the results of the ML system. a. A test may be performed in which a makeup artist checks the recommendations made by the ML system.

[0169] Once built and trained, the complexion model can be deployed as an AWS EC2 instance or hosted using other widely available services. The compute instance can operate synchronously or asynchronously. The compute instance provides an API interface for running the complexion color model. The machine learning system may be implemented using a widely available machine learning platform, and the machine learning model may be represented as a data description that the machine learning platform uses to build and run the machine learning model. Code running on the compute instance: 1. Receive a request via API to process a user scan into color recommendations. 2. Load the face model data (e.g., GLTF file) for a specific subject. 3. Load and manage machine learning models as needed. 4. Apply device color correction to the winged edge vertices. 5. Apply inverse rendering correction to the winged edge vertices. 6. Converting winged edge vertices into machine learning inputs. 7. Run the machine learning model. 8. Return the machine learning output data for the request.

[0170] In essence, this service is used to evaluate face model data (e.g., a GLTF file) to predict (by inference) face color in CIE L*a*b space. The captured image data (i.e., the face model data in the GLTF file) is composed of light from the device display and measured skin color. Using a known illuminant (device display) and the captured image, the model solves for skin color as described in more detail above.

[0171] Although certain exemplary embodiments described herein refer to topical agents including agents applied to the skin, such as skin foundation, embodiments of the present invention are equally applicable to topical agents for other areas of the face, such as the eyes or lips, and / or for determining color to allow matching or selection of agents applied to other areas, such as hair.

[0172] Some or all of the described functionality can be implemented in software and / or hardware on a user device. User devices can include, but are not limited to, smartphones, smartwatches, smart glasses, tablet computers, portable computers, televisions, game consoles, music players, mobile phones, virtual reality goggles, laptops, palmtops, smart or dumb terminals, network computers, personal digital assistants, home assistants preferably with cameras (such as Alexa™ or Google® Home™), wireless devices, information appliances, workstations, minicomputers, mainframe computers, or other computing devices operating as general-purpose computers or dedicated hardware devices capable of performing the functionality described herein. Software can be implemented on a general-purpose computing device, for example, in the form of a computer including a processing unit, a system memory, and a system bus coupling various system components including the system memory to the processing unit.

[0173] Additionally or alternatively, some or all of the functionality may be performed remotely, in the cloud, or via software as a service. For example, the matching functionality may be performed on one or more remote servers or other devices described above that communicate with the user devices. The remote functionality may be performed on a server-class computer that has sufficient memory, data storage, and processing power and runs a server-class operating system (e.g., Oracle® Solaris®, GNU / Linux®, and Microsoft® Windows® operating system families).

[0174] The system may include multiple software processing modules stored in memory and executed on a processor. By way of example, the program modules may be in the form of one or more suitable programming languages ​​that are converted into machine code or object code to enable one or more processors to execute the instructions. The software may be in the form of a standalone application implemented in a suitable programming language or framework.

[0175] The method steps of the techniques described herein may be performed by one or more programmable processors executing one or more computer programs to perform functions by manipulating input data and generating output. Method steps may also be performed by, and an apparatus may be implemented as, special purpose logic circuitry, such as, for example, an FPGA (Field Programmable Gate Array) or an ASIC (Application Specific Integrated Circuit). A module may refer to the portion of the computer program and / or processor / special purpose circuitry that implements that function.

[0176] Processors suitable for executing computer programs include, by way of example, both general-purpose and special-purpose microprocessors. Generally, a processor receives instructions and data from a read-only memory or a random-access memory, or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Information carriers suitable for embodying computer program instructions and data include all forms of non-volatile memory, including, by way of example, semiconductor memory devices such as EPROM, EEPROM, and flash memory devices, magnetic disks, e.g., internal or removable hard disks, magneto-optical disks, and CD-ROM and DVD-ROM disks. The one or more memories may store media assets (e.g., audio, video, graphics, interface elements, and / or other media files), configuration files, and / or instructions that, when executed by the processor, form modules, engines, and other components described herein and perform functions associated with the components. The processor and memory may be supplemented by, or incorporated in, special-purpose logic circuitry.

[0177] In various embodiments, a user device includes a web browser, native applications, or both that facilitate the execution of the functions described herein. A web browser allows a device to request web pages or other downloadable programs, applets, or documents (e.g., from a server) along with a web page request. An example of a web page is a data file containing computer-executable or interpretable information, graphics, sound, text, and / or video that can be displayed, executed, played, processed, streamed, and / or stored, and that may contain links or pointers to other web pages. In one embodiment, a user of the device manually requests a web page from a server. Alternatively, the device makes the request automatically with a web browser. Examples of commercially available web browser software include Google® Chrome®, Microsoft® Internet Explorer®, Mozilla® Firefox®, and Apple® Safari®.

[0178] In some implementations, the user device includes client software. The client software provides the device with functionality to implement and execute the features described herein. The client software can be implemented in various forms, such as a native application, a web page, a widget, and / or Java, JavaScript, .Net, Silverlight, Flash, and / or other applet or plug-in that is downloaded to the device and operates in conjunction with a web browser. The client software and the web browser can be part of a single client-server interface; for example, the client software can be implemented as a plug-in to a web browser or another framework or operating system. Other suitable client software architectures, including, but not limited to, widget frameworks and applet technologies, can also be used with the client software.

[0179] A communications network can connect devices to one or more servers and / or each other. Communications can occur over media such as standard telephone lines, LAN or WAN links (e.g., T1, T3, 56 kb, X.25), broadband connections (ISDN, Frame Relay, ATM), wireless links (802.11 (Wi-Fi), Bluetooth, GSM, CDMA, etc.), and the like. Other communications media are possible. The network can carry TCP / IP protocol communications and HTTP / HTTPS requests made by web browsers, and connections between clients and servers can communicate over such a TCP / IP network. Other communications protocols are also possible.

[0180] The system may also be practiced in distributed computing environments where tasks are performed by remote processing devices linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including memory storage devices. Other types of system hardware and software than those described herein may also be used, depending on the device capabilities and amount of data processing power required. The system may also be implemented on one or more virtual machines running a virtualization operating system such as those described above, running on one or more computers having hardware such as those described herein.

[0181] In some cases, a relational database or other structured database may provide such functionality, for example, as a database management system that stores data for processing. Examples of databases include the MySQL Database Server or the ORACLE Database Server offered by ORACLE Corp. of Redwood Shores, California, the PostgreSQL Database Server offered by the PostgreSQL Global Development Group of Berkeley, California, or the DB2 Database Server offered by IBM.

[0182] It should also be noted that implementations of the systems and methods can be provided as one or more computer-readable programs embodied on or within one or more articles of manufacture. The program instructions can be encoded in an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal generated to encode information for transmission to an appropriate receiving device for execution by a data processing device. A computer storage medium can be or be included in a computer-readable storage device, a computer-readable storage substrate, a random-access or serial-access memory array or device, or one or more combinations thereof. Furthermore, while a computer storage medium is not a propagated signal, the computer storage medium can be the source or destination of computer program instructions encoded in an artificially generated propagated signal. A computer storage medium can also be or be included in one or more separate physical components or media (e.g., multiple CDs, disks, or other storage devices).

[0183] Those skilled in the art will appreciate that changes could be made to the embodiments described above without departing from the broad inventive concept thereof. It is understood, therefore, that the invention is not limited to the particular embodiments disclosed, but that it is intended to cover modifications within the spirit and scope of the invention as defined by the appended claims. The present invention encompasses the following. [Section 1] Displaying an image of a body part of the user on an optical display of a device used by the user, the device comprising an image sensor, and the image of the body part of the user being sensed by the sensor; determining whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of the image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded images to determine lighting model data associated with the lighting environment; determining reflectance and color characteristics associated with the body part of the user based on the recorded images and the lighting model data; and A method comprising: [Section 2] Item 14. The method of item 1, wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part includes displaying colored light on the optical display. [Section 3] Item 1. The method of item 1, wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part includes displaying an illuminated outline of the body part on the optical display. [Section 4] Item 14. The method of item 1, wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part includes activating a tactile or audible indicator on the device. [Section 5] Item 11. The method of item 1, wherein determining whether the lighting environment is acceptable for recording the image of the body part includes displaying colored light on the optical display. [Section 6] Item 11. The method of item 1, wherein determining that the lighting environment is acceptable for recording the image of the body part includes displaying an illuminated outline of the body part. [Section 7] Item 11. The method of item 1, wherein determining that the lighting environment is acceptable for recording the image of the body part includes activating a tactile or audible indicator on the device. [Section 8] Determining the illumination model comprises: measuring exposure data associated with the device; determining data describing a relationship between a light source on the device and an aperture of the image sensor; determining data describing a relationship between the lighting environment and the image sensor; determining data describing a relationship between the image sensor, the light source, and a surface of the body part; The method according to item 1, comprising: [Section 9] determining a customized cosmetic formulation based in part on said reflectance and color characteristics; The method of claim 1, further comprising: [Section 10] Item 1. The method of item 1, wherein the optical display includes a light source, and illumination of the body part by the lighting environment is less than about 2% of illumination provided by the light source, and processing the recorded images to determine the illumination model data includes direct calculation. [Section 11] Item 1. The method of item 1, wherein the optical display includes a light source, and illumination of the body part by the lighting environment is approximately 2% to 10% of illumination provided by the light source, and processing the recorded images to determine the illumination model data includes performing image filtering. [Section 12] Item 1. The method of item 1, wherein the optical display includes a light source, and illumination of the body part by the lighting environment is approximately 10% to 25% of illumination provided by the light source, and processing the recorded images to determine the illumination model data includes performing a statistical estimation of bilateral symmetry. [Section 13] Item 1. The method of item 1, wherein the optical display includes a light source, and illumination of the body part by the lighting environment is approximately 25% to 40% of illumination provided by the light source, and processing the recorded images to determine the illumination model data includes using machine learning techniques. [Section 14] The optical display includes a light source, and if it is determined that the lighting environment associated with the sensor is not acceptable for recording the representation of the body part, the method comprises: instructing the user to modify the lighting environment so that illumination of the body part is less than about 2% of illumination provided by the light source; illuminating the body part with constant white light using the light source; determining whether the illuminated body part is positioned relative to the sensor to enable recording of the image of the body part by displaying an outline of the body part of the user on the optical display to position the body part within the field of view of the sensor; further comprising Item 1, wherein processing the recorded images to determine the illumination model data comprises direct calculation. [Section 15] 1. A system comprising: one or more processors and non-transitory memory; machine-readable instructions stored in said memory; the instructions, when executed by one or more processors, cause the system to: display an image of a body part of the user on an optical display of a device used by the user, the device including an image sensor, the image of the body part of the user being sensed by the sensor; determining whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of the image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded images to determine lighting model data associated with the lighting environment; determining reflectance and color characteristics associated with the body part of the user based on the recorded images and the lighting model data; and A system that causes an operation including [Section 16] 1. A method comprising: (a) illuminating a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of the device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device; the representation of the body part includes a contour associated with the body part, the representation allowing the user to position the body part within the optical display; and (c) recording an image of the body part sensed by the image sensor; and (d) recording data describing characteristics of the optical display, including the known intensity and color of the illumination light, and characteristics of the image sensor, including exposure settings of the image sensor; (e) determining a surface color of the body part based on data relating to the recorded image of the body part, the data describing characteristics of the optical display, and the data describing characteristics of the image sensor; A method comprising: [Section 17] determining a distance from the image sensor to the surface of the body part, the distance being further used to determine the surface color of the body part. Item 17. The method of item 16, further comprising: [Section 18] Item 17. The method of item 16, wherein determining the surface color of the body part includes comparing the data associated with the recorded image of the body part with the data describing the characteristics of the optical display and the data describing the characteristics of the image sensor. [Section 19] calibrating the exposure sensitivity of the illumination source and the image sensor using data from a recorded image of the illumination source reflected by a mirror; Item 17. The method of item 16, further comprising: [Section 20] Item 18. The method of item 17, wherein the surface color of the body part is determined by processing the distance from the image sensor to the surface of the body part, the data associated with the recorded image of the body part, the data describing the characteristics of the optical display, and the data describing the characteristics of the image sensor using a network of weighted functions. [Section 21] 1. A system comprising: one or more processors and non-transitory memory; machine-readable instructions stored in said memory; the instructions, when executed by one or more processors, cause the system to: (a) illuminate a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of the device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device; the representation of the body part includes a contour associated with the body part, the representation allowing the user to position the body part within the optical display; and (c) recording an image of the body part sensed by the image sensor; and (d) recording data describing characteristics of the optical display, including the known intensity and color of the illumination light, and characteristics of the image sensor, including exposure settings of the image sensor; (e) determining a surface color of the body part based on data relating to the recorded image of the body part, the data describing characteristics of the optical display, and the data describing characteristics of the image sensor; A system that causes an operation including [Section 22] 1. A method comprising: Displaying an image of the user's body part on an optical display of a device used by the user, the device including an image sensor, the image of the user's body part being sensed by the sensor; recording a first version and a second version of the image of the body part using the sensor to provide an associated recorded high dynamic range image; the display illumination on the optical display of the device is set to white to record the first version of the image; the display illumination on the optical display of the device is set to black to record the second version of the image; and removing at least a portion of the illumination of the second version of the image from the first version of the image to create a third version of the image; processing data associated with the third version of the image to create a three-dimensional model of the body part, the three-dimensional model being associated with a series of vertices, each of the vertices being associated with a color; and correcting the color associated with each of the vertices to account for a distance from the sensor to the body part and an angle from the sensor to the body part to determine a corrected color vertex; processing the corrected color vertices using a machine learning model to estimate color characteristics of the body part; and A method comprising: [Section 23] 23. The method of clause 22, further comprising operating the image sensor in a self-portrait mode using an application. [Section 24] 24. The method of clause 23, further comprising using the application to control settings of the device having the image sensor. [Section 25] 23. The method of claim 22, further comprising capturing the first version of the image in a dark indoor lighting environment. [Section 26] 26. The method of claim 25, further comprising illuminating the optical display with white light. [Section 27] 23. The method of clause 22, further comprising storing the third version of the image in a face data format. [Section 28] 28. The method of claim 27, wherein each vertex includes one or more of a label associated with the position of the vertex on the body part, an RGB color obtained from the third version of the image, a depth of the vertex obtained from depth data of the image sensor, a spatial position of the vertex relative to the viewpoint of the image sensor, and the projected normal position of the vertex relative to the viewpoint of the image sensor. [Section 29] 23. The method of claim 22, further comprising a pre-processing step of using image data from the device to correct color based on the type of the device. [Section 30] 23. The method of claim 22, wherein the machine learning model includes a color correction learning model, and the method further includes correcting for the type of device while training the complexion color model, and including images from different types of devices, including the device having the image sensor, as training data for the complexion color model. [Section 31] 23. The method of claim 22, wherein training data for use with the machine learning model is smoothed and filtered before training the machine learning model. [Section 32] 23. The method of claim 22, wherein the machine learning model is constructed and trained using training data from subjects, the training data including one or more of survey data, self-reported data from the subjects, reference photographs of the subjects along with color charts, skin color data from the subjects measured by a spectrophotometer in at least one facial region used as a ground truth measurement, and facial image data from users. [Section 33] 33. The method of claim 32, wherein the at least one facial area is selected from the wrist, forehead, right cheek, left cheek, right jaw line, left jaw line, and décolleté. [Section 34] Item 33. The method of item 32, wherein the training data, which is skin color data from the at least one facial region used for ground truth measurement, is combined into a single CIELAB color using a component median method, and the single CIELAB color for each facial region is used as input to a machine learning model, and the output of the machine learning model is a uniform color of facial cosmetics. [Section 35] 33. The method of claim 32, wherein the training data, which is skin color data from the at least one facial region used for ground truth measurement, is combined using a compositing method in which the skin color data from the at least one region is linearly weighted across the at least one facial region to determine which of the at least one region best matches a single CIELAB value for skin color in the ground truth dataset. [Section 36] 36. The method of claim 35, wherein in the machine learning model, a CIELAB vector for each of the at least one face region is an input to the model, and a ground truth color CIELAB single vector is the output. [Section 37] 37. The method of claim 36, wherein the linear weighting is calculated as a result of a regularized multivariate linear regression. [Section 38] 37. The method of clause 36, wherein the machine learning model can include a ground truth dataset having ground truth data captured in summer and ground truth data captured in winter.

Claims

1. Displaying an image of a body part of a user on an optical display of a device used by the user, the optical display including a light source, the device including an image sensor, and the image of the body part of the user being sensed by the sensor; determining whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of the image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded images to determine lighting model data associated with the lighting environment based on a ratio of illumination of the body part by the lighting environment to illumination of the body part provided by the light source; determining reflectance and color characteristics associated with the body part of the user based on the recorded images and the lighting model data; A method comprising:

2. The method of claim 1 , wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part comprises displaying colored light on the optical display.

3. 2. The method of claim 1, wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part includes displaying an illuminated outline of the body part on the optical display.

4. The method of claim 1 , wherein determining whether the position of the body part relative to the sensor is acceptable for recording the image of the body part includes activating a tactile or audible indicator on the device.

5. The method of claim 1 , wherein determining whether the lighting environment is acceptable for recording the image of the body part comprises displaying colored light on the optical display.

6. The method of claim 1 , wherein determining that the lighting environment is acceptable for recording the image of the body part comprises displaying a lit outline of the body part.

7. The method of claim 1 , wherein determining that the lighting environment is acceptable for recording the image of the body part comprises activating a tactile or audible indicator on the device.

8. Displaying an image of a body part of a user on an optical display of a device used by the user, the device comprising an image sensor, the image of the body part of the user being sensed by the sensor; and determining whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of the image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded images to determine lighting model data associated with the lighting environment; determining reflectance and color characteristics associated with the body part of the user based on the recorded images and the lighting model data; Including, Determining the illumination model data includes: measuring exposure data associated with the device; determining data describing a relationship between a light source on the device and an aperture of the image sensor; determining data describing a relationship between the lighting environment and the image sensor; determining data describing a relationship between the image sensor, the light source, and a surface of the body part; A method comprising:

9. determining a customized cosmetic formulation based in part on said reflectance and color characteristics. The method of claim 1 further comprising:

10. The method of claim 1, wherein illumination of the body part by the lighting environment is less than approximately 2% of the illumination provided by the light source, and processing the recorded images to determine the lighting model data includes direct calculation.

11. The method of claim 1, wherein illumination of the body part by the lighting environment is approximately 2% to 10% of the illumination provided by the light source, and processing the recorded images to determine the lighting model data includes performing image filtering.

12. The method of claim 1, wherein illumination of the body part by the lighting environment is approximately 10% to 25% of the illumination provided by the light source, and processing the recorded images to determine the lighting model data includes performing a statistical estimation of left-right symmetry.

13. The method of claim 1, wherein illumination of the body part by the lighting environment is approximately 25% to 40% of the illumination provided by the light source, and processing the recorded images to determine the lighting model data includes using machine learning techniques.

14. If it is determined that the lighting environment associated with the sensor is not acceptable for recording the representation of the body part, the method further comprising: instructing the user to modify the lighting environment such that illumination of the body part is less than about 2% of illumination provided by the light source; illuminating the body part with constant white light using the light source; determining whether the illuminated body part is positioned relative to the sensor to enable recording of the image of the body part by displaying an outline of the body part of the user on the optical display to position the body part within a field of view of the sensor; Further comprising: The method of claim 1 , wherein processing the recorded images to determine the illumination model data comprises direct computation.

15. 1. A system comprising: one or more processors and non-transitory memory; machine-readable instructions stored in said memory; the instructions, when executed by one or more processors, cause the system to: display an image of a body part of the user on an optical display of a device used by the user, the optical display including a light source, the device including an image sensor, and the image of the body part of the user being sensed by the sensor; determining whether a position of the body part image relative to the sensor is acceptable to enable recording of the image of the body part; determining whether a lighting environment associated with the sensor is acceptable to enable recording of the image of the body part; recording an image using the sensor to provide a recorded image having image data; processing the recorded images to determine lighting model data associated with the lighting environment based on a ratio of illumination of the body part by the lighting environment to illumination of the body part provided by the light source; determining reflectance and color characteristics associated with the body part of the user based on the recorded images and the lighting model data; A system that causes a system to perform an operation including:

16. 1. A method comprising: (a) illuminating a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of the device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device; the representation of the body part includes a contour associated with the body part, the representation enabling the user to place the body part within the optical display; and (c) recording an image of the body part sensed by the image sensor; and (d) recording data describing characteristics of the optical display, including the known intensity and color of the illumination light, and characteristics of the image sensor, including exposure settings of the image sensor; (e) determining a surface color of the body part based on data related to the recorded image of the body part, the data describing characteristics of the optical display, and the data describing the characteristics of the image sensor; A method comprising:

17. determining a distance from the image sensor to the surface of the body part, the distance being further used to determine a surface color of the body part.

20. The method of claim 16, further comprising:

18. 17. The method of claim 16, wherein determining the surface color of the body part comprises comparing the data associated with the recorded image of the body part with the data describing characteristics of the optical display and the data describing the characteristics of the image sensor.

19. calibrating the exposure sensitivity of the illumination source and the image sensor using data from a recorded image of the illumination source reflected by a mirror; 20. The method of claim 16, further comprising:

20. 18. The method of claim 17, wherein the surface color of the body part is determined by processing a distance from the image sensor to the surface of the body part, the data associated with the recorded image of the body part, the data describing characteristics of the optical display, and the data describing characteristics of the image sensor using a network of weighting functions.

21. 1. A system comprising: one or more processors and non-transitory memory; machine-readable instructions stored in said memory; the instructions, when executed by one or more processors, cause the system to: (a) illuminate a body part of a user with light of a known intensity and color using an illumination source associated with an optical display of a device; (b) displaying a representation of the body part on the optical display, the body part being sensed by an image sensor of the optical device; the representation of the body part includes a contour associated with the body part, the representation enabling the user to place the body part within the optical display; and (c) recording an image of the body part sensed by the image sensor; and (d) recording data describing characteristics of the optical display, including the known intensity and color of the illumination light, and characteristics of the image sensor, including exposure settings of the image sensor; (e) determining a surface color of the body part based on data related to the recorded image of the body part, the data describing characteristics of the optical display, and the data describing the characteristics of the image sensor; A system that causes a system to perform an operation including:

Citation Information

Patent Citations

  • Methods of enrolling and authenticating user in authentication system, facial authentication system, and methods of authenticating user in authentication system

    JP2016051482A

  • Systems and methods for embodying and formulating custom topical agents

    JP2016523574A