[go: up one dir, main page]

CN110264430B - Video beautifying method and device and electronic equipment - Google Patents

Video beautifying method and device and electronic equipment Download PDF

Info

Publication number
CN110264430B
CN110264430B CN201910580699.6A CN201910580699A CN110264430B CN 110264430 B CN110264430 B CN 110264430B CN 201910580699 A CN201910580699 A CN 201910580699A CN 110264430 B CN110264430 B CN 110264430B
Authority
CN
China
Prior art keywords
video frame
key point
leg
video
target object
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.)
Active
Application number
CN201910580699.6A
Other languages
Chinese (zh)
Other versions
CN110264430A (en
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 CN201910580699.6A priority Critical patent/CN110264430B/en
Publication of CN110264430A publication Critical patent/CN110264430A/en
Application granted granted Critical
Publication of CN110264430B publication Critical patent/CN110264430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the disclosure provides a video beautifying method, a video beautifying device and electronic equipment, belonging to the technical field of image processing, wherein the method comprises the following steps: acquiring a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, wherein the first video frame is earlier than the second video frame in the time dimension of the target video; respectively executing key point detection aiming at a target object on a first video frame and a second video frame, and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame; determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint; and performing smooth beautification processing on leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters. Through the processing scheme disclosed by the invention, the beautifying effect of the video is improved.

Description

Video beautifying method and device and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a video beautification method and apparatus, and an electronic device.
Background
Image processing (image processing), also called video processing, is a technique for achieving a desired result in an image by a computer. Since the 20 th century, digital image processing was common. The main contents of the image processing technology include image compression, enhancement restoration, and matching description identification 3 parts, and common processes include image digitization, image coding, image enhancement, image restoration, image segmentation, image analysis, and the like. The image processing is to process the image information by using a computer to meet the visual psychology of people or the behavior of application requirements, has wide application, and is mainly used for mapping, atmospheric science, astronomy, beautifying, image identification improvement and the like.
With the popularization of smart phones, the use of mobile phones for photographing is increasing, and in the process of photographing by using the mobile phones, due to various reasons such as photographing angles, the problem that the proportion of the body of a photo formed by people in photographing cannot meet the expected value of a user exists.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide a method, an apparatus, and an electronic device for beautifying a video, which at least partially solve the problems in the prior art.
In a first aspect, an embodiment of the present disclosure provides a video beautification method, including:
acquiring a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, wherein the first video frame is earlier than the second video frame in the time dimension of the target video;
respectively executing key point detection aiming at a target object on a first video frame and a second video frame, and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame;
determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint;
and performing smooth beautification processing on leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters.
According to a specific implementation manner of the embodiment of the present disclosure, after the smooth beautification processing is performed on the leg representation area of the target object on the first video frame and the second video frame, the method further includes:
acquiring a third video frame adjacent to the second video frame;
performing key point detection on the third video frame to form a hip key point, a knee key point and an ankle key point of the third video frame;
and performing smooth beautification processing on leg representation areas of the target object on the second video frame and the third video frame by using the deformation parameters.
According to a specific implementation manner of the embodiment of the present disclosure, performing smooth beautification processing on leg representation areas of a target object on the first video frame and the second video frame by using the obtained deformation parameter includes:
obtaining coordinates (x1, y1) of a first keypoint on a first video frame, and coordinates (x2, y2) of a second keypoint on a second video frame, the second keypoint corresponding to the first keypoint;
calculating the coordinates (x2 ', y 2') after the smoothing of the second key point based on a preset smoothing coefficient L, wherein
x2’=x1*L+x2*(1-L)
y2’=y1*L+y2*(1-L)。
According to a specific implementation manner of the embodiment of the present disclosure, the acquiring a first video frame and a second video frame that need to be smoothed and beautified in a target video includes:
performing target detection for a target object in a target video;
taking a first video frame image containing the target object as the first video frame;
and taking a video frame image which is adjacent to the first video frame and contains the target object as the second video frame.
According to a specific implementation manner of the embodiment of the present disclosure, the performing of the keypoint detection for the target object on the first video frame and the second video frame respectively includes:
converting the first video frame and the second video frame into corresponding gray level images;
and performing key point detection aiming at the target object by using the converted gray level image.
According to a specific implementation manner of the embodiment of the present disclosure, the determining, based on the knee key point and the ankle key point, a leg representation area on the first video frame and the second video frame includes:
determining whether a leg of the target object is in a separated state based on the knee key point and the ankle key point;
determining a representation area of the target subject's leg based on the hip keypoint, the knee keypoint, and the ankle keypoint when the target subject's leg is in a spread state.
According to a specific implementation manner of the embodiment of the present disclosure, the determining leg representation areas on the first video frame and the second video frame based on the knee key point and the ankle key point further includes:
and when the legs of the target object are in a combined state, determining a leg representing area of the target object for executing the extrusion deformation operation in an area with a preset length by taking the central point of the hip part as a starting point.
According to a specific implementation manner of the embodiment of the present disclosure, the determining whether the leg of the target object is in the separated state based on the knee key point and the ankle key point includes:
acquiring a first distance between the detected key point of the left knee and the key point of the right knee;
acquiring a second distance between the detected key point of the left ankle and the key point of the right ankle;
judging whether the difference value between the second distance and the first distance is larger than a first threshold value;
and if so, judging that the legs of the target object are in a separated state.
In a second aspect, an embodiment of the present disclosure provides a video beautification device, including:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, and the first video frame is earlier than the second video frame in the time dimension of the target video;
the detection module is used for respectively executing key point detection aiming at a target object on a first video frame and a second video frame and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame;
a determination module to determine leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint;
and the beautifying module is used for performing smooth beautifying processing on the leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the video beautification method of any of the preceding first aspects or any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the video beautification method of the first aspect or any implementation manner of the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the video beautification method of the first aspect or any of the implementations of the first aspect.
The video beautification scheme in the embodiment of the disclosure comprises the steps of obtaining a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, wherein the first video frame is earlier than the second video frame in the time dimension of the target video; respectively executing key point detection aiming at a target object on a first video frame and a second video frame, and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame; determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint; and performing smooth beautification processing on leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters. Through the scheme disclosed by the invention, the beautifying effect of the target video is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic view of a video beautification process according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram of key points based on a human body according to an embodiment of the present disclosure;
FIG. 3 is a schematic view of another video beautification process provided by the embodiment of the present disclosure;
FIG. 4 is a schematic view of another video beautification process provided by the embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a video beautification apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the disclosure provides a video beautification method. The video beautification method provided by the embodiment can be executed by a computing device, the computing device can be implemented as software, or implemented as a combination of software and hardware, and the computing device can be integrally arranged in a server, a terminal device and the like.
Referring to fig. 1, a video beautification method provided by an embodiment of the present disclosure includes:
s101, a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video are obtained, and the first video frame is earlier than the second video frame in the time dimension of the target video.
The target video is a video which needs to be beautified, the target video can be a video obtained by shooting through equipment such as a smart phone and the like, and can also be a video obtained through other modes, and the target video is composed of a plurality of video frames.
The target video includes a target object, and generally, the target object may be a person, for example, a user takes a video including a person through a mobile phone or the like, and the person in the video constitutes the target object. The target object may be a human, an animal, or other types of objects. The target object is displayed with a hip region and a leg region on the first video frame and the second video frame.
After the target video is obtained, adjacent first and second video frames can be obtained by extracting video frames in the target video, and the first and second video frames can be any two adjacent video frames containing the target object in the target video.
S102, respectively executing key point detection aiming at a target object on a first video frame and a second video frame, and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame.
The target object is displayed with a hip region and a leg region on the first video frame and the second video frame. After the first video frame and the second video frame are formed, keypoint detection can be performed on the hip region and the leg region, so that a plurality of hip keypoints, knee keypoints and ankle keypoints are obtained. Referring to fig. 2, fig. 2 shows the human body key points including P1 to P19. The hip and leg keypoints may contain a set of keypoints of multiple keypoints, for example, the hip keypoints may include keypoints P12, P3, and P16, and the leg keypoints may include knee keypoints P13, P17, and ankle keypoints P14, P18. The key points may include a left key point and a right key point according to the position of the key point distribution.
The detection of the key points in the hip region and the leg region can be performed by methods such as CPM (Convolutional Pose detector), PAF (Part Affinity Fields), and the like. The method of detecting the key point is not limited herein.
S103, determining leg representation areas on the first video frame and the second video frame based on the knee key point and the ankle key point.
Because two legs of the leg part can be in a combined or opened state in the actual photographing process, when the leg part is in the combined state, corresponding beautifying operation can be directly carried out on the leg part image through one leg part representation area, and when the leg part is in a separated state, the beautifying operation needs to be respectively carried out on the two leg parts in the separated state.
As an alternative embodiment, referring to fig. 3, the step of determining whether the leg of the target object is in the separated state may include the steps of:
s301, a first distance between the detected key point of the left knee and the key point of the right knee is obtained.
By acquiring the coordinates of the left knee keypoint and the right knee keypoint, the distance d1 between the left knee keypoint and the right knee keypoint can be calculated as the first distance.
And S302, acquiring a second distance between the detected key point of the left ankle and the key point of the right ankle.
By acquiring coordinates of the left ankle key point and the right ankle key point, a distance d2 between the left ankle key point and the right ankle key point can be calculated as the second distance.
S303, judging whether the difference value between the second distance and the first distance is larger than a first threshold value.
Generally, the first distance and the second distance are relatively close in value when the legs of the target object are in the closed state, and a large difference occurs between the first distance and the second distance when the legs of the target object are in the spaced state. At this time, a first threshold value may be set, and whether the legs of the user are in the spaced-apart state may be determined by comparing whether the difference between the second distance and the first distance is greater than the first threshold value.
S304, if yes, the legs of the target object are judged to be in the separated state.
As another alternative embodiment, referring to fig. 4, the determining whether the leg of the target object is in the separated state may include the steps of:
s401, acquiring a third distance between the hip central point and the knee central point.
Specifically, the hip central point is obtained by calculating the average value of a plurality of hip key points. The knee center point is obtained by calculating the average of a plurality of knee keypoints. By acquiring the coordinates of the knee center point and the hip center point, a third distance d3 between the hip center point and the knee center point may be calculated as the third distance.
S402, acquiring a fourth distance from the hip left key point to the knee left key point.
By acquiring coordinates of the knee left key point and the hip left key point, a fourth distance d4 from the hip left key point to the knee left key point can be calculated as a fourth distance
And S403, judging whether the difference value between the third distance and the fourth distance is larger than a second threshold value.
When the leg of the target object is in the separated state, the fourth distance may be generally greater than the third distance, and at this time, a second threshold may be set, and whether the leg is in the separated state may be further determined by determining whether a difference between the third distance and the fourth distance is greater than the second threshold.
S404, if yes, the legs of the target object are judged to be in the separated state.
In addition to the above-described manner of determining whether or not the legs of the target object are in the separated state, other similar manners may be employed for the determination.
S103, when the legs of the target object are in a separated state, determining the representing area of the legs of the target object based on the hip key point, the knee key point and the ankle key point.
When the legs of the target object are in the separated state, the representation area needs to be individually set for each leg, thereby improving the accuracy of the leg representation area.
Taking the left leg as an example, referring to fig. 2, a hip left side key point P12 and a knee left side key point P13 may be respectively obtained, a rectangular region is disposed between P12 and P13, the length of the rectangular region is the distance between P12 and P13, and the width of the rectangular region is a preset value. In this way, the upper left leg half can be represented.
By acquiring the coordinates of the key points P13 and P14, the distance between the knee left key point and the ankle left key point can be obtained as the length of the rectangle representing the area of the lower half of the left leg, and by setting a preset width value to the rectangle, the representing area of the lower half of the left leg can be obtained.
The representation area of the left leg is obtained by merging the representation areas of the upper and lower halves of the left leg.
In a similar manner, the representation area setting may be made for the right leg of the target object. The representation area of the right leg and the representation area of the left leg constitute the representation area of the leg as a whole.
In addition to the rectangular shape to describe the leg representation area, other figures such as circular, oval and the like may be used according to actual needs.
And S104, performing smooth beautification processing on leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters.
In the process of forming images on the first video frame and the second video frame by the leg region, the area of the leg region is slightly larger than that of other parts of the body due to shooting angles and the like, or the area of the leg region is expected to be smaller than that of the actual leg region by a user, so that the aesthetic degree of the leg of the target object is improved, and therefore the display of the target object on the first video frame and the second video frame can be adjusted in a manner of deforming the leg region, and the beautifying effect is achieved.
Before the deformation is performed, a deformation parameter of the leg region may be further obtained, where the deformation parameter indicates a scaling ratio of the leg region, for example, the deformation parameter may be 0.9, which indicates that a scaling process of 0.9 times is performed on the leg region.
The deformation parameter may be obtained in various ways, and as one way, the deformation parameter may be determined according to a value input by a user on a corresponding interactive interface. Alternatively, the deformation parameters may be automatically calculated by automatically calculating the proportions of the target object to the respective body parts on the target graph.
In the process of detecting key points of video frames, the key points of target objects on different video frames have a shaking phenomenon, so that the video formed after leg deformation has a discontinuous phenomenon, and therefore, smoothing processing needs to be performed on the first video frame and the second video frame after deformation. Before the smoothing process is performed, different deformation parameters can be set on different video frames in advance. Specifically, the determining the deformation parameter may include the following steps:
first, the jitter parameters of the leg representing region and the leg center point in the first video frame and the second video frame, and the preset default deformation parameter L1 are obtained.
By calculating the offset distances c1, c2, and c3 of the contour, the leg-representing region, and the leg center point of the target object on the first video frame and the second video frame, respectively, the jitter parameter d can be determined, for example, d ═ c2+ c3)/2 × c 1. The jitter parameter d indicates the case where the key point is shifted over different video frames. The leg center point may be obtained by averaging a set of coordinates consisting of the hip key point, the knee key point, and the ankle key point.
The default morphing parameter L1 is a morphing parameter set in advance, and as a mode, the default morphing parameter L1 may be determined according to a value input by a user on the corresponding interactive interface. Alternatively, the default deformation parameter L1 may be calculated automatically by automatically calculating the proportions of the target object in the first video frame.
Next, the default morphing parameter L1 is used as the morphing parameter of the first video frame.
Since the first video frame is the starting video frame, the default deformation parameter L1 may be kept unchanged on the first video frame, and the deformation operation may be performed on the leg representation area of the first video frame based on the default deformation parameter L1.
Finally, based on the default deformation parameter L1 and the jitter parameter, a deformation parameter L2 at the second video frame is determined.
Specifically, the jitter parameter d may be normalized to obtain a normalized jitter parameter between 0 and 1, where the normalization is a common processing manner, and the normalization manner is not limited herein. Then, taking the product of the normalized jitter parameter and the default deformation parameter as the deformation parameter L2 of the second video frame, and performing a deformation operation on the leg portion representing region of the second video frame based on the deformation parameter L2 of the second video.
And S104, based on the deformation parameters, performing smooth beautification processing on leg areas of the target object on the first video frame and the second video frame.
In the process of forming images on the first video frame and the second video frame by the leg region, the area of the leg region is slightly larger than that of other parts of the body due to shooting angles and the like, or the area of the leg region is expected to be smaller than that of the actual leg region by a user, so that the aesthetic degree of the leg of the target object is improved, and therefore the display of the target object on the first video frame and the second video frame can be adjusted in a manner of deforming the leg region, and the beautifying effect is achieved.
Before the deformation is performed, a deformation parameter of the leg region may be further obtained, where the deformation parameter indicates a scaling ratio of the leg region, for example, the deformation parameter may be 0.9, which indicates that a scaling process of 0.9 times is performed on the leg region.
The deformation parameter may be obtained in various ways, and as one way, the deformation parameter may be determined according to a value input by a user on a corresponding interactive interface. Alternatively, the deformation parameters may be automatically calculated by automatically calculating the proportions of the target object to the respective body parts on the target graph.
After obtaining the deformation parameters, the leg region may be deformed. For example, the leg region boundary may be compression-deformed in the horizontal direction, thereby obtaining a beautified leg image.
In addition, smoothing processing may be performed on the keypoints on the first video frame and the second video frame, as an example, coordinates (x1, y1) of a first keypoint on the first video frame and coordinates (x2, y2) of a second keypoint on the second video frame, where the second keypoint corresponds to the first keypoint, and coordinates (x2 ', y 2') after smoothing processing of the second keypoint are calculated based on a preset smoothing coefficient L, where x2 '═ x1 ═ L + x2 × (1-L), y 2' ═ y1 × + y2 × (1-L). L is a value between 0 and 1.
Through the scheme in this application, can guarantee to carry out effectual deformation to target object's shank region to target object's whole pleasing to the eye degree on the video has been improved.
Referring to fig. 4, according to a specific implementation manner of the embodiment of the present disclosure, after performing smooth beautification processing on the leg portion representing area of the target object on the first video frame and the second video frame, the smooth beautification processing may be further performed on other video frames in the target video, and specifically, the method may include the following steps:
s401, acquiring a third video frame adjacent to the second video frame.
Similar to the obtaining of the first video frame and the second video frame, in order to further beautify the effect of all the video frames in the video, a third video frame adjacent to the second video frame may be further obtained, where the third video frame is later than the second video frame in the time dimension of the target video.
S402, carrying out key point detection on the third video frame to form a hip key point, a knee key point and an ankle key point of the third video frame.
After the third video frame is obtained, the detection of the key points of the hip and the leg of the third video frame can be performed, so that the hip key point, the knee key point and the ankle key point of the third video frame are obtained. The hip, knee, and ankle key points of the third video frame may be detected by a method such as CPM (Convolutional Pose detector), PAF (Part Affinity Fields, local Affinity detection method), and the like. The method of detecting the key points is not limited herein
And S403, performing smooth beautification processing on the leg representation areas of the target object on the second video frame and the third video frame by using the deformation parameters.
Here, a similar beautification operation step as in step S104 may be adopted, and after the smoothing processing is performed on the key points, an image beautification operation is performed on the third video frame by using the smoothed key points, so as to form a third beautified image.
As an optional implementation manner of the embodiment of the present disclosure, in a process of acquiring a first video frame and a second video frame that need to be subjected to smooth beautification processing in a target video, target detection for a target object may be performed in the target video, where a first video frame image containing the target object is taken as the first video frame, and a video frame image that is adjacent to the first video frame and contains the target object is taken as the second video frame.
As an optional implementation manner of the embodiment of the present disclosure, the performing, for the first video frame and the second video frame, the key point detection on the target object includes: converting the first video frame and the second video frame into corresponding gray level images; and performing key point detection aiming at the target object by using the converted gray level image.
As an optional implementation of the embodiments of the present disclosure, the determining, based on the knee keypoint and the ankle keypoint, a leg representation area on the first video frame and the second video frame includes: determining whether a leg of the target object is in a separated state based on the knee key point and the ankle key point; determining a representation area of the target subject's leg based on the hip keypoint, the knee keypoint, and the ankle keypoint when the target subject's leg is in a spread state.
As an optional implementation manner of the embodiment of the present disclosure, the determining, based on the knee key point and the ankle key point, a leg representation area on the first video frame and the second video frame further includes: and when the legs of the target object are in a combined state, determining a leg representing area of the target object for executing the extrusion deformation operation in an area with a preset length by taking the central point of the hip part as a starting point.
As an optional implementation manner of the embodiment of the present disclosure, the determining whether the leg of the target object is in the separated state based on the knee key point and the ankle key point includes: acquiring a first distance between the detected key point of the left knee and the key point of the right knee; acquiring a second distance between the detected key point of the left ankle and the key point of the right ankle; judging whether the difference value between the second distance and the first distance is larger than a first threshold value; and if so, judging that the legs of the target object are in a separated state.
In correspondence with the above method embodiment, referring to fig. 5, the present disclosure also provides a video beautification apparatus 50 comprising:
an obtaining module 501, configured to obtain a first video frame and a second video frame that need to be smoothed and beautified in a target video, where the first video frame is earlier than the second video frame in a time dimension of the target video;
a detecting module 502, configured to perform keypoint detection on a first video frame and a second video frame for a target object, and determine a hip keypoint, a knee keypoint, and an ankle keypoint of the first video frame and the second video frame;
a determining module 503 for determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint;
and a beautification module 504, configured to perform smooth beautification processing on the leg representation areas of the target object on the first video frame and the second video frame by using the obtained deformation parameter.
The apparatus shown in fig. 5 may correspondingly execute the content in the above method embodiment, and details of the part not described in detail in this embodiment refer to the content described in the above method embodiment, which is not described again here.
Referring to fig. 6, an embodiment of the present disclosure also provides an electronic device 60, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the video beautification method of the method embodiments described above.
The disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the video beautification method of the aforementioned method embodiments.
Referring now to FIG. 6, a schematic diagram of an electronic device 60 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, the electronic device 60 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. While the figures illustrate an electronic device 60 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present disclosure should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A method for beautifying video, comprising:
acquiring a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, wherein the first video frame is earlier than the second video frame in the time dimension of the target video;
respectively executing key point detection aiming at a target object on a first video frame and a second video frame, and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame;
determining leg representation areas on the first video frame and the second video frame by determining whether a leg of a target object is in a separated state based on the knee key point and the ankle key point;
performing smooth beautification processing on leg representation areas of the target object on the first video frame and the second video frame by using the acquired deformation parameters, wherein the smooth beautification processing comprises the following steps:
obtaining coordinates (x1, y1) of a first keypoint on a first video frame, and coordinates (x2, y2) of a second keypoint on a second video frame, the second keypoint corresponding to the first keypoint;
calculating the coordinates (x2 ', y 2') after the smoothing of the second key point based on a preset smoothing coefficient L, wherein
x2’=x1*L+x2*(1-L)
y2’=y1*L+y2*(1-L);
The method further comprises determining a deformation parameter by:
calculating offset distances c1, c2 and c3 of the contour, the leg representing region and the leg center point of the target object on the first video frame and the second video frame respectively to determine a jitter parameter d; the jitter parameter d is calculated in the following manner: d ═ c2+ c3)/2 ═ c 1; the central point of the leg is obtained by averaging a coordinate set consisting of a hip key point, a knee key point and an ankle key point;
taking a preset default deformation parameter L1 as a deformation parameter of the first video frame; and taking the product of the normalized jitter parameter d and the default deformation parameter L1 as the deformation parameter L2 of the second video frame.
2. The method of claim 1, wherein after the smooth beautification processing of the leg representation area of the target object over the first video frame and the second video frame, the method further comprises:
acquiring a third video frame adjacent to the second video frame;
performing key point detection on the third video frame to form a hip key point, a knee key point and an ankle key point of the third video frame;
and performing smooth beautification processing on leg representation areas of the target object on the second video frame and the third video frame by using the deformation parameters.
3. The method of claim 1, wherein the obtaining the first video frame and the second video frame of the target video that need to be smoothed and beautified comprises:
performing target detection for a target object in a target video;
taking a first video frame image containing the target object as the first video frame;
and taking a video frame image which is adjacent to the first video frame and contains the target object as the second video frame.
4. The method of claim 1, wherein performing keypoint detection for the target object on the first video frame and the second video frame, respectively, comprises:
converting the first video frame and the second video frame into corresponding gray level images;
and performing key point detection aiming at the target object by using the converted gray level image.
5. The method of claim 1, wherein determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint comprises:
determining whether a leg of the target object is in a separated state based on the knee key point and the ankle key point;
determining a representation area of the target subject's leg based on the hip keypoint, the knee keypoint, and the ankle keypoint when the target subject's leg is in a spread state.
6. The method of claim 5, wherein determining leg representation areas on the first video frame and the second video frame based on the knee keypoint and the ankle keypoint further comprises:
and when the legs of the target object are in a combined state, determining a leg representing area of the target object for executing the extrusion deformation operation in an area with a preset length by taking the central point of the hip part as a starting point.
7. The method of claim 5, wherein determining whether the leg of the target subject is in a separated state based on the knee keypoint and the ankle keypoint comprises:
acquiring a first distance between the detected key point of the left knee and the key point of the right knee;
acquiring a second distance between the detected key point of the left ankle and the key point of the right ankle;
judging whether the difference value between the second distance and the first distance is larger than a first threshold value;
and if so, judging that the legs of the target object are in a separated state.
8. A video beautification apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first video frame and a second video frame which need to be subjected to smooth beautification processing in a target video, and the first video frame is earlier than the second video frame in the time dimension of the target video;
the detection module is used for respectively executing key point detection aiming at a target object on a first video frame and a second video frame and determining a hip key point, a knee key point and an ankle key point of the first video frame and the second video frame;
a determining module, configured to determine, based on the knee key point and the ankle key point, a leg representing region on the first video frame and the second video frame by determining whether a leg of a target object is in a separated state;
the beautification module is configured to perform smooth beautification processing on the leg representation area of the target object on the first video frame and the second video frame by using the obtained deformation parameter, and includes:
obtaining coordinates (x1, y1) of a first keypoint on a first video frame, and coordinates (x2, y2) of a second keypoint on a second video frame, the second keypoint corresponding to the first keypoint;
calculating the coordinates (x2 ', y 2') after the smoothing of the second key point based on a preset smoothing coefficient L, wherein
x2’=x1*L+x2*(1-L)
y2’=y1*L+y2*(1-L)
Calculating offset distances c1, c2 and c3 of the contour, the leg representing region and the leg center point of the target object on the first video frame and the second video frame respectively to determine a jitter parameter d; the jitter parameter d is calculated in the following manner: d ═ c2+ c3)/2 ═ c 1; the central point of the leg is obtained by averaging a coordinate set consisting of a hip key point, a knee key point and an ankle key point;
taking a preset default deformation parameter L1 as a deformation parameter of the first video frame; and taking the product of the normalized jitter parameter d and the default deformation parameter L1 as the deformation parameter L2 of the second video frame.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the video beautification method of any of the preceding claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the video beautification method of any of the preceding claims 1-7.
CN201910580699.6A 2019-06-29 2019-06-29 Video beautifying method and device and electronic equipment Active CN110264430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910580699.6A CN110264430B (en) 2019-06-29 2019-06-29 Video beautifying method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910580699.6A CN110264430B (en) 2019-06-29 2019-06-29 Video beautifying method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110264430A CN110264430A (en) 2019-09-20
CN110264430B true CN110264430B (en) 2022-04-15

Family

ID=67923376

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910580699.6A Active CN110264430B (en) 2019-06-29 2019-06-29 Video beautifying method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110264430B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113421196B (en) * 2021-06-08 2023-08-11 杭州逗酷软件科技有限公司 Image processing method and related device
CN114419024B (en) * 2022-01-27 2023-06-27 广州东利运动科技有限公司 Method for judging ankle deformation based on video image analysis

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106558039A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 A kind of facial image processing method and device
CN108830783A (en) * 2018-05-31 2018-11-16 北京市商汤科技开发有限公司 A kind of image processing method, device and computer storage medium
CN108830200A (en) * 2018-05-31 2018-11-16 北京市商汤科技开发有限公司 A kind of image processing method, device and computer storage medium
CN109684920A (en) * 2018-11-19 2019-04-26 腾讯科技(深圳)有限公司 Localization method, image processing method, device and the storage medium of object key point

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI417811B (en) * 2008-12-31 2013-12-01 Altek Corp The Method of Face Beautification in Digital Image
CN107704829B (en) * 2017-10-09 2019-12-03 武汉斗鱼网络科技有限公司 A kind of face key point method for tracing and application and device
CN109191414A (en) * 2018-08-21 2019-01-11 北京旷视科技有限公司 A kind of image processing method, device, electronic equipment and storage medium
CN109903217B (en) * 2019-01-25 2023-05-02 北京百度网讯科技有限公司 Image deformation method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106558039A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 A kind of facial image processing method and device
CN108830783A (en) * 2018-05-31 2018-11-16 北京市商汤科技开发有限公司 A kind of image processing method, device and computer storage medium
CN108830200A (en) * 2018-05-31 2018-11-16 北京市商汤科技开发有限公司 A kind of image processing method, device and computer storage medium
CN109684920A (en) * 2018-11-19 2019-04-26 腾讯科技(深圳)有限公司 Localization method, image processing method, device and the storage medium of object key point

Also Published As

Publication number Publication date
CN110264430A (en) 2019-09-20

Similar Documents

Publication Publication Date Title
CN110288551B (en) Video beautifying method and device and electronic equipment
CN110189246B (en) Image stylization generation method and device and electronic equipment
CN110288520B (en) Image beautifying method and device and electronic equipment
CN109460233B (en) Method, device, terminal equipment and medium for updating native interface display of page
CN110288553A (en) Image beautification method, device and electronic equipment
CN110298785A (en) Image beautification method, device and electronic equipment
CN110287891B (en) Gesture control method and device based on human body key points and electronic equipment
US20220277481A1 (en) Panoramic video processing method and apparatus, and storage medium
CN110415276B (en) Motion information calculation method and device and electronic equipment
CN110288521A (en) Image beautification method, device and electronic equipment
CN110288519A (en) Image beautification method, device and electronic equipment
CN110740315B (en) Camera correction method and device, electronic equipment and storage medium
CN110188782B (en) Image similarity determining method and device, electronic equipment and readable storage medium
CN110070495B (en) Image processing method and device and electronic equipment
CN110264430B (en) Video beautifying method and device and electronic equipment
CN110363860A (en) 3D model reconstruction method, device and electronic equipment
CN110555861B (en) Optical flow calculation method and device and electronic equipment
CN110751120A (en) Detection method and device and electronic equipment
CN110264431A (en) Video beautification method, device and electronic equipment
CN110070554A (en) Image processing method, device, hardware device
CN110288552A (en) Video beautification method, device and electronic equipment
CN111626990B (en) Target detection frame processing method and device and electronic equipment
CN110197459B (en) Image stylization generation method and device and electronic equipment
CN111292245B (en) Image processing method and device
CN110288554B (en) Video beautifying method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant