Face image processing process, device, equipment and storage medium
Technical field
The present embodiments relate to technical field of image processing more particularly to a kind of face image processing process, device, set
Standby and storage medium.
Background technique
Since the imaging of mirror is mirror image relative to real-world object, and eyes imaging is consistent relative to real-world object
, therefore people are more familiar to the mirror image of oneself, it is more familiar to other people true picture, and existing camera, such as
Mobile phone camera, the left and right face position of captured facial image be it is fixed, therefore people see oneself self-timer image or others
Self-timer image feel very awkward sometimes.
Summary of the invention
The embodiment of the invention provides a kind of face image processing process, device, equipment and storage mediums, solve existing
The left and right face position of facial image captured by the camera of technology is fixed technical problem, so that user can be according to photo
Consult the left and right face position of object adjustment target face.
In a first aspect, the embodiment of the invention provides a kind of face image processing process, comprising:
Determine the reference position of the left and right face of the target face of present image;
Obtain face adjustment information;
According to the reference position of the face adjustment information and the left and right face of the target face to the left and right of target face
Face executes face reversion or non-face reversion processing, to update the left and right face position of the target face.
Further, the reference position of the left and right face of the target face of the determining present image, comprising:
Pass through the reference position of the left and right face of the target face of manually identifying present image;Or
The reference bit of the left and right face of the target face of present image is identified and determined by the human face recognition model trained
It sets.
Further, the acquisition face adjustment information, comprising:
Determine the access object of present image;
If the access object of present image is oneself, face adjustment information is face reversion;
If the access object of present image is for other people, face adjustment information is non-face reversion.
Further, the acquisition face adjustment information, comprising:
If present image is personal self-timer image, and consulting object is oneself, then face adjustment information is face reversion.
Further, the acquisition face adjustment information, comprising:
If present image is the personal self-timer image of front camera shooting, face adjustment information is face reversion.
Further, the reference position is current location, described according to the face adjustment information and the target face
The reference position of left and right face face reversion is executed to the left and right face of target face or non-face reversion is handled, comprising:
If the face adjustment information is face reversion, and the left and right face position of the target face of present image is current
Position then inverts the left and right face position of the target face;
If the face adjustment information is non-face reversion, and the left and right face position of the target face of present image is to work as
Front position then keeps the current location of the left and right face of the target face.
Further, the reference position is physical slot, described according to the face adjustment information and the target face
The reference position of left and right face face reversion is executed to the left and right face of target face or non-face reversion is handled, comprising:
If the face adjustment information is face reversion, and the left and right face position of the target face of present image is nature
Position inverts the left and right face position of target face relative to the physical slot of left and right face;
If the face adjustment information is non-face reversion, and the left and right face position of the target face of present image is certainly
Right position then makes the left and right face position of target face be in physical slot.
Second aspect, the embodiment of the invention also provides a kind of face image processing devices, comprising:
Position determination module, the current location of the left and right face of the target face for determining present image or left and right face from
Right position;
Data obtaining module, for obtaining face adjustment information;
Adjust module, for according to the reference position of the face adjustment information and the left and right face of the target face to mesh
The left and right face for marking face executes face reversion or non-face reversion processing, to update the left and right face position of the target face.
The third aspect, the embodiment of the invention also provides a kind of equipment, the equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes face image processing process as described in relation to the first aspect.
Fourth aspect, the embodiment of the invention also provides a kind of equipment, the equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes face image processing process as described in relation to the first aspect.
The technical solution of face image processing process provided in an embodiment of the present invention, the target person of image before including determining when
The current location of the left and right face of face or the physical slot of left and right face;Obtain face adjustment information;Determine the target person of present image
The reference position of the left and right face of face;Obtain face adjustment information;According to the ginseng of face adjustment information and the left and right face of target face
It examines position and face reversion or non-face reversion processing is executed to the left and right face of target face, to update the left and right face position of target face
It sets.Face reversion is executed according to left and right face of the reference position of face adjustment information and the left and right face of target face to target face
Or non-face reversion processing, to realize the left and right face position for adjusting target face according to the different usage scenarios of image.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing does one and simply introduces, it should be apparent that, drawings in the following description are some embodiments of the invention, for this
For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others
Attached drawing.
Fig. 1 is the flow chart for the face image processing process that the embodiment of the present invention one provides;
Fig. 2 is the structural block diagram of face image processing device provided by Embodiment 2 of the present invention;
Fig. 3 is the structural schematic diagram for the equipment that the embodiment of the present invention three provides.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, hereinafter with reference to attached in the embodiment of the present invention
Figure, clearly and completely describes technical solution of the present invention by embodiment, it is clear that described embodiment is the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
Embodiment one
Fig. 1 is the flow chart for the face image processing process that the embodiment of the present invention one provides.The technical solution of the present embodiment
Suitable for the left and right face situation according to face different scene adjustment images.This method can be mentioned by the embodiment of the present invention
The face image processing device of confession executes, which can be realized by the way of software and/or hardware, and configures and handling
It is applied in device.This method specifically comprises the following steps:
S101, determine present image target face left and right face reference position.
Since the imaging of mirror is mirror image relative to real-world object, and eyes imaging is consistent relative to real-world object
, therefore people are more familiar to the mirror image of oneself, it is more familiar to other people true picture.Based on this, in order to use
Feel oneself and other people in photo more naturally, left and right face position progress of the present embodiment in different scenes to target face in family
Different processing.
Before the left and right face position of the target face to present image is handled, need first clearly to execute image procossing
Reference position, in view of the camera having provide be face mirror image, i.e., relative to natural person's left and right face position reversion after
Image, and it is the natural image of face that some cameras, which provide, that is, actual left and right face position, the present embodiment are exemplary
Give two reference positions, current location and physical slot respectively, the former is the position for the left and right face that present image is presented
It sets, the latter is the actual position of left and right face.
When determining reference position, user can pass through the reference of the left and right face of the target face of manually identifying present image
Position;Or the human face recognition model by having trained identifies and determines the reference bit of the left and right face of the target face of present image
It sets.It should be noted that the human face recognition model of the present embodiment use the prior art, the present embodiment to its specific algorithm not
Give restriction.
It is understood that can determine physical slot when camera shoots photograph according to the image presented, use at this time
Family, which can choose, uses physical slot as reference position, and for having shot the image finished, user can be by image
Upper selected marker region, then marks that the marked region is located at the left face of natural person or right face determines physical slot, or with
Then one or more non-mirror image image is determined it is left and right face as reference position template by the human face recognition model trained
Physical slot.
S102, face adjustment information is obtained.
Wherein, face adjustment information includes face reversion and non-face reversion, the former is the left and right relative to target face
The reference position of face executes reverse turn operation, to exchange the left and right face position of target face, the latter is the left and right for making target face
Face position is maintained at reference position.
Due to whether left and right face position needs to invert usually related to the consultant of image, the face tune of the present embodiment
The acquisition modes of whole information comprise determining that the access object of present image;If the access object of present image be oneself, people
Face adjustment information is face reversion;If the access object of present image is for other people, face adjustment information is non-face reversion.
It is understood that the image for executing face reversion processing is preferably single image, therefore, for the group photo of more people
Image, face adjustment information are preferably non-face reversion.And for single image, if consulting object is oneself, face tune
Whole information is face reversion, if consulting object is not oneself, face adjustment information is non-face reversion.Preferably, if
Present image is the personal self-timer image of front camera shooting, then face adjustment information is face reversion, if present image
For the personal self-timer image of rear camera shooting, then face adjustment information is non-face reversion.
S103, it is held according to left and right face of the reference position of face adjustment information and the left and right face of target face to target face
The reversion of pedestrian's face or non-face reversion processing, to update the left and right face position of target face.
If reference position is current location, the concrete mode of left and right face position adjustment are as follows: if face adjustment information is
Face reversion, and the left and right face position of the target face of present image is current location, then inverts the left and right face position of target face
It sets;If face adjustment information is non-face reversion, and the left and right face position of the target face of present image is current location, then
Keep the current location of target face.It is understood that executing the reversion of odd-times face if reference position is current location
The left and right face position of the target face of image obtained relative to the target face before adjustment left and right face position on the contrary, execute
Even-times face inverts the left and right face position of the target face of image obtained and the left and right face position of the target face before adjustment
It sets identical.
If reference position is physical slot, the concrete mode of left and right face position adjustment are as follows: if face adjustment information is
Face reversion, and the left and right face position of the target face of present image is physical slot, then makes the left and right face position of target face
The physical slot of opposite left and right face inverts;If face adjustment information is non-face reversion, and the target face of present image
Left and right face position is physical slot, then the left and right face position of target face is made to be in physical slot.It is understood that if ginseng
Examine position be physical slot, no matter execute how many times face reversion, after adjustment the left and right face position of the target face of image with
The physical slot of left and right face on the contrary, regardless of the left and right face position of the target face of present image whether the natural position with left and right face
Set it is identical, after executing non-face reversion, the left and right face position of the target face of image adjusted and the physical slot of left and right face
It is identical.
The technical solution of face image processing process provided in an embodiment of the present invention, the target person of image before including determining when
The current location of the left and right face of face or the physical slot of left and right face;Obtain face adjustment information;Determine the target person of present image
The reference position of the left and right face of face;Obtain face adjustment information;According to the ginseng of face adjustment information and the left and right face of target face
It examines position and face reversion or non-face reversion processing is executed to the left and right face of target face, to update the left and right face position of target face
It sets.Face reversion is executed according to left and right face of the reference position of face adjustment information and the left and right face of target face to target face
Or non-face reversion processing, to realize the left and right face position for adjusting target face according to the different usage scenarios of image.
Embodiment two
Fig. 2 is the structural block diagram of face image processing device provided by Embodiment 2 of the present invention.The device is for executing
Face image processing process provided by any embodiment is stated, which is chosen as software or hardware realization.The device includes:
Position determination module 11, the current location of the left and right face of the target face for determining present image or left and right face
Physical slot;
Data obtaining module 12, for obtaining face adjustment information;
Adjust module 13, for according to the reference position of face adjustment information and the left and right face of target face to target face
Left and right face execute face reversion or non-face reversion processing, to update the left and right face position of target face.
The technical solution of face image processing device provided in an embodiment of the present invention, including position determination module, for true
Determine the current location of the left and right face of the target face of present image or the physical slot of left and right face;Data obtaining module, for obtaining
Take face adjustment information;Module is adjusted, for the reference according to the face adjustment information and the left and right face of the target face
Position executes face reversion to the left and right face of target face or non-face reversion is handled, to update the left and right face of the target face
Position.It is anti-that face is executed according to left and right face of the reference position of face adjustment information and the left and right face of target face to target face
Turn or non-face reversion is handled, to realize the left and right face position for adjusting target face according to the different usage scenarios of image.
People provided by any embodiment of the invention can be performed in face image processing device provided by the embodiment of the present invention
Face image processing method has the corresponding functional module of execution method and beneficial effect.
Embodiment three
Fig. 3 is the structural schematic diagram for the equipment that the embodiment of the present invention three provides, as shown in figure 3, the equipment includes processor
101, memory 102, input unit 103 and output device 104;The quantity of processor 101 can be one or more in equipment
It is a, in Fig. 3 by taking a processor 101 as an example;Processor 101, memory 102, input unit 103 and output dress in equipment
Setting 104 can be connected by bus or other modes, in Fig. 3 for being connected by bus.
Memory 102 is used as a kind of computer readable storage medium, can be used for storing software program, journey can be performed in computer
Sequence and module, if the corresponding program instruction/module of the face image processing process in the embodiment of the present invention is (for example, position is true
Cover half block 11, data obtaining module 12 and adjustment module 13).Software of the processor 101 by operation storage in the memory 102
Program, instruction and module realize above-mentioned facial image thereby executing the various function application and data processing of equipment
Processing method.
Memory 102 can mainly include storing program area and storage data area, wherein storing program area can store operation system
Application program needed for system, at least one function;Storage data area, which can be stored, uses created data etc. according to terminal.This
Outside, memory 102 may include high-speed random access memory, can also include nonvolatile memory, for example, at least one
Disk memory, flush memory device or other non-volatile solid state memory parts.In some instances, memory 102 can be into one
Step includes the memory remotely located relative to processor 101, these remote memories can pass through network connection to equipment.On
The example for stating network includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Input unit 103 can be used for receiving the number or character information of input, and generate with the user setting of equipment with
And the related key signals input of function control.
Output device 104 may include that display screen etc. shows equipment, for example, the display screen of user terminal.
Example IV
The embodiment of the present invention four additionally provides a kind of storage medium comprising computer executable instructions, and the computer can
It executes instruction when being executed by computer processor for executing a kind of face image processing process, this method comprises:
Determine the reference position of the left and right face of the target face of present image;
Obtain face adjustment information;
According to the reference position of the face adjustment information and the left and right face of the target face to the left and right of target face
Face executes face reversion or non-face reversion processing, to update the left and right face position of the target face.
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present invention
The method operation that executable instruction is not limited to the described above, can also be performed facial image provided by any embodiment of the invention
Relevant operation in processing method.
By the description above with respect to embodiment, it is apparent to those skilled in the art that, the present invention
It can be realized by software and required common hardware, naturally it is also possible to which by hardware realization, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which can store in computer readable storage medium
In, floppy disk, read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random such as computer
Access Memory, abbreviation RAM), flash memory (FLASH), hard disk or CD etc., including some instructions are used so that a calculating
Machine equipment (can be personal computer, server or the network equipment etc.) executes face described in each embodiment of the present invention
Image processing method.
It is worth noting that, included each unit and module are only in the embodiment of above-mentioned face image processing device
It is to be divided according to the functional logic, but be not limited to the above division, as long as corresponding functions can be realized;Separately
Outside, the specific name of each functional unit is also only for convenience of distinguishing each other, the protection scope being not intended to restrict the invention.
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.