CN107451950A - Face image synthesis method, human face recognition model training method and related device - Google Patents

Face image synthesis method, human face recognition model training method and related device Download PDF

Info

Publication number
CN107451950A
CN107451950A CN201610370020.7A CN201610370020A CN107451950A CN 107451950 A CN107451950 A CN 107451950A CN 201610370020 A CN201610370020 A CN 201610370020A CN 107451950 A CN107451950 A CN 107451950A
Authority
CN
China
Prior art keywords
image
hair
face
key point
transformed
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
CN201610370020.7A
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 Megvii Technology Co Ltd
Beijing Maigewei Technology Co Ltd
Original Assignee
Beijing Megvii Technology Co Ltd
Beijing Maigewei 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 Megvii Technology Co Ltd, Beijing Maigewei Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Priority to CN201610370020.7A priority Critical patent/CN107451950A/en
Publication of CN107451950A publication Critical patent/CN107451950A/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
    • G06T3/14Transformations for image registration, e.g. adjusting or mapping for alignment of images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)

Abstract

The embodiment provides Face image synthesis method, human face recognition model training method and related device.The Face image synthesis method includes:Obtain the facial image through marking face key point;The hair image through marking hair key point is obtained, wherein the hair key point is corresponding with the face key point;And the hair portion of the hair image is added on the facial image based on the face key point and the hair key point, to obtain face synthetic image.Using above-mentioned Face image synthesis method and apparatus, the composograph of faces substantial amounts of, true to nature, that there are various hair styles can be obtained.Many effectively analysis materials are provided for follow-up face image processing.In the case where effectively utilizing these materials, the speed and precision of face image processing can be significantly improved.

Description

Face image synthesis method, human face recognition model training method and related device
Technical field
The present invention relates to image processing field, relates more specifically to a kind of Face image synthesis method and apparatus, Yi Jiren Face identification model training method and device.
Background technology
As the development that image processing techniques is maked rapid progress, the application scenarios of face image processing are also more and more.Such as The technology such as Face datection and recognition of face has been widely used for the fields such as security protection, finance.
The influence that face is blocked to face image processing system is huge, such as the statistics of current main flow or machine learning Human face recognition model.The hair (particularly bang) of people is that a kind of common face blocks.Below by taking human face recognition model as an example Illustrate main influence of the hair on face image processing system of people.1) it is difficult to collect the largely facial image with bang to be used for people Face identification model is trained;2) the hair style varied styles of people, metamorphosis is big, and the pattern of bang is also very strange, so hair is very Hardly possible is portrayed with a simple model;3) hair can change the statistical nature of image, characteristics of image, so as to give human face recognition model Identification is brought to disturb.
Therefore, it is necessary to a kind of Face image synthesis method and apparatus, to provide the facial image of various hair styles.And then base More preferably face image processing system, such as face can be obtained in the image of this face substantial amounts of, with various hair styles Identification model.
The content of the invention
The present invention is proposed in view of above mentioned problem.The invention provides a kind of Face image synthesis method and apparatus, Facial image and hair image can be synthesized based on the key point in image, it is hereby achieved that largely, there are various hairs The composograph of the face of type.
According to an aspect of the present invention, there is provided a kind of Face image synthesis method, including:
Obtain the facial image through marking face key point;
The hair image through marking hair key point is obtained, wherein the hair key point and the face key point pair Should;And
Based on the face key point and the hair key point, the hair portion of the hair image is added to described On facial image, to obtain face synthetic image.
Exemplarily, the hair portion of the hair image is added on the facial image and further comprised:
According to the face key point and the hair key point, the transformation matrix for the hair image is obtained;
Line translation is entered to the hair image using the transformation matrix, regarded with obtaining to project to where the facial image Plane, transformed hair image;
Image segmentation is carried out to the transformed hair image, to obtain the hair wheel of the transformed hair image Wide template;And
Using the hair contour mould, the hair portion of the transformed hair image is added to the face figure As upper, to obtain the face synthetic image.
Exemplarily, the hair portion by the hair image is added on the facial image and further comprised:
Image segmentation is carried out to the hair image, to obtain hair contour mould;
According to the face key point and the hair key point, obtain for the hair image and the hair profile The transformation matrix of template;
Line translation is entered to the hair image and the hair contour mould using the transformation matrix, to be projected to View plane where the facial image, transformed hair image and view plane, warp where projecting to the facial image The hair contour mould of conversion;And
Facial image place view plane, transformed hair contour mould is projected to using described, by the warp The hair portion of the hair image of conversion is added on the facial image, to obtain the face synthetic image.
Exemplarily, after the acquisition transformation matrix, the hair portion by the hair image is added to institute State and further comprise on facial image:At least part element in the transformation matrix is increased into noise, for the conversion.
Exemplarily, the noise Gaussian distributed.
Exemplarily, the conversion is perspective transform.
Exemplarily, the hair portion by the transformed hair image is added to the facial image enterprising one Step includes:The hair portion of the transformed hair image is added on the facial image using graph cut method.
Exemplarily, the face key point includes:Intersection point, the right side of positive face peak, left eye angle extended line and face profile The intersection point and chin of canthus extended line and face profile.
According to a further aspect of the invention, a kind of human face recognition model training method is additionally provided, including:
Face synthetic image is generated using above-mentioned Face image synthesis method;And
The training of human face recognition model is carried out using image library, wherein described image storehouse includes the face synthetic image.
According to a further aspect of the present invention, a kind of Face image synthesis device is additionally provided, including:
First acquisition module, for obtaining the facial image through marking face key point;
Second acquisition module, for obtain through mark hair key point hair image, wherein the hair key point with The face key point is corresponding;And
Synthesis module, for based on the face key point and the hair key point by the hair portion of the hair image Divide and be added on the facial image, to obtain face synthetic image.
Exemplarily, the synthesis module further comprises:
Matrix generation unit, for according to the face key point and the hair key point, obtaining for the hair The transformation matrix of image;
First converter unit, for entering line translation to the hair image using the transformation matrix, to be projected to View plane where the facial image, transformed hair image;
First cutting unit, it is described transformed to obtain for carrying out image segmentation to the transformed hair image Hair image hair contour mould;And
Synthesis unit, for utilizing the hair contour mould, the hair portion of the transformed hair image is folded It is added on the facial image, to obtain the face synthetic image.
Exemplarily, the synthesis module further comprises:
Second cutting unit, for carrying out image segmentation to the hair image, to obtain hair contour mould;
Matrix generation unit, for according to the face key point and the hair key point, obtaining for the hair The transformation matrix of image and the hair contour mould;
Second converter unit, for being carried out using the transformation matrix to the hair image and the hair contour mould Conversion, facial image place view plane, transformed hair image is projected to acquisition and projects to the face figure As place view plane, transformed hair contour mould;And
Synthesis unit, for view plane where the facial image is projected to described in utilization, transformed hair profile Template, the hair portion of the transformed hair image is added on the facial image, to obtain the human face segmentation Image.
Exemplarily, the synthesis module further comprises plus made an uproar unit, for by least portion in the transformation matrix Divide element increase noise, for the conversion.
Exemplarily, the noise Gaussian distributed.
Exemplarily, the conversion is perspective transform.
Exemplarily, the synthesis unit further comprises:Graph cut subelement, for utilizing graph cut method will The hair portion of the transformed hair image is added on the facial image.
Exemplarily, the face key point includes:Intersection point, the right side of positive face peak, left eye angle extended line and face profile The intersection point and chin of canthus extended line and face profile.
According to another aspect of the invention, a kind of human face recognition model trainer is additionally provided, including:
Above-mentioned Face image synthesis device;And
Training module, for carrying out the training of human face recognition model using image library, wherein described image storehouse includes described The face synthetic image that Face image synthesis device is generated.
Face image synthesis method and apparatus according to embodiments of the present invention, it is based on face key point and crucial with face The hair portion of hair image can be added on facial image by hair key point corresponding to point, so as to obtain it is substantial amounts of, force Really, the composograph of the face with various hair styles.Many effectively analysis materials are provided for follow-up face image processing. In the case of effectively utilizing these materials, the speed and precision of face image processing can be significantly improved.
Facial image identification model training method according to embodiments of the present invention and device, utilize above-mentioned Face image synthesis Face synthetic image that method and apparatus are obtained training facial image identification model, it is higher and identify that accuracy of identification can be obtained The faster facial image identification model of speed.
Brief description of the drawings
The embodiment of the present invention is described in more detail in conjunction with the accompanying drawings, above-mentioned and other purpose of the invention, Feature and advantage will be apparent.Accompanying drawing is used for providing further understanding the embodiment of the present invention, and forms explanation A part for book, it is used to explain the present invention together with the embodiment of the present invention, is not construed as limiting the invention.In the accompanying drawings, Identical reference number typically represents same or similar part or step.
Fig. 1 is shown for realizing that the exemplary electron of Face image synthesis method and apparatus according to embodiments of the present invention is set Standby schematic block diagram;
Fig. 2 shows the indicative flowchart of Face image synthesis method according to an embodiment of the invention;
Fig. 3 shows the facial image according to an embodiment of the invention through marking face key point;
Fig. 4 a, Fig. 4 b, Fig. 4 c and Fig. 4 d respectively illustrate gathered hair image according to an embodiment of the invention In hair information;
Fig. 5 shows the position view of hair key point according to an embodiment of the invention;
Fig. 6 a, Fig. 6 b, Fig. 6 c and Fig. 6 d respectively illustrate Fig. 4 a, Fig. 4 b, the hair image warp involved by Fig. 4 c and Fig. 4 d The schematic diagram of the hair contour mould obtained after segmentation;
Fig. 7 shows that the hair portion according to an embodiment of the invention by transformed hair image is directly superimposed to The operation chart of facial image;
Fig. 8 shows the schematic flow according to an embodiment of the invention for synthesizing facial image and hair image Figure;
Fig. 9 a and Fig. 9 b respectively illustrate head in hair image before and after perspective transform according to an embodiment of the invention Send out the schematic diagram of part;
Figure 10 show it is according to an embodiment of the invention by the way of graph cut by transformed hair image Hair portion be added to the operation chart of facial image;
Figure 11 shows the schematic flow according to another embodiment of the present invention for synthesizing facial image and hair image Figure;
Figure 12 shows the schematic flow for synthesizing facial image and hair image according to further embodiment of this invention Figure;
Figure 13 shows the indicative flowchart of human face recognition model training method according to an embodiment of the invention;
Figure 14 shows the schematic block diagram of Face image synthesis device according to an embodiment of the invention;
Figure 15 shows the schematic of the synthesis module in Face image synthesis device according to an embodiment of the invention Block diagram;
Figure 16 shows the signal of the synthesis module in Face image synthesis device in accordance with another embodiment of the present invention Property block diagram;
Figure 17 shows the schematic block diagram of human face recognition model trainer according to an embodiment of the invention;And
Figure 18 is the schematic block diagram of the electronic equipment according to an embodiment of the invention for Face image synthesis.
Embodiment
Become apparent in order that obtaining the object, technical solutions and advantages of the present invention, root is described in detail below with reference to accompanying drawings According to the example embodiment of the present invention.Obviously, described embodiment is only the part of the embodiment of the present invention, rather than this hair Bright whole embodiments, it should be appreciated that the present invention is not limited by example embodiment described herein.Described in the present invention The embodiment of the present invention, those skilled in the art's all other embodiment resulting in the case where not paying creative work It should all fall under the scope of the present invention.
First, reference picture 1 describes the example of the Face image synthesis method and apparatus for realizing the embodiment of the present invention Electronic equipment 100.
As shown in figure 1, electronic equipment 100 includes one or more processors 102, one or more storage devices 104, defeated Enter device 106 and output device 108, bindiny mechanism's (not shown) that these components pass through bus system 110 and/or other forms Interconnection.It should be noted that the component and structure of electronic equipment 100 shown in Fig. 1 are illustrative, and not restrictive, according to Need, the electronic equipment can also have other assemblies and structure.
The processor 102 can be CPU (CPU) or be performed with data-handling capacity and/or instruction The processing unit of the other forms of ability, and other components in the electronic equipment 100 can be controlled desired to perform Function.
The storage device 104 can include one or more computer program products, and the computer program product can With including various forms of computer-readable recording mediums, such as volatile memory and/or nonvolatile memory.It is described easy The property lost memory is such as can include random access memory (RAM) and/or cache memory (cache).It is described non- Volatile memory is such as can include read-only storage (ROM), hard disk, flash memory.In the computer-readable recording medium On can store one or more computer program instructions, processor 102 can run described program instruction, to realize hereafter institute The computer function (realized in the embodiment of the present invention stated by processor) and/or other desired functions.In the meter Can also store various application programs and various data in calculation machine readable storage medium storing program for executing, for example, the application program use and/or Caused various data etc..
The input unit 106 can be the device for receiving instruction that user inputted and gathered data, and Keyboard, mouse, microphone, touch-screen can be included and imaged one or more of first-class.
The output device 108 can export various information (such as image or sound) to outside (such as user), and One or more of display, loudspeaker etc. can be included.
Above-mentioned input unit 106 and output device 108 is mainly used in and user mutual, electronic equipment 100 can not also wrap Include the two.
Below, Face image synthesis method 200 according to an embodiment of the invention will be described with reference to figure 2.
First, in step S210, the facial image through marking face key point is obtained.
Facial image refers to the image comprising face information.Face key point refers to has special semantic position on face, Such as pupil position, inner eye corner position, external eyes Angle Position etc..These face key points can be marked on facial image.
Specifically, various facial images can be gathered by network first.Alternatively, real scene shooting can also be passed through down online Mode gathers various facial images.Then, face key point is marked on the facial image gathered.Part or all of face The labeling operation of key point can be realized by manual type.The labeling operation of part or all of face key point can also be by machine Automatic marking.For example, facial image is directed to, using active appearance models (AAM, Active Appearance Model), active Shape (ASM, Active Shape Model), random forest (Random forest), deep learning (Deep Learning) the methods of, is fitted by machine learning to face key point position.
It should be appreciated that the present invention is not limited by specific face key point mask method, either existing face key point mark Injecting method or in the future the face key point mask method of exploitation, can be applied to facial image according to embodiments of the present invention In generation method, and it should also include within the scope of the present invention.
Fig. 3 shows the facial image according to an embodiment of the invention through marking face key point.As shown in figure 3, Wherein face key point can include:Positive face peak, intersection point, right eye angle extended line and the face of left eye angle extended line and face profile The intersection point and chin of profile.Above-mentioned key point reflects the border of face, and it is the point closely related with the positioning of hair image. The position of hair image in the vertical direction can accurately be determined according to positive face peak and chin, and according to images of left and right eyes The intersection point of angle extended line and face profile then can accurately determine the position of hair image in the lateral direction.Thus, utilize Above-mentioned face key point can more accurately synthesize face synthetic image so that the more accurate status of hair on face synthetic image Correct position around face.It will be understood by those skilled in the art that the face key point shown in Fig. 3 is only to illustrate, rather than Limitation, face key point can not include part or all of in above-mentioned 4 key points.In addition, face key point can also wrap Include the point of other positions on face.
In step S220, the hair image through marking hair key point is obtained.
Hair image refers to the various images of the hair portion comprising people.Wherein, hair portion refers to that people's in image is true Hair where part, it includes the hair information such as hair position, color, head dummy shape.Hair image can pass through Network is gathered or gathered under online by way of real scene shooting.Hair image can be that the head for being directed to the people with various hair styles is entered Row IMAQ is obtained.Except including hair portion, face part, image background, glasses can also be included in hair image Etc. other information, the other information outside hair portion is not defined herein.Fig. 4 a to Fig. 4 d respectively illustrate basis Hair portion in the hair image that one embodiment of the invention is gathered.As illustrated, the hair length of people is different, head dummy Also varied, it is also not quite similar to blocking for face, so processing of the hair to facial image can produce larger bad shadow Ring.
It is similar with marking face key point on facial image, it is corresponding with face key point that mark is also required on hair image Hair key point.Similar with face key point, hair key point can also use artificial or machine mark, and the present invention is not had The limitation of body hair key point mask method.Hair key point corresponds with face key point.If for example, in facial image Face key point include positive face peak, then the positive face peak is also required to be labeled in hair image, as hair close Key point.Hair image can be mapped to by facial image according to the corresponding relation between face key point and hair key point, from And the corresponding relation for the pixel established in pixel and facial image in hair image.Face key point and hair key point are each Number be more than 2, effectively to establish the mapping relations between above-mentioned image.
Fig. 5 shows the position view of hair key point according to an embodiment of the invention.4 are shown in Fig. 5 Hair key point, specifically include positive face peak, intersection point, right eye angle extended line and the face profile of left eye angle extended line and face profile Intersection point and chin.As can be seen that the hair key point shown in Fig. 5 is corresponding with the face key point shown in Fig. 3.
In step S230, the hair portion of above-mentioned hair image is superimposed based on above-mentioned face key point and hair key point Onto facial image, to obtain face synthetic image.
In this step, the hair portion of hair image is added to according to the matching of face key point and head portrait key point Correct position on facial image.Hair image includes the hair of various hair styles, and therefore, the face in face synthetic image will With various hair styles.
Above-mentioned Face image synthesis method 200 can automatically obtain face that is substantial amounts of, true to nature, having various hair styles Composograph, many effectively analysis materials are provided for follow-up face image processing.In the case where effectively utilizing these materials, Face image processing can be made to avoid being disturbed by hair, significantly improve the speed and precision of face image processing.
In an embodiment of the invention, above-mentioned steps S230 includes step S231 and step S232.
In step S231, hair image is subjected to image segmentation, obtains the hair contour mould of hair image.Image point Segmentation method can utilize the method for any currently known or following exploitation, such as Grabcut split plot designs.Hair contour mould is logical The image of the marginal information of hair in hair image can be provided for the progress image segmentation of hair image obtained from by crossing.Head It is hair portion clean, without other information to send out inside the edge of the hair in image.In other words, hair contour mould can Assist in which pixel in hair image belongs to hair portion, which pixel belongs to other information part.A to Fig. 6 d points of Fig. 6 The hair contour mould that the hair image involved by Fig. 4 a to Fig. 4 d is obtained after singulated is not shown.For these hair wheels Wide template, corresponding with the white pixel of the hair contour mould in hair image is partly hair portion, in hair image with Part is other information part corresponding to the black picture element of the hair contour mould.Exemplarily, hair profile module can be Binary image, wherein, its value of white pixel part in corresponding diagram 6a to Fig. 6 d is 1, and its value of black picture element part is 0, When carrying out image synthesis processing, for hair image, only retention is 1 pixel portion in face synthetic image.
In step S232, the hair contour mould that is obtained using step S231 is straight by the hair portion of hair image Connect and be added on facial image, to obtain the face synthetic image.Face synthetic image is will to utilize hair contour mould will Hair portion in hair image is synthesized to correct position in facial image and obtains composograph.Fig. 7 is shown according to this hair The step S232 of bright one embodiment schematic diagram.The picture left above is that to obtain hair contour mould using step S231 true in Fig. 7 Hair portion in fixed hair image.Lower-left figure is facial image in Fig. 7.Right figure is hair portion and facial image in Fig. 7 The face synthetic image obtained after simple split.Specifically, as described above, can be with according to face key point and hair key point The mapping relations established between facial image and hair image.It is possible, firstly, to for each in the hair portion of hair image Pixel, according to above-mentioned mapping relations, search its respective pixel in facial image.Then, by the correspondence in facial image The pixel value of pixel replaces with its pixel value.For example, it is assumed that according to face key point and hair key point in respective image Position, determine that facial image and hair image size are 1024*1024.It can so determine to be located at hair figure in hair portion The pixel of the position (500,500) of picture corresponds in facial image the pixel for being located at position (500,500).Then can be by face figure Pixel value positioned at the pixel of position (500,500) as in directly replaces with the picture for being located at position (500,500) in hair image The pixel value of element.The synthesis mode being directly superimposed, calculate simple.But comparatively, accommodation is narrower.If hair image It is larger with the size difference of facial image, then the synthesis mode being directly superimposed may be because that synthetic effect distortion is serious and loses Lose.
In order that synthetic effect is more life-like, before step S232, above-mentioned steps S230 can also include step S231 ', facial image or hair image are zoomed in and out, so that the hair size in the face and hair image in facial image It is corresponding.In other words, zoom operations can cause the face in the hair and facial image in hair image to match, rather than It is excessive or too small.
Fig. 8 shows the signal that step S230 according to another embodiment of the present invention synthesizes facial image and hair image Property flow chart.As shown in figure 8, step S230 further comprises step S831, step S833, step S835 and step S837.
In step S831, according to face key point and hair key point, transformation matrix is obtained.The transformation matrix is used for will Hair image projection is to the view plane where facial image.In other words, i.e., by utilizing the transformation matrix pair in subsequent step Hair image enters line translation, the view plane for making it be transformed to where facial image.
Alternatively, the conversion is perspective transform.Perspective transform can not only change the size of image, additionally it is possible to change in image The shape of destination object.Simply for example, a square in image to be transformed can be transformed to four by transformation matrix Side shape;Conversely, it is also the same that quadrangle, which transforms to square,.In this way, pass through perspective transform, thus it is possible to vary head in hair image Send out the shape of part so that the hair style in the face synthetic image finally obtained is more rich changeable.
Alternatively, above-mentioned conversion can be affine transformation.Face key point needed for affine transformation and hair key point are less, Amount of calculation is smaller.
Below by taking perspective transform as an example, the process of the acquisition transformation matrix according to an example of the present invention is described in detail.Such as Shown in lower, the process of acquisition transformation matrix below utilizes 4 face key points and corresponding hair key point.4 faces close Key point and the position coordinates of corresponding hair key point can be used as known conditions to obtain transformation matrix.Alternatively, face closes Key point can also be 5.4 or 5 face key points can obtain suitable transformation matrix, can ensure to be converted again The amount of calculation of the operation of matrix is smaller.
Assuming that coordinate of the face key point in facial image is:Intersection point (the x of left eye angle extended line and face profilel,yl), Intersection point (the x of right eye angle extended line and face profiler,yr), positive face peak (xt,yt), chin (xc,yc).Hair key point is in head Hair image in coordinate be:Intersection point (the x ' of left eye angle extended line and face profilel,y′l), the friendship of right eye angle extended line and face profile Point (x 'r,y′r), positive face peak (x 't,y′t), chin (x 'c,y′c).Optimal conversion is found for example, by least square method Matrix T.
Wherein, w and w " are operational parameters, its energy It is enough to be calculated in calculating process.
Also,
It is a 3*3 matrix by the transformation matrix T acquired in above-mentioned computing, uses below To represent.
In step S833, line translation is entered to the hair image using transformation matrix T, the face is projected to obtain View plane where image, transformed hair image.As described above, the conversion can be perspective transform, it can change head Send out the shapes and sizes of hair portion in image.Fig. 9 a and Fig. 9 b respectively illustrate perspective according to an embodiment of the invention and become Change the schematic diagram of hair portion in front and rear hair image.
In step S835, image segmentation is carried out to transformed hair image, obtains the transformed hair image Hair contour mould.Step S835 operation is similar with above-mentioned steps S231's, and simply step S835 operation object is step The transformed hair image that rapid S833 map functions are obtained.
In step S837, using the hair contour mould, the hair portion of the transformed hair image is folded It is added on the facial image, to obtain the face synthetic image.
Step S837 operation can be similar with above-mentioned steps S232, and human face segmentation is obtained using the mode being directly superimposed Image.
Alternatively, step S837 can also be by the way of graph cut by the hair of the transformed hair image Partial stack is on the facial image.Exemplarily, hair portion and face that can be by graph cut to hair image The superposition border of image is handled, and makes face synthetic image as far as possible smooth, without obvious border, it appears that more natural.Pool Pine fusion is a kind of region blending algorithm based on pixel.Alternatively, in one embodiment of the invention, melt for each The mode that pixel involved by closing operation employs 4 neighborhoods carries out mixing operation.Can be by solving red (R), green (G), indigo plant respectively (B) system of linear equations of three passages, the new pixel value after each pixel fusion is obtained, thus, obtains final human face segmentation figure Picture.
Figure 10 shows step S837 according to an embodiment of the invention schematic diagram.The picture left above is to utilize step in Figure 10 Rapid S835 obtains the hair portion in the hair image of hair contour mould determination.Lower-left figure is facial image in Figure 10.Figure Right figure is the face synthetic image obtained after hair portion and facial image graph cut in 10.As illustrated, with it is right in Fig. 7 Figure is compared, and the face synthetic image in Figure 10 obtained by right figure is truer.
The details of hair portion is a lot.For face synthetic image, graph cut can obtain seamless, more true to nature melt Close result.Thus, the face synthetic image obtained would be even more beneficial to follow-up face image processing.Although in addition, hair figure The details of picture is more, but selects the process of integration region still relatively simple and conveniently in Poisson mixing operation.
In the operation for synthesizing facial image and hair image shown in Fig. 8, only hair image is entered in step S833 Line translation, amount of calculation are smaller.
Figure 11 shows that step S230 according to another embodiment of the present invention shows what facial image and hair image synthesized Meaning property flow chart.As shown in figure 11, step S230 further comprises step S1131, step S1133, step S1135 and step S1137。
In step S1131, image segmentation is carried out to hair image, to obtain hair contour mould.The step with it is above-mentioned Step S231 is similar, in order to succinctly will not be repeated here.
In step S1133, according to face key point and hair key point, obtain for hair image and hair profile die The transformation matrix of plate.The step is similar with above-mentioned steps S831, in order to succinctly will not be repeated here.
In step S1135, line translation is entered to hair image and hair contour mould using transformation matrix, to be projected To view plane where facial image, transformed hair image and view plane where projecting to facial image, it is transformed Hair contour mould.The map function is similar with above-mentioned steps S833 map function, and simply step S1135 map function is not Only for hair image also directed to hair contour mould.That is, the object of map function adds hair contour mould.Can To understand because entering line translation based on identical transformation matrix, the conversion behaviour for hair image and hair contour mould Work is identical.In step S1137, using hair contour mould that project to view plane where facial image, transformed, The hair portion of transformed hair image is added on the facial image, to obtain face synthetic image.
Step S1137 operation can be similar with above-mentioned steps S232, and obtaining face using the mode being directly superimposed closes Into image.Alternatively, step S1137 can also be by the way of graph cut by the hair of the transformed hair image Partial stack is on the facial image.Those of ordinary skill in the art are above-mentioned on step S232 and step S837 by reading Description, it is possible to understand that this step implementation process, for sake of simplicity, will not be repeated here.
It should be noted that in some instances, step S1133 can also be first carried out, then perform step S1131.
In the scheme illustrated in fig. 11 for synthesizing facial image and hair image, the segmentation of hair image is carried out first To obtain hair contour mould, transformation matrix is then obtained again, and then carries out image conversion, finally again by facial image and hair The hair portion of image is synthesized.In this scheme, for same hair image, how many faces to be synthesized no matter be present Image, it is only necessary to perform step S1131 cutting operation.Although for each face figure to be synthesized in step S1135 As needing to perform both hair image and hair contour mould conversion, but because the amount of calculation of cutting operation is much larger than conversion The amount of calculation of operation, so in the case of it multiple facial images to be synthesized be present, compared with the synthetic schemes shown in Fig. 8, Amount of calculation can be substantially reduced.
Alternatively, in the flow of the synthetic operation shown in above-mentioned Fig. 8 and Figure 11, after transformation matrix is obtained, in addition to At least part element in transformation matrix is increased into noise, for above-mentioned steps S837 and step S1137 map function.Under Face illustrates by taking the synthetic operation shown in Fig. 8 as an example.Figure 12 is shown people according to the step S230 of further embodiment of this invention Face image and the indicative flowchart of hair image synthesis.As shown in figure 12, step S230 further comprises step S1231, step Rapid S1232, step S1233, step S1235 and step S1237.Compared with step S230 shown in Fig. 8, the step shown in Figure 12 Step S1232 is added in S230.Step S1231, step S1233, step S1235 and the step S1237 of remaining respectively with Fig. 8 In corresponding step it is similar, for sake of simplicity, will not be repeated here.
In step S1232, at least part element increase noise in the transformation matrix that step S1231 is obtained, with Conversion for the hair image in step S1233.According to an example of the present invention, the transformation matrix expression of noise is added For:
Wherein nxx,nxy,npx,nyx,nyy,npy,ndx,ndyIt is noise.
nxx,nxy,nyx,nyyThe profile of hair, n can be used for changingdx,ndyThe position of hair, n can be used for changingpx, npyFor producing perspective transform.Alternatively, above-mentioned noise Gaussian distributed.For example, it is 0 that above-mentioned noise, which is satisfied by average, side Difference is λ Gaussian Profile.Wherein λ is used for the size of control disturbance, and alternatively, λ values are the hair picture size after conversion 1/50。
Profile and the position of hair can be further controlled transformation matrix T increase noises, so as to extreme enrichment people The head dummy pattern of face in face composograph, further, dramatically increases the quantity of face synthetic image.Further, to becoming Change matrix T increase Gaussian distributed noise, it is ensured that increased face synthetic image reasonability, avoid face from closing Head dummy into the people in image is excessively strange.
Exemplarily, Face image synthesis method according to embodiments of the present invention can be with memory and processor Realized in unit or system.
According to a further aspect of the invention, a kind of human face recognition model training method is additionally provided.Figure 13 is shown according to this The human face recognition model training method of invention one embodiment.As shown in figure 13, human face recognition model training method includes step S1301 and step S1303.In step S1301, face synthetic image is generated using above-mentioned Face image synthesis method.As before Described, the people in face synthetic image can have various hair styles.So in face synthetic image, hair can be with It is variously-shaped that different degrees of block is caused to face.In step S1303, the instruction of human face recognition model is carried out using image library Practice, wherein described image storehouse includes the face synthetic image.Image library can be the above-mentioned facial image of the full utilization present invention What generation method was generated.Alternatively, can also be by the way that the face synthetic image generated be added in existing image library To obtain described image storehouse.In a word, above-mentioned face synthetic image is greatly enriched image library.
It is more sane to be obtained using the training of the image library progress human face recognition model including above-mentioned face synthetic image Human face recognition model.Above-mentioned human face recognition model training method has been obviously improved the recognition performance of human face recognition model.
Figure 14 shows the schematic block diagram of Face image synthesis device 1400 according to embodiments of the present invention.Such as Figure 14 institutes Show, Face image synthesis device 1400 includes the first acquisition module 1410, the second acquisition module 1420 and synthesis module 1430.
First acquisition module 1410 is used to obtain the facial image through marking face key point.The face key point can be with It is 4 or 5.Alternatively, face key point includes the intersection point of positive face peak, left eye angle extended line and face profile, right eye angle The intersection point and chin of extended line and face profile.First acquisition module 1410 can be as shown in Figure 1 electronic equipment in processor The programmed instruction that is stored in 102 Running storage devices 104 is realized, and can perform people according to an embodiment of the invention Step S210 in face image generation method.
Second acquisition module 1420 is used to obtain the hair image through marking hair key point, wherein the hair key point It is corresponding with the face key point.Second acquisition module 1420 can be as shown in Figure 1 electronic equipment in processor 102 run The programmed instruction stored in storage device 104 is realized, and can perform facial image according to an embodiment of the invention Step S220 in generation method.
Synthesis module 1430 is used for the head of the hair image based on the face key point and the hair key point Partial stack is sent out to the facial image, to obtain face synthetic image.Synthesis module 1430 can be as shown in Figure 1 electronics The programmed instruction that is stored in the Running storage device 104 of processor 102 in equipment is realized, and can be performed according to the present invention Step S230 in the Face image synthesis method of one embodiment.
Using above-mentioned Face image synthesis device 1400, face substantial amounts of, true to nature, that there are various hair styles can be obtained Composograph.Many effectively analysis materials are provided for follow-up face image processing.Effectively utilizing the situation of these materials Under, the speed and precision of face image processing can be significantly improved.
Figure 15 shows the synthesis module 1430 in Face image synthesis device 1400 according to an embodiment of the invention Schematic block diagram.As shown in figure 15, the synthesis module 1430 can include matrix generation unit 1531, the first converter unit 1533rd, the first cutting unit 1535 and synthesis unit 1537.
The matrix generation unit 1531 is used for according to the face key point and the hair key point, obtains for institute State the transformation matrix of hair image.The matrix generation unit 1531 can be as shown in Figure 1 electronic equipment in processor 102 The programmed instruction stored in Running storage device 104 is realized, and can perform facial image according to embodiments of the present invention The step S831 of generation method.
First converter unit 1533 is used to enter line translation to the hair image using the transformation matrix, to obtain View plane where projecting to the facial image, transformed hair image.First converter unit 1533 can be by Fig. 1 The programmed instruction that is stored in the Running storage device 104 of processor 102 in shown electronic equipment is realized, and can be performed The step S833 of Face image synthesis method according to embodiments of the present invention.Alternatively, the conversion is perspective transform.
First cutting unit 1535 is used to carry out image segmentation to the transformed hair image, with described in acquisition The hair contour mould of transformed hair image.In the electronic equipment that first cutting unit 1535 can be as shown in Figure 1 The Running storage device 104 of processor 102 in the programmed instruction that stores realize, and can perform according to embodiments of the present invention Face image synthesis method step S835.
The synthesis unit 1537 is used to utilize the hair contour mould, by the hair of the transformed hair image Partial stack is on the facial image, to obtain the face synthetic image.The synthesis unit 1537 can be as shown in Figure 1 Electronic equipment in the Running storage device 104 of processor 102 in the programmed instruction that stores realize, and basis can be performed The step S837 of the Face image synthesis method of the embodiment of the present invention.
Alternatively, the synthesis unit 1537 further comprises graph cut subelement, for utilizing graph cut method The hair portion of the transformed hair image is added on the facial image.
Figure 16 shows the synthesis module in the Face image synthesis device 1400 according to another embodiment of the invention 1430 schematic block diagram.As shown in figure 16, the synthesis module 1430 can include the second cutting unit 1631, matrix generates Unit 1633, the second converter unit 1635 and synthesis unit 1637.
Second cutting unit 1631 is used to carry out image segmentation to the hair image, to obtain hair profile die Plate.Second cutting unit 1631 can be as shown in Figure 1 electronic equipment in the Running storage device 104 of processor 102 in The step of programmed instruction of storage is to realize, and can perform Face image synthesis method according to embodiments of the present invention S1131。
The matrix generation unit 1633 is used for according to the face key point and the hair key point, obtains for institute State the transformation matrix of hair image and the hair contour mould.The matrix generation unit 1633 can be as shown in Figure 1 electricity The programmed instruction that is stored in the Running storage device 104 of processor 102 in sub- equipment is realized, and can be performed according to this hair The step S1133 of the Face image synthesis method of bright embodiment.Alternatively, the conversion is perspective transform.
Second converter unit 1635 is used for using the transformation matrix to the hair image and the hair profile Template enters line translation, projects to facial image place view plane, transformed hair image with acquisition and projects to institute View plane where stating facial image, transformed hair contour mould.Second converter unit 1635 can be as shown in Figure 1 Electronic equipment in the Running storage device 104 of processor 102 in the programmed instruction that stores realize, and basis can be performed The step S1135 of the Face image synthesis method of the embodiment of the present invention.
The synthesis unit 1637 is used for view plane where projecting to the facial image described in utilization, transformed head Contour mould is sent out, the hair portion of the transformed hair image is added on the facial image, to obtain the people Face composograph.The synthesis unit 1637 can be as shown in Figure 1 electronic equipment in the Running storage device of processor 102 The programmed instruction stored in 104 is realized, and can perform the step of Face image synthesis method according to embodiments of the present invention Rapid S1137.
Alternatively, the synthesis unit 1637 further comprises graph cut subelement, for utilizing graph cut method The hair portion of the transformed hair image is added on the facial image.
Alternatively, above-mentioned synthesis module 1430 can also include adding unit (not shown) of making an uproar.Unit of making an uproar is added to be used for matrix At least part element increase noise in the transformation matrix that generation unit is obtained, is converted for the first converter unit or second The conversion of unit.Alternatively, the noise Gaussian distributed.
Figure 17 shows the schematic block diagram of human face recognition model trainer 1700 according to an embodiment of the invention. As shown in figure 17, human face recognition model trainer 1700 further comprises above-mentioned Face image synthesis device 1400 and training mould Block 1702.Wherein, training module 1702 is used for the training that human face recognition model is carried out using image library, and wherein described image storehouse is wrapped Include the face synthetic image that the Face image synthesis device 1400 is generated.
Those of ordinary skill in the art are trained by reading above for Face image synthesis method and human face recognition model The detailed description of method, it is to be understood that the structure of above-mentioned Face image synthesis device and human face recognition model trainer, realize And advantage, therefore repeat no more here.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Member and algorithm steps, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, application-specific and design constraint depending on technical scheme.Professional and technical personnel Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
Figure 18 shows the schematic block diagram of electronic equipment 1800 according to embodiments of the present invention.The electronic equipment 1800 can To generate face synthetic image, the face in the face synthetic image has various hair styles.Electronic equipment 1800 includes Input unit 1810, storage device 1820, processor 1830 and output device 1840.
The input unit 1810 is used to receive operational order and the gathered data that user is inputted.Input unit 1810 Keyboard, mouse, microphone, touch-screen can be included and imaged one or more of first-class.
The storage device 1820 is stored for realizing the phase in Face image synthesis method according to embodiments of the present invention Answer the program code of step.
The processor 1830 is used to run the program code stored in the storage device 1820, to perform according to this hair The corresponding steps of the Face image synthesis method of bright embodiment, and for realizing facial image life according to embodiments of the present invention Into the first acquisition module 1410 in device, the second acquisition module 1420 and synthesis module 1430.
Output device 1840 can be used for exporting corresponding steps in Face image synthesis method according to embodiments of the present invention It is at least one in the facial image of acquisition, hair image and face synthetic image.Output device 1840 can be defeated to outside Go out various information, exemplarily, to external display output image information (for example, face synthetic image), and/or, to Module of data-handling capacity etc. exports processing data (for example, crucial point data, the partition data of hair image, hair image Conversion data, model training data, obtained model of training etc.).It will be appreciated by persons skilled in the art that output is filled It is exemplary to put the type of 1840 output data and the form of output data etc., and the present invention is not limited.
In one embodiment, the electronic equipment 1800 is made when described program code is run by the processor 1830 Perform following steps:
Obtain the facial image through marking face key point;
The hair image through marking hair key point is obtained, wherein the hair key point and the face key point pair Should;And
The hair portion of the hair image is added to based on the face key point and the hair key point described On facial image, to obtain face synthetic image.
Exemplarily, the face key point includes positive face peak, intersection point, the right eye of left eye angle extended line and face profile The intersection point and chin of angle extended line and face profile.
Exemplarily, make when described program code is run by the processor 1830 electronic equipment 1800 perform by The step that the hair portion of the hair image is added on the facial image includes:
According to the face key point and the hair key point, the transformation matrix for the hair image is obtained;
Line translation is entered to the hair image using the transformation matrix, regarded with obtaining to project to where the facial image Plane, transformed hair image;
Image segmentation is carried out to the transformed hair image, to obtain the hair wheel of the transformed hair image Wide template;And
Using the hair contour mould, the hair portion of the transformed hair image is added to the face figure As upper, to obtain the face synthetic image.
Exemplarily, make when described program code is run by the processor 1830 electronic equipment 1800 perform by The step that the hair portion of the hair image is added on the facial image includes:
According to the face key point and the hair key point, the transformation matrix for the hair image is obtained;
Line translation is entered to the hair image using the transformation matrix, regarded with obtaining to project to where the facial image Plane, transformed hair image;
Image segmentation is carried out to the transformed hair image, to obtain the hair wheel of the transformed hair image Wide template;And
Using the hair contour mould, the hair portion of the transformed hair image is added to the face figure As upper, to obtain the face synthetic image.
Exemplarily, the conversion is perspective transform.
Exemplarily, the hair portion of the transformed hair image is added on the facial image is to utilize pool Loose fusion method.
The electronic equipment 1800 is set to perform the hair when described program code is run by the processor 1830 The step that the hair portion of image is added on the facial image also includes:By at least part element in the transformation matrix Increase noise, for the conversion.
Exemplarily, the noise Gaussian distributed.
Alternatively, above-mentioned electronic equipment 1800 can be also used for performing human face recognition model instruction according to embodiments of the present invention Practice the corresponding steps of method, and for realizing the training mould in human face recognition model trainer according to embodiments of the present invention Block.
The storage device 1820 can also be stored for realizing human face recognition model training according to embodiments of the present invention The program code of corresponding steps in method.
The processor 1830 is used to run the program code stored in the storage device 1820, to perform according to this hair The corresponding steps of the human face recognition model training method of bright embodiment, and for realizing that face according to embodiments of the present invention is known Face image synthesis device and training module in other model training apparatus.
Specifically, when described program code is run by the processor 1830 perform also the electronic equipment 1800 with Lower step:The training of human face recognition model is carried out using image library, wherein described image storehouse includes the face synthetic image.
In addition, according to embodiments of the present invention, a kind of storage medium is additionally provided, stores program on said storage Instruction, when described program instruction is run by computer or processor for performing the Face image synthesis side of the embodiment of the present invention The corresponding steps of method or human face recognition model training method, and for realizing Face image synthesis according to embodiments of the present invention Corresponding module in device or human face recognition model trainer.The storage medium can for example include the storage of smart phone Card, the memory unit of tablet personal computer, the hard disk of personal computer, read-only storage (ROM), Erasable Programmable Read Only Memory EPROM (EPROM), any combination of portable compact disc read-only storage (CD-ROM), USB storage or above-mentioned storage medium. The computer-readable recording medium can be any combination of one or more computer-readable recording mediums.
In one embodiment, the computer program instructions can be realized when being run by computer according to of the invention real The Face image synthesis device of example or each functional module of human face recognition model trainer are applied, and/or can be performed Face image synthesis method or human face recognition model training method according to embodiments of the present invention.
In one embodiment, the computer program instructions perform following steps when being run by computer:
Obtain the facial image through marking face key point;
The hair image through marking hair key point is obtained, wherein the hair key point and the face key point pair Should;And
The hair portion of the hair image is added to based on the face key point and the hair key point described On facial image, to obtain face synthetic image.
Exemplarily, the face key point includes positive face peak, intersection point, the right eye of left eye angle extended line and face profile The intersection point and chin of angle extended line and face profile.
Exemplarily, computer or place are made when by the computer or processor operation in the computer program instructions Reason device, which performs, includes the step that the hair portion of the hair image is added on the facial image:
According to the face key point and the hair key point, the transformation matrix for the hair image is obtained;
Line translation is entered to the hair image using the transformation matrix, regarded with obtaining to project to where the facial image Plane, transformed hair image;
Image segmentation is carried out to the transformed hair image, to obtain the hair wheel of the transformed hair image Wide template;And
Using the hair contour mould, the hair portion of the transformed hair image is added to the face figure As upper, to obtain the face synthetic image.
Exemplarily, computer or place are made when by the computer or processor operation in the computer program instructions Reason device, which performs, includes the step that the hair portion of the hair image is added on the facial image:
Image segmentation is carried out to the hair image, to obtain hair contour mould;
According to the face key point and the hair key point, obtain for the hair image and the hair profile The transformation matrix of template;
Line translation is entered to the hair image and the hair contour mould using the transformation matrix, to be projected to View plane where the facial image, transformed hair image and view plane, warp where projecting to the facial image The hair contour mould of conversion;And
Facial image place view plane, transformed hair contour mould is projected to using described, by the warp The hair portion of the hair image of conversion is added on the facial image, to obtain the face synthetic image.
Exemplarily, the conversion is perspective transform.
Exemplarily, the hair portion of the transformed hair image is added to the people using graph cut method In face image.
Make computer or computing device when by the computer or processor operation in the computer program instructions The step that the hair portion of the hair image is added on the facial image is also included:By in the transformation matrix extremely Small part element increases noise, for the conversion.
Exemplarily, the noise Gaussian distributed.
In one embodiment, the computer program instructions also perform following steps when being run by computer:Utilize Image library carries out the training of human face recognition model, and wherein described image storehouse includes the face synthetic image.
Each module being used to generate in the electronic equipment of facial image according to embodiments of the present invention can be by according to this The processor computer program instructions that store in memory of operation of inventive embodiments realize, or can be according to this hair When the computer instruction stored in the computer-readable recording medium of the computer program product of bright embodiment is run by computer Realize.
Face image synthesis method and device, electronic equipment and storage medium according to embodiments of the present invention, based on people Face key point and hair key point corresponding with face key point can synthesize facial image and hair image, so as to obtain Largely, the composograph of face true to nature, that there are various hair styles.Many effective points are provided for follow-up face image processing Analyse material.In the case where effectively utilizing these materials, the speed and precision of face image processing can be significantly improved.
Facial image identification model training method according to embodiments of the present invention and device, electronic equipment and storage are situated between Matter, the face synthetic image obtained using above-mentioned Face image synthesis method and apparatus train facial image identification model, can To obtain, accuracy of identification is higher and the faster facial image identification model of recognition speed.
Although describe example embodiment by reference to accompanying drawing here, it should be understood that above-mentioned example embodiment is merely exemplary , and be not intended to limit the scope of the invention to this.Those of ordinary skill in the art can carry out various changes wherein And modification, it is made without departing from the scope of the present invention and spiritual.All such changes and modifications are intended to be included in appended claims Within required the scope of the present invention.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Member and algorithm steps, it can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, application-specific and design constraint depending on technical scheme.Professional and technical personnel Described function can be realized using distinct methods to each specific application, but this realization is it is not considered that exceed The scope of the present invention.
In several embodiments provided herein, it should be understood that disclosed apparatus and method, it can be passed through Its mode is realized.For example, apparatus embodiments described above are only schematical, for example, the division of the unit, only Only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be tied Another equipment is closed or is desirably integrated into, or some features can be ignored, or do not perform.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the present invention and help to understand one or more of each inventive aspect, To the present invention exemplary embodiment description in, each feature of the invention be grouped together into sometimes single embodiment, figure, Or in descriptions thereof.However, the method for the invention should be construed to reflect following intention:It is i.e. claimed Application claims features more more than the feature being expressly recited in each claim.More precisely, as accordingly As claims reflect, its inventive point is to use all features less than some disclosed single embodiment Feature solves corresponding technical problem.Therefore, it then follows thus claims of embodiment are expressly incorporated in the tool Body embodiment, wherein each claim is in itself as separate embodiments of the invention.
It will be understood to those skilled in the art that in addition to mutually exclusive between feature, any combinations pair can be used All features and so disclosed any method disclosed in this specification (including adjoint claim, summary and accompanying drawing) Or all processes or unit of equipment are combined.Unless expressly stated otherwise, this specification (including adjoint right will Ask, make a summary and accompanying drawing) disclosed in each feature can be replaced by the alternative features for providing identical, equivalent or similar purpose.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in detail in the claims, embodiment claimed it is one of any Mode it can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) realize Face image synthesis device and face according to embodiments of the present invention The some or all functions of some modules in identification model trainer.The present invention is also implemented as being used to perform here Some or all program of device (for example, computer program and computer program product) of described method.So Realization the present invention program can store on a computer-readable medium, or can have one or more signal shape Formula.Such signal can be downloaded from internet website and obtained, and either be provided or with any other shape on carrier signal Formula provides.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.
The foregoing is only a specific embodiment of the invention or the explanation to embodiment, protection of the invention Scope is not limited thereto, any one skilled in the art the invention discloses technical scope in, can be easily Expect change or replacement, should all be included within the scope of the present invention.Protection scope of the present invention should be with claim Protection domain is defined.

Claims (18)

1. a kind of Face image synthesis method, including:
Obtain the facial image through marking face key point;
The hair image through marking hair key point is obtained, wherein the hair key point is corresponding with the face key point;With And
The hair portion of the hair image is added to the face based on the face key point and the hair key point On image, to obtain face synthetic image.
2. Face image synthesis method as claimed in claim 1, wherein, the hair portion by the hair image is superimposed Further comprise on to the facial image:
According to the face key point and the hair key point, the transformation matrix for the hair image is obtained;
Line translation is entered to the hair image using the transformation matrix, facial image place view plane is projected to obtain , transformed hair image;
Image segmentation is carried out to the transformed hair image, to obtain the hair profile die of the transformed hair image Plate;And
Using the hair contour mould, the hair portion of the transformed hair image is added to the facial image On, to obtain the face synthetic image.
3. Face image synthesis method as claimed in claim 1, wherein, the hair portion by the hair image is superimposed Further comprise on to the facial image:
Image segmentation is carried out to the hair image, to obtain hair contour mould;
According to the face key point and the hair key point, obtain for the hair image and the hair contour mould Transformation matrix;
Line translation is entered to the hair image and the hair contour mould using the transformation matrix, projected to acquisition described It is view plane where facial image, transformed hair image and view plane where projecting to the facial image, transformed Hair contour mould;And
Facial image place view plane, transformed hair contour mould is projected to using described, will be described transformed The hair portion of hair image be added on the facial image, to obtain the face synthetic image.
4. Face image synthesis method as claimed in claim 2 or claim 3, wherein, it is described to incite somebody to action after the acquisition transformation matrix The hair portion of the hair image, which is added on the facial image, to be further comprised:
At least part element in the transformation matrix is increased into noise, for the conversion.
5. Face image synthesis method as claimed in claim 4, wherein, the noise Gaussian distributed.
6. Face image synthesis method as claimed in claim 2 or claim 3, wherein, the conversion is perspective transform.
7. Face image synthesis method as claimed in claim 2 or claim 3, wherein, it is described by the transformed hair image Hair portion, which is added on the facial image, to be further comprised:
The hair portion of the transformed hair image is added on the facial image using graph cut method.
8. Face image synthesis method as claimed in claim 1, wherein, the face key point includes:Positive face peak, a left side Canthus extended line and the intersection point of face profile, the intersection point and chin of right eye angle extended line and face profile.
9. a kind of human face recognition model training method, including:
Face synthetic image is generated using the Face image synthesis method as described in any one of claim 1 to 8;And
The training of human face recognition model is carried out using image library, wherein described image storehouse includes the face synthetic image.
10. a kind of Face image synthesis device, including:
First acquisition module, for obtaining the facial image through marking face key point;
Second acquisition module, for obtain through mark hair key point hair image, wherein the hair key point with it is described Face key point is corresponding;And
Synthesis module, for being folded the hair portion of the hair image based on the face key point and the hair key point It is added on the facial image, to obtain face synthetic image.
11. Face image synthesis device as claimed in claim 10, wherein, the synthesis module further comprises:
Matrix generation unit, for according to the face key point and the hair key point, obtaining for the hair image Transformation matrix;
First converter unit, for entering line translation to the hair image using the transformation matrix, projected to acquisition described View plane where facial image, transformed hair image;
First cutting unit, for carrying out image segmentation to the transformed hair image, to obtain the transformed head Send out the hair contour mould of image;And
Synthesis unit, for utilizing the hair contour mould, the hair portion of the transformed hair image is added to On the facial image, to obtain the face synthetic image.
12. Face image synthesis device as claimed in claim 10, wherein, the synthesis module further comprises:
Second cutting unit, for carrying out image segmentation to the hair image, to obtain hair contour mould;
Matrix generation unit, for according to the face key point and the hair key point, obtaining for the hair image With the transformation matrix of the hair contour mould;
Second converter unit, for being become using the transformation matrix to the hair image and the hair contour mould Change, facial image place view plane, transformed hair image is projected to acquisition and projects to the facial image Place view plane, transformed hair contour mould;And
Synthesis unit, hair contour mould for projecting to facial image place view plane described in utilization, transformed, The hair portion of the transformed hair image is added on the facial image, to obtain the face synthetic image.
13. the Face image synthesis device as described in claim 11 or 12, wherein, the synthesis module further comprises:
Add unit of making an uproar, at least part element in the transformation matrix to be increased into noise, for the conversion.
14. Face image synthesis device as claimed in claim 13, wherein, the noise Gaussian distributed.
15. the Face image synthesis device as described in claim 11 or 12, wherein, the conversion is perspective transform.
16. the Face image synthesis device as described in claim 11 or 12, wherein, the synthesis unit further comprises:
Graph cut subelement, for the hair portion of the transformed hair image to be added to using graph cut method On the facial image.
17. Face image synthesis device as claimed in claim 10, wherein, the face key point includes:Positive face peak, Left eye angle extended line and the intersection point of face profile, the intersection point and chin of right eye angle extended line and face profile.
18. a kind of human face recognition model trainer, including:
Face image synthesis device as described in any one of claim 10 to 17;And
Training module, for carrying out the training of human face recognition model using image library, wherein described image storehouse includes the face The face synthetic image that video generation device is generated.
CN201610370020.7A 2016-05-30 2016-05-30 Face image synthesis method, human face recognition model training method and related device Pending CN107451950A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610370020.7A CN107451950A (en) 2016-05-30 2016-05-30 Face image synthesis method, human face recognition model training method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610370020.7A CN107451950A (en) 2016-05-30 2016-05-30 Face image synthesis method, human face recognition model training method and related device

Publications (1)

Publication Number Publication Date
CN107451950A true CN107451950A (en) 2017-12-08

Family

ID=60485648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610370020.7A Pending CN107451950A (en) 2016-05-30 2016-05-30 Face image synthesis method, human face recognition model training method and related device

Country Status (1)

Country Link
CN (1) CN107451950A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108492343A (en) * 2018-03-28 2018-09-04 东北大学 A kind of image combining method for the training data expanding target identification
CN108898650A (en) * 2018-06-15 2018-11-27 Oppo广东移动通信有限公司 Humanoid material creation method and relevant apparatus
CN109117760A (en) * 2018-07-27 2019-01-01 北京旷视科技有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN109886144A (en) * 2019-01-29 2019-06-14 深圳市云之梦科技有限公司 Virtual examination forwarding method, device, computer equipment and storage medium
CN109978805A (en) * 2019-03-18 2019-07-05 Oppo广东移动通信有限公司 It takes pictures processing method, device, mobile terminal and storage medium
CN110084775A (en) * 2019-05-09 2019-08-02 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110738595A (en) * 2019-09-30 2020-01-31 腾讯科技(深圳)有限公司 Picture processing method, device and equipment and computer storage medium
CN111652828A (en) * 2020-05-27 2020-09-11 北京百度网讯科技有限公司 Face image generation method, device, equipment and medium
CN111833240A (en) * 2020-06-03 2020-10-27 北京百度网讯科技有限公司 Face image conversion method and device, electronic equipment and storage medium
CN111898513A (en) * 2020-07-24 2020-11-06 星业(海南)科技有限公司 Method and system for processing hairstyle of face image
CN112102149A (en) * 2019-06-18 2020-12-18 北京陌陌信息技术有限公司 Figure hair style replacing method, device, equipment and medium based on neural network
CN112102148A (en) * 2019-06-18 2020-12-18 北京陌陌信息技术有限公司 Figure hair style replacing method, device, equipment and medium based on neural network
CN112116548A (en) * 2020-09-28 2020-12-22 北京百度网讯科技有限公司 Method and device for synthesizing face image
CN112163552A (en) * 2020-10-14 2021-01-01 北京达佳互联信息技术有限公司 Labeling method and device for key points of nose, electronic equipment and storage medium
CN112489169A (en) * 2020-12-17 2021-03-12 脸萌有限公司 Portrait image processing method and device
CN112766215A (en) * 2021-01-29 2021-05-07 北京字跳网络技术有限公司 Face fusion method and device, electronic equipment and storage medium
WO2022257456A1 (en) * 2021-06-10 2022-12-15 平安科技(深圳)有限公司 Hair information recognition method, apparatus and device, and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102074001A (en) * 2010-11-25 2011-05-25 上海合合信息科技发展有限公司 Method and system for stitching text images
CN102214361A (en) * 2010-04-09 2011-10-12 索尼公司 Information processing device, method, and program
CN103065360A (en) * 2013-01-16 2013-04-24 重庆绿色智能技术研究院 Generation method and generation system of hair style effect pictures
US20130170766A1 (en) * 2011-12-28 2013-07-04 HeHuan Xu Method of performing eyebrow shaping on an image and related computing device
CN103366400A (en) * 2013-07-24 2013-10-23 深圳市华创振新科技发展有限公司 Method for automatically generating three-dimensional head portrait
CN103679767A (en) * 2012-08-30 2014-03-26 卡西欧计算机株式会社 Image generation apparatus and image generation method
CN104157001A (en) * 2014-08-08 2014-11-19 中科创达软件股份有限公司 Method and device for drawing head caricature
CN104899825A (en) * 2014-03-06 2015-09-09 腾讯科技(深圳)有限公司 Method and device for modeling picture figure
CN105184253A (en) * 2015-09-01 2015-12-23 北京旷视科技有限公司 Face identification method and face identification system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102214361A (en) * 2010-04-09 2011-10-12 索尼公司 Information processing device, method, and program
CN102074001A (en) * 2010-11-25 2011-05-25 上海合合信息科技发展有限公司 Method and system for stitching text images
US20130170766A1 (en) * 2011-12-28 2013-07-04 HeHuan Xu Method of performing eyebrow shaping on an image and related computing device
CN103679767A (en) * 2012-08-30 2014-03-26 卡西欧计算机株式会社 Image generation apparatus and image generation method
CN103065360A (en) * 2013-01-16 2013-04-24 重庆绿色智能技术研究院 Generation method and generation system of hair style effect pictures
CN103366400A (en) * 2013-07-24 2013-10-23 深圳市华创振新科技发展有限公司 Method for automatically generating three-dimensional head portrait
CN104899825A (en) * 2014-03-06 2015-09-09 腾讯科技(深圳)有限公司 Method and device for modeling picture figure
CN104157001A (en) * 2014-08-08 2014-11-19 中科创达软件股份有限公司 Method and device for drawing head caricature
CN105184253A (en) * 2015-09-01 2015-12-23 北京旷视科技有限公司 Face identification method and face identification system

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108492343B (en) * 2018-03-28 2021-09-21 东北大学 Image synthesis method for training data for expanding target recognition
CN108492343A (en) * 2018-03-28 2018-09-04 东北大学 A kind of image combining method for the training data expanding target identification
CN108898650A (en) * 2018-06-15 2018-11-27 Oppo广东移动通信有限公司 Humanoid material creation method and relevant apparatus
CN108898650B (en) * 2018-06-15 2022-11-15 Oppo广东移动通信有限公司 Human-shaped material creating method and related device
CN109117760A (en) * 2018-07-27 2019-01-01 北京旷视科技有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN109117760B (en) * 2018-07-27 2021-01-22 北京旷视科技有限公司 Image processing method, image processing device, electronic equipment and computer readable medium
CN109886144A (en) * 2019-01-29 2019-06-14 深圳市云之梦科技有限公司 Virtual examination forwarding method, device, computer equipment and storage medium
CN109886144B (en) * 2019-01-29 2021-08-13 深圳市云之梦科技有限公司 Virtual trial sending method and device, computer equipment and storage medium
CN109978805A (en) * 2019-03-18 2019-07-05 Oppo广东移动通信有限公司 It takes pictures processing method, device, mobile terminal and storage medium
CN110084775A (en) * 2019-05-09 2019-08-02 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN110084775B (en) * 2019-05-09 2021-11-26 深圳市商汤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN112102149A (en) * 2019-06-18 2020-12-18 北京陌陌信息技术有限公司 Figure hair style replacing method, device, equipment and medium based on neural network
CN112102148A (en) * 2019-06-18 2020-12-18 北京陌陌信息技术有限公司 Figure hair style replacing method, device, equipment and medium based on neural network
CN110738595A (en) * 2019-09-30 2020-01-31 腾讯科技(深圳)有限公司 Picture processing method, device and equipment and computer storage medium
CN111652828A (en) * 2020-05-27 2020-09-11 北京百度网讯科技有限公司 Face image generation method, device, equipment and medium
CN111652828B (en) * 2020-05-27 2023-08-08 北京百度网讯科技有限公司 Face image generation method, device, equipment and medium
CN111833240A (en) * 2020-06-03 2020-10-27 北京百度网讯科技有限公司 Face image conversion method and device, electronic equipment and storage medium
CN111833240B (en) * 2020-06-03 2023-07-25 北京百度网讯科技有限公司 Face image conversion method and device, electronic equipment and storage medium
CN111898513A (en) * 2020-07-24 2020-11-06 星业(海南)科技有限公司 Method and system for processing hairstyle of face image
CN112116548A (en) * 2020-09-28 2020-12-22 北京百度网讯科技有限公司 Method and device for synthesizing face image
CN112163552A (en) * 2020-10-14 2021-01-01 北京达佳互联信息技术有限公司 Labeling method and device for key points of nose, electronic equipment and storage medium
CN112489169A (en) * 2020-12-17 2021-03-12 脸萌有限公司 Portrait image processing method and device
CN112489169B (en) * 2020-12-17 2024-02-13 脸萌有限公司 Portrait image processing method and device
CN112766215A (en) * 2021-01-29 2021-05-07 北京字跳网络技术有限公司 Face fusion method and device, electronic equipment and storage medium
WO2022257456A1 (en) * 2021-06-10 2022-12-15 平安科技(深圳)有限公司 Hair information recognition method, apparatus and device, and storage medium

Similar Documents

Publication Publication Date Title
CN107451950A (en) Face image synthesis method, human face recognition model training method and related device
Kotovenko et al. A content transformation block for image style transfer
CN108550176A (en) Image processing method, equipment and storage medium
Liu et al. SwapGAN: A multistage generative approach for person-to-person fashion style transfer
CN104376594B (en) Three-dimensional face modeling method and device
CN103824253B (en) Figure five sense organ deformation method based on image local precise deformation
AU2018201319B2 (en) Flow-based ornamental element packing
CN109859305A (en) Three-dimensional face modeling, recognition methods and device based on multi-angle two-dimension human face
Li et al. Learning to reconstruct botanical trees from single images
CN106777185A (en) A kind of across media Chinese herbal medicine image search methods based on deep learning
CN103279936A (en) Human face fake photo automatic combining and modifying method based on portrayal
Zhang et al. Detail-preserving cyclegan-adain framework for image-to-ink painting translation
US10559061B2 (en) Computerized generation of ornamental designs by placing instances of simple shapes in accordance with a direction guide
CN109978077A (en) Visual identity methods, devices and systems and storage medium
CN105096249B (en) Image processing method and device
CN107066979A (en) A kind of human motion recognition method based on depth information and various dimensions convolutional neural networks
KR20230085931A (en) Method and system for extracting color from face images
CN112221145A (en) Game face model generation method and device, storage medium and electronic equipment
Yang et al. Multiscale mesh deformation component analysis with attention-based autoencoders
Kim et al. Style your hair: Latent optimization for pose-invariant hairstyle transfer via local-style-aware hair alignment
CN109615671A (en) A kind of character library sample automatic generation method, computer installation and readable storage medium storing program for executing
Li et al. High-quality face sketch synthesis via geometric normalization and regularization
Kim et al. Animeceleb: Large-scale animation celebheads dataset for head reenactment
Gal et al. Breathing life into sketches using text-to-video priors
Wei et al. Segmentation and synthesis of embroidery art images based on deep learning convolutional neural networks

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20171208

RJ01 Rejection of invention patent application after publication