CN110288552A - Video beautification method, device and electronic equipment - Google Patents

Video beautification method, device and electronic equipment Download PDF

Info

Publication number
CN110288552A
CN110288552A CN201910580711.3A CN201910580711A CN110288552A CN 110288552 A CN110288552 A CN 110288552A CN 201910580711 A CN201910580711 A CN 201910580711A CN 110288552 A CN110288552 A CN 110288552A
Authority
CN
China
Prior art keywords
video frame
keypoints
video
key point
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910580711.3A
Other languages
Chinese (zh)
Inventor
黄佳斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910580711.3A priority Critical patent/CN110288552A/en
Publication of CN110288552A publication Critical patent/CN110288552A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Image Processing (AREA)

Abstract

A kind of video beautification method, device and electronic equipment are provided in the embodiment of the present disclosure, belongs to technical field of image processing, this method comprises: obtaining the first video frame and the second video frame adjacent in target video;The critical point detection for being directed to target object is executed to the first video frame and the second video frame respectively, forms the first set of keypoints and the second set of keypoints;Based on the corresponding relationship between key point in second set of keypoints and first set of keypoints, smoothing processing is executed to the key point in second set of keypoints, obtains third set of keypoints;The key point being based respectively in first set of keypoints and the third set of keypoints executes the image beautification operation for target object head zone to first video frame and second video frame.By the processing scheme of the disclosure, landscaping treatment can be executed to the image of head zone present in video.

Description

Video beautification method, device and electronic equipment
Technical field
This disclosure relates to technical field of image processing more particularly to a kind of video beautification method, device and electronic equipment.
Background technique
Image procossing (image processing) is also known as image processing, is needed for being reached with computer to image As a result technology.Originating from the 1920s, generally Digital Image Processing.The main contents of image processing techniques include figure As compression, enhancing restore, matching description identification 3 parts, common processing have image digitazation, image coding, image enhancement, Image restoration, image segmentation and image analysis etc..Image procossing is to be processed image information to meet people using computer Visual psychology or application demand behavior, be widely used, be chiefly used in mapping science, atmospheric science, astronomy, U.S. figure, make figure As improving identification etc..
Universal with smart phone, the video of the shooting of mobile phone is also more and more, but due to the preset lens of smart phone Head can only be held during taking pictures or using closely taking pictures, take the number of people large percentage in the video come, generate photograph The inaesthetic problem of the people of piece.
Summary of the invention
In view of this, the embodiment of the present disclosure provides a kind of video beautification method, device and electronic equipment, at least partly solve Problems of the prior art.
In a first aspect, the embodiment of the present disclosure provides a kind of video beautification method, comprising:
The first video frame and the second video frame adjacent in target video are obtained, first video frame is in target video Earlier than second video frame on time dimension;
The critical point detection for being directed to target object is executed to the first video frame and the second video frame respectively, it is crucial to form first Point set and the second set of keypoints;
Based on the corresponding relationship between key point in second set of keypoints and first set of keypoints, to institute The key point stated in the second set of keypoints executes smoothing processing, obtains third set of keypoints;
The key point being based respectively in first set of keypoints and the third set of keypoints, to first view Frequency frame and second video frame execute the image for target object head zone and beautify operation, formed the first beautifying picture and The video frame of second beautifying picture, first beautifying picture and the second beautifying picture to constitute beautification video.
It is described to first video frame and second video according to a kind of specific implementation of the embodiment of the present disclosure After frame executes the image beautification operation for target object head zone, the method also includes:
Obtain the third video frame adjacent with second video frame;
Critical point detection is carried out to the third video frame, forms the 4th set of keypoints;
Based on the third set of keypoints and the 4th set of keypoints, image beauty is executed to the third video frame Change operation, forms third beautifying picture;
Using the third beautifying picture as the video frame of the beautification video.
It is described based on second set of keypoints and described the according to a kind of specific implementation of the embodiment of the present disclosure Corresponding relationship in one set of keypoints between key point executes smooth place to the key point in second set of keypoints Reason, comprising:
It obtains in the coordinate (x1, y1) and the second set of keypoints of the first key point in the first set of keypoints The coordinate (x2, y2) of second key point, second key point are corresponding with first key point;
Based on pre-set smoothing factor L, coordinate after calculating the second key point smoothing processing (x2 ', y2 '), wherein
X2 '=x1*L+x2* (1-L)
Y2 '=y1*L+y2* (1-L).
It is described that the first video frame and the second video frame are held respectively according to a kind of specific implementation of the embodiment of the present disclosure Critical point detection of the hand-manipulating of needle to target object, comprising:
Pass is executed to the head zone and head adjacent area of target object in the first video frame and the second video frame respectively The detection of key point, obtains multiple header key points and multiple head adjacent area key points.
It is described that the first video frame and the second video frame are held respectively according to a kind of specific implementation of the embodiment of the present disclosure After the hand-manipulating of needle is to the critical point detection of target object, the method also includes:
Based on the header key point, determine that the center point coordinate of head zone and head indicate region.
It is described to first video frame and second video according to a kind of specific implementation of the embodiment of the present disclosure Frame executes the image beautification operation for target object head zone, comprising:
Respectively in the first video frame and the second video frame, using the deformation parameter for head zone got, with Centered on the center point coordinate, the image in region, which executes deformation operation, to be indicated to the head, forms leading edge deformation image.
It is described to first video frame and second video according to a kind of specific implementation of the embodiment of the present disclosure Frame executes the image beautification operation for target object head zone, further includes:
Respectively in the first video frame and the second video frame, closed using the center point coordinate and the head adjacent area The head adjacent area of the leading edge deformation image and the target object is carried out matching setting, obtains target object by key point Beautifying picture.
It is described to target in the first video frame and the second video frame according to a kind of specific implementation of the embodiment of the present disclosure The head zone and head adjacent area of object execute critical point detection, comprising:
Respectively in the first video frame and the second video frame, the gray level image of the head zone is obtained;
It obtains in a local small neighbourhood of any pixel point gc in the gray level image, using gc as center pixel, with r For p equally distributed pixel collection gp of radius;
Using the difference between each pixel in central pixel point gc and pixel collection gp, around pixel gc P equally distributed pixels carry out binary conversion treatment;
Based on the head zone image after binary conversion treatment, critical point detection is executed to the head zone of target object.
Second aspect, the embodiment of the present disclosure provide a kind of video beautifying apparatus, comprising:
Module is obtained, for obtaining the first video frame and the second video frame adjacent in target video, first video Frame is on the time dimension of target video earlier than second video frame;
Detection module, for executing the key point inspection for target object to the first video frame and the second video frame respectively It surveys, forms the first set of keypoints and the second set of keypoints;
Leveling Block, for based between key point in second set of keypoints and first set of keypoints Corresponding relationship executes smoothing processing to the key point in second set of keypoints, obtains third set of keypoints;
Execution module, the key for being based respectively in first set of keypoints and the third set of keypoints Point executes the image beautification operation for target object head zone, shape to first video frame and second video frame At the first beautifying picture and the second beautifying picture, first beautifying picture and the second beautifying picture are to constitute beautification video Video frame.
The third aspect, the embodiment of the present disclosure additionally provide a kind of electronic equipment, which includes:
At least one processor;And
The memory being connect at least one processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one processor, and the instruction is by least one processor It executes, so that at least one processor is able to carry out the view in any implementation of aforementioned first aspect or first aspect Frequency beautification method.
Fourth aspect, the embodiment of the present disclosure additionally provide a kind of non-transient computer readable storage medium, the non-transient meter Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction is for making the computer execute aforementioned first aspect or the In any implementation of one side based on human body key point image shaping method.
5th aspect, the embodiment of the present disclosure additionally provide a kind of computer program product, which includes The calculation procedure being stored in non-transient computer readable storage medium, the computer program include program instruction, when the program Instruction is when being computer-executed, make the computer execute in aforementioned first aspect or any implementation of first aspect based on Human body key point image shaping method.
In the embodiment of the present disclosure based on human body key point image body beautification scheme, including respectively to target pair on target image The head zone and head adjacent area of elephant execute critical point detection, obtain multiple header key points and multiple head adjacent areas Key point;Based on the header key point, determine that the center point coordinate of head zone and head indicate region;Utilize what is got For the deformation parameter of head zone, centered on the center point coordinate, the image in region, which executes change, to be indicated to the head Shape operation, forms leading edge deformation image;Using the center point coordinate and the head adjacent area key point, by the head The head adjacent area of deformation pattern and the target object carries out matching setting, obtains the beautifying picture of target object.Pass through The scheme of the disclosure solves the problems, such as the head portrait that human body head and stature eurythmy and front camera are taken pictures in image Beautification problem.
Detailed description of the invention
It, below will be to needed in the embodiment attached in order to illustrate more clearly of the technical solution of the embodiment of the present disclosure Figure is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present disclosure, for this field For those of ordinary skill, without creative efforts, it can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is that a kind of video that the embodiment of the present disclosure provides beautifies flow diagram;
Fig. 2 is that another video that the embodiment of the present disclosure provides beautifies flow diagram;
Fig. 3 is that another video that the embodiment of the present disclosure provides beautifies flow diagram;
Fig. 4 is that another video that the embodiment of the present disclosure provides beautifies flow diagram;
Fig. 5 is a kind of video beautifying apparatus structural schematic diagram that the embodiment of the present disclosure provides;
Fig. 6 is the electronic equipment schematic diagram that the embodiment of the present disclosure provides.
Specific embodiment
The embodiment of the present disclosure is described in detail with reference to the accompanying drawing.
Illustrate embodiment of the present disclosure below by way of specific specific example, those skilled in the art can be by this specification Disclosed content understands other advantages and effect of the disclosure easily.Obviously, described embodiment is only the disclosure A part of the embodiment, instead of all the embodiments.The disclosure can also be subject to reality by way of a different and different embodiment It applies or applies, the various details in this specification can also be based on different viewpoints and application, in the spirit without departing from the disclosure Lower carry out various modifications or alterations.It should be noted that in the absence of conflict, the feature in following embodiment and embodiment can To be combined with each other.Based on the embodiment in the disclosure, those of ordinary skill in the art are without creative efforts Every other embodiment obtained belongs to the range of disclosure protection.
It should be noted that the various aspects of embodiment within the scope of the appended claims are described below.Ying Xian And be clear to, aspect described herein can be embodied in extensive diversified forms, and any specific structure described herein And/or function is only illustrative.Based on the disclosure, it will be understood by one of ordinary skill in the art that one described herein Aspect can be independently implemented with any other aspect, and can combine the two or both in these aspects or more in various ways. For example, carry out facilities and equipments in terms of any number set forth herein can be used and/or practice method.In addition, can make With other than one or more of aspect set forth herein other structures and/or it is functional implement this equipment and/or Practice the method.
It should also be noted that, diagram provided in following embodiment only illustrates the basic structure of the disclosure in a schematic way Think, component count, shape and the size when only display is with component related in the disclosure rather than according to actual implementation in schema are drawn System, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its assembly layout kenel can also It can be increasingly complex.
In addition, in the following description, specific details are provided for a thorough understanding of the examples.However, fields The skilled person will understand that the aspect can be practiced without these specific details.
The embodiment of the present disclosure provides a kind of video beautification method.Video beautification method provided in this embodiment can be by a meter Device is calculated to execute, which can be implemented as software, or be embodied as the combination of software and hardware, which can To be integrally disposed in server, terminal device etc..
Referring to Fig. 1, a kind of video beautification method of embodiment of the present disclosure offer, comprising:
S101 obtains the first video frame and the second video frame adjacent in target video, and first video frame is in target Earlier than second video frame on the time dimension of video.
Target video is the video for needing to carry out landscaping treatment, and target video can be to be shot by equipment such as smart phones The video of acquisition, is also possible to the video obtained by other means, and target video is made of multiple video frames.
It include target object in target video, generally, target object can be people, for example, user passes through mobile phone etc. Equipment has taken the video comprising personage, and the personage in video just constitutes target object.Target object is in addition to can be Except people, the other kinds of object such as animal can also be.
Target object shows head zone and head adjacent area on target video.For example, user passes through mobile phone certainly Take obtains a photo, then the organs such as face, ear, nose, hair, mouth, eyes of personage together constitute mesh in photo Mark the head zone of object.The regions such as neck, the shoulder adjacent with head part collectively form head adjacent area.
After obtaining target video, the first adjacent video frame can be obtained by extracting the video frame in target video With the second video frame, the first video frame and the second video frame can be two video frames of arbitrary neighborhood in target video.
S102 executes the critical point detection for being directed to target object to the first video frame and the second video frame respectively, forms the One set of keypoints and the second set of keypoints.
After obtaining the first video frame and the second video frame, it can be directed to the head of the first video frame and the second video frame respectively Portion region and head adjacent area execute critical point detection, and then obtain multiple header key points and multiple head adjacent areas pass Key point.Such as CPM (Convolutional Pose can be used to the keyword detection of head zone and head adjacent area Machine, convolution gesture detector), the modes such as PAF (Part Affinity Fields, position detection method that part is affine) Come carry out.The detection method of key point is not construed as limiting herein.
By carrying out critical point detection to the first video frame, the first set of keypoints can be obtained, by the second video Frame carries out critical point detection, can obtain the second set of keypoints.
S103, based on the corresponding pass between second set of keypoints and key point in first set of keypoints System executes smoothing processing to the key point in second set of keypoints, obtains third set of keypoints.
Key point in first video frame and the second video frame will lead to the first video frame and second during detection Shake is generated between the key point at the same position in video frame, these shakes influence whether smooth between adjacent key frame Property.
For this reason, it may be necessary to be smoothed to the key point in adjacent the first video frame and the second video frame, to disappear Except the key point of shake.
Specifically, the coordinate (x1, y1) of the first key point in available first set of keypoints and the second key The coordinate (x2, y2) of the second key point in point set, the second key point and the first key point are the same portion on target object The key point of position.Followed by pre-set smoothing factor L, coordinate after calculating the second key point smoothing processing (x2 ', Y2 '), L is the parameter between 0 and 1, pass through following formula:
X2 '=x1*L+x2* (1-L)
Y2 '=y1*L+y2* (1-L)
Coordinate (x2 ', y2 ') after the smoothing processing of the second key point can be calculated.It in this way, can be to second Key point all in the second set of keypoints is smoothed in video frame, is formed after smoothing processing in the second video frame New set of keypoints constitutes third set of keypoints.
S104, the key point being based respectively in first set of keypoints and the third set of keypoints, to described First video frame and second video frame execute the image beautification operation for target object head zone, form the first beautification The video frame of image and the second beautifying picture, first beautifying picture and the second beautifying picture to constitute beautification video.
Head zone is during forming video frame on target video, it will usually due to shooting angle etc., cause The area of head zone is bigger compared with the area at other positions of body, to affect the overall beautiful of target object, is This can adjust display of the target object on target image by way of deforming to head zone, to reach beauty The effect of change.
Before carrying out deformation, the deformation parameter of head zone can be further obtained, deformation parameter illustrates enemy The scaling in portion region indicates to execute head zone 0.9 times of scaling processing for example, deformation parameter can be 0.9.
Deformation parameter can obtain in several ways, and as a kind of mode, deformation parameter can be according to user corresponding Interactive interface on the value that inputs determine.Alternatively, alternatively mode, deformation parameter can also be by calculating mesh automatically The ratio of object body various pieces on targeted graphical is marked to be calculated automatically from.
After obtaining deformation parameter, deformation can be carried out to this head zone.For example, can by head zone boundary to The center position on head carries out compressive deformation.During carrying out deformation to head zone, the image of head zone will lead to Gap is generated between the adjacent area of head due to deformation, the head zone and head adjacent area after leading to deformation can not Preferably fit together.
For this purpose, can be according to the distance between the center point coordinate of head zone and key point of head adjacent region, to count Calculate the gap lengths that head zone is generated due to deformation.For example, the distance of head center point coordinate and head adjacent region is a, Deformation coefficient is b, then after the image of head zone completes deformation, a* can be generated between head zone and head adjacent region The gap of (1-b), at this point it is possible to come in such a way that the gap area of a* (1-b) fills head adjacent area color-values At the matching of leading edge deformation image and the head adjacent area of the target object, and then obtain the beautifying picture of target object.
So, deformation and matching operation are executed by being directed to the first video frame and the second video frame respectively, just obtained The view of first beautifying picture and the second beautifying picture, first beautifying picture and the second beautifying picture to constitute beautification video Frequency frame.
By the above-mentioned means, can beautify to the video frame in target video, to improve target in video frame The landscaping effect of object.
Referring to fig. 2, described to first video frame and described according to a kind of specific implementation of the embodiment of the present disclosure After second video frame executes the image beautification operation for target object head zone, the method also includes:
S201 obtains the third video frame adjacent with second video frame.
It is similar with the first video frame of acquisition and the second video frame, in order to further be carried out to video frame all in video Effect beautification, can further obtain the third video frame adjacent with the second video frame, third video frame is in target video It is later than the second video frame on time dimension.
S202 carries out critical point detection to the third video frame, forms the 4th set of keypoints.
After obtaining third video frame, can head zone to third video frame and head adjacent area execute key point Detection, and then obtain multiple header key points and multiple head adjacent area key points.To head zone and head adjacent area Keyword detection can use such as CPM (Convolutional Pose Machine, convolution gesture detector), PAF Modes such as (Part Affinity Fields, part affine position detection method) carry out.Herein for the detection of key point Method is not construed as limiting.
S203 is based on the third set of keypoints and the 4th set of keypoints, executes to the third video frame Image beautification operation, forms third beautifying picture.
The beautification operating procedure similar with step S103-S104 can be used herein, pass through third set of keypoints pair After 4th key point combines execution smoothing processing, the set of keypoints after using smoothing processing executes image to third video frame Beautification operation, forms third beautifying picture.
S204, using the third beautifying picture as the video frame of the beautification video.
By the processing mode in step S201-S204, what can be continued executes image to the video frame in target video Beautification operation.
It is described to be based on second set of keypoints according to a kind of specific implementation of the embodiment of the present disclosure referring to Fig. 3 With the corresponding relationship in first set of keypoints between key point, the key point in second set of keypoints is executed Smoothing processing, comprising:
S301 obtains the coordinate (x1, y1) and the second set of keypoints of the first key point in the first set of keypoints In the second key point coordinate (x2, y2), second key point is corresponding with first key point;
S302 is based on pre-set smoothing factor L, the coordinate (x2 ', y2 ') after calculating the second key point smoothing processing.
Specifically, formula x2 '=x1*L+x2* (1-L) can be used, y2 '=y1*L+y2* (1-L) calculates calculating the Coordinate (x2 ', y2 ') after two key point smoothing processings.
According to a kind of specific implementation of the embodiment of the present disclosure, the first video frame and the second video frame are being executed respectively For target object critical point detection during, can be respectively to target object in the first video frame and the second video frame Head zone and head adjacent area execute critical point detection, obtain multiple header key points and multiple head adjacent areas are crucial Point.
According to a kind of specific implementation of the embodiment of the present disclosure, the first video frame and the second video frame are being executed respectively After the critical point detection of target object, it is also based on the header key point, determines that the central point of head zone is sat Mark and head indicate region.Header key point, which can be, contains the crucial point set of multiple organ characteristics such as eyes, nose, ear It closes, header key point obtained by calculation can determine the center point coordinate of head zone.Specifically, available head The coordinate position of key point calculates the central point on head, such as the key head using these key point coordinate informations Point coordinate carries out average computation, or is weighted and averaged to key point coordinate.Other similar fashions can also be taken To calculate the center point coordinate of head zone.After the center point coordinate for obtaining head zone, the center point coordinate can be based on Respective image processing is executed to be directed to head zone.Other than calculating the center point coordinate of head zone, this can also be utilized A little key point coordinate informations calculate the size on head, for example obtaining a smallest rectangle using header key point coordinate can These key points are made all in this rectangle inside, to obtain the longest edge of this rectangle then multiplied by a coefficient, can be evaluated whether The size on head out, and then head expression region is obtained based on the rectangle.Head indicates that region can be used to describe the big of head Cause region.Certainly, according to the actual needs, other than describing head using rectangle and indicating region, can also using it is round, Other figures such as ellipse.
According to a kind of specific implementation of the embodiment of the present disclosure, first video frame and second video frame are held The hand-manipulating of needle beautifies operation to the image of target object head zone, can utilize respectively in the first video frame and the second video frame The deformation parameter for head zone got indicates the head figure in region centered on the center point coordinate As executing deformation operation, leading edge deformation image is formed.
It is described to first video frame and second video according to a kind of specific implementation of the embodiment of the present disclosure Frame executes the image beautification operation for target object head zone, further includes: respectively in the first video frame and the second video frame On, using the center point coordinate and the head adjacent area key point, by the leading edge deformation image and the target pair The head adjacent area of elephant carries out matching setting, obtains the beautifying picture of target object.
Referring to fig. 4, described to the first video frame and the second video according to a kind of specific implementation of the embodiment of the present disclosure The head zone of target object and head adjacent area execute critical point detection on frame, comprising:
S401 obtains the gray level image of the head zone respectively in the first video frame and the second video frame.
In order to facilitate critical point detection is executed, the first video frame and the second video frame can be converted into gray level image, led to Gray level image is crossed to calculate the key point of head zone and head adjacent area.It can be obtained on gray level image after conversion thus Take the gray level image of head zone.
S402 is obtained in a local small neighbourhood of any pixel point gc in the gray level image, using gc as center pixel Point, using r as the p of radius equally distributed pixel collection gp.
R can be configured according to the actual needs, for example, r can be several pixel values.
S403, using the difference between each pixel in central pixel point gc and pixel collection gp, to pixel gc P equally distributed pixels of surrounding carry out binary conversion treatments.
Specifically, when the difference in central pixel point gc and pixel collection gp between any pixel point is greater than 0, it can be with Pixel value two-value in the pixel collection is turned to 0, conversely, being then 1 by its binaryzation.By carrying out binaryzation to pixel Processing, can be improved the computational efficiency of key point.
S404 executes key point inspection to the head zone of target object based on the head zone image after binary conversion treatment It surveys.
Specifically, ring shift right operation can be executed to the string of binary characters of the head zone image after binaryzation, obtain To the multiple groups invariable rotary feature L of head area image.For every group of invariable rotary feature L, radius is set as r's in target point Interest range calculates the contribution margin of each target pointEach target point is calculated on multiple and different directions Feature T determines the key point of head zone based on feature T.
For example, the weighted sum on 8 direction Di (i=1,2 ..., 8) can be calculated to each target point, obtain i-th The feature Ti of target point, wherein Ti=L*w (r).It, can be with by comparing the size between the feature Ti and preset value of target point Determine whether the target point is key point.
Corresponding with above method embodiment, referring to Fig. 5, the disclosure additionally provides a kind of video beautifying apparatus 50, packet It includes:
Module 501 is obtained, for obtaining the first video frame and the second video frame adjacent in target video, first view Frequency frame is on the time dimension of target video earlier than second video frame;
Detection module 502, for executing the key point for being directed to target object to the first video frame and the second video frame respectively Detection forms the first set of keypoints and the second set of keypoints;
Leveling Block 503, for based on key point in second set of keypoints and first set of keypoints it Between corresponding relationship, in second set of keypoints key point execute smoothing processing, obtain third set of keypoints;
Execution module 504, the pass for being based respectively in first set of keypoints and the third set of keypoints Key point executes the image beautification operation for target object head zone to first video frame and second video frame, The first beautifying picture and the second beautifying picture are formed, first beautifying picture and the second beautifying picture are to constitute beautification video Video frame.
Fig. 5 shown device can it is corresponding execute above method embodiment in content, what the present embodiment was not described in detail Part, referring to the content recorded in above method embodiment, details are not described herein.
Referring to Fig. 6, the embodiment of the present disclosure additionally provides a kind of electronic equipment 60, which includes:
At least one processor;And
The memory being connect at least one processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one processor, and the instruction is by least one processor It executes, so that at least one processor is able to carry out video beautification method in preceding method embodiment.
The embodiment of the present disclosure additionally provides a kind of non-transient computer readable storage medium, and the non-transient computer is readable to deposit Storage media stores computer instruction, and the computer instruction is for executing the computer in preceding method embodiment.
The embodiment of the present disclosure additionally provides a kind of computer program product, and the computer program product is non-temporary including being stored in Calculation procedure on state computer readable storage medium, the computer program include program instruction, when the program instruction is calculated When machine executes, the computer is made to execute the video beautification method in preceding method embodiment.
Below with reference to Fig. 6, it illustrates the structural schematic diagrams for the electronic equipment 60 for being suitable for being used to realize the embodiment of the present disclosure. Electronic equipment in the embodiment of the present disclosure can include but is not limited to such as mobile phone, laptop, Digital Broadcasting Receiver Device, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal are (such as vehicle-mounted Navigation terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electronics shown in Fig. 6 Equipment is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in fig. 6, electronic equipment 60 may include processing unit (such as central processing unit, graphics processor etc.) 601, It can be loaded into random access storage according to the program being stored in read-only memory (ROM) 602 or from storage device 608 Program in device (RAM) 603 and execute various movements appropriate and processing.In RAM 603, it is also stored with the behaviour of electronic equipment 60 Various programs and data needed for making.Processing unit 601, ROM 602 and RAM 603 are connected with each other by bus 604.It is defeated Enter/export (I/O) interface 605 and is also connected to bus 604.
In general, following device can connect to I/O interface 605: including such as touch screen, touch tablet, keyboard, mouse, figure As the input unit 606 of sensor, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaking The output device 607 of device, vibrator etc.;Storage device 608 including such as tape, hard disk etc.;And communication device 609.It is logical T unit 609 can permit electronic equipment 60 and wirelessly or non-wirelessly be communicated with other equipment to exchange data.Although showing in figure The electronic equipment 60 with various devices is gone out, it should be understood that being not required for implementing or having all devices shown. It can alternatively implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 609, or from storage device 608 It is mounted, or is mounted from ROM 602.When the computer program is executed by processing unit 601, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
It should be appreciated that each section of the disclosure can be realized with hardware, software, firmware or their combination.
The above, the only specific embodiment of the disclosure, but the protection scope of the disclosure is not limited thereto, it is any Those familiar with the art is in the technical scope that the disclosure discloses, and any changes or substitutions that can be easily thought of, all answers Cover within the protection scope of the disclosure.Therefore, the protection scope of the disclosure should be subject to the protection scope in claims.

Claims (11)

1. a kind of video beautification method characterized by comprising
Obtain the first video frame and the second video frame adjacent in target video, time of first video frame in target video Earlier than second video frame in dimension;
The critical point detection for being directed to target object is executed to the first video frame and the second video frame respectively, forms the first crucial point set It closes and the second set of keypoints;
Based on the corresponding relationship between key point in second set of keypoints and first set of keypoints, to described Key point in two set of keypoints executes smoothing processing, obtains third set of keypoints;
The key point being based respectively in first set of keypoints and the third set of keypoints, to first video frame The image beautification operation for target object head zone is executed with second video frame, forms the first beautifying picture and second The video frame of beautifying picture, first beautifying picture and the second beautifying picture to constitute beautification video.
2. the method according to claim 1, wherein described to first video frame and second video frame After executing the image beautification operation for target object head zone, the method also includes:
Obtain the third video frame adjacent with second video frame;
Critical point detection is carried out to the third video frame, forms the 4th set of keypoints;
Based on the third set of keypoints and the 4th set of keypoints, image beautification behaviour is executed to the third video frame Make, forms third beautifying picture;
Using the third beautifying picture as the video frame of the beautification video.
3. the method according to claim 1, wherein described be based on second set of keypoints and described first Corresponding relationship in set of keypoints between key point executes smoothing processing to the key point in second set of keypoints, Include:
Obtain second in the coordinate (x1, y1) and the second set of keypoints of the first key point in the first set of keypoints The coordinate (x2, y2) of key point, second key point are corresponding with first key point;
Based on pre-set smoothing factor L, coordinate after calculating the second key point smoothing processing (x2 ', y2 '), wherein
X2 '=x1*L+x2* (1-L)
Y2 '=y1*L+y2* (1-L).
4. the method according to claim 1, wherein described respectively execute the first video frame and the second video frame For the critical point detection of target object, comprising:
The head zone to target object in the first video frame and the second video frame and head adjacent area execute key point respectively Detection, obtains multiple header key points and multiple head adjacent area key points.
5. according to the method described in claim 4, it is characterized in that, described respectively execute the first video frame and the second video frame After the critical point detection of target object, the method also includes:
Based on the header key point, determine that the center point coordinate of head zone and head indicate region.
6. according to the method described in claim 5, it is characterized in that, described to first video frame and second video frame The image executed for target object head zone beautifies operation, comprising:
Respectively in the first video frame and the second video frame, using the deformation parameter for head zone got, with described Centered on center point coordinate, the image in region, which executes deformation operation, to be indicated to the head, forms leading edge deformation image.
7. according to the method described in claim 6, it is characterized in that, described to first video frame and second video frame The image executed for target object head zone beautifies operation, further includes:
It is crucial using the center point coordinate and the head adjacent area respectively in the first video frame and the second video frame The head adjacent area of the leading edge deformation image and the target object is carried out matching setting, obtains target object by point Beautifying picture.
8. according to the method described in claim 4, it is characterized in that, described to target pair in the first video frame and the second video frame The head zone and head adjacent area of elephant execute critical point detection, comprising:
Respectively in the first video frame and the second video frame, the gray level image of the head zone is obtained;
It obtains in a local small neighbourhood of any pixel point gc in the gray level image, is half with r using gc as center pixel P equally distributed pixel collection gp of diameter;
Using the difference between each pixel in central pixel point gc and pixel collection gp, to p around pixel gc Equally distributed pixel carries out binary conversion treatment;
Based on the head zone image after binary conversion treatment, critical point detection is executed to the head zone of target object.
9. a kind of video beautifying apparatus characterized by comprising
Module is obtained, for obtaining the first video frame and the second video frame adjacent in target video, first video frame exists Earlier than second video frame on the time dimension of target video;
Detection module, for executing the critical point detection for being directed to target object, shape to the first video frame and the second video frame respectively At the first set of keypoints and the second set of keypoints;
Leveling Block, for based on corresponding between second set of keypoints and key point in first set of keypoints Relationship executes smoothing processing to the key point in second set of keypoints, obtains third set of keypoints;
Execution module, the key point for being based respectively in first set of keypoints and the third set of keypoints are right First video frame and second video frame execute the image beautification operation for target object head zone, form first The video of beautifying picture and the second beautifying picture, first beautifying picture and the second beautifying picture to constitute beautification video Frame.
10. a kind of electronic equipment, which is characterized in that the electronic equipment includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one It manages device to execute, so that at least one described processor is able to carry out described in aforementioned any claim 1-8 based on human body key Point image microcephaly's beautification method.
11. a kind of non-transient computer readable storage medium, which stores computer instruction, The computer instruction is for making the computer execute video beautification method described in aforementioned any claim 1-8.
CN201910580711.3A 2019-06-29 2019-06-29 Video beautification method, device and electronic equipment Pending CN110288552A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910580711.3A CN110288552A (en) 2019-06-29 2019-06-29 Video beautification method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910580711.3A CN110288552A (en) 2019-06-29 2019-06-29 Video beautification method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN110288552A true CN110288552A (en) 2019-09-27

Family

ID=68020187

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910580711.3A Pending CN110288552A (en) 2019-06-29 2019-06-29 Video beautification method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110288552A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402116A (en) * 2020-03-11 2020-07-10 北京字节跳动网络技术有限公司 Method and device for processing human waist body beautification in picture and electronic equipment
CN111753685A (en) * 2020-06-12 2020-10-09 北京字节跳动网络技术有限公司 Method and device for adjusting human face hairline in image and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446781A (en) * 2016-08-29 2017-02-22 厦门美图之家科技有限公司 Face image processing method and face image processing device
CN107704829A (en) * 2017-10-09 2018-02-16 武汉斗鱼网络科技有限公司 A kind of face key point method for tracing and application and device
CN109903217A (en) * 2019-01-25 2019-06-18 北京百度网讯科技有限公司 Image distortion method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106446781A (en) * 2016-08-29 2017-02-22 厦门美图之家科技有限公司 Face image processing method and face image processing device
CN107704829A (en) * 2017-10-09 2018-02-16 武汉斗鱼网络科技有限公司 A kind of face key point method for tracing and application and device
CN109903217A (en) * 2019-01-25 2019-06-18 北京百度网讯科技有限公司 Image distortion method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111402116A (en) * 2020-03-11 2020-07-10 北京字节跳动网络技术有限公司 Method and device for processing human waist body beautification in picture and electronic equipment
CN111753685A (en) * 2020-06-12 2020-10-09 北京字节跳动网络技术有限公司 Method and device for adjusting human face hairline in image and electronic equipment
CN111753685B (en) * 2020-06-12 2024-01-12 北京字节跳动网络技术有限公司 Method and device for adjusting facial hairline in image and electronic equipment

Similar Documents

Publication Publication Date Title
CN110298785A (en) Image beautification method, device and electronic equipment
CN110766777B (en) Method and device for generating virtual image, electronic equipment and storage medium
CN110288551A (en) Video beautification method, device and electronic equipment
CN110288553A (en) Image beautification method, device and electronic equipment
CN110288520A (en) Image beautification method, device and electronic equipment
CN110288519A (en) Image beautification method, device and electronic equipment
CN110222726A (en) Image processing method, device and electronic equipment
CN110287891A (en) Gestural control method, device and electronic equipment based on human body key point
CN110288521A (en) Image beautification method, device and electronic equipment
CN109754464A (en) Method and apparatus for generating information
CN110378947A (en) 3D model reconstruction method, device and electronic equipment
CN110070585A (en) Image generating method, device and computer readable storage medium
CN110069974A (en) Bloom image processing method, device and electronic equipment
CN110070555A (en) Image processing method, device, hardware device
CN110062157A (en) Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110070495A (en) Processing method, device and the electronic equipment of image
CN110288552A (en) Video beautification method, device and electronic equipment
CN110264431A (en) Video beautification method, device and electronic equipment
CN110310293A (en) Human body image dividing method and equipment
WO2020077912A1 (en) Image processing method, device, and hardware device
CN110264430A (en) Video beautification method, device and electronic equipment
WO2021057463A1 (en) Image stylization processing method and apparatus, and electronic device and readable medium
CN109635821A (en) Feature extracting method, device, equipment and the readable medium of image-region
CN116681765A (en) Method for determining identification position in image, method for training model, device and equipment
CN110069195A (en) Image pulls deformation 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