CN109949407A - A kind of head portrait generation method, device and electronic equipment - Google Patents
A kind of head portrait generation method, device and electronic equipment Download PDFInfo
- Publication number
- CN109949407A CN109949407A CN201910166944.9A CN201910166944A CN109949407A CN 109949407 A CN109949407 A CN 109949407A CN 201910166944 A CN201910166944 A CN 201910166944A CN 109949407 A CN109949407 A CN 109949407A
- Authority
- CN
- China
- Prior art keywords
- portrait
- head portrait
- user
- preset
- active user
- 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.)
- Granted
Links
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The embodiment of the invention provides a kind of head portrait generation method, device and electronic equipments, this method comprises: whether detection Video chat starts;When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;Selection meets active user's portrait of default head portrait selection standard from user's portrait of capture;By preset head portrait pattern, image procossing is carried out to active user's portrait, generates user's head portrait.Since the embodiment of the present invention is during user video is chatted, head portrait can be generated for user automatically according to preset head portrait selection standard and head portrait pattern, it is achieved that personalized head portrait is generated for user in easier mode.
Description
Technical field
The present invention relates to technical field of video processing, more particularly to a kind of head portrait generation method, device and electronic equipment.
Background technique
With the development of internet and universal, user is using various application program App daily.Usual feelings
Under condition, when being registered as the user of a certain App, need to be arranged the letter such as oneself the pet name, head portrait, email address, hobby
Breath.By taking instant messaging App as an example, new user needs to fill in the essential information of oneself and upload represents oneself virtually in registration
User's head portrait of image.User's head portrait can not only play the role of identity user, can also show that user is online or offline
State.
User needs the picture in Album for glancing over pictures one by one when head portrait is arranged, and is found according to the hobby of itself and is suitble to do head
The picture of picture.But if the picture number stored in photograph album is huge, user will take a substantial amount of time and look into
The picture looked for, and found may cannot be arranged to head portrait since oversized or format is undesirable;And if
User is because complicated operating process is not desired to setting head portrait, then machine-made default head portrait can also not only without diversity
Reduce the enjoyment that user uses APP.
Therefore, cumbersome process affects the usage experience of user when head portrait is arranged.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of head portrait generation method, device and electronic equipment, with easier
Personalized head portrait is generated for user in mode.Specific technical solution is as follows:
In a first aspect, being applied to client, the method packet the embodiment of the invention provides a kind of head portrait generation method
It includes:
Whether detection Video chat starts;
When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user Xiao
Picture;
Selection meets active user's portrait of default head portrait selection standard from user's portrait of capture;
By preset head portrait pattern, image procossing is carried out to active user's portrait, generates user's head portrait.
Optionally, the default head portrait selection standard, comprising: illumination standard, angular standard, head portrait account for screen than standard or head
At least one of image position standard.
Optionally, the preset head portrait pattern, comprising: style, dimension, size and the resolution of user's head portrait of generation
Rate;
It is described to press preset head portrait pattern, the step of carrying out image procossing to active user's portrait, generate user's head portrait, packet
It includes:
According to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, image is carried out to active user's portrait
Pretreatment obtains the initial head portrait with dimension corresponding with preset head portrait pattern, size and resolution ratio;
According to the preset corresponding image processing algorithm of style for generating head portrait, initial head portrait is converted into the style
User's head portrait.
Optionally, described to carry out image preprocessing to active user's portrait, obtaining has and preset head portrait pattern
The step of initial head portrait of corresponding dimension, size and resolution ratio, comprising:
If the corresponding dimension of head portrait pattern is two dimension, active user's portrait is carried out by the size and resolution ratio
Normalized obtains the two dimensional image of active user's portrait as initial head portrait;
If the corresponding dimension of head portrait pattern is three-dimensional, active user's portrait is carried out by the size and resolution ratio
Normalized obtains the two dimensional image of active user's portrait;
3D model is established using the two dimensional image of default three-dimensional face modeling algorithm and active user's portrait, and with building
Vertical 3D model generates three-dimensional face images as initial head portrait.
Optionally, the two dimensional image using default three-dimensional face modeling algorithm and active user's portrait establishes 3D
Model, and with establish 3D model, generate three-dimensional face images as initial head portrait the step of, comprising:
If the quantity of active user's portrait is 1, free hand drawing piece face modeling algorithm is used, according to the active user
Portrait establishes 3D model;
If the quantity of active user's portrait be it is multiple, use more picture face modeling algorithms, according to the multiple
Active user's portrait establishes 3D model.
Optionally, described according to the preset corresponding image processing algorithm of style for generating head portrait, initial head portrait is converted
For it is described generate head portrait style head portrait the step of, comprising:
Obtain the corresponding Style Transfer model trained in advance of the preset style for generating head portrait;
The initial head portrait is inputted into the Style Transfer model, obtains user's head portrait of the style.
Optionally, the preset head portrait pattern is determined in user registration course.
Optionally, after generation user's head portrait the step of, further includes:
Judge whether Video chat terminates;If it is not, then returning to the figure for being spaced shoot from camera at preset timed intervals
The step of user's portrait is captured as in;
If it is, saving user's head portrait.
Optionally, the step of preservation user's head portrait, comprising:
Using user's head portrait as candidate head portrait, output is saved in registration information after user determines to user.
Second aspect, the embodiment of the invention provides a kind of head portrait generating means, are applied to client, described device packet
It includes:
A kind of head portrait generating means, which is characterized in that be applied to client, described device includes:
Detection unit, for detecting whether Video chat starts;
Portrait capturing unit, for when detecting that Video chat starts, being spaced at preset timed intervals from camera shooting
User's portrait is captured in image;
Portrait selecting unit, the active user for selecting to meet default head portrait selection standard from user's portrait of capture
Portrait;
Head portrait generation unit carries out image procossing to active user's portrait, generates user for pressing preset head portrait pattern
Head portrait.
Optionally, the preset head portrait pattern, comprising: style, dimension, size and the resolution of user's head portrait of generation
Rate;
The head portrait generation unit, comprising:
Preprocessing module is used for according to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, to described current
User's portrait carries out image preprocessing, obtains the initial head with dimension corresponding with preset head portrait pattern, size and resolution ratio
Picture;
Style conversion module, for the corresponding image processing algorithm of style according to preset generation head portrait, by initial head
User's head portrait as being converted to the style.
Optionally, the preprocessing module, comprising:
First initial head portrait obtains submodule, if being two dimension for the corresponding dimension of head portrait pattern, by the size with
Active user's portrait is normalized in resolution ratio, obtains the two dimensional image of active user's portrait as initial head
Picture;
Second initial head portrait obtains submodule, if being three-dimensional for the corresponding dimension of head portrait pattern, by the size with
Active user's portrait is normalized in resolution ratio, obtains the two dimensional image of active user's portrait;And using default
The two dimensional image of three-dimensional face modeling algorithm and active user's portrait establishes 3D model, and with the 3D model established, generates
Three-dimensional face images are as initial head portrait.
Optionally, the second initial head portrait obtains submodule, is specifically used for:
If the quantity of active user's portrait is 1, free hand drawing piece face modeling algorithm is used, according to the active user
Portrait establishes 3D model;
If the quantity of active user's portrait be it is multiple, use more picture face modeling algorithms, according to the multiple
Active user's portrait establishes 3D model.
Optionally, the style conversion module, comprising:
Model obtains submodule, moves for obtaining the corresponding style trained in advance of the preset style for generating head portrait
Shifting formwork type;
User's head portrait obtains submodule, for the initial head portrait to be inputted the Style Transfer model, obtains the wind
User's head portrait of lattice.
Optionally, the head portrait generation unit, comprising:
Judgment module, for judging whether Video chat terminates;If it is not, then triggering the portrait capturing unit executes institute
It states and is spaced the step of capturing user's portrait from the image that camera is shot at preset timed intervals;
Preserving module, for if so, saving user's head portrait.
Optionally, the preserving module, comprising:
Output sub-module, for using user's head portrait as candidate head portrait, output to be to user, after user determines, saves
Into registration information.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and
Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of first aspect.
A kind of head portrait generation method, device and electronic equipment provided in an embodiment of the present invention are by detecting Video chat
No beginning;When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;
Selection meets active user's portrait that default head portrait generates standard from user's portrait of capture;It is right by preset head portrait pattern
Active user's portrait carries out image procossing, generates user's head portrait.Since the embodiment of the present invention is during user video is chatted,
Head portrait can be generated for user automatically according to preset head portrait selection standard and head portrait pattern, it is achieved that with easier side
Personalized head portrait is generated for user in formula.
Certainly, implement any of the products of the present invention or method it is not absolutely required at the same reach all the above excellent
Point.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow diagram of head portrait generation method provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of registration process in embodiment illustrated in fig. 1;
Fig. 3 is a kind of structural schematic diagram of head portrait generating means provided in an embodiment of the present invention;
Fig. 4 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description.
In order to which personalized head portrait is generated for user in easier mode, the embodiment of the invention provides a kind of generations of head portrait
Method, apparatus and electronic equipment.Whether detection Video chat first starts;When detecting that Video chat starts, when by presetting
Between interval from the image that camera shoot capture user's portrait;Then, selection meets default head from user's portrait of capture
Active user's portrait as generating standard is carried out image procossing to active user's portrait, is generated user by preset head portrait pattern
Head portrait.It, can be according to preset head portrait selection standard and head portrait since the embodiment of the present invention is during user video is chatted
Head portrait is generated for user in pattern automatically, it is achieved that personalized head portrait is generated for user in easier mode.
As a kind of embodiment of the embodiment of the present invention, as shown in Figure 1, a kind of head portrait provided in an embodiment of the present invention is raw
At method, it is applied to client, specifically includes:
Whether S101, detection Video chat start.
Specifically, establishing the communication link of Video chat for Video chat software, so that it may confirm that video is chatted
It starts.
S102 is spaced to capture from the image that camera is shot at preset timed intervals and use when detecting that Video chat starts
Family portrait.
Specifically, picture captured by a camera can be intercepted every prefixed time interval when user video is chatted
Face, as user's portrait.
S103, selection meets active user's portrait of default head portrait selection standard from user's portrait of capture.
In the present embodiment, presetting head portrait selection standard may include: that illumination standard, angular standard, head portrait account for screen than mark
At least one of quasi- or head portrait location criteria.
Specifically, can to user's portrait of capture carry out image procossing, therefrom extract Lighting information, angle information,
Head portrait accounts for screen ratio or head portrait location information;The information of acquisition is compared with default head portrait selection standard, meets the standard
User's portrait is assured that as active user's portrait.
S104 is carried out image procossing to active user's portrait, is generated user's head portrait by preset head portrait pattern.
In the present embodiment, preset head portrait pattern may include: the style of user's head portrait of generation, dimension, size and
Resolution ratio;Wherein, the style of user's head portrait may include: realistic style, animation style, watercolor style etc..
Optionally, according to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, active user's portrait is carried out
Image preprocessing.When the corresponding dimension of head portrait pattern is two dimension, according to the size and resolution ratio to active user's portrait
It is normalized, obtains the two dimensional image of active user's portrait as initial head portrait;When the corresponding dimension of head portrait pattern is
When three-dimensional, then first active user's portrait is normalized by the size and resolution ratio, obtains active user's portrait
Then two dimensional image is established 3D model using the two dimensional image of default three-dimensional face modeling algorithm and active user's portrait, is used in combination
The 3D model of foundation generates three-dimensional face images as initial head portrait.
In the present embodiment, using the two dimensional image of default three-dimensional face modeling algorithm and active user's portrait, 3D is established
The mode of model has the following two kinds:
First way is: if the quantity of active user's portrait is 1, using free hand drawing piece face modeling algorithm, will work as
Preceding user's portrait inputs trained convolutional neural networks in advance, establishes 3D model.
The second way is: if the quantity of active user's portrait be it is multiple, use more picture face modeling algorithms, root
3D model is established according to multiple active user's portraits.Specifically, the step of more picture face modeling algorithms, is as follows:
According to face alignment algorithm, it is fixed that key point is carried out to each active user's portrait in multiple active user's portraits
Position obtains the facial normal vector of three-dimensional 3D face template;
According to the illumination condition in active user's portrait, estimating for 3D face template is calculated using photometric stereo vision algorithm
Surface normal;
According to the facial normal vector of the 3D face template of acquisition, surface normal and loss function are estimated, calculates loss
Value;
Judge whether penalty values meet default precision;If it is, obtaining 3D model;If it is not, then adjustment 3D face mould
Plate estimates surface normal, and return to the facial normal vector of 3D face template according to acquisition, estimate surface normal and
The step of loss function, calculating penalty values.
After obtaining initial head portrait, according to the preset corresponding image processing algorithm of style for generating head portrait, by initial head portrait
It is further converted into user's head portrait of above-mentioned style.Specifically, obtaining the preset corresponding preparatory training of style for generating head portrait
Style Transfer model, initial head portrait is then inputted into the Style Transfer model, obtain above-mentioned generation head portrait style uses account
Picture.For example, the Style Transfer model of realistic style, animation style, watercolor style can be trained in advance respectively, if preset
In head portrait pattern, head portrait style be animation style, then just by initial head portrait input animation style migration models, model it is defeated
It is out user's head portrait of animation style.
Optionally, after obtaining user's head portrait, judge whether Video chat terminates;If it is not, then returning at preset timed intervals
Interval captures the step of user's portrait from the image that camera is shot;If so, simultaneously using user's head portrait as candidate head portrait
Display saves after user determines into registration information.
In the present embodiment, presetting head portrait selection standard and preset head portrait pattern can be during user's registration
Determining.Specific registration process is as shown in Figure 2, comprising:
S201 shows register interface.
S202 detects whether the permission for allowing to obtain capture user's portrait;If so, thening follow the steps S203;If not,
S206 is thened follow the steps, registration information is saved.
S203 is detected whether using default setting;If so, thening follow the steps S204;If not, thening follow the steps
S205。
S204 obtains default head portrait selection standard and default head portrait pattern, executes step S206.
S205 obtains the head portrait selection standard and head portrait pattern of user's selection.
Specifically, if detecting that user's selection using default setting, obtains default head portrait selection standard and default
Head portrait pattern, respectively as preset head portrait selection standard and preset head portrait pattern;Otherwise, the head portrait choosing of user's selection is obtained
The head portrait pattern for taking standard and user to select, respectively as preset head portrait selection standard and preset head portrait pattern.
In this step, if the user determine that default setting is not used, then a set interface can be first exported, it will be optional
Head portrait standard and head portrait pattern be shown to user;Then, user's selection is obtained in the selection result of set interface according to user
Head portrait selection standard and head portrait pattern.
S206 saves registration information.
It can be user according to method shown in FIG. 1 when user uses the function of Video chat after registration
Generate personalized head portrait.
A kind of head portrait generation method provided in an embodiment of the present invention, by detecting whether Video chat starts;When detecting
When Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;Then, from the use of capture
Selection meets active user's portrait that default head portrait generates standard in the portrait of family, by preset head portrait pattern, to Xiao active user
As carrying out image procossing, user's head portrait is generated.It, can be according to pre- since the embodiment of the present invention is during user video is chatted
If head portrait selection standard and head portrait pattern head portrait is generated for user automatically, it is achieved that being that user is raw in easier mode
At personalized head portrait.
As a kind of embodiment of the embodiment of the present invention, as shown in figure 3, a kind of head portrait provided in an embodiment of the present invention is raw
At device, comprising:
Detection unit 310, for detecting whether Video chat starts;
Portrait capturing unit 320 is shot for when detecting that Video chat starts, being spaced at preset timed intervals from camera
Image in capture user's portrait;
Portrait selecting unit 330 meets the current of default head portrait selection standard for selecting from user's portrait of capture
User's portrait;
Head portrait generation unit 340 carries out image procossing to active user's portrait, generates for pressing preset head portrait pattern
User's head portrait.
A kind of head portrait generating means provided in an embodiment of the present invention, by detecting whether Video chat starts;When detecting
When Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;Then, from the use of capture
Selection meets active user's portrait that default head portrait generates standard in the portrait of family, by preset head portrait pattern, to Xiao active user
As carrying out image procossing, user's head portrait is generated.It, can be according to pre- since the embodiment of the present invention is during user video is chatted
If head portrait selection standard and head portrait pattern head portrait is generated for user automatically, it is achieved that being that user is raw in easier mode
At personalized head portrait.
As a kind of embodiment of the embodiment of the present invention, preset head portrait pattern, comprising: the wind of user's head portrait of generation
Lattice, dimension, size and resolution ratio;
The head portrait generation unit 340 may include:
Preprocessing module is used for according to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, to described current
User's portrait carries out image preprocessing, obtains the initial head with dimension corresponding with preset head portrait pattern, size and resolution ratio
Picture;
Style conversion module, for the corresponding image processing algorithm of style according to preset generation head portrait, by initial head
User's head portrait as being converted to the style.
As a kind of embodiment of the embodiment of the present invention, the preprocessing module may include:
First initial head portrait obtains submodule, if being two dimension for the corresponding dimension of head portrait pattern, by the size with
Active user's portrait is normalized in resolution ratio, obtains the two dimensional image of active user's portrait as initial head
Picture;
Second initial head portrait obtains submodule, if being three-dimensional for the corresponding dimension of head portrait pattern, by the size with
Active user's portrait is normalized in resolution ratio, obtains the two dimensional image of active user's portrait;And using default
The two dimensional image of three-dimensional face modeling algorithm and active user's portrait establishes 3D model, and with the 3D model established, generates
Three-dimensional face images are as initial head portrait.
As a kind of embodiment of the embodiment of the present invention, the second initial head portrait obtains submodule, is specifically used for:
If the quantity of active user's portrait is 1, free hand drawing piece face modeling algorithm is used, according to the active user
Portrait establishes 3D model;
If the quantity of active user's portrait be it is multiple, use more picture face modeling algorithms, according to the multiple
Active user's portrait establishes 3D model.
As a kind of embodiment of the embodiment of the present invention, the style conversion module may include:
Model obtains submodule, moves for obtaining the corresponding style trained in advance of the preset style for generating head portrait
Shifting formwork type;
User's head portrait obtains submodule, for the initial head portrait to be inputted the Style Transfer model, obtains the wind
User's head portrait of lattice.
As a kind of embodiment of the embodiment of the present invention, the head portrait generation unit may include:
Judgment module, for judging whether Video chat terminates;If it is not, then triggering the portrait capturing unit executes institute
It states and is spaced the step of capturing user's portrait from the image that camera is shot at preset timed intervals;
Preserving module, for if so, saving user's head portrait.
As a kind of embodiment of the embodiment of the present invention, the preserving module, comprising:
Output sub-module, for using user's head portrait as candidate head portrait, output to be to user, after user determines, saves
Into registration information.
A kind of head portrait generating means provided in an embodiment of the present invention, by detecting whether Video chat starts;When detecting
When Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;Then, from the use of capture
Selection meets active user's portrait that default head portrait generates standard in the portrait of family, by preset head portrait pattern, to Xiao active user
As carrying out image procossing, user's head portrait is generated.It, can be according to pre- since the embodiment of the present invention is during user video is chatted
If head portrait selection standard and head portrait pattern head portrait is generated for user automatically, it is achieved that being that user is raw in easier mode
At personalized head portrait.
The embodiment of the invention also provides a kind of electronic equipment, as shown in figure 4, include processor 401, communication interface 402,
Memory 403 and communication bus 404, wherein processor 401, communication interface 402, memory 403 are complete by communication bus 404
At mutual communication,
Memory 403, for storing computer program;
Processor 401 when for executing the program stored on memory 403, realizes following steps:
Whether detection Video chat starts;
When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user Xiao
Picture;
Selection meets active user's portrait of default head portrait selection standard from user's portrait of capture;
By preset head portrait pattern, image procossing is carried out to active user's portrait, generates user's head portrait.
A kind of electronic equipment provided in an embodiment of the present invention, the method for realizing head portrait generation, by detecting Video chat
Whether start;When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user Xiao
Picture;Selection meets active user's portrait that default head portrait generates standard from user's portrait of capture;By preset head portrait pattern,
Image procossing is carried out to active user's portrait, generates user's head portrait.The process chatted due to the embodiment of the present invention in user video
In, head portrait can be generated for user automatically according to preset head portrait selection standard and head portrait pattern, it is achieved that with easier
Mode personalized head portrait is generated for user.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component
Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..For just
It is only indicated with a thick line in expression, figure, it is not intended that an only bus or a type of bus.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, RAM), also may include non-easy
The property lost memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal
Processing, DSP), it is specific integrated circuit (Application Specific Integrated Circuit, ASIC), existing
It is field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete
Door or transistor logic, discrete hardware components.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real
It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program
Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or
It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter
Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium
In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer
Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center
User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or
Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or
It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with
It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk
Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (17)
1. a kind of head portrait generation method, which is characterized in that be applied to client, which comprises
Whether detection Video chat starts;
When detecting that Video chat starts, it is spaced from the image that camera is shot at preset timed intervals and captures user's portrait;
Selection meets active user's portrait of default head portrait selection standard from user's portrait of capture;
By preset head portrait pattern, image procossing is carried out to active user's portrait, generates user's head portrait.
2. the method according to claim 1, wherein the default head portrait selection standard, comprising: illumination standard,
Angular standard, head portrait account for screen than at least one of standard or head portrait location criteria.
3. the method according to claim 1, wherein
The preset head portrait pattern, comprising: style, dimension, size and the resolution ratio of user's head portrait of generation;
It is described to press preset head portrait pattern, the step of carrying out image procossing to active user's portrait, generate user's head portrait, comprising:
According to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, image is carried out to active user's portrait and is located in advance
Reason obtains the initial head portrait with dimension corresponding with preset head portrait pattern, size and resolution ratio;
According to the preset corresponding image processing algorithm of style for generating head portrait, initial head portrait is converted to the user of the style
Head portrait.
4. according to the method described in claim 3, it is characterized in that, described locate active user's portrait progress image in advance
Reason, acquisition have the step of initial head portrait of dimension corresponding with preset head portrait pattern, size and resolution ratio, comprising:
If the corresponding dimension of head portrait pattern is two dimension, normalizing is carried out to active user's portrait by the size and resolution ratio
Change processing obtains the two dimensional image of active user's portrait as initial head portrait;
If the corresponding dimension of head portrait pattern is three-dimensional, normalizing is carried out to active user's portrait by the size and resolution ratio
Change processing, obtains the two dimensional image of active user's portrait;
3D model established using the two dimensional image of default three-dimensional face modeling algorithm and active user's portrait, and with establishing
3D model generates three-dimensional face images as initial head portrait.
5. according to the method described in claim 4, it is characterized in that, described using default three-dimensional face modeling algorithm and described work as
The two dimensional image of preceding user's portrait establishes 3D model, and with the 3D model established, generates three-dimensional face images as initial head portrait
The step of, comprising:
If the quantity of active user's portrait is 1, free hand drawing piece face modeling algorithm is used, according to active user's portrait
Establish 3D model;
If the quantity of active user's portrait be it is multiple, more picture face modeling algorithms are used, according to the multiple current
User's portrait establishes 3D model.
6. according to the method described in claim 3, it is characterized in that, described according to the preset corresponding figure of style for generating head portrait
As Processing Algorithm, the step of initial head portrait is converted into the head portrait of the style for generating head portrait, comprising:
Obtain the corresponding Style Transfer model trained in advance of the preset style for generating head portrait;
The initial head portrait is inputted into the Style Transfer model, obtains user's head portrait of the style.
7. the method according to claim 1, wherein the preset head portrait pattern, is in user registration course
Middle determination.
8. the method according to claim 1, wherein after generation user's head portrait the step of, further includes:
Judge whether Video chat terminates;If it is not, then returning to described be spaced from the image that camera is shot at preset timed intervals
The step of capturing user's portrait;
If it is, saving user's head portrait.
9. according to the method described in claim 8, it is characterized in that, the step of preservation user's head portrait, comprising:
Using user's head portrait as candidate head portrait, output is saved in registration information after user determines to user.
10. a kind of head portrait generating means, which is characterized in that be applied to client, described device includes:
Detection unit, for detecting whether Video chat starts;
Portrait capturing unit, for when detecting that Video chat starts, being spaced the image shot from camera at preset timed intervals
Middle capture user's portrait;
Portrait selecting unit, Xiao active user for selecting to meet default head portrait selection standard from user's portrait of capture
Picture;
Head portrait generation unit carries out image procossing to active user's portrait, account is used in generation for pressing preset head portrait pattern
Picture.
11. device according to claim 10, which is characterized in that the preset head portrait pattern, comprising: the user of generation
Style, dimension, size and the resolution ratio of head portrait;
The head portrait generation unit, comprising:
Preprocessing module is used for according to the corresponding Image Pretreatment Algorithm of preset difference head portrait dimension, to the active user
Portrait carries out image preprocessing, obtains the initial head portrait with dimension corresponding with preset head portrait pattern, size and resolution ratio;
Style conversion module, for according to the preset corresponding image processing algorithm of style for generating head portrait, initial head portrait to be turned
It is changed to user's head portrait of the style.
12. device according to claim 11, which is characterized in that the preprocessing module, comprising:
First initial head portrait obtains submodule, if being two dimension for the corresponding dimension of head portrait pattern, by the size and resolution
Active user's portrait is normalized in rate, obtains the two dimensional image of active user's portrait as initial head portrait;
Second initial head portrait obtains submodule, if being three-dimensional for the corresponding dimension of head portrait pattern, by the size and resolution
Active user's portrait is normalized in rate, obtains the two dimensional image of active user's portrait;And using default three-dimensional
The two dimensional image of face modeling algorithm and active user's portrait establishes 3D model, and with the 3D model established, generates three-dimensional
Facial image is as initial head portrait.
13. device according to claim 12, which is characterized in that the second initial head portrait obtains submodule, is specifically used for:
If the quantity of active user's portrait is 1, free hand drawing piece face modeling algorithm is used, according to active user's portrait
Establish 3D model;
If the quantity of active user's portrait be it is multiple, more picture face modeling algorithms are used, according to the multiple current
User's portrait establishes 3D model.
14. device according to claim 11, which is characterized in that the style conversion module, comprising:
Model obtains submodule, for obtaining the corresponding Style Transfer mould trained in advance of the preset style for generating head portrait
Type;
User's head portrait obtains submodule, for the initial head portrait to be inputted the Style Transfer model, obtains the style
User's head portrait.
15. device according to claim 10, which is characterized in that the head portrait generation unit, comprising:
Judgment module, for judging whether Video chat terminates;It is pressed described in the portrait capturing unit execution if it is not, then triggering
Prefixed time interval captures the step of user's portrait from the image that camera is shot;
Preserving module, for if so, saving user's head portrait.
16. device according to claim 15, which is characterized in that the preserving module, comprising:
Output sub-module, for using user's head portrait as candidate head portrait, output to be saved in note after user determines to user
In volume information.
17. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing
Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910166944.9A CN109949407B (en) | 2019-03-06 | 2019-03-06 | Head portrait generation method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910166944.9A CN109949407B (en) | 2019-03-06 | 2019-03-06 | Head portrait generation method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109949407A true CN109949407A (en) | 2019-06-28 |
CN109949407B CN109949407B (en) | 2023-04-07 |
Family
ID=67009093
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910166944.9A Active CN109949407B (en) | 2019-03-06 | 2019-03-06 | Head portrait generation method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109949407B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110446000A (en) * | 2019-08-07 | 2019-11-12 | 三星电子(中国)研发中心 | A kind of figural method and apparatus of generation dialogue |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102454A (en) * | 2007-06-29 | 2008-01-09 | 中兴通讯股份有限公司 | Method for setting personalized head image information of business card via mobile phone video phone |
US20100073501A1 (en) * | 2008-09-19 | 2010-03-25 | Premier Image Technology(China) Ltd. | Digital image capture device and head portrait generating method thereof |
CN101945175A (en) * | 2010-09-26 | 2011-01-12 | 宇龙计算机通信科技(深圳)有限公司 | Method and device for automatically adding contact information and mobile terminal |
CN102361493A (en) * | 2011-10-28 | 2012-02-22 | 上海华勤通讯技术有限公司 | Mobile terminal and method for setting address list head portrait |
CN102821064A (en) * | 2012-08-09 | 2012-12-12 | 上海量明科技发展有限公司 | Method for setting real-time user icon for real-time communication tool, client and system |
CN108833655A (en) * | 2018-06-14 | 2018-11-16 | 深圳超多维科技有限公司 | A kind of method and device generating three-dimensional head portrait in terminal device |
-
2019
- 2019-03-06 CN CN201910166944.9A patent/CN109949407B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101102454A (en) * | 2007-06-29 | 2008-01-09 | 中兴通讯股份有限公司 | Method for setting personalized head image information of business card via mobile phone video phone |
US20100073501A1 (en) * | 2008-09-19 | 2010-03-25 | Premier Image Technology(China) Ltd. | Digital image capture device and head portrait generating method thereof |
CN101945175A (en) * | 2010-09-26 | 2011-01-12 | 宇龙计算机通信科技(深圳)有限公司 | Method and device for automatically adding contact information and mobile terminal |
CN102361493A (en) * | 2011-10-28 | 2012-02-22 | 上海华勤通讯技术有限公司 | Mobile terminal and method for setting address list head portrait |
CN102821064A (en) * | 2012-08-09 | 2012-12-12 | 上海量明科技发展有限公司 | Method for setting real-time user icon for real-time communication tool, client and system |
CN108833655A (en) * | 2018-06-14 | 2018-11-16 | 深圳超多维科技有限公司 | A kind of method and device generating three-dimensional head portrait in terminal device |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110446000A (en) * | 2019-08-07 | 2019-11-12 | 三星电子(中国)研发中心 | A kind of figural method and apparatus of generation dialogue |
CN110446000B (en) * | 2019-08-07 | 2021-04-16 | 三星电子(中国)研发中心 | Method and device for generating dialogue figure image |
Also Published As
Publication number | Publication date |
---|---|
CN109949407B (en) | 2023-04-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104767933B (en) | A method of having the portable digital equipment and screening photo of camera function | |
CN105338238B (en) | A kind of photographic method and electronic equipment | |
CN104683692B (en) | A kind of continuous shooting method and device | |
CN105824875B (en) | A kind of photo be shared method and mobile terminal | |
JP2017531950A (en) | Method and apparatus for constructing a shooting template database and providing shooting recommendation information | |
WO2016100318A2 (en) | Gallery of messages with a shared interest | |
CN111369428B (en) | Virtual head portrait generation method and device | |
CN110119700B (en) | Avatar control method, avatar control device and electronic equipment | |
CN105981368A (en) | Photo composition and position guidance in an imaging device | |
US9384579B2 (en) | Stop-motion video creation from full-motion video | |
CN104580883B (en) | Image processing apparatus, image processing method and recording medium | |
CN104793887B (en) | The dual camera control method and device of mobile terminal | |
CN105005599A (en) | Photograph sharing method and mobile terminal | |
CN106648344A (en) | Screen content adjustment method and equipment | |
CN110493512B (en) | Photographic composition method, photographic composition device, photographic equipment, electronic device and storage medium | |
CN108156385A (en) | Image acquiring method and image acquiring device | |
CN115769260A (en) | Photometric measurement based 3D object modeling | |
CN104573290A (en) | Method, device and system for manufacturing customized earphone | |
CN105391941B (en) | Photo processing method and device | |
CN109949407A (en) | A kind of head portrait generation method, device and electronic equipment | |
CN110163794B (en) | Image conversion method, image conversion device, storage medium and electronic device | |
CN108989666A (en) | Image pickup method, device, mobile terminal and computer-readable storage medium | |
WO2021109764A1 (en) | Image or video generation method and apparatus, computing device and computer-readable medium | |
CN104469092B (en) | A kind of image-pickup method and electronic equipment | |
US8953843B1 (en) | Selecting objects in a sequence of images |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |