CN111340818A - Hair dyeing effect picture generation method and device and computer readable storage medium - Google Patents

Hair dyeing effect picture generation method and device and computer readable storage medium Download PDF

Info

Publication number
CN111340818A
CN111340818A CN201811551438.3A CN201811551438A CN111340818A CN 111340818 A CN111340818 A CN 111340818A CN 201811551438 A CN201811551438 A CN 201811551438A CN 111340818 A CN111340818 A CN 111340818A
Authority
CN
China
Prior art keywords
hair
color
user
dyeing
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811551438.3A
Other languages
Chinese (zh)
Inventor
齐坤鹏
杨超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201811551438.3A priority Critical patent/CN111340818A/en
Publication of CN111340818A publication Critical patent/CN111340818A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Abstract

The invention discloses a method and a device for generating a hair dyeing effect picture and a computer readable storage medium, and relates to the field of image processing. The method for generating the hair dyeing effect picture comprises the following steps: acquiring the original hair color of a user from the user image; acquiring a color change value of the hair dye; determining the hair color of the simulated user after dyeing according to the original hair chroma and the color change value of the hair dye; and generating a user hair dyeing effect picture according to the user image and the simulated hair color of the user after hair dyeing. The embodiment of the invention simulates the hair color of the user after the hair dyeing through the calculation process based on the color change value of the hair dye based on the chemical characteristics of the hair dye, so that the simulated hair color is closer to the actual hair color, the accuracy of the hair dyeing effect chart is improved, and the user experience is improved.

Description

Hair dyeing effect picture generation method and device and computer readable storage medium
Technical Field
The present invention relates to the field of image processing, and in particular, to a method and an apparatus for generating a hair dyeing effect map, and a computer-readable storage medium.
Background
At present, the main implementation of virtual hair dyeing is to use an image segmentation algorithm to segment the hair part in the user image, and then implement the dyeing process for the hair part. The mainstream hair coloring algorithm is mainly realized by mixing the hair color and the target color according to different proportions. The target color is the color of the hair after dyeing, and is generally noted on the package of the hair dye. For example, a certain hair dye is marked with a "color" of 3.15, i.e., dark reddish-grey-brown, and the color of the hair dyeing effect of the model on the package is dark reddish-grey-brown.
The blending ratio is a weight of a target color when two colors are blended, and the weight of the hair color may be a difference between 1 and the blending ratio. The larger the mixing ratio, the closer the color after final mixing is to the target color. For example, when the hair color is black (0.1, 0.1, 0.1) and the target color is red (1, 0, 0), the colors are mixed at a ratio of 0.8 to obtain a dark red color (0.82, 0.02, 0.02).
Disclosure of Invention
The inventors have recognized that a single blend ratio is difficult to accommodate for a wide variety of hair colors and target colors. Light-colored hair is easier to dye than dark-colored hair, and therefore the mixing ratio that should be used when using one hair dye to dye hair of different colors is different. And such dynamic mixing ratios are difficult to set. Also, the target color in the product information of the hair dye is a color dyed based on hair of a certain color, and the hair colors of different users are different, so the target color is also inaccurate. Thereby making it difficult to obtain an accurate hair dyeing effect map.
The embodiment of the invention aims to solve the technical problem that: how to improve the accuracy of the hair dyeing effect picture.
According to a first aspect of some embodiments of the present invention, there is provided a method for generating a hair dyeing effect map, comprising: acquiring the original hair color of a user from the user image; acquiring a color change value of the hair dye; determining the hair color of the simulated user after dyeing according to the original hair chroma and the color change value of the hair dye; and generating a user hair dyeing effect picture according to the user image and the simulated hair color of the user after hair dyeing.
In some embodiments, the color change value is a color advancement or a lightening.
In some embodiments, the color penetration is determined from the difference between a sample hair color of the hair colorant and the color of the hair colorant; the lightening degree is determined according to a difference between the color of the hair dye and the color of the sample hair of the hair dye.
In some embodiments, determining a simulated user-dyed hair color based on the original hair shade and the color change value of the hair colorant comprises: under the condition that the color change value is the color entering value, taking the sum of the original hair color and the color entering value as the hair color value after the hair dyeing; taking the difference between the original hair chroma and the lightening degree as the chroma value of the dyed hair under the condition that the color change value is the lightening degree; and determining the hair color of the simulated user after the hair is dyed according to the hair color value after the hair is dyed.
In some embodiments, determining a simulated user dyed hair color based on the dyed hair chroma values comprises: and determining the hair color after the hair dyeing of the simulated user according to the hair colorimetric value after the hair dyeing and the corresponding color of the tone value of the hair dye in the chroma tone table.
In some embodiments, generating the user hair coloring effect map according to the user image and the simulated user hair color after hair coloring comprises: segmenting the user image into a hair portion and a non-hair portion; and regenerating the image data of the hair part according to the simulated hair color of the user after hair dyeing to obtain a hair dyeing effect picture of the user.
In some embodiments, the image data of the hair part is generated by re-generating the lightness channel, the color tone channel and the saturation channel of the hair color after the hair part is dyed by the user, and the user hair dyeing effect graph is obtained.
In some embodiments, raw hair shades of a plurality of hair regions of a user are obtained from a user image; acquiring a color change value of the hair dye; determining the hair color of the hair dyed by the user corresponding to each hair area according to the original hair color of each hair area and the color change value of the hair dye; and generating a user hair dyeing effect graph according to the user image and the simulated hair color of the user after hair dyeing corresponding to each hair area.
In some embodiments, a user hair-dyeing effect graph corresponding to each user image is generated according to a plurality of user images in a real-time user video and the hair color of the simulated user hair-dyed corresponding to each user image; the method for generating the hair dyeing effect picture further comprises the following steps:
and generating a user hair dyeing effect video according to the user hair dyeing effect graphs corresponding to the plurality of continuous user images.
According to a second aspect of some embodiments of the present invention, there is provided a hair coloring effect map generating apparatus, comprising: the original chromaticity acquisition module is configured to acquire original hair chromaticity of the user from the user image; a color change value acquisition module configured to acquire a color change value of the hair dye; a hair color determination module configured to determine a simulated hair color of the user after hair dyeing according to the original hair chromaticity and the color change value of the hair dye; and the effect picture generating module is configured to generate a user hair dyeing effect picture according to the user image and the simulated hair color of the user after hair dyeing.
In some embodiments, the color change value is a color advancement or a lightening.
In some embodiments, the color penetration is determined from the difference between a sample hair color of the hair colorant and the color of the hair colorant; the lightening degree is determined according to a difference between the color of the hair dye and the color of the sample hair of the hair dye.
In some embodiments, the hair color determination module is further configured to determine a sum of the original hair color and the further color as a hair color value after hair coloring, if the color change value is the further color; taking the difference between the original hair chroma and the lightening degree as the chroma value of the dyed hair under the condition that the color change value is the lightening degree; and determining the hair color of the simulated user after the hair is dyed according to the hair color value after the hair is dyed.
In some embodiments, the hair color determination module is further configured to determine a simulated user-dyed hair color based on the dyed hair chroma value and a corresponding color of the dyed hair hue value in the chroma hue table.
In some embodiments, the effect map generation module is further configured to segment the user image into a hair portion and a non-hair portion; and regenerating the image data of the hair part according to the simulated hair color of the user after hair dyeing to obtain a hair dyeing effect picture of the user.
In some embodiments, the effect map generation module is further configured to re-generate the image data of the hair part using the lightness channel, the hue channel and the saturation channel of the simulated user-dyed hair color of the hair part in the user image, to obtain the user-dyed effect map.
In some embodiments, the raw chromaticity obtaining module is further configured to obtain raw hair chromaticities of a plurality of hair regions of the user from the user image; the hair dyeing color determining module is further configured to determine a simulated user dyed hair color corresponding to each hair area according to the original hair chromaticity of each hair area and the color change value of the hair dye; the effect map generating module is further configured to generate a user hair-dyeing effect map according to the user image and the simulated hair color of the user after hair-dyeing corresponding to each hair area.
In some embodiments, the effect map generating module is further configured to generate a user hair-dyeing effect map corresponding to each user image according to the plurality of user images in the real-time user video and the simulated hair color of the user after hair dyeing corresponding to each user image; the hair dyeing effect map generating apparatus further comprises: and the hair dyeing effect video generation module is configured to generate a user hair dyeing effect video according to the user hair dyeing effect graph corresponding to the plurality of continuous user images.
According to a third aspect of some embodiments of the present invention, there is provided a hair coloring effect map generating apparatus, comprising: a memory; and a processor coupled to the memory, the processor configured to execute any one of the above-mentioned hair coloring effect map generating methods based on instructions stored in the memory.
According to a fourth aspect of some embodiments of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the program is executed by a processor to implement any one of the hair coloring effect map generating methods.
Some embodiments of the above invention have the following advantages or benefits: the embodiment of the invention simulates the hair color of the user after the hair dyeing through the calculation process based on the color change value of the hair dye based on the chemical characteristics of the hair dye, so that the simulated hair color is closer to the actual hair color, the accuracy of the hair dyeing effect chart is improved, and the user experience is improved.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for generating a hair coloring effect map according to some embodiments of the present invention.
Fig. 2 is a schematic flow diagram of a method of simulating hair color after coloring hair according to some embodiments of the present invention.
Fig. 3 is a flowchart illustrating a method for generating a hair dyeing effect map according to other embodiments of the present invention.
Fig. 4 is a schematic flow chart of a method for generating a hair dyeing effect map according to still other embodiments of the present invention.
Fig. 5 is a flowchart illustrating a method for generating a video of hair coloring effect according to some embodiments of the present invention.
Fig. 6 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to some embodiments of the present invention.
Fig. 7 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to other embodiments of the present invention.
Fig. 8 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to still other embodiments of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The inventors further analyzed the related art and found that the process of dyeing hair using a hair dye is a chemical reaction process. During the hair dyeing process, firstly, hair scales of the hair are opened, and the oxidant and the colorant enter the interior of the hair through small holes opened by the hair scales; then, the oxidizing agent bleaches the pigment in the hair, and then the oxidizing agent and the colorant entering the hair simultaneously carry out oxidation reaction to re-color the hair; and finally, closing the scales. Thus, the hair dyeing process is not a simple color mixing or superimposition, but a chemical reaction process. The hair dye can generate the color change effect of hair by bleaching and coloring.
The inventor discovers that the product information of the hair dye and the color of the hair dye in the cover are inaccurate by analyzing the chemical reaction process, but the bleaching and coloring effects of the same hair dye are certain, namely the color change value of the hair brought by the hair dye is certain. Therefore, when the hair dyeing effect graph is generated, the color change value of the hair dye can be used for calculation, and image processing is carried out according to the calculation result so as to generate the hair dyeing effect graph. An embodiment of the method for generating a hair dyeing effect map according to the present invention will be described with reference to fig. 1.
Fig. 1 is a schematic flow chart of a method for generating a hair coloring effect map according to some embodiments of the present invention. As shown in fig. 1, the method for generating a hair dyeing effect map of this embodiment includes steps S102 to S108.
In step S102, the original hair color of the user is acquired from the user image.
The user image may be an image uploaded by the user or an image acquired in real time, for example, an image captured by the user in real time when the camera is turned on. Through algorithms such as object recognition, the hair part in the user image can be recognized. By reading the pixel values of the pixels in the hair part, the original hair color of the user can be acquired.
In step S104, a color change value of the hair dye is acquired.
The color change value of the hair dye is the degree of color change of the hair dye caused by bleaching and coloring. In some embodiments, the color change value may be a further color or a lighter. The color changing value of the dyed hair is larger than the color of the hair when the color of the hair dye is larger than the color of the hair; the lightening degree is the color change value of the hair after dyeing when the chroma of the hair dye is smaller than that of the hair. The color-change value of the hair dye can be obtained by, for example, reading product information data and calling an information acquisition interface provided by a hair dye manufacturer.
The color change value may be obtained through calculation when the related information of the hair dye product or the information acquisition interface does not provide the color change value of the hair dye but provides the sample hair color of the hair dye. In some embodiments, the color penetration is determined from the difference between a sample hair color of the hair colorant and the color of the hair colorant; the lightening degree is determined according to a difference between the color of the hair dye and the color of the sample hair of the hair dye.
In step S106, the hair color of the simulated user dyed hair is determined according to the original hair color and the color change value of the hair dye.
In some embodiments, in the case that the color change value is a color advance value, the sum of the original hair color and the color advance value is taken as a hair color value after the hair is dyed; when the color change value is a lightening degree, the difference between the original hair color and the lightening degree is used as the hair color value after dyeing. Then, based on the dyed hair color values, a simulated user dyed hair color can be determined.
In step S108, a user hair-dyeing effect map is generated according to the user image and the simulated hair color of the user after hair-dyeing. For example, a simulated user-dyed hair color may be filled into the hair region in the user image.
Above-mentioned embodiment is based on the chemical property of hair dye, and the computational process through the variable colour value based on the hair dye simulates the hair colour after the user has dyed hair for the hair colour of simulation more is close to actual hair colour of dying, has improved the accuracy of dyeing the hair effect picture, has promoted user experience.
In some embodiments, the color of the hair colorant is expressed using a colorimetric hue method. The shade represents the shade of the hair, and can be divided into 10 grades from shade to shade, for example, and table 1 is an example of a color table.
TABLE 1
Figure BDA0001910733590000081
The hue refers to the gloss reflected by the hair, and table 2 is an example of a hue table.
TABLE 2
Numerical value 1 2 3 4 5 6 7
Colour(s) Grey/blue Purple color Yellow colour Orange colour Brown colour Red colour Green colour
The shades may include a main shade and a secondary shade, alerting the hair of the primary and secondary colors, respectively. For example, when the color of the hair dye is represented by "3.15", the chromaticity of the hair dye is 3 (brown), the main color tone is 1 (gray/blue), the sub-color tone is 5 (magenta), and the color expressed as a whole is dark reddish-grayish-brown. An embodiment of the simulated post-hair-coloring hair color determination method of the present invention is described below with reference to fig. 2.
Fig. 2 is a schematic flow diagram of a method of simulating hair color after coloring hair according to some embodiments of the present invention. As shown in fig. 2, the method of this embodiment includes steps S202 to S210.
In step S202, the original hair color of the user is acquired from the user image.
In step S204, a color change value of the hair dye is acquired. If the color change value is a color advance value, executing step S206; if the discoloration value is a shallow value, step S208 is executed.
In step S206, the sum of the original hair color and the color advancing degree is taken as the dyed hair color value.
In step S208, the difference between the original hair color and the lightening degree is used as the dyed hair color value.
In step S210, the simulated user-dyed hair color is determined according to the dyed hair colorimetric value and the corresponding color of the color tone value of the hair dye in the colorimetric and colorimetric table.
The hue value of the hair dye can be acquired from the product information. For example, the product information of a certain hair dye indicates that the color of the hair dye is "a.bc". Through calculation, the chromatic value of the hair dyed by the user is A1, the color of the hair dyed by the user is represented as 'A1. BC', and the simulated hair color dyed by the user can be obtained by searching the color corresponding to 'A1. BC' in the chromatic tone table. The chromaticity tone table may be, for example, preset or acquired through an information acquisition interface provided by the manufacturer of the hair dye.
The method of the embodiment can comprehensively determine the hair color after the hair dyeing corresponding to each user based on the hair color of each user by combining the color change value and the color tone value of the hair dye, so that the generated hair dyeing effect is more accurate.
In order to make the hair dyeing effect picture more vivid, the hair dyeing effect picture can be generated by combining the ambient light characteristics in the user image and the simulated hair color after hair dyeing when the hair dyeing effect picture is generated. An embodiment of the method for generating a hair dyeing effect map according to the present invention will be described with reference to fig. 3.
Fig. 3 is a schematic flow chart of a method for generating a hair coloring effect map according to some embodiments of the present invention. As shown in fig. 3, the method for generating a hair dyeing effect map of this embodiment includes steps S302 to S304.
In step S302, the hair color of the simulated user after hair coloring is determined. For the specific implementation of this step, reference may be made to the foregoing embodiments, which are not described herein again.
In step S304, the lightness channel of the hair part in the user image, the hue channel and the saturation channel of the simulated hair color after the user has dyed hair are used to regenerate the image data of the hair part, so as to obtain the user hair dyeing effect diagram.
This embodiment employs an HSV (Hue-Saturation-Value) color model in representing colors. In generating the effect map, the H, S channel of the original user image may be replaced with the H, S channel of the dyed hair color, while the V channel of the original user image is retained. Therefore, the illumination texture details of the hair can be increased, the generated hair dyeing effect picture is more vivid, and the user experience is improved.
Some users have uneven hair color, such as a darker root and a yellow tip. Some embodiments of the invention can also determine the hair color of each area after dyeing the hair in different areas, so that the hair dyeing effect is more accurate. An embodiment of the method for generating a hair dyeing effect map according to the present invention will be described with reference to fig. 4.
Fig. 4 is a flowchart illustrating a method for generating a hair dyeing effect map according to other embodiments of the present invention. As shown in fig. 4, the method for generating a hair dyeing effect map of this embodiment includes steps S402 to S408.
In step S402, the original hair color of a plurality of hair regions of the user is acquired from the user image. In dividing the plurality of hair regions, for example, it is possible to divide by the number of pixels, by a scale, by a color difference value, or the like.
In step S404, a color change value of the hair dye is acquired.
In step S406, the hair color of the hair dyed by the user is determined according to the original hair color of each hair region and the color change value of the hair dye.
In step S408, a user hair-dyeing effect map is generated according to the user image and the simulated hair color of the user after hair-dyeing corresponding to each hair region. In some embodiments, the adjacent hair regions can be provided with transition regions when being re-colored and spliced, and the transition regions are provided with gradient colors, so that the generated effect graph is more natural and smooth.
By the method of the embodiment, when the hair of different areas of the same user has color difference, the dyed color of each hair area can be determined respectively, so that the generated hair dyeing effect graph is more accurate.
The embodiment of the invention can be applied to generating a single static hair dyeing effect picture and can also be applied to video application scenes such as augmented reality, video call and the like. An embodiment of the video generating method for hair dyeing effects according to the present invention will be described with reference to fig. 5.
Fig. 5 is a flowchart illustrating a method for generating a video of hair coloring effect according to some embodiments of the present invention. As shown in fig. 5, the method for generating a hair dyeing effect video of this embodiment includes steps S502 to S508.
In step S502, a user image in a real-time user video is acquired.
In step S504, the hair color of the simulated user dyed hair corresponding to each user image in the real-time user video is determined.
In step S506, a user hair-dyeing effect map corresponding to each user image is generated according to the plurality of user images in the real-time user video and the simulated hair color of the user after hair-dyeing corresponding to each user image.
In step S508, a user hair dye effect video is generated according to the user hair dye effect diagrams corresponding to the plurality of consecutive user images.
By the method of the embodiment, the hair dyeing effect video can be generated, so that a user can dynamically observe a vivid hair dyeing effect. For example, when a user browses the hair dye product through an e-commerce website, the camera of the terminal can be opened, and the terminal or the server can display the hair dye effect of the user on a screen in real time through real-time calculation, so that the user can conveniently see the hair dye effect; for example, when the user performs a video chat or a video live broadcast, the viewer can see the effect of the user after the hair dyeing in real time, so that the interestingness of the video chat and the live broadcast is increased, and the viewer can evaluate the hair dyeing effect and provide reference opinions. Thus, the embodiment of the invention meets the requirements of more application scenarios.
An embodiment of the hair dyeing effect pattern generating apparatus according to the present invention will be described with reference to fig. 6.
Fig. 6 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to some embodiments of the present invention. As shown in fig. 6, the hair dyeing effect map generating apparatus 60 of this embodiment includes: an original chromaticity obtaining module 610 configured to obtain an original hair chromaticity of the user from the user image; a color-change value acquisition module 620 configured to acquire a color-change value of the hair dye; a hair color determination module 630 configured to determine a hair color of the simulated user dyed hair according to the original hair chromaticity and the color change value of the hair dye; and the effect map generating module 640 is configured to generate the user hair dyeing effect map according to the user image and the simulated hair color of the user after hair dyeing.
In some embodiments, the color change value is a color advancement or a lightening.
In some embodiments, the color penetration is determined from the difference between a sample hair color of the hair colorant and the color of the hair colorant; the lightening degree is determined according to a difference between the color of the hair dye and the color of the sample hair of the hair dye.
In some embodiments, the hair color determination module 630 is further configured to take the sum of the original hair color and the further color as the hair color value after hair color if the color change value is the further color; taking the difference between the original hair chroma and the lightening degree as the chroma value of the dyed hair under the condition that the color change value is the lightening degree; and determining the hair color of the simulated user after the hair is dyed according to the hair color value after the hair is dyed.
In some embodiments, the hair color determination module 630 is further configured to determine a simulated user-dyed hair color based on the dyed hair chroma value and the corresponding color in the chroma palette for the color value of the hair dye.
In some embodiments, the effects map generation module 640 is further configured to segment the user image into a hair portion and a non-hair portion; and regenerating the image data of the hair part according to the simulated hair color of the user after hair dyeing to obtain a hair dyeing effect picture of the user.
In some embodiments, the effect map generating module 640 is further configured to re-generate the image data of the hair part using the lightness channel, the hue channel and the saturation channel of the simulated user-dyed hair color in the user image, to obtain the user-dyed effect map.
In some embodiments, the raw chromaticity obtaining module 610 is further configured to obtain raw hair chromaticities of a plurality of hair regions of the user from the user image; the hair color determination module 630 is further configured to determine a simulated user-dyed hair color corresponding to each hair region according to the original hair chromaticity of each hair region and the color change value of the hair dye; the effect map generating module 640 is further configured to generate a user hair coloring effect map according to the user image and the simulated user hair colored hair color corresponding to each hair region.
In some embodiments, the effect map generating module 640 is further configured to generate a user hair-dyeing effect map corresponding to each user image according to the plurality of user images in the real-time user video and the simulated user hair-dyed hair color corresponding to each user image; the hair dye effect pattern generating apparatus 60 further includes: and a hair dyeing effect video generating module 650 configured to generate a user hair dyeing effect video according to the user hair dyeing effect diagram corresponding to the plurality of continuous user images.
Fig. 7 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to other embodiments of the present invention. As shown in fig. 7, the hair dyeing effect map generating apparatus 70 of this embodiment includes: a memory 710 and a processor 720 coupled to the memory 710, wherein the processor 720 is configured to execute the method for generating a hair coloring effect map according to any of the above embodiments based on instructions stored in the memory 710.
Memory 710 may include, for example, system memory, fixed non-volatile storage media, and the like. The system memory stores, for example, an operating system, an application program, a Boot Loader (Boot Loader), and other programs.
Fig. 8 is a schematic structural view of a hair dyeing effect pattern generating apparatus according to still other embodiments of the present invention. As shown in fig. 8, the hair dyeing effect map generating apparatus 80 of this embodiment includes: the memory 810 and the processor 820 may further include an input/output interface 830, a network interface 840, a storage interface 850, and the like. These interfaces 830, 840, 850 and the memory 810 and the processor 820 may be connected, for example, by a bus 860. The input/output interface 830 provides a connection interface for input/output devices such as a display, a mouse, a keyboard, and a touch screen. The network interface 840 provides a connection interface for various networking devices. The storage interface 850 provides a connection interface for external storage devices such as an SD card and a usb disk.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the program is executed by a processor to implement any one of the above-mentioned hair-dyeing effect map generating methods.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable non-transitory storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (20)

1. A hair dyeing effect map generating method comprises the following steps:
acquiring the original hair color of a user from the user image;
acquiring a color change value of the hair dye;
determining the hair color of the simulated user after dyeing according to the original hair chroma and the color change value of the hair dye;
and generating a user hair dyeing effect picture according to the user image and the simulated hair color of the user after hair dyeing.
2. The method for generating a hair dyeing effect map according to claim 1, wherein the color changing value is a color advancing degree or a color lightening degree.
3. The method for generating hair coloring effect pattern according to claim 2,
the color feeding degree is determined according to the difference value of the sample hair color degree of the hair dye and the color dye color degree;
the lightening degree is determined according to a difference between the color degree of the hair dye and the color degree of the sample hair of the hair dye.
4. The method for generating a hair dyeing effect map according to claim 1, wherein the determining the hair color of the simulated user dyed hair according to the original hair color and the color change value of the hair dye comprises:
under the condition that the color changing value is the color advancing value, taking the sum of the original hair color and the color advancing value as the hair color value after the hair dyeing;
taking the difference between the original hair chroma and the lightening degree as the hair chroma value after dyeing under the condition that the color changing value is the lightening degree;
and determining the hair color of the simulated user after the hair is dyed according to the hair color value after the hair is dyed.
5. The method for generating a hair dyeing effect map according to claim 4, wherein the determining the simulated user dyed hair color according to the dyed hair chromaticity value comprises:
and determining the hair color after the hair dyeing of the simulated user according to the hair colorimetric value after the hair dyeing and the corresponding color of the tone value of the hair dye in the chroma tone table.
6. The method for generating a hair coloring effect map according to claim 1, wherein the generating a user hair coloring effect map according to the user image and the simulated hair color of the user after hair coloring comprises:
segmenting the user image into a hair portion and a non-hair portion;
and regenerating the image data of the hair part according to the simulated hair color of the user after hair dyeing to obtain a hair dyeing effect picture of the user.
7. The method of claim 6, wherein the user coloring effect map is obtained by re-generating the image data of the hair part using a lightness channel, a hue channel and a saturation channel of the hair color after the user coloring, of the hair part in the user image.
8. The method for generating hair dyeing effect pattern according to any of claims 1 to 7, wherein,
acquiring original hair chroma of a plurality of hair areas of a user from an image of the user;
acquiring a color change value of the hair dye;
determining the hair color of the hair dyed by the user corresponding to each hair area according to the original hair color of each hair area and the color change value of the hair dye;
and generating a user hair dyeing effect graph according to the user image and the simulated hair color of the user after hair dyeing corresponding to each hair area.
9. The method for generating hair dyeing effect pattern according to any of claims 1 to 7, wherein,
generating a user hair dyeing effect graph corresponding to each user image according to a plurality of user images in a real-time user video and the hair color of the simulated user hair dyed corresponding to each user image;
the hair dyeing effect map generation method further comprises the following steps:
and generating a user hair dyeing effect video according to the user hair dyeing effect graphs corresponding to the plurality of continuous user images.
10. A hair dye effect map generating device comprising:
the original chromaticity acquisition module is configured to acquire original hair chromaticity of the user from the user image;
a color change value acquisition module configured to acquire a color change value of the hair dye;
a hair color determination module configured to determine a simulated hair color of the user after hair dyeing according to the original hair chromaticity and the color change value of the hair dye;
and the effect picture generating module is configured to generate a user hair dyeing effect picture according to the user image and the simulated hair color of the user after hair dyeing.
11. The hair coloring effect map generating apparatus of claim 10, wherein the color-changing value is a color-advancing degree or a color-lightening degree.
12. The hair coloring effect map generating apparatus of claim 11, wherein the coloring degree is determined based on a difference between a sample hair coloring degree of the hair coloring agent and a coloring agent coloring degree; the lightening degree is determined according to a difference between the color degree of the hair dye and the color degree of the sample hair of the hair dye.
13. The hair coloring effect map generating apparatus according to claim 10, wherein the hair coloring color determining module is further configured to take the sum of the original hair color and the color advancing degree as the hair color value after hair coloring, if the color changing value is the color advancing degree; taking the difference between the original hair chroma and the lightening degree as the hair chroma value after dyeing under the condition that the color changing value is the lightening degree; and determining the hair color of the simulated user after the hair is dyed according to the hair color value after the hair is dyed.
14. The hair coloring effect map generating apparatus of claim 13, wherein the hair coloring determination module is further configured to determine the simulated user-colored hair color according to the hair color value after coloring and the corresponding color of the color tone value of the hair coloring agent in the color tone table.
15. The hair coloring effect map generating device of claim 10, wherein the effect map generating module is further configured to segment the user image into a hair part and a non-hair part; and regenerating the image data of the hair part according to the simulated hair color of the user after hair dyeing to obtain a hair dyeing effect picture of the user.
16. The hair coloring effect map generating apparatus of claim 15, wherein the effect map generating module is further configured to re-generate the image data of the hair part by using the lightness channel, the hue channel and the saturation channel of the hair color after the hair coloring of the user in the user image to obtain the user hair coloring effect map.
17. The hair coloring effect pattern generating apparatus according to any one of claims 10 to 16,
the original chromaticity obtaining module is further configured to obtain original hair chromaticities of a plurality of hair areas of the user from the user image;
the hair dyeing color determination module is further configured to determine a simulated user dyed hair color corresponding to each hair area according to the original hair chromaticity of each hair area and the color change value of the hair dye;
the effect map generating module is further configured to generate a user hair-dyeing effect map according to the user image and the simulated hair color of the user after hair-dyeing corresponding to each hair area.
18. The hair coloring effect pattern generating apparatus according to any one of claims 10 to 16,
the effect graph generating module is further configured to generate a user hair dyeing effect graph corresponding to each user image according to a plurality of user images in the real-time user video and the simulated hair color of the user after hair dyeing corresponding to each user image;
the hair dyeing effect map generating device further comprises:
and the hair dyeing effect video generation module is configured to generate a user hair dyeing effect video according to the user hair dyeing effect graph corresponding to the plurality of continuous user images.
19. A hair dye effect map generating device comprising:
a memory; and
a processor coupled to the memory, the processor configured to execute the hair coloring effect map generating method according to any one of claims 1-9 based on instructions stored in the memory.
20. A computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the hair dye effect map generating method according to any one of claims 1 to 9.
CN201811551438.3A 2018-12-19 2018-12-19 Hair dyeing effect picture generation method and device and computer readable storage medium Pending CN111340818A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811551438.3A CN111340818A (en) 2018-12-19 2018-12-19 Hair dyeing effect picture generation method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811551438.3A CN111340818A (en) 2018-12-19 2018-12-19 Hair dyeing effect picture generation method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111340818A true CN111340818A (en) 2020-06-26

Family

ID=71183180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811551438.3A Pending CN111340818A (en) 2018-12-19 2018-12-19 Hair dyeing effect picture generation method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111340818A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020010556A1 (en) * 2000-05-12 2002-01-24 Marapane Suresh Bandara Method for analyzing hair and predicting achievable hair dyeing ending colors
CN1440503A (en) * 2000-05-12 2003-09-03 宝洁公司 Method for analyzing hair and predicting achievable hair dyeing ending colors
JP2004144569A (en) * 2002-10-23 2004-05-20 Kose Corp Hair dyeing state prediction method of hair dyeing agent
JP2010246853A (en) * 2009-04-20 2010-11-04 Kao Corp Method for simulating color of dyed hair
US20120075331A1 (en) * 2010-09-24 2012-03-29 Mallick Satya P System and method for changing hair color in digital images
CN107256555A (en) * 2017-05-25 2017-10-17 腾讯科技(上海)有限公司 A kind of image processing method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020010556A1 (en) * 2000-05-12 2002-01-24 Marapane Suresh Bandara Method for analyzing hair and predicting achievable hair dyeing ending colors
CN1440503A (en) * 2000-05-12 2003-09-03 宝洁公司 Method for analyzing hair and predicting achievable hair dyeing ending colors
JP2004144569A (en) * 2002-10-23 2004-05-20 Kose Corp Hair dyeing state prediction method of hair dyeing agent
JP2010246853A (en) * 2009-04-20 2010-11-04 Kao Corp Method for simulating color of dyed hair
US20120075331A1 (en) * 2010-09-24 2012-03-29 Mallick Satya P System and method for changing hair color in digital images
CN107256555A (en) * 2017-05-25 2017-10-17 腾讯科技(上海)有限公司 A kind of image processing method, device and storage medium

Similar Documents

Publication Publication Date Title
US8508546B2 (en) Image mask generation
CN100568283C (en) A kind of picture dominant hue analytical approach and device thereof
JP5318587B2 (en) Gradation creating method, program and apparatus
CN108846869B (en) Automatic clothes color matching method based on natural image colors
CN109923385B (en) Method and apparatus for determining hair color uniformity
CN108198250A (en) Virtual objects model colouring method and device, storage medium, electronic equipment
Wang et al. Color contrast-preserving decolorization
Sinaga Color-based Segmentation of Batik Using the L* a* b Color Space
CN106652046B (en) Model dyeing method and device
CN107203312A (en) Rendering intent, the storage device of mobile terminal and its picture
EP3846910A1 (en) Method for determining a correspondance between hair coloring agents and hair coloring results
CN111340818A (en) Hair dyeing effect picture generation method and device and computer readable storage medium
CN116563570A (en) Color recognition method and device, electronic equipment and storage medium
CN112927321B (en) Intelligent image design method, device, equipment and storage medium based on neural network
CN112883821B (en) Image processing method and device and electronic equipment
US20220053916A1 (en) Method for determining a coloration product recommendation
RU2815612C2 (en) Wood shading visualization
Nicolás-Sáenz et al. ABANICCO: A New Color Space for Multi-Label Pixel Classification and Color Segmentation
Hascoët Visual color design
CN113763496B (en) Method, apparatus and computer readable storage medium for image coloring
US7590283B2 (en) Representing colors in stored images using color tinting
CN114096992A (en) Visual wood dyeing
Gavet et al. The color logarithmic image processing (CoLIP) antagonist space
Lipowezky Automatic Hair Colorization Using Chromaticity Distribution Matching
Chang et al. Color transfer between images based on basic color category

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination