CN108564526A - Image processing method and device, electronic equipment and medium - Google Patents

Image processing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN108564526A
CN108564526A CN201810290726.1A CN201810290726A CN108564526A CN 108564526 A CN108564526 A CN 108564526A CN 201810290726 A CN201810290726 A CN 201810290726A CN 108564526 A CN108564526 A CN 108564526A
Authority
CN
China
Prior art keywords
makeup
region
image
waiting
wait
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
CN201810290726.1A
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 Lemi Technology Co ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201810290726.1A priority Critical patent/CN108564526A/en
Publication of CN108564526A publication Critical patent/CN108564526A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • 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
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the invention provides an image processing method, an image processing device, electronic equipment and a medium, wherein the image processing method comprises the following steps: acquiring an image to be made up; performing image semantic segmentation on an image to be made up to obtain at least one area to be made up; and performing virtual makeup on the at least one area to be made up by adopting a preset makeup strategy according to the attribute of the at least one area to be made up. The accuracy of virtual makeup can be improved through the scheme.

Description

A kind of image processing method, device, electronic equipment and medium
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of image processing method, device, electronic equipment and Medium.
Background technology
With the development of image processing techniques, virtual makeup is as a kind of new technique, by favor.Virtual makeup technology It is mainly used for providing quick dressing effect to the user, user need to only provide and wait for makeup image, you can by simple operations see not Same dressing effect, therefrom to select the dressing for being suitble to itself.
Currently, the main method that uses of virtual makeup for:For makeup image is waited for, picture is obtained using face alignment techniques The position of middle human face five-sense-organ (such as cheek, face, eyes) characteristic point, is then formed by region to features described above point position again Carry out virtual makeup, such as addition blush, lip gloss, change pupil color.
It is above-mentioned if occurring the case where human face five-sense-organ is blocked in original image when carrying out virtual makeup using the above method Method can still predict the face being blocked, and obtain the characteristic point position of prediction, then special to the prediction got Sign point position is formed by region and carries out virtual makeup, for example, the face of personage is blocked by hand in original image, the above method Complete face shape can be predicted in the hand region of personage, and the operation of lip gloss is added to above-mentioned estimation range, Aforesaid operations have really carried out wrong makeup to the hand without makeup.Therefore, if there is above-mentioned the case where being blocked, When carrying out virtual makeup, it may occur that makeup mistake.
Invention content
The embodiment of the present invention is designed to provide a kind of image processing method, device, electronic equipment and medium, to improve The accuracy of virtual makeup.Specific technical solution is as follows:
In a first aspect, an embodiment of the present invention provides a kind of image processing method, the method includes:
Acquisition waits for makeup image;
It waits for that makeup image carries out image, semantic segmentation to described, obtains at least one waiting for makeup region;
According at least one attribute for waiting for makeup region, at least one wait for that makeup region carries out to described using default Virtual makeup.
Further, it is described to it is described wait for makeup image carry out image, semantic segmentation, obtain it is at least one wait for makeup region, Including:
It is waited for described in the makeup image input neural network model that training obtains in advance, passes through the neural network model Operation, wait at least one of makeup image feature described in extraction;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
Further, described that type mark is carried out to the corresponding region of at least one feature, obtain at least one wait for Makeup region, including:
It is corresponding at least one feature according to the correspondence of preset at least one feature and pixel value Region carries out type mark, obtains described at least one waiting for makeup region.
Further, at least one attribute for waiting for makeup region is at least one pixel for waiting for makeup region Value;
It is described according at least one attribute for waiting for makeup region, at least one waited for described using default makeup strategy Makeup region carries out virtual makeup, including:
Receive makeup instruction, makeup instruction for treat in makeup image with specify wait for the corresponding region in makeup region into The instruction of row monochrome makeup, wherein described specified to wait for that makeup region is described at least one to wait for that any of makeup region is waited for Makeup region;
Described specify is waited for that the pixel value in makeup region is set as target pixel value corresponding with the monochrome;
By the target pixel value and described to wait for that the pixel value of each pixel in makeup image is expressed as tone saturation degree bright Spend HSV color space pixel values;
The tone H components in the HSV pixel values for waiting for each pixel in makeup image are replaced with into the target respectively H components in the HSV pixel values of pixel value, by S points of saturation degree in the HSV pixel values for waiting for each pixel in makeup image Amount replaces with the S components in the HSV pixel values of the target pixel value, obtains pixel and replaces image;
Image is replaced to the pixel and carries out RGB rgb color space conversion, obtains virtual makeup image.
Further, described according at least one attribute for waiting for makeup region, using default makeup strategy to described It is at least one to wait for that makeup region carries out virtual makeup, including:
According at least one attribute for waiting for makeup region, obtains and at least one wait for that makeup region is corresponding pre- with described If target figure layer;
Based on it is described it is at least one wait for makeup region, deformation is carried out to the corresponding goal-selling figure layer, is obtained and institute State at least one target figure layer after the identical deformation of makeup region shape;
Using target figure layer after the deformation, wait at least one waiting for makeup region pair with described in makeup image described in covering The region answered obtains virtual makeup image.
Further, described according at least one attribute for waiting for makeup region, it obtains and at least one is waited for described The corresponding goal-selling figure layer in adornment region, including:
Based on the pixel value for waiting for each pixel in makeup image, target colour of skin attribute is determined;
According to the target colour of skin attribute and at least one attribute for waiting for makeup region, obtain with it is described at least one Wait for the corresponding goal-selling figure layer in makeup region.
Second aspect, an embodiment of the present invention provides a kind of image processing apparatus, described device includes:
Image collection module waits for makeup image for obtaining;
Image segmentation module obtains at least one waiting for makeup for waiting for that makeup image carries out image, semantic segmentation to described Region;
Virtual die-filling piece, for according at least one attribute for waiting for makeup region, using default makeup strategy pair It is described at least one to wait for that makeup region carries out virtual makeup.
Further, described image divides module, is specifically used for:
It is waited for described in the makeup image input neural network model that training obtains in advance, passes through the neural network model Operation, wait at least one of makeup image feature described in extraction;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
Further, described image divides module, is specifically used for:
It is corresponding at least one feature according to the correspondence of preset at least one feature and pixel value Region carries out type mark, obtains described at least one waiting for makeup region.
Further, at least one attribute for waiting for makeup region is at least one pixel for waiting for makeup region Value;
Described virtual die-filling piece, be specifically used for receiving makeup instruction, the makeup instruction for treat in makeup image with Specify the instruction for waiting for that the corresponding region in makeup region carries out monochromatic makeup, wherein described specify waits for makeup region for described at least One is waited for that makeup region is waited in any of makeup region;Described specify is waited for that the pixel value in makeup region is set as and the list The corresponding target pixel value of color;By the target pixel value and described wait for that the pixel value of each pixel in makeup image is expressed as color Adjust saturation degree lightness HSV color space pixel values;Respectively by the color in the HSV pixel values for waiting for each pixel in makeup image It adjusts H components to replace with the H components in the HSV pixel values of the target pixel value, wait for each pixel in makeup image by described Saturation degree S components in HSV pixel values replace with the S components in the HSV pixel values of the target pixel value, obtain pixel replacement Image;Image is replaced to the pixel and carries out RGB rgb color space conversion, obtains virtual makeup image.
Further, described die-filling piece virtual, specifically for according at least one attribute for waiting for makeup region, obtaining It takes and at least one waits for the corresponding goal-selling figure layer in makeup region with described;Based on it is described it is at least one wait for makeup region, to institute It states corresponding goal-selling figure layer and carries out deformation, obtain and at least one target after the identical deformation of makeup region shape Figure layer;Using target figure layer after the deformation, wait at least one waiting for that makeup region is corresponding with described in makeup image described in covering Region, obtain virtual makeup image.
Further, described die-filling piece virtual, specifically for based on the pixel for waiting for each pixel in makeup image Value, determines target colour of skin attribute;According to the target colour of skin attribute and at least one attribute for waiting for makeup region, obtain with It is described at least one to wait for the corresponding goal-selling figure layer in makeup region.
The third aspect, an embodiment of the present invention provides a kind of electronic equipment, including processor, communication interface, memory and Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor, when for executing the program stored on memory, the step of realizing any of the above-described image processing method.
Fourth aspect, the embodiment of the present invention additionally provide a kind of computer readable storage medium, described computer-readable to deposit Computer program is stored in storage media, when run on a computer so that computer executes any of the above-described image procossing Method.
5th aspect, the embodiment of the present invention additionally provides a kind of computer program product including instruction, when it is being calculated When being run on machine so that computer executes any of the above-described image processing method.
In a kind of image processing method provided in an embodiment of the present invention, device, electronic equipment and medium, acquisition waits for makeup figure Picture;It treats makeup image and carries out image, semantic segmentation, obtain at least one waiting for makeup region;Makeup region is waited for according at least one Attribute, wait for that makeup region carries out virtual makeup at least one using default makeup strategy.By treat the image of makeup into Row semantic segmentation, obtain it is at least one wait for makeup region, then treat makeup region again and carry out virtual upper dress, for different spies Sign, be divided in it is different wait for makeup region, when blocking, the feature of shelter is different from the feature for the object that is blocked, therefore Be divided into it is different wait for makeup region, for example, wait for makeup image be one it is secondary include face feature (cheek, eyes, eyebrow, nose And face) personage's recent photograph, wherein some is blocked by hand at face position, and the embodiment of the present invention passes through to above-mentioned image Semantic segmentation is carried out, obtains including that cheek waits for that makeup region, eyes wait for that makeup region, eyebrow wait for that makeup is waited in makeup region, nose Region and face wait for the dicing masks in makeup region, wherein it includes the face area that do not blocked by hand that face, which waits for makeup region only, Domain carries out virtual makeup to above-mentioned each makeup region, the case where so as to avoid to carrying out wrong makeup without the hand of makeup, Improve the accuracy of virtual makeup.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with Obtain other attached drawings according to these attached drawings.
Fig. 1 is the flow diagram of image processing method provided by one embodiment of the present invention;
Fig. 2 waits for makeup area schematic to be provided by one embodiment of the present invention;
Fig. 3 is the structural schematic diagram of image processing apparatus provided by one embodiment of the present invention;
Fig. 4 is the structural schematic diagram of electronic equipment provided by one embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
In order to improve the accuracy of virtual makeup, an embodiment of the present invention provides a kind of image processing method, device, electronics Equipment and medium.
As shown in Figure 1, a kind of image processing method that the embodiment of the present invention is provided, can specifically include following steps:
Step 101, it obtains and waits for makeup image.
In this step, waiting for for getting can include the one or more in human face five-sense-organ feature in makeup image.Example Such as, waiting for makeup image can be that personage's whole body shines or half body shines, wherein comprising complete face feature (cheek, face, Eyes, nose, hair and ear etc.), or for the feature at the positions such as face, eyes.
Step 102, it treats makeup image and carries out image, semantic segmentation, obtain at least one waiting for makeup region.
Wherein, each wait for that makeup region is the region with specific characteristic in waiting for makeup image, as where eye feature Region is that eyes wait for that makeup region, face feature region are that face waits for makeup region.It is waited for for what is got in step 101 Makeup image, that distinguishes in image using image, semantic cutting techniques each waits for makeup region.As shown in Fig. 2, left hand view As to wait for makeup image, image right is then to treat after makeup image carries out image, semantic segmentation, and what is obtained multiple waits for makeup area Domain (including hair waits for that makeup region, eyes wait for that makeup region, cheek wait for that makeup region, lip wait for that makeup region and eyebrow are waited for Adornment region).
Further, it treats makeup image and carries out image, semantic segmentation, obtain at least one the step of waiting for makeup region, have Body may include:
It will wait in the makeup image input neural network model that training obtains in advance, pass through the fortune of the neural network model It calculates, extraction waits at least one of makeup image feature;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
It can will wait in the makeup image input neural network model that training obtains in advance, pass through the fortune of the network model It calculates, extraction waits for multiple features in makeup image.Specifically, neural network can be efficient neural network ENet, or Full convolutional neural networks CNN etc., herein, the neural network with image, semantic dividing function belong to the present embodiment protection model It encloses.
When carrying out image, semantic segmentation using ENet, it can wait for that makeup image is directly inputted to by original and have already passed through In ENet models after training, after the operation by ENet models, acquisition is at least one to wait for makeup region, as eyes wait for makeup Region, cheek wait for that makeup region, hair wait for that makeup region etc. is waited in makeup region and face.
ENet model frameworks are coding-decoding architecture, and coded portion can be realized by down-sampling mode treats makeup figure The extraction of each feature as in, but since during being extracted to each feature, picture size can reduce, therefore, need Feature extraction result to be counter-propagating to by decoded portion and original wait for makeup image, and each feature institute to extracting Place waits for that makeup region carries out type mark, and then obtains at least one waiting for makeup region, that is to say, that obtains coded portion Result be restored to it is original wait for the size of makeup image, and complete type mark.Coded portion due to ENet models and decoding Part is made of bottleneck (bottleneck) network layer, and therefore, model calculation speed, image, semantic segmentation are efficient.
To the corresponding region of at least one feature carry out type mark, obtain it is at least one when makeup region, if obtaining To wait for that makeup region has multiple, then different can be waited for that makeup region carries out difference mark according to the difference of gray value, also may be used To carry out difference mark according to the difference of brightness value, in this regard, not being restricted.
Step 103, according at least one attribute for waiting for makeup region, using default makeup strategy wait at least one Makeup region carries out virtual makeup.
Wait for that the attribute in makeup region can be the shape for waiting for makeup region, can also be this wait for makeup region brightness, Gray scale or pixel value etc., in this regard, being not construed as limiting.
In step 102, type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region The step of, it can specifically include:
According to the correspondence of preset at least one feature and pixel value, the corresponding region of at least one feature is carried out Type marks, and obtains at least one waiting for makeup region.
For example, for including that cheek, nose, eyes, face and eyebrow wait for makeup image, which is inputted efficient After neural network model, this can be extracted and wait for each feature in makeup image:Cheek, nose, eyes, face and eyebrow, Then according to the preset correspondence for respectively waiting for makeup region and pixel value, (such as hair feature corresponds to light blue, eyebrow feature Corresponding to navy blue, eye feature corresponds to green, and face feature corresponds to red, and nose feature corresponds to yellow), it can be right It waits for that makeup region is labeled residing for each feature, correspondingly, will wait for that makeup area marking is light blue residing for hair feature Color waits for that makeup area marking is navy blue residing for eyebrow feature, waits for that makeup area marking is green, mouth residing for eye feature It waits for that makeup area marking is red residing for Bart's sign, waits for that makeup area marking is yellow residing for nose feature, process is above-mentioned After step, you can obtain waiting for makeup region.
Further, at least one attribute for waiting for makeup region can be at least one pixel value for waiting for makeup region;
According at least one attribute for waiting for makeup region, wait for that makeup region carries out at least one using default makeup strategy The step of virtual makeup, can specifically be realized by Colour Blend Mode algorithms, be can specifically include:
Receive makeup instruction, makeup instruction waits for that the corresponding region in makeup region carries out list to treat in makeup image with specified The instruction of color makeup, wherein specified to wait for that makeup region waits for that makeup region is waited in any of makeup region to be at least one;
Wait for that the pixel value in makeup region is set as and monochromatic corresponding target pixel value by specified;
By target pixel value and wait for that the pixel value of each pixel in makeup image is expressed as tone saturation degree lightness HSV colors Spatial pixel values;
The tone H components in the HSV pixel values for waiting for each pixel in makeup image are replaced with into target pixel value respectively Saturation degree S components in the HSV pixel values for waiting for each pixel in makeup image are replaced with target by H components in HSV pixel values S components in the HSV pixel values of pixel value, and keep waiting for the lightness V component in the HSV pixel values of each pixel in makeup image It is constant, it obtains pixel and replaces image;
Image is replaced to pixel and carries out RGB rgb color space conversion, obtains virtual makeup image.
The color of pixel can be described by a variety of different color space patterns in image, and common color is empty Between have:Rgb color space, HSV color spaces and lightness colors LAB color spaces, wherein rgb color space by it is red, The variation of green, blue three Color Channels and its mutual superposition indicate the color space of color;LAB color spaces are The color space of color is indicated with a luminance component L and two color component A and B;And HSV color spaces are then to pass through color Hue, saturation degree Saturation and lightness Value is adjusted to indicate the color space of color.
Further, according at least one attribute for waiting for makeup region, using default makeup strategy at least one wait for Adornment region carries out the step of virtual makeup, can specifically include:
According at least one attribute for waiting for makeup region, obtains and wait for the corresponding goal-selling figure in makeup region at least one Layer;
Makeup region is waited for based at least one, and deformation is carried out to corresponding goal-selling figure layer, obtains waiting for at least one Target figure layer after the identical deformation of makeup region shape;
Using target figure layer after deformation, covering waits for waiting for the corresponding region in makeup region at least one in makeup image, obtains To virtual makeup image.
Further, it according at least one attribute for waiting for makeup region, obtains and waits for that makeup region is corresponding at least one It the step of goal-selling figure layer, can specifically include:
Based on the pixel value for waiting for each pixel in makeup image, target colour of skin attribute is determined;
According to the target colour of skin attribute and at least one attribute for waiting for makeup region, obtains and at least one waited for described The corresponding goal-selling figure layer in adornment region.
It, can be first according to the picture for waiting for each region in makeup image, each pixel before obtaining goal-selling figure layer Element value judges the colour of skin attribute (such as the colour of skin is partially white, the colour of skin is partially black, the colour of skin is brighter or the colour of skin is dimer) of the target, so Further according to the colour of skin attribute and the attribute (such as shape) for waiting for makeup region of makeup is carried out afterwards, select suitable target figure Layer, to carry out virtual makeup, can make makeup effect more ideal.Such as, wait for that makeup image is face image, when judging the people When the face colour of skin is whiter, it is if desired added the virtual makeup of lip gloss, then can select the lip gloss color of inclined light tone, such as watermelon Lip gloss color red, with metallic luster effect carries out makeup.
Goal-selling figure layer in this step can be the figure layer with default makeup effect for pre-establishing and storing, example Such as, for waiting for that makeup region, corresponding goal-selling figure layer can be the figure layers with U.S. pupil effect residing for eye feature, And figure layer color can there are many;Can be for wait for the makeup region, corresponding goal-selling figure layer residing for cheek feature Figure layer with blush effect;For waiting for that makeup region, corresponding goal-selling figure layer can have to refer to residing for lip The figure layer for determining color lip gloss effect, for the type of goal-selling figure layer, here, not being limited.Meanwhile it is default in this step Target figure layer can also be after the figure layer setting instruction for receiving user, according to the figure layer that above-metioned instruction creates, for example, connecing When receiving the instruction of " hair color is become chestnut brown " of user, it can be directed to where hair feature according to above-metioned instruction Region create chestnut brown figure layer.
In image processing method shown in FIG. 1 provided in an embodiment of the present invention, acquisition waits for makeup image;Treat makeup image Image, semantic segmentation is carried out, obtains at least one waiting for makeup region;According at least one attribute for waiting for makeup region, using default Makeup strategy waits for that makeup region carries out virtual makeup at least one.Image by treating makeup carries out semantic segmentation, obtains It is at least one to wait for makeup region, makeup region is then treated again and carries out virtual upper dress, for different features, is divided in different Wait for makeup region, when blocking, the feature of shelter is different from the feature for the object that is blocked, therefore is divided into different wait for Adornment region, in this way, in virtual makeup it is possible to prevente effectively from the case where human face five-sense-organ is blocked, to the position without makeup The problem of mistake makeup, improves the accuracy of virtual makeup.
Based on same inventive concept, according to a kind of image processing method that the above embodiment of the present invention provides, correspondingly, this Inventive embodiments provide a kind of image processing apparatus, and structural schematic diagram is as shown in figure 3, include:
Image collection module 201 waits for makeup image for obtaining;
Image segmentation module 202 carries out image, semantic segmentation for treating makeup image, obtains at least one waiting for makeup area Domain;
Virtual die-filling piece 203, for according at least one attribute for waiting for makeup region, using default makeup strategy to extremely Few one is waited for that makeup region carries out virtual makeup.
Further, image segmentation module 202 specifically can be used for:
The input of makeup image will be waited in advance in the obtained neural network model of training, by the operation of neural network model, Extraction waits at least one of makeup image feature;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
Further, image segmentation module 202 specifically can be used for:
According to the correspondence of preset at least one feature and pixel value, region corresponding at least one character Type mark is carried out, obtains at least one waiting for makeup region.
Further, at least one attribute for waiting for makeup region is at least one pixel value for waiting for makeup region;
Virtual die-filling piece 203, specifically can be used for receiving makeup instruction, makeup instruction for treat in makeup image with finger Surely wait for that the corresponding region in makeup region carries out the instruction of monochromatic makeup, wherein specified to wait for that makeup is waited in makeup region to be at least one Wait for makeup region in any of region;Wait for that the pixel value in makeup region is set as and monochromatic corresponding object pixel by specified Value;By target pixel value and wait for that the pixel value of each pixel in makeup image is expressed as tone saturation degree lightness HSV color spaces Pixel value;The tone H components in the HSV pixel values for waiting for each pixel in makeup image are replaced with into target pixel value respectively Saturation degree S components in the HSV pixel values for waiting for each pixel in makeup image are replaced with target by H components in HSV pixel values S components in the HSV pixel values of pixel value obtain pixel and replace image;Image is replaced to pixel and carries out RGB rgb color sky Between convert, obtain virtual makeup image.
Further, die-filling piece 203 virtual, it specifically can be used for, according at least one attribute for waiting for makeup region, obtaining It takes and waits for the corresponding goal-selling figure layer in makeup region at least one;Makeup region is waited for based at least one, to corresponding default Target figure layer carries out deformation, obtains and at least one target figure layer after the identical deformation of makeup region shape;After deformation Target figure layer, covering wait for waiting for the corresponding region in makeup region at least one in makeup image, obtains virtual makeup image.
Further, die-filling piece 203 virtual, specifically it can be used for based on the pixel for waiting for each pixel in makeup image Value, determines target colour of skin attribute;According to target colour of skin attribute and at least one attribute for waiting for makeup region, obtain with it is at least one Wait for the corresponding goal-selling figure layer in makeup region.
In image processing apparatus provided in an embodiment of the present invention, the acquisition of image collection module 201 waits for makeup image;Image point It cuts module 202 and treats makeup image and carry out image, semantic segmentation, obtain at least one waiting for makeup region;It is die-filling piece 203 virtual According at least one attribute for waiting for makeup region, wait for that makeup region carries out on virtual at least one using default makeup strategy Adornment.By treat makeup image carry out semantic segmentation, obtain it is at least one wait for makeup region, then treat again makeup region into The virtual upper dress of row, for different features, be divided in it is different wait for makeup region, when blocking, the feature of shelter and Be blocked object feature it is different, therefore be divided into it is different wait for makeup region, in this way, in virtual makeup it is possible to prevente effectively from In the case that human face five-sense-organ is blocked, the problem of to position mistake makeup without makeup, the accuracy of virtual makeup is improved.
Based on same inventive concept, according to the image processing method that the above embodiment of the present invention provides, correspondingly, the present invention Embodiment additionally provides a kind of electronic equipment, as shown in figure 4, including processor 301, communication interface 302, memory 303 and leading to Believe bus 304, wherein processor 301, communication interface 302, memory 303 complete mutual lead to by communication bus 304 Letter,
Memory 303, for storing computer program;
Processor 301 at least realizes following steps when for executing the program stored on memory 303:
Acquisition waits for makeup image;
It treats makeup image and carries out image, semantic segmentation, obtain at least one waiting for makeup region;
According at least one attribute for waiting for makeup region, wait for that makeup region carries out at least one using default makeup strategy Virtual makeup.
It further, can also be including other processing streams in above-mentioned image processing method provided in an embodiment of the present invention Journey is no longer described in detail herein.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc.. For ease of indicating, only indicated with a thick line in figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), can also include Nonvolatile memory (Non-Volatile Memory, abbreviation NVM), for example, at least a magnetic disk storage.Further, Memory can also be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processor, abbreviation DSP), application-specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array, Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In electronic equipment provided in an embodiment of the present invention, the method that uses for:Acquisition waits for makeup image;Treat makeup figure As carrying out image, semantic segmentation, obtain at least one waiting for makeup region;According at least one attribute for waiting for makeup region, using pre- If makeup strategy waits for that makeup region carries out virtual makeup at least one.Image by treating makeup carries out semantic segmentation, obtains Makeup region is waited for at least one, is then treated makeup region again and is carried out virtual upper dress, for different features, is divided in difference Wait for makeup region, when blocking, the feature of shelter is different from the feature for the object that is blocked, therefore is divided into different wait for Makeup region, in this way, in virtual makeup it is possible to prevente effectively from the case where human face five-sense-organ is blocked, to the portion without makeup The problem of bit-errors makeup, improves the accuracy of virtual makeup.
In another embodiment provided by the invention, a kind of computer readable storage medium is additionally provided, which can It reads to be stored with instruction in storage medium, when run on a computer so that computer executes on any in above-described embodiment The image processing method stated.
In computer readable storage medium provided in an embodiment of the present invention, the method that uses for:Acquisition waits for makeup image; It treats makeup image and carries out image, semantic segmentation, obtain at least one waiting for makeup region;According at least one makeup region of waiting for Attribute waits for that makeup region carries out virtual makeup using default makeup strategy at least one.Image by treating makeup carries out Semantic segmentation, obtain it is at least one wait for makeup region, then treat makeup region again and carry out virtual upper dress, for different spies Sign, be divided in it is different wait for makeup region, when blocking, the feature of shelter is different from the feature for the object that is blocked, therefore Be divided into it is different wait for makeup region, in this way, in virtual makeup it is possible to prevente effectively from the case where human face five-sense-organ is blocked, The problem of to position mistake makeup without makeup, improve the accuracy of virtual makeup.
In another embodiment provided by the invention, a kind of computer program product including instruction is additionally provided, when it When running on computers so that computer executes any above-mentioned image processing method in above-described embodiment.
In computer program product provided in an embodiment of the present invention comprising instruction, the method that uses for:Acquisition waits for Adornment image;It treats makeup image and carries out image, semantic segmentation, obtain at least one waiting for makeup region;Makeup is waited for according at least one The attribute in region waits for that makeup region carries out virtual makeup using default makeup strategy at least one.By the figure for treating makeup As carrying out semantic segmentation, obtain it is at least one wait for makeup region, then treat makeup region again and carry out virtual upper dress, for difference Feature, be divided in it is different wait for makeup region, when blocking, the feature of shelter is different from the feature for the object that is blocked, Therefore be divided into it is different wait for makeup region, in this way, in virtual makeup it is possible to prevente effectively from there is the feelings blocked in human face five-sense-organ Under condition, the problem of to position mistake makeup without makeup, the accuracy of virtual makeup is improved.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its arbitrary combination real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.Computer program product Including one or more computer instructions.It is all or part of when loading on computers and executing above computer program instruction Ground is generated according to above-mentioned flow or function of the embodiment of the present invention.Computer can be all-purpose computer, special purpose computer, calculating Machine network or other programmable devices.Computer instruction can store in a computer-readable storage medium, or from one Computer readable storage medium is transmitted to another computer readable storage medium, for example, computer instruction can be from a net Website, computer, server or data center by it is wired (such as coaxial cable, optical fiber, Digital Subscriber Line (English: Digital Subscriber Line, referred to as:DSL)) or wireless (such as infrared, wireless, microwave etc.) mode is to another net Website, computer, server or data center are transmitted.Above computer readable storage medium storing program for executing can be that computer can Any usable medium of access is either comprising data storages such as one or more usable mediums integrated server, data centers Equipment.Above-mentioned usable medium can be magnetic medium, and (for example, floppy disk, hard disk, tape), optical medium are (for example, digital video light Disk (English:Digital Video Disc, referred to as:DVD)) or semiconductor medium (such as solid state disk (English:Solid State Disk, referred to as:SSD)) etc..
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that There is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is all made of relevant mode and describes, identical similar portion between each embodiment Point just to refer each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment and storage medium embodiment, since it is substantially similar to the method embodiment, so description is fairly simple, The relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (10)

1. a kind of image processing method, which is characterized in that including:
Acquisition waits for makeup image;
It waits for that makeup image carries out image, semantic segmentation to described, obtains at least one waiting for makeup region;
According at least one attribute for waiting for makeup region, makeup region at least one is waited for described using default makeup strategy Carry out virtual makeup.
2. according to the method described in claim 1, it is characterized in that, described wait for that makeup image carries out image, semantic point to described Cut, obtain it is at least one wait for makeup region, including:
It is waited for described in the makeup image input neural network model that training obtains in advance, passes through the fortune of the neural network model It calculates, at least one of makeup image feature is waited for described in extraction;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
3. according to the method described in claim 2, it is characterized in that, described carry out the corresponding region of at least one feature Type marks, obtain it is at least one wait for makeup region, including:
According to the correspondence of preset at least one feature and pixel value, region corresponding at least one feature Type mark is carried out, obtains described at least one waiting for makeup region.
4. according to the method described in claim 3, it is characterized in that, at least one attribute for waiting for makeup region be it is described extremely A few pixel value for waiting for makeup region;
It is described according at least one attribute for waiting for makeup region, makeup at least one is waited for described using default makeup strategy Region carries out virtual makeup, including:
Receive makeup instruction, makeup instruction waits for that the corresponding region in makeup region carries out list to treat in makeup image with specified The instruction of color makeup, wherein described specified to wait for that makeup region is described at least one to wait for that makeup is waited in any of makeup region Region;
Described specify is waited for that the pixel value in makeup region is set as target pixel value corresponding with the monochrome;
By the target pixel value and described wait for that the pixel value of each pixel in makeup image is expressed as tone saturation degree lightness HSV Color space pixel value;
The tone H components in the HSV pixel values for waiting for each pixel in makeup image are replaced with into the object pixel respectively H components in the HSV pixel values of value replace the saturation degree S components in the HSV pixel values for waiting for each pixel in makeup image The S components being changed in the HSV pixel values of the target pixel value obtain pixel and replace image;
Image is replaced to the pixel and carries out RGB rgb color space conversion, obtains virtual makeup image.
5. according to the either method described in claim 1-3, which is characterized in that described at least one to wait for makeup region according to described Attribute, using default makeup strategy to it is described it is at least one wait for that makeup region carries out virtual makeup, including:
According at least one attribute for waiting for makeup region, obtains and at least one wait for the corresponding default mesh in makeup region with described It marks on a map layer;
Based on it is described it is at least one wait for makeup region, deformation is carried out to the corresponding goal-selling figure layer, obtain with it is described extremely A few target figure layer after the identical deformation of makeup region shape;
Using target figure layer after the deformation, wait at least one waiting for that makeup region is corresponding with described in makeup image described in covering Region obtains virtual makeup image.
6. according to the method described in claim 5, it is characterized in that, described according at least one category for waiting for makeup region Property, obtain with it is described it is at least one wait for the corresponding goal-selling figure layer in makeup region, including:
Based on the pixel value for waiting for each pixel in makeup image, target colour of skin attribute is determined;
According to the target colour of skin attribute and at least one attribute for waiting for makeup region, obtains and at least one waited for described The corresponding goal-selling figure layer in adornment region.
7. a kind of image processing apparatus, which is characterized in that including:
Image collection module waits for makeup image for obtaining;
Image segmentation module obtains at least one waiting for makeup region for waiting for that makeup image carries out image, semantic segmentation to described;
Virtual die-filling piece, for according at least one attribute for waiting for makeup region, using default makeup strategy to described It is at least one to wait for that makeup region carries out virtual makeup.
8. device according to claim 7, which is characterized in that described image divides module, is specifically used for:
It is waited for described in the makeup image input neural network model that training obtains in advance, passes through the fortune of the neural network model It calculates, at least one of makeup image feature is waited for described in extraction;
Type mark is carried out to the corresponding region of at least one feature, obtains at least one waiting for makeup region.
9. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and steps of claim 1-6.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer in the computer readable storage medium Program realizes claim 1-6 any method and steps when the computer program is executed by processor.
CN201810290726.1A 2018-03-30 2018-03-30 Image processing method and device, electronic equipment and medium Pending CN108564526A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810290726.1A CN108564526A (en) 2018-03-30 2018-03-30 Image processing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810290726.1A CN108564526A (en) 2018-03-30 2018-03-30 Image processing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN108564526A true CN108564526A (en) 2018-09-21

Family

ID=63533813

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810290726.1A Pending CN108564526A (en) 2018-03-30 2018-03-30 Image processing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN108564526A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685713A (en) * 2018-11-13 2019-04-26 平安科技(深圳)有限公司 Makeup analog control method, device, computer equipment and storage medium
CN110827195A (en) * 2019-10-31 2020-02-21 北京达佳互联信息技术有限公司 Virtual article adding method and device, electronic equipment and storage medium
CN111311736A (en) * 2020-03-04 2020-06-19 北京奇艺世纪科技有限公司 Modeling method, modeling device and electronic equipment
CN111369644A (en) * 2020-02-28 2020-07-03 北京旷视科技有限公司 Face image makeup trial processing method and device, computer equipment and storage medium
CN111489284A (en) * 2019-01-29 2020-08-04 北京搜狗科技发展有限公司 Image processing method and device for image processing
CN111539937A (en) * 2020-04-24 2020-08-14 北京海益同展信息科技有限公司 Object index detection method and livestock weight detection method and device
CN112529914A (en) * 2020-12-18 2021-03-19 北京中科深智科技有限公司 Real-time hair segmentation method and system
CN112734633A (en) * 2021-01-07 2021-04-30 京东方科技集团股份有限公司 Virtual hair style replacing method, electronic equipment and storage medium
CN113344836A (en) * 2021-06-28 2021-09-03 展讯通信(上海)有限公司 Face image processing method and device, computer readable storage medium and terminal

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180872A (en) * 2010-10-29 2013-06-26 欧姆龙株式会社 Image-processing device, image-processing method, and control program
US20150145882A1 (en) * 2013-04-08 2015-05-28 Panasonic Intellectual Property Corporation Of America Image processing device, image processing method, and program, capable of virtual reproduction of makeup application state
CN105373777A (en) * 2015-10-30 2016-03-02 中国科学院自动化研究所 Face recognition method and device
CN107153805A (en) * 2016-03-02 2017-09-12 北京美到家科技有限公司 Customize makeups servicing unit and method
CN107220960A (en) * 2017-05-27 2017-09-29 无限极(中国)有限公司 One kind examination cosmetic method, system and equipment
CN107705240A (en) * 2016-08-08 2018-02-16 阿里巴巴集团控股有限公司 Virtual examination cosmetic method, device and electronic equipment
US20180075523A1 (en) * 2016-09-15 2018-03-15 GlamST LLC Generating virtual makeup products
CN107808136A (en) * 2017-10-31 2018-03-16 广东欧珀移动通信有限公司 Image processing method, device, readable storage medium storing program for executing and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103180872A (en) * 2010-10-29 2013-06-26 欧姆龙株式会社 Image-processing device, image-processing method, and control program
US20150145882A1 (en) * 2013-04-08 2015-05-28 Panasonic Intellectual Property Corporation Of America Image processing device, image processing method, and program, capable of virtual reproduction of makeup application state
CN105373777A (en) * 2015-10-30 2016-03-02 中国科学院自动化研究所 Face recognition method and device
CN107153805A (en) * 2016-03-02 2017-09-12 北京美到家科技有限公司 Customize makeups servicing unit and method
CN107705240A (en) * 2016-08-08 2018-02-16 阿里巴巴集团控股有限公司 Virtual examination cosmetic method, device and electronic equipment
US20180075523A1 (en) * 2016-09-15 2018-03-15 GlamST LLC Generating virtual makeup products
CN107220960A (en) * 2017-05-27 2017-09-29 无限极(中国)有限公司 One kind examination cosmetic method, system and equipment
CN107808136A (en) * 2017-10-31 2018-03-16 广东欧珀移动通信有限公司 Image processing method, device, readable storage medium storing program for executing and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CSDN博客: "如何妙笔勾檀妆:像素级语义理解", 《HTTPS://BLOG.CSDN.NET/C2A2O2/ARTICLE/DETAILS/79695443》 *
GOZDE YOLCU OZTEL ET AL.: "Virtual Makeup Application Using Image Processing Methods", 《INTERNATIONAL JOURNAL OF SCIENTIFIC ENGINEERING AND APPLIED SCIENCE (IJSEAS)》 *

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109685713A (en) * 2018-11-13 2019-04-26 平安科技(深圳)有限公司 Makeup analog control method, device, computer equipment and storage medium
CN109685713B (en) * 2018-11-13 2024-05-10 平安科技(深圳)有限公司 Cosmetic simulation control method, device, computer equipment and storage medium
CN111489284A (en) * 2019-01-29 2020-08-04 北京搜狗科技发展有限公司 Image processing method and device for image processing
CN111489284B (en) * 2019-01-29 2024-02-06 北京搜狗科技发展有限公司 Image processing method and device for image processing
CN110827195B (en) * 2019-10-31 2023-09-22 北京达佳互联信息技术有限公司 Virtual article adding method and device, electronic equipment and storage medium
CN110827195A (en) * 2019-10-31 2020-02-21 北京达佳互联信息技术有限公司 Virtual article adding method and device, electronic equipment and storage medium
CN111369644A (en) * 2020-02-28 2020-07-03 北京旷视科技有限公司 Face image makeup trial processing method and device, computer equipment and storage medium
CN111311736A (en) * 2020-03-04 2020-06-19 北京奇艺世纪科技有限公司 Modeling method, modeling device and electronic equipment
CN111539937A (en) * 2020-04-24 2020-08-14 北京海益同展信息科技有限公司 Object index detection method and livestock weight detection method and device
CN112529914A (en) * 2020-12-18 2021-03-19 北京中科深智科技有限公司 Real-time hair segmentation method and system
CN112529914B (en) * 2020-12-18 2021-08-13 北京中科深智科技有限公司 Real-time hair segmentation method and system
CN112734633A (en) * 2021-01-07 2021-04-30 京东方科技集团股份有限公司 Virtual hair style replacing method, electronic equipment and storage medium
CN113344836A (en) * 2021-06-28 2021-09-03 展讯通信(上海)有限公司 Face image processing method and device, computer readable storage medium and terminal

Similar Documents

Publication Publication Date Title
CN108564526A (en) Image processing method and device, electronic equipment and medium
US8508546B2 (en) Image mask generation
CN110163810B (en) Image processing method, device and terminal
CN110198437B (en) Image processing method and device, storage medium and electronic device
CN108320312B (en) Image color matching method and device and computer terminal
CN107771336A (en) Feature detection and mask in image based on distribution of color
CN109871828A (en) Video frequency identifying method and identification device, storage medium
US11610433B2 (en) Skin tone assisted digital image color matching
CN107204034B (en) A kind of image processing method and terminal
CN107808136A (en) Image processing method, device, readable storage medium storing program for executing and computer equipment
CN104076928B (en) A kind of method for adjusting text importing image
CN109658330B (en) Color development adjusting method and device
CN104754211B (en) Image processing apparatus and image processing method
CN104574358B (en) From the method and apparatus for focusing heap image progress scene cut
CN111784568A (en) Face image processing method and device, electronic equipment and computer readable medium
CN108463823A (en) A kind of method for reconstructing, device and the terminal of user's Hair model
CN108737875A (en) Image processing method and device
CN104636759A (en) Method for obtaining picture recommending filter information and picture filter information recommending system
CN113344836B (en) Face image processing method and device, computer readable storage medium and terminal
CN111739027A (en) Image processing method, device and equipment and readable storage medium
US11670031B2 (en) System and method for automatically generating an avatar with pronounced features
CN110599554A (en) Method and device for identifying face skin color, storage medium and electronic device
CN110969631A (en) Fine photo hair dyeing method and system
CN109242775A (en) A kind of attribute information moving method, device, equipment and readable storage medium storing program for executing
WO2023143229A1 (en) Image processing method and apparatus, and device and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20201202

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing 100123

Applicant after: Beijing LEMI Technology Co.,Ltd.

Address before: 100123 Building 8, Huitong Times Square, 1 South Road, Chaoyang District, Beijing.

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20180921

RJ01 Rejection of invention patent application after publication