CN109345447A - The method and apparatus of face replacement processing - Google Patents

The method and apparatus of face replacement processing Download PDF

Info

Publication number
CN109345447A
CN109345447A CN201811102139.1A CN201811102139A CN109345447A CN 109345447 A CN109345447 A CN 109345447A CN 201811102139 A CN201811102139 A CN 201811102139A CN 109345447 A CN109345447 A CN 109345447A
Authority
CN
China
Prior art keywords
face
image
facial image
facial
eye midpoint
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811102139.1A
Other languages
Chinese (zh)
Inventor
吴文艺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Kugou Computer Technology Co Ltd
Original Assignee
Guangzhou Kugou Computer Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Kugou Computer Technology Co Ltd filed Critical Guangzhou Kugou Computer Technology Co Ltd
Priority to CN201811102139.1A priority Critical patent/CN109345447A/en
Publication of CN109345447A publication Critical patent/CN109345447A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus of face replacement processing, belong to video technique field.The described method includes: determining the position of preset Face datection point in first facial image;According to the position of Face datection point preset in the first facial image, the orientation information of the first facial image is determined;The orientation information of target person according to the pre-stored data and the corresponding relationship of face-image determine corresponding second face-image of the orientation information of the first facial image;Face replacement processing is carried out to the first facial image based on second face-image.Using the present invention, the deformation extent of the face-image when carrying out face replacement processing can reduce.

Description

The method and apparatus of face replacement processing
Technical field
The present invention relates to video technique field, in particular to a kind of method and apparatus of face replacement processing.
Background technique
The gradually development of network technology has started the agitation of the short-sighted frequency of recording.When user is when recording short-sighted frequency, can make With face replacement processing function, the face-image that user can replace user with the face-image in material database is short-sighted to record Frequently, for example, the face-image in material database can be the face-image of certain star.
The process that terminal carries out face replacement processing can be such that terminal first determines in the first facial image of user 106 face test points are based on Face datection point, carry out triangulation processing to first facial image, obtain first facial figure The block image of picture.The block image that terminal will take same operation to obtain the second face-image in material database, and to every One piece of block image carries out Adjusting Shape, enables its size identical with the block image size of corresponding first facial image.So Afterwards, with the block image after Adjusting Shape, corresponding block image in first facial image is replaced, to realize face replacement Processing function.
In the implementation of the present invention, the inventor finds that the existing technology has at least the following problems:
Corresponding point in the block image replacement first facial image of the second face-image after terminal Adjusting Shape The mode of block image, different block image Adjusting Shapes is different, for example, having plenty of elongation, having plenty of and draw high, have plenty of diminution Deng the same picture material for leading to be distributed in different block images generates dislocation, for example, tress is distributed in two pieces of piecemeals Image, after Adjusting Shape may tress be cut off from centre.As it can be seen that carrying out the function of above-mentioned face replacement processing, can lead Causing face replacement, treated that face-image deforms.
Summary of the invention
In order to solve problems in the prior art, the embodiment of the invention provides the methods and dress of a kind of processing of face replacement It sets.The technical solution is as follows:
In a first aspect, providing a kind of method of face replacement processing, which comprises
Determine the position of preset Face datection point in first facial image;
According to the position of Face datection point preset in the first facial image, the court of the first facial image is determined To information;
The orientation information of target person according to the pre-stored data and the corresponding relationship of face-image, determine the first facial Corresponding second face-image of the orientation information of image;
Face replacement processing is carried out to the first facial image based on second face-image.
Optionally, in the determining first facial image preset Face datection point position, comprising:
Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point;
The position according to Face datection point preset in the first facial image, determines the first facial image Orientation information, comprising:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, first face is determined The orientation information of portion's image.
Optionally, the position according to left eye midpoint, right eye midpoint and nose saddle point in the first facial image determines The orientation information of the first facial image, comprising:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, determine left eye midpoint with The second distance between first distance and right eye midpoint and nose saddle point between nose saddle point;
Determine the ratio between the first distance and the second distance;
The corresponding relationship of ratio and orientation information according to the pre-stored data, determines the first distance and the second distance Between the corresponding orientation information of ratio, the orientation information as the first facial image.
Optionally, described to be based on second face-image, to the first facial image, face replacement processing is carried out, Include:
Determine directional information of the line at left eye midpoint, right eye midpoint in the first facial image;
Rotation processing is carried out to second face-image based on the directional information, obtains postrotational second face figure Picture;
Face replacement processing is carried out to the first facial image based on postrotational second face-image.
Optionally, described to be based on second face-image, to the first facial image, face replacement processing is carried out, Include:
Based on the facial color of the first facial image, the facial color of second face-image is adjusted, The second face-image after being adjusted;
Face replacement processing is carried out to the first facial image based on second face-image adjusted.
Second aspect, provides a kind of device of face replacement processing, and described device includes:
First determining module, for determining the position of preset Face datection point in first facial image;
Second determining module determines institute for the position according to Face datection point preset in the first facial image State the orientation information of first facial image;
Third determining module, the orientation information pass corresponding with face-image for target person according to the pre-stored data System, determines corresponding second face-image of the orientation information of the first facial image;
Processing module, to the first facial image, carries out at face replacement for being based on second face-image Reason.
Optionally, first determining module, is used for:
Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point;
Second determining module, is used for:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, first face is determined The orientation information of portion's image.
Optionally, second determining module, is also used to:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, determine left eye midpoint with The second distance between first distance and right eye midpoint and nose saddle point between nose saddle point;
Determine the ratio between the first distance and the second distance;
The corresponding relationship of ratio and orientation information according to the pre-stored data, determines the first distance and the second distance Between the corresponding orientation information of ratio, the orientation information as the first facial image.
Optionally, the processing module, is used for:
Determine directional information of the line at left eye midpoint, right eye midpoint in the first facial image;
Rotation processing is carried out to second face-image based on the directional information, obtains postrotational second face figure Picture;
Face replacement processing is carried out to the first facial image based on postrotational second face-image.
Optionally, the processing module, is used for:
Based on the facial color of the first facial image, the facial color of second face-image is adjusted, The second face-image after being adjusted;
Face replacement processing is carried out to the first facial image based on second face-image adjusted.
The third aspect provides a kind of computer readable storage medium, at least one finger is stored in the storage medium It enables, at least one instruction is loaded by the processor and executed the face replacement processing with realization as described in relation to the first aspect Method.
Technical solution bring beneficial effect provided in an embodiment of the present invention includes at least:
In the embodiment of the present invention, the second face-image of selection is closer to the direction of first facial image, in this way, The block image shape in block image and first facial image in the replacement process for carrying out block image, in the second face-image Shape can be closer to, correspondingly, the adjustment degree that the block image in the second face-image carries out Adjusting Shape can be smaller, from And the deformation extent of face-image can be smaller when carrying out face replacement processing.
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 is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is a kind of flow chart of the method for face replacement processing provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram at recorded video interface provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram at selection of materials interface provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of the method for face replacement processing provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention;
Fig. 6 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached drawing to embodiment party of the present invention Formula is described in further detail.
The embodiment of the invention provides a kind of method of face replacement processing, this method can be realized by terminal.Wherein, should Terminal can be the mobile terminals such as mobile phone, tablet computer, notebook, be also possible to the fixed terminals such as desktop computer.In terminal The application program for recording short-sighted frequency can be installed, which can have video record function, direct broadcast function, face replacement Processing function etc..
As shown in Figure 1, the process flow of this method may include following step:
In a step 101, the position of preset Face datection point in first facial image is determined.
Wherein, Face datection point is the specific location point of some certain organs in face-image, such as left corners of the mouth point, right mouth Angle point, left inside canthus point, right inner eye corner point, left eye midpoint, right eye midpoint and nose saddle point etc. share 106 inspections in face-image Measuring point.
In an implementation, user can install the application program for recording short-sighted frequency at the terminal.It is built in the application program It is vertical to have material database, several face-images as material are prestored in material database, such as the face-image of star, wherein in element In material library, corresponding each personage can store the face-image of multiple and different directions, such as left-hand face-image, dextrad face figure Picture and positive face-image.In material database, corresponding each personage can store the breviary of the positive face-image of the personage Figure, can also be stored with the information such as the title of personage.
When user wants to record short-sighted frequency, the application program that short-sighted frequency is recorded in shortcut icon operation can be clicked, and The function choosing-item of short-sighted frequency is recorded in selection in the main interface of the application program.The function choosing of short-sighted frequency is recorded in selection when the user clicks Xiang Shi, the application program can show recorded video interface.As shown in Fig. 2, the application program is provided in recorded video interface Different function buttons may include recording key, Face Changing key (i.e. face replacement function button).If user wants to record Short-sighted frequency can click recording key, then can start camera with triggering terminal and carry out video record.User can will take the photograph at this time It is shot as head against oneself or against other personages.During video record, if user at a time thinks Facial replacement function is used, the Face Changing key at recorded video interface can be clicked.After user clicks Face Changing key, this is answered Selection of materials interface can be shown with program, as shown in figure 3, showing the breviary of each personage in material database in selection of materials interface Figure.
User may browse through selection of materials interface, and the face figure for Face Changing for oneself wanting selection is considered based on thumbnail Picture can click corresponding thumbnail after user thinks about in selection of materials interface.Terminal can be opened from current time One video frame of every recording that begins then obtains a video frame, recognition of face is carried out, for recognizing the video frame of face, after progress Continuous processing, this video frame for recognizing face are the first facial image in subsequent processing.Terminal obtains first facial figure As after, the Face datection point in first facial image will test, determine the position of wherein preset Face datection point.
Optionally, the position of certain Face datection points in first facial image can be determined, processing mode can be such that really Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point.
In an implementation, terminal, which can establish face-image, unified plane right-angle coordinate.It can be in application program Including the Face datection program that third party provides, for detecting face monitoring point.After getting first facial image, terminal The position of the face monitoring point in Face datection Programmable detection first facial image can be passed through.Then, left eye is obtained wherein Midpoint, right eye midpoint and nose saddle point position.
In a step 102, according to the position of Face datection point preset in first facial image, first facial image is determined Orientation information.
In an implementation, terminal can preset certain some Face datection point in first facial image, for example, left eye midpoint, Right eye midpoint, nose saddle point, left corners of the mouth point etc..Terminal determines the coordinate of preset Face datection point, and then determines certain face inspections Measuring point to the distance between (referred to as test point distance).Because face is towards when changing, different test points is apart from it Between relationship can change, therefore, can use this variation, by the coordinate of preset Face datection point, determine the first face The orientation information of portion's image.
Optionally, first can be determined according to the position at left eye midpoint, right eye midpoint and nose saddle point in first facial image The orientation information of face-image.
Can according to left eye midpoint at a distance from nose saddle point, right eye midpoint determine orientation information at a distance from nose saddle point, Processing mode can be such that terminal, can be according to the first face after the position for obtaining left eye midpoint, right eye midpoint and nose saddle point The position at left eye midpoint, right eye midpoint and nose saddle point in portion's image, determine first distance between left eye midpoint and nose saddle point, with And the second distance between right eye midpoint and nose saddle point, the ratio between first distance and second distance is determined, according to depositing in advance The ratio of storage and the corresponding relationship of orientation information determine the corresponding orientation information of ratio between first distance and second distance, Orientation information as first facial image.
In an implementation, technical staff can preset the corresponding relationship between ratio and orientation information, which is a left side The ratio of the distance between eye the distance between midpoint and nose saddle point and right eye midpoint and nose saddle point.The corresponding relationship physical record The corresponding relationship that can be ratio range and orientation information.The corresponding relationship can record in table form, such as following table 1。
Table 1
After terminal gets the coordinate at left eye midpoint, right eye midpoint and nose saddle point, it can be calculated based on these coordinates The distance between left eye midpoint and nose saddle point (are denoted as first distance), and calculate the distance between right eye midpoint and nose saddle point (note Do second distance), and then calculate the ratio of first distance and second distance.Then it in above table, determines belonging to the ratio Ratio range, and then determine the corresponding orientation information of the ratio range.
In step 103, the corresponding relationship of the orientation information of target person according to the pre-stored data and face-image determines Corresponding second face-image of the orientation information of first facial image.
Wherein, target person is personage belonging to thumbnail that user chooses in selection of materials interface.Orientation information can To include left-hand, dextrad and forward direction.
It in an implementation,, can be with pre-recorded each face figure for all face-images of each personage in material database As corresponding orientation information.After terminal takes out the orientation information for determining first facial image, if the orientation information is left-hand, Terminal then can choose the face figure that corresponding orientation information is left-hand in the face-image for the target person that material database stores Picture, i.e. left-hand face-image, this face-image chosen is the second face-image.Likewise, if the orientation information is the right side To terminal then can choose the face that corresponding orientation information is dextrad in the face-image for the target person that material database stores Image, i.e. dextrad face-image, this face-image chosen is the second face-image.If the orientation information is forward direction, eventually End then can be in the face-image for the target person that material database stores, and choosing corresponding orientation information is positive face-image, I.e. positive face-image, this face-image chosen is the second face-image.Terminal will determine the second face-image selected.
At step 104, it is based on the second face-image, to first facial image, carries out face replacement processing.
In an implementation, for each face-image in material database, the face of each face-image can be previously stored with The position of the position of test point, these face-images and corresponding Face datection point can be predefined by technical staff, can be with It is stored in the server of network side, or is stored in terminal.After determining the second face-image, available second face of terminal The position of portion's image and corresponding Face datection point.Meanwhile the Face datection point of the available first facial image of terminal Position.
Then, terminal can carry out triangulation to the second face-image based on the Face datection point of the second face-image Processing, obtains the block image of multiple triangles of the second face-image, and based on the Face datection of first facial image point, right First facial image carries out triangulation processing, obtains the block image of multiple triangles of first facial image.Triangulation The process of processing can be such that
As shown in figure 4, terminal is previously stored with a mapping table, corresponding record has triangle in mapping table Need the Face datection point of line in subdivision processing, Face datection point corresponding record two-by-two in mapping table.Carrying out three When the processing of angle subdivision, terminal can be according to the mapping table by Face datection point line two-by-two, in this way, just in face-image Multiple triangles are depicted, these lines is then based on and face-image is divided, obtain multiple triangle block images.
After carrying out triangulation processing to first facial image and the second face-image, to each of second face-image The shape and size of block image are adjusted, adjust to the geomery phase of corresponding block image in first facial image Together.Finally, the block image after the adjusting of the second face-image can be used, to corresponding block image in first facial image It is replaced, obtains replaced first facial image.
Above-mentioned is the face-image replacement processing of a video frame in video for recording, and user is in recorded video In the process, each video frame recorded after selection of materials interface is selected, can according to above-mentioned processing mode into Row processing.At the end of user again taps on Face Changing key or video record, terminal no longer carries out face replacement processing.
Optionally, can the face gradient based on first facial image to the second face-image carry out face gradient tune It is whole, face replacement is then carried out, processing mode can be such that the line at determining left eye midpoint, right eye midpoint in first facial figure Directional information as in carries out rotation processing to the second face-image based on directional information, obtains postrotational second face figure Picture is based on postrotational second face-image, to first facial image, carries out face replacement processing.
In an implementation, in the Face datection point of the available first facial image of terminal left eye midpoint and right eye midpoint seat Then mark determines the line at left eye midpoint and right eye midpoint, and then determines the angle between the line and horizontal line, which is sharp Angle.In addition, determining the height at left eye midpoint and right eye midpoint.If left eye midpoint is higher than right eye midpoint, the second face is schemed As being rotated counterclockwise, angle identical with the angle is rotated;If left eye midpoint is lower than right eye midpoint, to the second face Image is rotated clockwise, and angle identical with the angle is rotated.After being rotated to the second face-image, it can be based on Postrotational second face-image carries out face replacement processing to first facial image.Corresponding processing may refer to this implementation Example foregoing.
Optionally, terminal can be handled the colour of skin of the second face-image, and processing mode can be such that based on first The facial color of face-image, is adjusted the facial color of the second face-image, the second face-image after being adjusted, Face replacement processing is carried out to first facial image based on the second face-image adjusted.
In an implementation, terminal can determine the facial color of first facial image and the facial color of the second face-image. Fuzzy clustering algorithm or adaptive-migration algorithm scheduling algorithm can be used in terminal, and the facial color of the second face-image is adjusted to Similar with the facial color of first facial image or identical facial color.Then, the facial color of adjustment can be used in terminal The second face-image later carries out face replacement processing to first facial image.Corresponding processing may refer to the present embodiment Foregoing.
Based on the same technical idea, the embodiment of the invention also provides a kind of device of face replacement processing, the devices It can be the terminal in above-described embodiment, as shown in figure 5, the device includes: the first determining module 510, the second determining module 520, third determining module 530 and processing module 540.
First determining module 510, for determining the position of preset Face datection point in first facial image;
Second determining module 520 is determined for the position according to Face datection point preset in the first facial image The orientation information of the first facial image;
Third determining module 530, the orientation information for target person according to the pre-stored data are corresponding with face-image Relationship determines corresponding second face-image of the orientation information of the first facial image;
Processing module 540, to the first facial image, carries out face replacement for being based on second face-image Processing.
Optionally, first determining module 510, is used for:
Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point;
Second determining module 520, is used for:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, first face is determined The orientation information of portion's image.
Optionally, second determining module 520, is also used to:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, determine left eye midpoint with The second distance between first distance and right eye midpoint and nose saddle point between nose saddle point;
Determine the ratio between the first distance and the second distance;
The corresponding relationship of ratio and orientation information according to the pre-stored data, determines the first distance and the second distance Between the corresponding orientation information of ratio, the orientation information as the first facial image.
Optionally, the processing module 540, is used for:
Determine directional information of the line at left eye midpoint, right eye midpoint in the first facial image;
Rotation processing is carried out to second face-image based on the directional information, obtains postrotational second face figure Picture;
Face replacement processing is carried out to the first facial image based on postrotational second face-image.
Optionally, the processing module 540, is used for:
Based on the facial color of the first facial image, the facial color of second face-image is adjusted, The second face-image after being adjusted;
Face replacement processing is carried out to the first facial image based on second face-image adjusted.
In the embodiment of the present invention, the second face-image of selection is closer to the direction of first facial image, in this way, The block image shape in block image and first facial image in the replacement process for carrying out block image, in the second face-image Shape can be closer to, correspondingly, the adjustment degree that the block image in the second face-image carries out Adjusting Shape can be smaller, from And the deformation extent of face-image can be smaller when carrying out face replacement processing.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
It should be understood that the device of face replacement provided by the above embodiment processing is in face replacement processing, only with The division progress of above-mentioned each functional module can according to need and for example, in practical application by above-mentioned function distribution by not Same functional module is completed, i.e., the internal structure of equipment is divided into different functional modules, to complete whole described above Or partial function.In addition, the device of face replacement processing provided by the above embodiment and the method for face replacement processing are implemented Example belongs to same design, and specific implementation process is detailed in embodiment of the method, and which is not described herein again.
Fig. 6 is a kind of structural schematic diagram of terminal provided in an embodiment of the present invention.The terminal 600 can be Portable movable Terminal, such as: smart phone, tablet computer.Terminal 600 is also possible to referred to as other titles such as user equipment, portable terminal.
In general, terminal 600 includes: processor 601 and memory 602.
Processor 601 may include one or more processing cores, such as 4 core processors, 6 core processors etc..Place Reason device 601 can use DSP (Digital Signal Processing, Digital Signal Processing), FPGA (Field- Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, may be programmed Logic array) at least one of example, in hardware realize.Processor 601 also may include primary processor and coprocessor, master Processor is the processor for being handled data in the awake state, also referred to as CPU (Central Processing Unit, central processing unit);Coprocessor is the low power processor for being handled data in the standby state.? In some embodiments, processor 601 can be integrated with GPU (Graphics Processing Unit, image processor), GPU is used to be responsible for the rendering and drafting of content to be shown needed for display screen.In some embodiments, processor 601 can also be wrapped AI (Artificial Intelligence, artificial intelligence) processor is included, the AI processor is for handling related machine learning Calculating operation.
Memory 602 may include one or more computer readable storage mediums, which can To be tangible and non-transient.Memory 602 may also include high-speed random access memory and nonvolatile memory, Such as one or more disk storage equipments, flash memory device.In some embodiments, non-transient in memory 602 Computer readable storage medium for storing at least one instruction, at least one instruction for performed by processor 601 with The method for realizing face replacement processing provided herein.
In some embodiments, terminal 600 is also optional includes: peripheral device interface 603 and at least one peripheral equipment. Specifically, peripheral equipment includes: radio circuit 604, touch display screen 605, camera 606, voicefrequency circuit 607, positioning component At least one of 608 and power supply 609.
Peripheral device interface 603 can be used for I/O (Input/Output, input/output) is relevant outside at least one Peripheral equipment is connected to processor 601 and memory 602.In some embodiments, processor 601, memory 602 and peripheral equipment Interface 603 is integrated on same chip or circuit board;In some other embodiments, processor 601, memory 602 and outer Any one or two in peripheral equipment interface 603 can realize on individual chip or circuit board, the present embodiment to this not It is limited.
Radio circuit 604 is for receiving and emitting RF (Radio Frequency, radio frequency) signal, also referred to as electromagnetic signal.It penetrates Frequency circuit 604 is communicated by electromagnetic signal with communication network and other communication equipments.Radio circuit 604 turns electric signal It is changed to electromagnetic signal to be sent, alternatively, the electromagnetic signal received is converted to electric signal.Optionally, radio circuit 604 wraps It includes: antenna system, RF transceiver, one or more amplifiers, tuner, oscillator, digital signal processor, codec chip Group, user identity module card etc..Radio circuit 604 can be carried out by least one wireless communication protocol with other terminals Communication.The wireless communication protocol includes but is not limited to: WWW, Metropolitan Area Network (MAN), Intranet, each third generation mobile communication network (2G, 3G, 4G and 5G), WLAN and/or WiFi (Wireless Fidelity, Wireless Fidelity) network.In some embodiments, it penetrates Frequency circuit 604 can also include NFC (Near Field Communication, wireless near field communication) related circuit, this Application is not limited this.
Touch display screen 605 is for showing UI (User Interface, user interface).The UI may include figure, text Sheet, icon, video and its their any combination.Touch display screen 605 also have acquisition touch display screen 605 surface or The ability of the touch signal of surface.The touch signal can be used as control signal and be input to processor 601 and be handled.Touching Display screen 605 is touched for providing virtual push button and/or dummy keyboard, also referred to as soft button and/or soft keyboard.In some embodiments In, touch display screen 605 can be one, and the front panel of terminal 600 is arranged;In further embodiments, touch display screen 605 It can be at least two, be separately positioned on the different surfaces of terminal 600 or in foldover design;In still other embodiments, touch Display screen 605 can be flexible display screen, be arranged on the curved surface of terminal 600 or on fold plane.Even, touch display screen 605 can also be arranged to non-rectangle irregular figure, namely abnormity screen.Touch display screen 605 can use LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) Etc. materials preparation.
CCD camera assembly 606 is for acquiring image or video.Optionally, CCD camera assembly 606 include front camera and Rear camera.In general, front camera is for realizing video calling or self-timer, rear camera is for realizing photo or video Shooting.In some embodiments, rear camera at least two are main camera, depth of field camera, wide-angle imaging respectively Any one in head, to realize that main camera and the fusion of depth of field camera realize background blurring function, main camera and wide-angle Pan-shot and VR (Virtual Reality, virtual reality) shooting function are realized in camera fusion.In some embodiments In, CCD camera assembly 606 can also include flash lamp.Flash lamp can be monochromatic warm flash lamp, be also possible to double-colored temperature flash of light Lamp.Double-colored temperature flash lamp refers to the combination of warm light flash lamp and cold light flash lamp, can be used for the light compensation under different-colour.
Voicefrequency circuit 607 is used to provide the audio interface between user and terminal 600.Voicefrequency circuit 607 may include wheat Gram wind and loudspeaker.Microphone is used to acquire the sound wave of user and environment, and converts sound waves into electric signal and be input to processor 601 are handled, or are input to radio circuit 604 to realize voice communication.For stereo acquisition or the purpose of noise reduction, wheat Gram wind can be it is multiple, be separately positioned on the different parts of terminal 600.Microphone can also be array microphone or omnidirectional's acquisition Type microphone.Loudspeaker is then used to that sound wave will to be converted to from the electric signal of processor 601 or radio circuit 604.Loudspeaker can To be traditional wafer speaker, it is also possible to piezoelectric ceramic loudspeaker.When loudspeaker is piezoelectric ceramic loudspeaker, not only may be used To convert electrical signals to the audible sound wave of the mankind, the sound wave that the mankind do not hear can also be converted electrical signals to survey Away from etc. purposes.In some embodiments, voicefrequency circuit 607 can also include earphone jack.
Positioning component 608 is used for the current geographic position of positioning terminal 600, to realize navigation or LBS (Location Based Service, location based service).Positioning component 608 can be the GPS (Global based on the U.S. Positioning System, global positioning system), China dipper system or Russia Galileo system positioning group Part.
Power supply 609 is used to be powered for the various components in terminal 600.Power supply 609 can be alternating current, direct current, Disposable battery or rechargeable battery.When power supply 609 includes rechargeable battery, which can be wired charging electricity Pond or wireless charging battery.Wired charging battery is the battery to be charged by Wireline, and wireless charging battery is by wireless The battery of coil charges.The rechargeable battery can be also used for supporting fast charge technology.
In some embodiments, terminal 600 further includes having one or more sensors 610.The one or more sensors 610 include but is not limited to: acceleration transducer 611, gyro sensor 612, pressure sensor 613, fingerprint sensor 614, Optical sensor 615 and proximity sensor 616.
Acceleration transducer 611 can detecte the acceleration ruler in three reference axis of the coordinate system established with terminal 600 It is very little.For example, acceleration transducer 611 can be used for detecting component of the acceleration of gravity in three reference axis.Processor 601 can With the acceleration of gravity signal acquired according to acceleration transducer 611, touch display screen 605 is controlled with transverse views or longitudinal view Figure carries out the display of user interface.Acceleration transducer 611 can be also used for the acquisition of game or the exercise data of user.
Gyro sensor 612 can detecte body direction and the rotational angle of terminal 600, and gyro sensor 612 can To cooperate with acquisition user to act the 3D of terminal 600 with acceleration transducer 611.Processor 601 is according to gyro sensor 612 Following function may be implemented in the data of acquisition: when action induction (for example changing UI according to the tilt operation of user), shooting Image stabilization, game control and inertial navigation.
The lower layer of side frame and/or touch display screen 605 in terminal 600 can be set in pressure sensor 613.Work as pressure When the side frame of terminal 600 is arranged in sensor 613, it can detecte user to the gripping signal of terminal 600, believed according to the gripping Number carry out right-hand man's identification or prompt operation.When the lower layer of touch display screen 605 is arranged in pressure sensor 613, Ke Yigen According to user to the pressure operation of touch display screen 605, realization controls the operability control on the interface UI.Operability Control includes at least one of button control, scroll bar control, icon control, menu control.
Fingerprint sensor 614 is used to acquire the fingerprint of user, according to the identity of collected fingerprint recognition user.Knowing Not Chu the identity of user when being trusted identity, authorize the user to execute relevant sensitive operation, the sensitive operation by processor 601 Including solution lock screen, check encryption information, downloading software, payment and change setting etc..End can be set in fingerprint sensor 614 Front, the back side or the side at end 600.When being provided with physical button or manufacturer Logo in terminal 600, fingerprint sensor 614 can To be integrated with physical button or manufacturer Logo.
Optical sensor 615 is for acquiring ambient light intensity.In one embodiment, processor 601 can be according to optics The ambient light intensity that sensor 615 acquires controls the display brightness of touch display screen 605.Specifically, when ambient light intensity is higher When, the display brightness of touch display screen 605 is turned up;When ambient light intensity is lower, the display for turning down touch display screen 605 is bright Degree.In another embodiment, the ambient light intensity that processor 601 can also be acquired according to optical sensor 615, dynamic adjust The acquisition parameters of CCD camera assembly 606.
Proximity sensor 616, also referred to as range sensor are generally arranged at the front of terminal 600.Proximity sensor 616 is used In the distance between the front of acquisition user and terminal 600.In one embodiment, when proximity sensor 616 detects user When the distance between front of terminal 600 gradually becomes smaller, touch display screen 605 is controlled by processor 601 and is cut from bright screen state It is changed to breath screen state;When proximity sensor 616 detects user and the distance between the front of terminal 600 becomes larger, by Processor 601 controls touch display screen 605 and is switched to bright screen state from breath screen state.
It will be understood by those skilled in the art that the restriction of structure shown in Fig. 6 not structure paired terminal 600, can wrap It includes than illustrating more or fewer components, perhaps combine certain components or is arranged using different components.
In the exemplary embodiment, a kind of computer readable storage medium is additionally provided, is stored at least in storage medium One instruction, at least one instruction are loaded by processor and are executed the side to realize the processing of the face replacement in above-described embodiment Method.For example, the computer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (11)

1. a kind of method of face replacement processing, which is characterized in that the described method includes:
Determine the position of preset Face datection point in first facial image;
According to the position of Face datection point preset in the first facial image, the direction letter of the first facial image is determined Breath;
The orientation information of target person according to the pre-stored data and the corresponding relationship of face-image determine the first facial image Corresponding second face-image of orientation information;
Face replacement processing is carried out to the first facial image based on second face-image.
2. the method according to claim 1, wherein preset Face datection in the determining first facial image The position of point, comprising:
Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point;
The position according to Face datection point preset in the first facial image, determines the court of the first facial image To information, comprising:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, the first facial figure is determined The orientation information of picture.
3. according to the method described in claim 2, it is characterized in that, it is described according to left eye midpoint in the first facial image, The position at right eye midpoint and nose saddle point determines the orientation information of the first facial image, comprising:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, left eye midpoint and nose saddle are determined The second distance between first distance and right eye midpoint and nose saddle point between point;
Determine the ratio between the first distance and the second distance;
The corresponding relationship of ratio and orientation information according to the pre-stored data, determines between the first distance and the second distance The corresponding orientation information of ratio, the orientation information as the first facial image.
4. the method according to claim 1, wherein described be based on second face-image, to described first Face-image carries out face replacement processing, comprising:
Determine directional information of the line at left eye midpoint, right eye midpoint in the first facial image;
Rotation processing is carried out to second face-image based on the directional information, obtains postrotational second face-image;
Face replacement processing is carried out to the first facial image based on postrotational second face-image.
5. the method according to claim 1, wherein described be based on second face-image, to described first Face-image carries out face replacement processing, comprising:
Based on the facial color of the first facial image, the facial color of second face-image is adjusted, is obtained Second face-image adjusted;
Face replacement processing is carried out to the first facial image based on second face-image adjusted.
6. a kind of device of face replacement processing, which is characterized in that described device includes:
First determining module, for determining the position of preset Face datection point in first facial image;
Second determining module determines described for the position according to Face datection point preset in the first facial image The orientation information of one face-image;
Third determining module, for the orientation information of target person according to the pre-stored data and the corresponding relationship of face-image, really Corresponding second face-image of orientation information of the fixed first facial image;
Processing module, to the first facial image, carries out face replacement processing for being based on second face-image.
7. device according to claim 6, which is characterized in that first determining module is used for:
Determine the position at left eye midpoint in first facial image, right eye midpoint and nose saddle point;
Second determining module, is used for:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, the first facial figure is determined The orientation information of picture.
8. device according to claim 7, which is characterized in that second determining module is also used to:
According to the position at left eye midpoint, right eye midpoint and nose saddle point in the first facial image, left eye midpoint and nose saddle are determined The second distance between first distance and right eye midpoint and nose saddle point between point;
Determine the ratio between the first distance and the second distance;
The corresponding relationship of ratio and orientation information according to the pre-stored data, determines between the first distance and the second distance The corresponding orientation information of ratio, the orientation information as the first facial image.
9. device according to claim 6, which is characterized in that the processing module is used for:
Determine directional information of the line at left eye midpoint, right eye midpoint in the first facial image;
Rotation processing is carried out to second face-image based on the directional information, obtains postrotational second face-image;
Face replacement processing is carried out to the first facial image based on postrotational second face-image.
10. device according to claim 6, which is characterized in that the processing module is used for:
Based on the facial color of the first facial image, the facial color of second face-image is adjusted, is obtained Second face-image adjusted;
Face replacement processing is carried out to the first facial image based on second face-image adjusted.
11. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, institute in the storage medium At least one instruction is stated to be loaded by the processor and executed to realize face replacement as claimed in claim 1 to 5 The method of reason.
CN201811102139.1A 2018-09-20 2018-09-20 The method and apparatus of face replacement processing Pending CN109345447A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811102139.1A CN109345447A (en) 2018-09-20 2018-09-20 The method and apparatus of face replacement processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811102139.1A CN109345447A (en) 2018-09-20 2018-09-20 The method and apparatus of face replacement processing

Publications (1)

Publication Number Publication Date
CN109345447A true CN109345447A (en) 2019-02-15

Family

ID=65306258

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811102139.1A Pending CN109345447A (en) 2018-09-20 2018-09-20 The method and apparatus of face replacement processing

Country Status (1)

Country Link
CN (1) CN109345447A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956580A (en) * 2019-11-28 2020-04-03 广州华多网络科技有限公司 Image face changing method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107105310A (en) * 2017-05-05 2017-08-29 广州盈可视电子科技有限公司 Figure image replacement method, device and a kind of recording and broadcasting system in a kind of net cast
CN107122054A (en) * 2017-04-27 2017-09-01 青岛海信医疗设备股份有限公司 A kind of detection method and device of face deflection angle and luffing angle
CN107767325A (en) * 2017-09-12 2018-03-06 深圳市朗形网络科技有限公司 Method for processing video frequency and device
CN108062404A (en) * 2017-12-28 2018-05-22 奇酷互联网络科技(深圳)有限公司 Processing method, device, readable storage medium storing program for executing and the terminal of facial image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107122054A (en) * 2017-04-27 2017-09-01 青岛海信医疗设备股份有限公司 A kind of detection method and device of face deflection angle and luffing angle
CN107105310A (en) * 2017-05-05 2017-08-29 广州盈可视电子科技有限公司 Figure image replacement method, device and a kind of recording and broadcasting system in a kind of net cast
CN107767325A (en) * 2017-09-12 2018-03-06 深圳市朗形网络科技有限公司 Method for processing video frequency and device
CN108062404A (en) * 2017-12-28 2018-05-22 奇酷互联网络科技(深圳)有限公司 Processing method, device, readable storage medium storing program for executing and the terminal of facial image

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110956580A (en) * 2019-11-28 2020-04-03 广州华多网络科技有限公司 Image face changing method and device, computer equipment and storage medium
CN110956580B (en) * 2019-11-28 2024-04-16 广州方硅信息技术有限公司 Method, device, computer equipment and storage medium for changing face of image

Similar Documents

Publication Publication Date Title
US11517099B2 (en) Method for processing images, electronic device, and storage medium
CN108595239A (en) image processing method, device, terminal and computer readable storage medium
CN110427110A (en) A kind of live broadcasting method, device and direct broadcast server
CN109558837B (en) Face key point detection method, device and storage medium
CN113763228B (en) Image processing method, device, electronic equipment and storage medium
CN110956580B (en) Method, device, computer equipment and storage medium for changing face of image
CN108965922A (en) Video cover generation method, device and storage medium
CN109886208B (en) Object detection method and device, computer equipment and storage medium
CN109862412A (en) It is in step with the method, apparatus and storage medium of video
CN109859102A (en) Special display effect method, apparatus, terminal and storage medium
CN108563377A (en) The method and apparatus that switching shows the page
CN109522863A (en) Ear's critical point detection method, apparatus and storage medium
CN110121094A (en) Video is in step with display methods, device, equipment and the storage medium of template
CN109192218A (en) The method and apparatus of audio processing
CN110263617A (en) Three-dimensional face model acquisition methods and device
CN109583370A (en) Human face structure grid model method for building up, device, electronic equipment and storage medium
CN110081902A (en) Direction indicating method, device and terminal in navigation
CN109166150A (en) Obtain the method, apparatus storage medium of pose
CN109978996A (en) Generate method, apparatus, terminal and the storage medium of expression threedimensional model
CN110225390A (en) Method, apparatus, terminal and the computer readable storage medium of video preview
CN110288689A (en) The method and apparatus that electronic map is rendered
CN108734662A (en) The method and apparatus for showing icon
CN108829582A (en) The method and apparatus of program compatibility
CN108664300A (en) A kind of application interface display methods under picture-in-picture mode and device
CN110147796A (en) Image matching method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190215