CN109241889A - A kind of facial image replacement method and device - Google Patents
A kind of facial image replacement method and device Download PDFInfo
- Publication number
- CN109241889A CN109241889A CN201810975216.8A CN201810975216A CN109241889A CN 109241889 A CN109241889 A CN 109241889A CN 201810975216 A CN201810975216 A CN 201810975216A CN 109241889 A CN109241889 A CN 109241889A
- Authority
- CN
- China
- Prior art keywords
- image
- target
- face
- scene
- facial image
- 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.)
- Withdrawn
Links
- 230000001815 facial effect Effects 0.000 title claims abstract description 78
- 238000000034 method Methods 0.000 title claims abstract description 20
- 238000012549 training Methods 0.000 claims abstract description 28
- 210000005036 nerve Anatomy 0.000 claims abstract description 25
- 238000012545 processing Methods 0.000 claims abstract description 16
- 238000013528 artificial neural network Methods 0.000 claims abstract description 9
- 238000000605 extraction Methods 0.000 claims description 4
- 238000010586 diagram Methods 0.000 claims description 3
- 238000013135 deep learning Methods 0.000 abstract description 3
- 239000000463 material Substances 0.000 abstract description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 210000004218 nerve net Anatomy 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/161—Detection; Localisation; Normalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Molecular Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a kind of facial image replacement method and devices, wherein the facial image replacement method includes: to obtain target face image set;The target facial image concentrated to target facial image carries out distortion processing, obtains target face warp image collection;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;The image that target face image set and target face warp image are concentrated is input in neural network and is trained, the target nerve network for having the ability that the face image in any scene image is replaced with to target facial image is obtained;It will be input to the target nerve network to Training scene image, target facial image will be replaced with to the face image in Training scene image, obtain target scene image.Method by deep learning will replace with target facial image to the face image in Training scene image, not need not only artificially to complete, but also treatment effeciency improves, and reduces drain on manpower and material resources.
Description
Technical field
The present invention relates to field of image processing, in particular to a kind of facial image replacement method and device.
Background technique
Since personal portrait is one of the chief component of real pictures and image type that people are most interested in,
Portrait editor has important research and application value.
But in the prior art, it usually needs editor and the amendment of personal portrait are completed using figure software is repaired, it is bothersome to take
Power, efficiency are lower.
Summary of the invention
Modification can be automatically performed the technical problem to be solved in the present invention is to provide one kind or is edited personal portrait (face)
Method.
In order to solve the above-mentioned technical problem, technical solution of the present invention includes:
A kind of facial image replacement method, specifically includes: obtaining target face image set;Wherein, the target face figure
It include multiframe target facial image in image set;
The target facial image concentrated to target facial image carries out distortion processing, obtains target face warp image collection;
Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;
The image that target face image set and target face warp image are concentrated is input in neural network and is trained,
Obtain the target nerve network for having the ability that the face image in any scene image is replaced with to target facial image;
The target nerve network will be input to Training scene image, it will be to the face image in Training scene image
Target facial image is replaced with, target scene image is obtained.
On the basis of the above embodiments, the acquisition target face image set, comprising:
Multiframe target scene figure is extracted from target video;
For any multiframe target scene figure, the human face region in target scene figure is identified, cut target scene figure
In human face region part, obtain target face image set.
On the basis of the above embodiments, the target nerve network includes at least 4 convolutional layers and at least one pond
Layer.
Based on identical thinking, the present embodiment additionally provides a kind of facial image alternative, specifically includes:
Module is obtained, for obtaining target face image set;Wherein, it includes multiframe target that the target facial image, which is concentrated,
Facial image;
Processing module, the target facial image for concentrating to target facial image carry out distortion processing, obtain target person
Face warp image collection;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;
Training module, for the image of target face image set and target face warp image concentration to be input to nerve net
It is trained in network, obtains the target for having the ability that the face image in any scene image is replaced with to target facial image
Neural network;
Replacement module will be to Training scene figure for that will be input to the target nerve network to Training scene image
Face image as in replaces with target facial image, obtains target scene image.
On the basis of the above embodiments, extraction unit, for extracting multiframe target scene figure from target video;
Cutter unit, for identifying the human face region in target scene figure, cutting for any multiframe target scene figure
The human face region part in target scene figure is cut, target face image set is obtained.
On the basis of the above embodiments, the target nerve network includes at least 4 convolutional layers and at least one pond
Layer.
By adopting the above technical scheme, by obtaining target face image set;The target face that target facial image is concentrated
Image carries out distortion processing, obtains target face warp image collection;By target face image set and target face warp image collection
In image be input in neural network and be trained, obtain having the face image in any scene image replaced with into target
The target nerve network of the ability of facial image;The target nerve network will be input to Training scene image, it will be wait instruct
The face image practiced in scene image replaces with target facial image, obtains target scene image.Pass through the method for deep learning
Target facial image will be replaced with to the face image in Training scene image, do not need not only artificially to complete, but also handles effect
Rate improves, and reduces drain on manpower and material resources.
Detailed description of the invention
Fig. 1 is a kind of flow chart for facial image replacement method that the embodiment of the present invention one provides;
Fig. 2 is a kind of facial image alternative structural schematic diagram that the embodiment of the present invention three provides.
Specific embodiment
Specific embodiments of the present invention will be further explained with reference to the accompanying drawing.It should be noted that for
The explanation of these embodiments is used to help understand the present invention, but and does not constitute a limitation of the invention.In addition, disclosed below
The each embodiment of the present invention involved in technical characteristic can be combined with each other as long as they do not conflict with each other.
Embodiment one
Fig. 1 is a kind of flow chart for facial image replacement method that the embodiment of the present invention one provides, and this method can be by one
Facial image alternative is planted to execute, which can realize by way of software and/or hardware, and being integrated in is intelligence
In equipment.
The method that the present embodiment passes through specifically comprises the following steps:
S110, target face image set is obtained;Wherein, it includes multiframe target face figure that the target facial image, which is concentrated,
Picture.
Wherein, it includes multiframe target facial image that the target facial image, which is concentrated, and is in multiframe target facial image
The facial image of same personage.
Specifically, the multiframe target facial image that target facial image is concentrated can be and be clapped from different perspectives target face
It takes the photograph to obtain, can be and taken in different light, scene, be also possible to intercept out by human face region from original image
Part.
S120, the target facial image concentrated to target facial image carry out distortion processing, obtain target face distortion figure
Image set;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,.
Wherein, distortion processing is one kind of planar graph variation, is used to target facial image carrying out image transformation,
Obtain more training samples.
In the present embodiment, warping process can pass through space coordinate transformation, the assignment of coordinate transforming and interpolation arithmetic
And etc. completion.
S130, it the image that target face image set and target face warp image are concentrated is input in neural network carries out
Training, obtains the target nerve net for having the ability that the face image in any scene image is replaced with to target facial image
Network.
Wherein, the target nerve network includes at least 4 cov layer and at least one upscale layers, during wherein conv is
The convolution of square adds relu activation primitive in rule, has a function PixelShuffler, PixelShuffler function in upscale
The size of filter can be reduced to original 25%, height and width is allowed respectively to become original 2 times.
S140, the target nerve network will be input to Training scene image, it will be to the face in Training scene image
Portion's image replaces with target facial image, obtains target scene image.
By adopting the above technical scheme, by obtaining target face image set;The target face that target facial image is concentrated
Image carries out distortion processing, obtains target face warp image collection;By target face image set and target face warp image collection
In image be input in neural network and be trained, obtain having the face image in any scene image replaced with into target
The target nerve network of the ability of facial image;The target nerve network will be input to Training scene image, it will be wait instruct
The face image practiced in scene image replaces with target facial image, obtains target scene image.Pass through the method for deep learning
Target facial image will be replaced with to the face image in Training scene image, do not need not only artificially to complete, but also handles effect
Rate improves, and reduces drain on manpower and material resources.
Embodiment two
On the basis of example 1, face image set described in the present embodiment can be extracted from same video and be obtained
, specifically, the facial image replacement method includes:
S210, multiframe target scene figure is extracted from target video.
Wherein, target scene figure can be any one frame image in target video, may include picture in target scene figure
Background, target person configuration.In the present embodiment, it can be provided by softwares such as FFmpeg, Google image
Picture extracts extraction of the interface completion to multiframe target scene figure.
S220, it is directed to any multiframe target scene figure, identifies the human face region in target scene figure, cut target field
Human face region part in scape figure, obtains target face image set.
Wherein, target facial image is the image that the human face region from target scene figure is cut down.In the present embodiment
It can identify the human face region in target scene figure, by edge detection algorithm to cut the target person from human face region
Face image ultimately forms face image set.
Corresponding, the quantity of the target facial image is identical as the quantity of target scene figure.
In order to guarantee to train the performance of obtained target nerve network, the picture clarity of the target scene figure can be use up
Possible raising.
S230, the target facial image concentrated to target facial image carry out distortion processing, obtain target face distortion figure
Image set;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;
S240, it the image that target face image set and target face warp image are concentrated is input in neural network carries out
Training, obtains the target nerve net for having the ability that the face image in any scene image is replaced with to target facial image
Network;
S250, the target nerve network will be input to Training scene image, it will be to the face in Training scene image
Portion's image replaces with target facial image, obtains target scene image.
Wherein, the target nerve network includes at least 4 convolutional layers and at least one pond layer.
Embodiment three
Fig. 2 is a kind of structural schematic diagram for facial image alternative that the embodiment of the present invention three provides, and specifically includes: obtaining
Modulus block 310, processing module 320, training module 330 and replacement module 340.
Module 310 is obtained, for obtaining target face image set;Wherein, it includes multiframe that the target facial image, which is concentrated,
Target facial image;
Processing module 320, the target facial image for concentrating to target facial image carry out distortion processing, obtain target
Face warp image collection;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;
Training module 330, for the image of target face image set and target face warp image concentration to be input to mind
It is trained in network, obtains having the ability that the face image in any scene image is replaced with to target facial image
Target nerve network;
Replacement module 340 will be to Training scene for that will be input to the target nerve network to Training scene image
Face image in image replaces with target facial image, obtains target scene image.
On the basis of the above embodiments, the acquisition module includes:
Extraction unit, for extracting multiframe target scene figure from target video;
Cutter unit, for identifying the human face region in target scene figure, cutting for any multiframe target scene figure
The human face region part in target scene figure is cut, target face image set is obtained.
On the basis of the above embodiments, the target nerve network includes at least 4 convolutional layers and at least one pond
Layer.
In conjunction with attached drawing, the embodiments of the present invention are described in detail above, but the present invention is not limited to described implementations
Mode.For a person skilled in the art, in the case where not departing from the principle of the invention and spirit, to these embodiments
A variety of change, modification, replacement and modification are carried out, are still fallen in protection scope of the present invention.
Claims (6)
1. a kind of facial image replacement method, it is characterised in that:
Obtain target face image set;Wherein, it includes multiframe target facial image that the target facial image, which is concentrated,;
The target facial image concentrated to target facial image carries out distortion processing, obtains target face warp image collection;Wherein,
It includes multiframe target face warp image that target face warp image, which is concentrated,;
The image that target face image set and target face warp image are concentrated is input in neural network and is trained, is obtained
The target nerve network for having the ability that the face image in any scene image is replaced with to target facial image;
It will be input to the target nerve network to Training scene image, will be replaced to the face image in Training scene image
For target facial image, target scene image is obtained.
2. facial image replacement method according to claim 1, which is characterized in that the acquisition target face image set,
Include:
Multiframe target scene figure is extracted from target video;
For any multiframe target scene figure, the human face region in target scene figure is identified, cut in target scene figure
Human face region part obtains target face image set.
3. facial image replacement method according to claim 2, it is characterised in that:
The target nerve network includes at least 4 convolutional layers and at least one pond layer.
4. a kind of facial image alternative, it is characterised in that:
Module is obtained, for obtaining target face image set;Wherein, it includes multiframe target face that the target facial image, which is concentrated,
Image;
Processing module, the target facial image for concentrating to target facial image carry out distortion processing, obtain the torsion of target face
Diagram image set;Wherein, it includes multiframe target face warp image that target face warp image, which is concentrated,;
Training module, for the image of target face image set and target face warp image concentration to be input in neural network
It is trained, obtains the target nerve for having the ability that the face image in any scene image is replaced with to target facial image
Network;
Replacement module will be in Training scene image for that will be input to the target nerve network to Training scene image
Face image replace with target facial image, obtain target scene image.
5. facial image alternative according to claim 4, which is characterized in that the acquisition module includes:
Extraction unit, for extracting multiframe target scene figure from target video;
Cutter unit cuts mesh for identifying the human face region in target scene figure for any multiframe target scene figure
The human face region part in scene figure is marked, target face image set is obtained.
6. facial image alternative according to claim 4, it is characterised in that:
The target nerve network includes at least 4 convolutional layers and at least one pond layer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810975216.8A CN109241889A (en) | 2018-08-24 | 2018-08-24 | A kind of facial image replacement method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810975216.8A CN109241889A (en) | 2018-08-24 | 2018-08-24 | A kind of facial image replacement method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109241889A true CN109241889A (en) | 2019-01-18 |
Family
ID=65068277
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810975216.8A Withdrawn CN109241889A (en) | 2018-08-24 | 2018-08-24 | A kind of facial image replacement method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109241889A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109754364A (en) * | 2019-01-20 | 2019-05-14 | 杭州富阳优信科技有限公司 | A kind of video character face's replacement method based on deep learning |
-
2018
- 2018-08-24 CN CN201810975216.8A patent/CN109241889A/en not_active Withdrawn
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109754364A (en) * | 2019-01-20 | 2019-05-14 | 杭州富阳优信科技有限公司 | A kind of video character face's replacement method based on deep learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110889855B (en) | Certificate photo matting method and system based on end-to-end convolution neural network | |
CN105096280B (en) | Handle the method and device of picture noise | |
CN104104886B (en) | Overexposure image pickup method and device | |
CN106846339A (en) | Image detection method and device | |
CN105247567B (en) | A kind of image focusing device, method, system and non-transient program storage device again | |
CN106910170B (en) | A kind of minimizing technology of image salt-pepper noise | |
CN103325089A (en) | Method and device for processing skin color in image | |
CN110136144A (en) | A kind of image partition method, device and terminal device | |
CN109410144A (en) | A kind of end-to-end image defogging processing method based on deep learning | |
CN106339476B (en) | A kind of image processing method and system | |
CN107403452A (en) | Object identification method and its device based on FIG pull handle | |
CN110163265A (en) | Data processing method, device and computer equipment | |
CN105931211A (en) | Face image beautification method | |
CN109241889A (en) | A kind of facial image replacement method and device | |
Wang et al. | AAGAN: enhanced single image dehazing with attention-to-attention generative adversarial network | |
CN112839167A (en) | Image processing method, image processing device, electronic equipment and computer readable medium | |
CN110175959B (en) | Typhoon cloud picture enhancement method | |
Albuquerque et al. | Image fusion combining frequency domain techniques based on focus | |
CN104869283A (en) | Shooting method and electronic equipment | |
CN109886963A (en) | A kind of image processing method and system | |
CN110047057A (en) | A kind of image processing method, terminal and storage device | |
CN108304916B (en) | Convolutional neural network optimization method combining attention mechanism and depth separable convolution | |
US11645739B2 (en) | Image processing method and image processing system | |
JPS60171573A (en) | Picture emphasis system in picture processing system | |
Li et al. | A fast image dehazing algorithm for highway tunnel based on artificial multi-exposure image fusion |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20190118 |