Video special effects processing method, device, terminal and storage medium

By manually calibrating the key points of the face in the video and performing automatic recognition processing, it solves the problems of video special effects processing delay and frame rate reduction caused by third-party face recognition platforms, and achieves efficient video special effects processing.

CN111753784BActive Publication Date: 2024-09-10GUANGZHOU KUGOU COMP TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202010614999.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2024-09-10
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

Existing video special effects processing methods use third-party face recognition platforms to perform face recognition, which results in long data interaction and may cause special effects delays and reduced video frame rates during video recording.

Method used

By manually calibrating multiple facial key points in the video, calculating their image features, and performing special effects processing on subsequent frame images, automatic recognition and special effects processing of facial key points are achieved, avoiding dependence on third-party face recognition platforms.

Benefits of technology

It achieves efficient video special effects processing, avoids the problem of frame rate reduction caused by time-consuming data interaction, and improves the smoothness of video playback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111753784B
    Figure CN111753784B
Patent Text Reader

Abstract

The present application discloses a method, device, terminal and storage medium for special effects processing of a video, and belongs to the field of video processing technology. The method includes: obtaining multiple first face key points of a first image of a video, determining the image features of the multiple first face key points, determining multiple second face key points that match the image features in multiple frames of second images, performing special effects processing on the multiple frames of images based on the multiple face key points, and generating a target video based on the multiple frames of images after special effects processing. In an embodiment of the present application, by manually calibrating the multiple first face key points of the first image, and matching the multiple frames of second images with the image features of the first face key points respectively, it is possible to realize automatic recognition of the face key points of the multiple frames of second images, and then perform special effects processing on the image based on the face key points of each frame of the image, thereby realizing special effects processing of the video without using a third-party face recognition platform, and avoiding the problem of taking too long to reduce the frame rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of video processing technology, and in particular to a method, device, terminal and storage medium for special effects processing of a video. Background Art

[0002] With the rapid development of video processing technology, special effects processing of faces in videos has been widely used. In order to increase the fun of videos, users can perform special effects processing on faces in videos, such as adding props stickers, expression effects, etc., so as to achieve special effects when playing videos.

[0003] At present, the special effects processing method for videos is usually as follows: when recording a video, a third-party face recognition platform is called to perform face recognition, identify the key points of the face in the video, and perform real-time detection and tracking of the key points of the face, and then perform special effects processing on the detected and tracked face, so as to achieve special effects when playing the video.

[0004] However, face recognition through a third-party face recognition platform requires a large amount of data interaction with the third-party face recognition platform, such as sending videos, receiving recognition results, etc., and the third-party face recognition platform also needs to recognize the video to obtain the above recognition results, which is time-consuming and may cause special effects delays and video freezes in video recording, reducing the video frame rate. Summary of the invention

[0005] The embodiments of the present application provide a method, device, terminal and storage medium for special effects processing of a video, which can realize special effects processing of a video without using a third-party face recognition platform, thus avoiding the problem of taking too long and reducing the frame rate. The technical solution is as follows:

[0006] On the one hand, a method for special effects processing of a video is provided, the method comprising:

[0007] Acquire a plurality of first facial key points of a first image of a video, where the plurality of first facial key points are manually calibrated;

[0008] Determine the image features of the multiple first facial key points respectively, the image features being image features of image blocks corresponding to the first facial key points in the first image;

[0009] For a plurality of frames of second images after the first image in the video, respectively determine a plurality of second facial key points in the plurality of frames of second images that match image features of the plurality of first facial key points;

[0010] Based on multiple facial key points of multiple frames of images in the video, special effects processing is performed on the multiple frames of images to obtain multiple frames of images after special effects processing;

[0011] A target video is generated based on the multiple frames of images processed by the special effects.

[0012] In a possible implementation, respectively determining the image features of the plurality of first facial key points includes:

[0013] For each first facial key point among the plurality of first facial key points, in the first frame image, determining a target image block with the first facial key point as the center and the target value as the side length;

[0014] Based on the pixel points of the image in the target image block, the image feature of the first facial key point is calculated.

[0015] In a possible implementation, before acquiring a plurality of first facial key points of the first image of the video, the method further includes:

[0016] Obtain the video, decode the video, and obtain multiple frames of images of the video;

[0017] Among the multiple frames of the video, the first frame of the video is determined as the first image, and the first image is displayed.

[0018] In a possible implementation, for a plurality of frames of second images after the first image in the video, respectively determining a plurality of second facial key points in the plurality of frames of second images that match image features of the plurality of first facial key points includes:

[0019] Based on a plurality of image blocks in the plurality of frames of second images, determining similarities between the plurality of image blocks and image features of the plurality of first facial key points;

[0020] Determine a plurality of image blocks whose image feature similarity with the plurality of first facial key points reaches a target threshold;

[0021] The centers of the multiple image blocks are determined as the multiple second facial key points.

[0022] In a possible implementation, based on multiple facial key points of multiple frames of images in the video, special effects processing is performed on the multiple frames of images to obtain the multiple frames of images after special effects processing, including:

[0023] For each frame of the multiple frames of images, a rectangular coordinate system is constructed in the image based on multiple facial key points of the image;

[0024] Based on the rectangular coordinate system, the target face special effect and the face special effect parameters corresponding to the target face special effect, the image is processed with video special effects to obtain multiple frames of images after special effect processing.

[0025] In a possible implementation, based on the rectangular coordinate system, the target face effect and the face effect parameters corresponding to the target face effect, the image is subjected to video special effect processing to obtain a plurality of frames of images after the special effect processing, including:

[0026] In the rectangular coordinate system, based on the facial effect parameters corresponding to the target facial effect, determine the position information of the target facial effect in the rectangular coordinate system;

[0027] At the position corresponding to the position information, the target face special effect is rendered to obtain multiple frames of images after special effect processing.

[0028] In a possible implementation, before performing special effects processing on the multiple frames of images in the video based on multiple facial key points to obtain the multiple frames of images after special effects processing, the method further includes:

[0029] In response to the determination operation of the target facial special effect, a facial special effect acquisition request is sent to the server, where the facial special effect acquisition request is used to instruct acquisition of facial special effect parameters corresponding to the target facial special effect;

[0030] Receive the facial effect parameters corresponding to the target facial effect returned by the server.

[0031] In one aspect, a video special effects processing device is provided, the device comprising:

[0032] An acquisition module, used to acquire a plurality of first facial key points of a first image of a video, wherein the plurality of first facial key points are manually calibrated;

[0033] An image feature determination module, used to respectively determine image features of the plurality of first facial key points, the image features being image features of image blocks corresponding to the first facial key points in the first image;

[0034] A key point determination module, for determining, for a plurality of frames of second images following the first image in the video, a plurality of second face key points in the plurality of frames of second images that match the image features of the plurality of first face key points;

[0035] A processing module, used for performing special effects processing on the multiple frames of images in the video based on multiple facial key points of the multiple frames of images to obtain the multiple frames of images after special effects processing;

[0036] The generation module is used to generate a target video based on the multiple frames of images processed by the special effects.

[0037] In a possible implementation, the image feature determination module is used to:

[0038] For each first facial key point among the plurality of first facial key points, in the first frame image, determining a target image block with the first facial key point as the center and the target value as the side length;

[0039] Based on the pixel points of the image in the target image block, the image feature of the first facial key point is calculated.

[0040] In a possible implementation, the device further includes a first image display module:

[0041] Obtain the video, decode the video, and obtain multiple frames of images of the video;

[0042] Among the multiple frames of the video, the first frame of the video is determined as the first image, and the first image is displayed.

[0043] In a possible implementation, the key point determination module is used to:

[0044] Based on a plurality of image blocks in the plurality of frames of second images, determining similarities between the plurality of image blocks and image features of the plurality of first facial key points;

[0045] Determine a plurality of image blocks whose image feature similarity with the plurality of first facial key points reaches a target threshold;

[0046] The centers of the multiple image blocks are determined as the multiple second facial key points.

[0047] In a possible implementation, the processing module includes:

[0048] A construction submodule, for constructing a rectangular coordinate system in each frame of the multiple frames of images based on multiple facial key points of the image;

[0049] The processing submodule is used to perform video special effects processing on the image based on the rectangular coordinate system, the target face special effects and the face special effects parameters corresponding to the target face special effects, so as to obtain multiple frames of images after special effects processing.

[0050] In a possible implementation, the processing submodule is used to:

[0051] In the rectangular coordinate system, based on the facial effect parameters corresponding to the target facial effect, determine the position information of the target facial effect in the rectangular coordinate system;

[0052] At the position corresponding to the position information, the target face special effect is rendered to obtain multiple frames of images after special effect processing.

[0053] In a possible implementation, the device further includes:

[0054] A sending module, configured to send a facial special effect acquisition request to a server in response to a determination operation on the target facial special effect, wherein the facial special effect acquisition request is used to instruct acquisition of facial special effect parameters corresponding to the target facial special effect;

[0055] The receiving module is used to receive the facial effects parameters corresponding to the target facial effects returned by the server.

[0056] On the one hand, a terminal is provided, which includes a processor and a memory, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the operations performed by the above-mentioned video special effects processing method.

[0057] On the one hand, a computer-readable storage medium is provided, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement the operations performed by the above-mentioned video special effects processing method.

[0058] On the one hand, a computer program product or a computer program is provided, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the operations performed by the above-mentioned video special effects processing method.

[0059] The technical solution provided in the embodiment of the present application can realize automatic recognition of facial key points of multiple frames of second images by manually calibrating multiple first facial key points of the first image and matching the remaining multiple frames of second images in the video with the image features of the first facial key points respectively, thereby obtaining multiple successfully matched second facial key points, and then performing special effects processing operations on the image based on the facial key points of each frame of the image, thereby realizing special effects processing of the video without the need to use a third-party facial recognition platform, and avoiding the problem of taking too long to reduce the frame rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0061] Figure 1 It is a schematic diagram of an implementation environment of a special effects processing method for a video provided in an embodiment of the present application;

[0062] Figure 2 It is a flowchart of a special effects processing method for a video provided in an embodiment of the present application;

[0063] Figure 3 It is a flowchart of a special effects processing method for a video provided in an embodiment of the present application;

[0064] Figure 4 is a schematic diagram of a special effect processing provided by an embodiment of the present application;

[0065] Figure 5 It is a structural schematic diagram of a video special effects processing device provided in an embodiment of the present application;

[0066] Figure 6 It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0068] Figure 1 Schematic diagram of an implementation environment of a special effects processing method for a video provided in an embodiment of the present application. Figure 1 , the implementation environment includes: a terminal 101 or a server 102.

[0069] Terminal 101 may be at least one of a smart phone, a smart watch, a desktop computer, a laptop, a virtual reality terminal, an augmented reality terminal, a wireless terminal, and a laptop computer. Terminal 101 may run a facial expression editing tool, and the facial expression editing tool may have the functions of adding special effects to a video, video preview, and video playback. Terminal 101 has a communication function and can access the Internet. Terminal 101 may generally refer to one of a plurality of terminals. This embodiment is only illustrated by terminal 101. Those skilled in the art may know that the number of the above terminals may be more or less.

[0070] The server 102 may be an independent physical server, or a server cluster or distributed file system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The server 102 may run a special effects information database, which is used to store facial special effects parameters corresponding to multiple facial special effects. The server 102 and the terminal 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application. Optionally, the number of the above-mentioned servers 102 may be more or less, which is not limited in the embodiments of the present application. Of course, the server 102 may also include other functional servers to provide more comprehensive and diversified services.

[0071] In the process of implementing the embodiments of the present application, the special effects processing method of the video can be executed by the terminal 101. When the user wants to add special effects to the face in a video stored locally, the user can operate on the terminal 101, start the facial expression editing tool, select to load the video in the facial expression editing tool, and click on the facial special effects to be added in the facial special effects window of the facial expression editing tool. The terminal 101 can then obtain the video and the facial special effects parameters corresponding to the facial special effects, and use the special effects processing method for the video provided in the embodiments of the present application to complete the special effects processing of the face in the video. Optionally, in a possible implementation, the process of terminal 101 obtaining facial special effects parameters corresponding to facial special effects can be performed jointly by terminal 101 and server 102, that is, terminal 101 sends a facial special effects acquisition request to server 102, and after server 102 receives the facial special effects acquisition request, it queries the special effects information database to obtain the facial special effects parameters corresponding to the facial special effects acquisition request, and sends the facial special effects parameters to terminal 101, so that terminal 101 can obtain the facial special effects parameters corresponding to the facial special effects. In another possible implementation, the process of terminal 101 obtaining facial special effects parameters corresponding to facial special effects can be performed only by terminal 101, and terminal 101 can store downloaded facial special effects and their corresponding facial special effects parameters locally, so terminal 101 can obtain the facial special effects parameters corresponding to the facial special effects by local query. The embodiments of this application are subsequently described using the joint execution of terminal 101 and server 102 as an example.

[0072] Figure 2 This is a flow chart of a method for processing special effects of a video provided in an embodiment of the present application. This embodiment is described with a terminal as the execution subject. Figure 2 , the embodiment comprises:

[0073] 201. A terminal obtains a plurality of first facial key points of a first image of a video, where the plurality of first facial key points are manually calibrated.

[0074] 202. The terminal determines image features of the multiple first facial key points respectively, where the image features are image features of image blocks corresponding to the first facial key points in the first image.

[0075] 203. The terminal determines, for a plurality of frames of second images subsequent to the first image in the video, a plurality of second facial key points in the plurality of frames of second images that respectively match image features of the plurality of first facial key points.

[0076] 204. The terminal performs special effect processing on the multiple frames of images in the video based on multiple facial key points of the multiple frames of images to obtain the multiple frames of images after special effect processing.

[0077] 205. The terminal generates a target video based on the multiple frames of images processed with the special effects.

[0078] The technical solution provided in the embodiment of the present application can realize automatic recognition of facial key points of multiple frames of second images by manually calibrating multiple first facial key points of the first image and matching the remaining multiple frames of second images in the video with the image features of the first facial key points respectively, thereby obtaining multiple successfully matched second facial key points, and then performing special effects processing operations on the image based on the facial key points of each frame of the image, thereby realizing special effects processing of the video without the need to use a third-party facial recognition platform, and avoiding the problem of taking too long to reduce the frame rate.

[0079] Figure 3 This is a flow chart of a method for processing special effects of a video provided in an embodiment of the present application. This embodiment is described with a terminal as the execution subject. Figure 3 , the embodiment comprises:

[0080] 301. The terminal obtains a video, and decodes the video to obtain multiple frames of images of the video.

[0081] Among them, video is used to represent a video to be processed with special effects, and the video is a video containing a face. The video can be a video recorded in advance and stored locally, or it can be a video downloaded from a server and stored locally. To ensure the accuracy of the special effects processing, the video is a video that has not been processed with any other special effects. Optionally, the video can be a video in which each frame contains a face, such as a video containing only facial expressions, or the video can be a video in which individual frames contain a face, such as a video in which face clips appear in a landscape video. In the embodiments of the present application, a video in which each frame contains a face is used as an example for explanation. Decoding processing refers to the process of performing a restoration decoding operation on an encoded video, specifically the process of converting a data encoding file into an analog audio and video signal.

[0082] In a possible implementation, when a user wants to add special effects to a face in a locally stored video, the user can operate on the terminal, start the facial expression editing tool, and select to load the video in the facial expression editing tool. Then, the terminal can obtain the video, and the facial expression editing tool can also obtain the video. After the facial expression editing tool obtains the video, it decodes the video through a video decoder to obtain multiple frames of the video. The facial expression editing tool may include a video decoder, or a video decoder may be installed in the terminal system.

[0083] 302. The terminal determines, from among multiple frames of the video, a first frame of the video as the first image, and displays the first image.

[0084] The first image is used to represent an image to be manually calibrated, and the first image is an image containing a face.

[0085] In a possible implementation, after acquiring multiple frames of images of the video, the terminal can determine the first frame of image corresponding to the starting timestamp based on the multiple frames of image and the timestamps corresponding to the multiple frames of image as the first image, and then display the first image. In this process, the terminal can directly determine the starting frame (that is, the first frame) image and then display it. The processing process is very simple and the first frame of image can be quickly determined.

[0086] It should be noted that in step 302, the first image is taken as the first frame image of the video for explanation. It should be understood that the process is applied to the video in which each frame contains a face. In another possible implementation, the first image can also be an image of any frame of the video containing a face. The corresponding process can be: after the terminal obtains multiple frames of the video, it can display the multiple frames in the form of frames in the face expression editing tool. The user can click on a frame image containing a face on the terminal interface, and the terminal can determine that the frame image is the first image, and then display the first image. In this process, a frame image containing a face is determined by artificial selection, and a frame image containing a face can be selected from the video in which individual frames contain a face, and subsequent operations such as determining features, feature matching, and special effects processing are performed based on the frame image, thereby realizing special effects processing of the video. It should be understood that the process can be applied to the video in which each frame contains a face, and can also be applied to the video in which individual frames contain a face.

[0087] 303. The terminal obtains a plurality of first facial key points of a first image of a video, where the plurality of first facial key points are manually calibrated.

[0088] The first face key points are used to represent the face key points in the first image. The first face key points may include face features key points and face contour key points. The face features key points may be left eye, right eye, nose, mouth, etc. The face contour key points may be multiple key points corresponding to the face boundary. The following description will be made by taking the example that the first face key points include the left eye, right eye, and nose three key points.

[0089] In one possible implementation, after the terminal displays the first image, the user can manually calibrate multiple first facial key points in the first image. After clicking the confirmation submission option, the terminal can obtain the multiple first facial key points of the first image of the video, and then perform a subsequent feature determination process based on the multiple first facial key points.

[0090] For example, if the first facial key points include the left eye, the right eye, and the nose, the user can click on the left eye, the right eye, and the nose in the face of the first image, and then click to confirm the submission option.

[0091] 304. The terminal determines image features of the multiple first facial key points respectively, where the image features are image features of image blocks corresponding to the first facial key points in the first image.

[0092] Among them, image features refer to features that can be distinguished from other pixels in the image, that is, features that can represent image information in an image block, and image features are also features that can measure the similarity between one image and another. Image features can specifically be feature vectors. In the embodiment of the present application, texture features are used as image features. It should be noted that texture features need to be obtained by statistical calculation in an area containing multiple pixels. A pixel refers to the basic element (or smallest unit) of an image, which can be understood as a small square with a single color that cannot be divided into smaller elements (or units), and each small square can be called a pixel.

[0093] In a possible implementation, after the terminal obtains multiple first facial key points of the first image of the video, the terminal uses the multiple first facial key points as input to a feature extraction algorithm. For each of the multiple first facial key points, the feature extraction algorithm determines a target image block with the first facial key point as the center and the target value as the side length in the first image, and calculates the image features of the first facial key point based on the pixel points of the image in the target image block. The target value is a pre-set fixed value, such as 10. The target image block is used to represent an image block corresponding to the neighborhood of the first facial key point. The target image block can be an image block with the first facial key point as the center. The target image block can be a square block. For example, when the target value is 10, the target image block is a 10*10 square block.

[0094] Optionally, the feature extraction algorithm may be a SIFT (Scale-Invariant Feature Transform) algorithm. Taking the target value of 10 as an example, the specific process of the terminal determining the image features based on the SIFT algorithm may include: for each of the multiple first face key points, selecting a target image block with the first face key point as the center and 10 as the side length, and in the target image block, based on the pixel points of the image in the target image block, calculating the gradient direction value of each pixel point, the gradient direction value includes the gradient direction and the gradient amplitude, and each pixel point corresponds to the gradient direction and the gradient amplitude. The target image block is evenly divided into multiple small image blocks, and the gradient direction values ​​of the multiple small image blocks are weighted by using Gaussian coefficients to calculate the accumulated value of each gradient direction as the gradient information of each small image block. Based on the gradient information of the small image block, a gradient histogram of 8 gradient directions is drawn on each small image block. The gradient histogram is a histogram drawn using the image gradient direction feature, and the gradient histogram is used to represent the image feature. It should be understood that there are at most 8 small image blocks around a small image block, so a small image block can correspond to 8 gradient directions: up, down, left, right, upper left, upper right, lower left and lower right. According to the gradient histogram of the multiple small image blocks, the feature vectors of the multiple small image blocks can be determined, that is, the feature vector of the target image block can be determined as the image feature of the first facial key point. For example, the terminal can divide the 10*10 target image block into 2*2 small image blocks to obtain 5 small image blocks, and draw the gradient histogram of 8 gradient directions on each small image block to obtain the image features corresponding to the 5 small image blocks. The image features of each first facial key point are composed of the image features corresponding to the 5 small image blocks, and each small image block corresponding to the image feature has vector information of 8 gradient directions. Therefore, a feature vector with a dimension of 5*8=40 can be obtained as the image feature of the first facial key point.

[0095] In an embodiment of the present application, image features are calculated based on a target image block of a first facial key point, and the relevant information of the first facial key point and its neighborhood are combined to determine a unique image feature, and the target image block contains a sufficient number of features, thereby improving the accuracy and reliability of determining the image features, thereby improving the accuracy of feature matching in subsequent feature matching.

[0096] 305. The terminal determines, for a plurality of frames of second images subsequent to the first image in the video, a plurality of second facial key points in the plurality of frames of second images that respectively match image features of the plurality of first facial key points.

[0097] The second image is used to represent the image to be feature matched, and the second image may be an image containing a face or an image not containing a face. The second face key points are used to represent the face key points in the second image.

[0098] In a possible implementation, after the terminal determines the image features of the multiple first facial key points, for multiple frames of second images after the first image in the video, based on multiple image blocks in the multiple frames of second images, the similarities between the multiple image blocks and the image features of the multiple first facial key points are determined, multiple image blocks whose similarities with the image features of the multiple first facial key points reach a target threshold are determined, and the centers of the multiple image blocks are determined as the multiple second facial key points. Wherein, the similarity is used to indicate the degree of similarity between the image features of each image block and the image features of the first facial key points, and the target threshold may be a preset fixed threshold. The similarity may be represented by the distance between the image features, and the similarity reaching the target threshold may also be represented by the distance being less than a certain threshold. Optionally, the distance may be Euclidean distance, Manhattan distance, chi-square distance, or Chebyshev distance, etc., and the embodiment of the present application does not limit the distance to be selected. It should be understood that the smaller the distance, the higher the similarity, and the larger the distance, the lower the similarity.

[0099] Optionally, the specific process of feature matching performed by the terminal may be: determining multiple image blocks of the same size as the target image block in the multiple frames of the second image, respectively calculating the image features of the multiple image blocks, and calculating the similarity between the image features of the multiple image blocks and the image features of the multiple first facial key points based on the image features of the multiple image blocks; if there is an image block and the similarity between the image features of the first facial key points reaches a target threshold, determining that the image block is successfully matched, obtaining multiple successfully matched image blocks, and determining the centers of the multiple image blocks as multiple successfully matched second facial key points.

[0100] It should be noted that in step 305, feature matching of multiple frames of second images with image features of the first facial key points in the first image is taken as an example. In another possible implementation, the terminal can perform feature matching on the second image and the second image adjacent to it in sequence based on the timestamps of the multiple frames of second images to obtain multiple second facial key points of the second image. Taking the first image as the first frame image as an example, the multiple frames of second images are images after the first frame image. When the terminal determines multiple second facial key points of the second frame image, the second frame image can be feature matched with the first frame image to obtain multiple second facial key points that are successfully matched. When the terminal determines multiple second facial key points of the third frame image, the third frame image can be feature matched with the second frame image to obtain multiple second facial key points that are successfully matched. Then, multiple second facial key points of the multiple frames of second images are determined in sequence. In this process, due to the high similarity between adjacent images, by performing feature matching on the second image and the second image adjacent to it, the second facial key points can be determined more accurately, avoiding the problem of determining the key points due to the long distance between the previous and next images and the inability to accurately match.

[0101] 306. In response to the determination operation of the target facial special effect, the terminal sends a facial special effect acquisition request to the server, where the facial special effect acquisition request is used to instruct acquisition of facial special effect parameters corresponding to the target facial special effect.

[0102] Among them, the target face special effect is used to indicate the face special effect selected by the user to be added. The face special effect is a special effect designed in advance, such as prop stickers, expression special effects, etc. Different target face special effects correspond to different face special effect parameters. Using different face special effect parameters to process the face special effect can display different special effects. It should be noted that the operation of determining the target facial special effects can be performed after the user calibrates the first facial key points, that is, after the user manually calibrates multiple first facial key points in the first image, clicks Submit, and multiple facial special effects options are displayed on the terminal interface. The user can then click on the target facial special effects on the terminal interface. Alternatively, the operation of determining the target facial special effects can also be performed after the user loads the video and before calibrating the first facial key points, that is, after the user loads the video in the facial expression editing tool, multiple facial special effects options are displayed on the terminal interface. The user can then click on the target facial special effects on the terminal interface. The terminal then responds to the operation of determining the target facial special effects and executes the subsequent process of determining the first image, displaying the first image, and obtaining the first facial key points calibrated by the user.

[0103] In a possible implementation, when the terminal detects the user's confirmation operation on the target face special effect, the terminal is triggered to send a face special effect acquisition request for the target face special effect to the server. After receiving the face special effect acquisition request for the target face special effect, the server obtains the identifier of the target face special effect carried in the face special effect acquisition request, queries the special effect information database according to the identifier of the target face special effect, obtains the face special effect parameters corresponding to the identifier, and uses them as the face special effect parameters corresponding to the target face special effect. The face special effect parameters corresponding to the target face special effect are sent to the terminal, and the terminal can obtain the face special effect parameters corresponding to the target face special effect, and then perform subsequent special effect processing. Among them, the special effect information database is used to store the face special effect parameters corresponding to multiple face special effects.

[0104] 307. The terminal receives facial special effect parameters corresponding to the target facial special effect returned by the server.

[0105] Steps 306 to 307 are explained by taking the example of obtaining the facial effects parameters corresponding to the target facial effects through the server side. In another possible implementation, the terminal may store the downloaded facial effects and their corresponding facial effects parameters locally. When the terminal detects the user's confirmation operation on the target facial effects, the facial effects acquisition instruction for the target facial effects is triggered. The terminal then locally queries the facial effects parameters corresponding to the facial effects acquisition instruction as the facial effects parameters corresponding to the target facial effects.

[0106] In the above steps 303 to 307, the terminal obtains the facial special effect parameters after determining the image features, feature matching, and then determining multiple second facial key points. In another possible implementation, the terminal may also obtain the facial special effect parameters before determining the image features, feature matching, and determining multiple second facial key points. The embodiment of the present application does not limit when to obtain the facial special effect parameters.

[0107] 308. The terminal performs special effects processing on the multiple frames of images in the video based on multiple facial key points of the multiple frames of images and facial special effects parameters corresponding to the target facial special effects to obtain multiple frames of images after special effects processing.

[0108] In one possible implementation, for each frame of the multiple images, a rectangular coordinate system is constructed in the image based on multiple facial key points of the image, and video special effects processing is performed on the image based on the rectangular coordinate system, the target facial special effects, and the facial special effects parameters corresponding to the target facial special effects, to obtain multiple frames of images after special effects processing.

[0109] Optionally, the coordinate origin of the rectangular coordinate system can be any one of a plurality of facial key points. Taking the plurality of facial key points as the left eye, the right eye and the nose as an example, the coordinate origin of the rectangular coordinate system can be any one of the left eye key point, the right eye key point and the nose key point of the face in the image. In another possible implementation, the left eye key point and the right eye key point are connected to obtain an eye line, and a perpendicular line from the nose key point to the eye line is drawn based on the nose key point. The intersection of the eye line and the perpendicular line can also be used as the coordinate origin of the rectangular coordinate system, such as Figure 4 As shown, Figure 4 It is a schematic diagram of a special effects processing provided in an embodiment of the present application, with the straight line where the eye line is located as the horizontal axis of the rectangular coordinate system, the straight line where the vertical line is located as the vertical axis of the rectangular coordinate system, and the rectangular coordinate system is constructed with the intersection of the eye line and the vertical line as the coordinate origin.

[0110] Optionally, the process of performing special effects processing based on a rectangular coordinate system by the terminal may include: in the rectangular coordinate system, based on the facial special effects parameters corresponding to the target facial special effects, determining the position information of the target facial special effects in the rectangular coordinate system, rendering the target facial special effects at the position corresponding to the position information, and obtaining multiple frames of images after special effects processing. The position information may be coordinate information, and the coordinate information includes a horizontal coordinate and a vertical coordinate. Figure 4 As shown, Figure 4 FIG. 1 shows a schematic diagram of special effects processing. The target face special effect may be a star-shaped sticker. After determining the position information of the star-shaped sticker in the rectangular coordinate system, the star-shaped sticker is rendered at the position corresponding to the position information in the image. Figure 4 The special effects shown.

[0111] In the above steps 301 to 308, an example is taken in which the terminal first determines multiple facial key points of multiple frames of images and then performs special effects processing on the multiple frames of images. In another possible implementation, after the terminal determines multiple facial key points of each frame of image, it can perform special effects processing on the frame of image to obtain an image processed with special effects. The corresponding process may be: after the terminal obtains multiple first facial key points of the first image, it performs special effects processing on the first image based on the multiple first facial key points to obtain the first image processed with special effects. For each frame of the multiple second images, after determining multiple second facial key points that match the multiple first facial key points in the first image, the second image is processed with special effects to obtain a second image processed with special effects, thereby obtaining multiple frames of images processed with special effects.

[0112] 309. The terminal generates a target video based on the multiple frames of images processed with the special effects.

[0113] The encoding process refers to the process of compressing the video. The target video is used to represent the video obtained by special effect processing.

[0114] In a possible implementation, after the terminal obtains the multiple frames of images processed with special effects, it encodes the multiple frames of images processed with special effects based on the video encoding frame rate of the video to generate a target video.

[0115] Optionally, after the terminal generates the target video, it can respond to the user's video preview operation or video playback operation to perform video preview or video playback on the target video. During the video preview or video playback process, the effect of facial special effects can be achieved.

[0116] The technical solution provided in the embodiment of the present application can realize automatic recognition of facial key points of multiple frames of second images by manually calibrating multiple first facial key points of the first image and matching the remaining multiple frames of second images in the video with the image features of the first facial key points respectively, thereby obtaining multiple successfully matched second facial key points, and then performing special effects processing operations on the image based on the facial key points of each frame of the image, thereby realizing special effects processing of the video without the need to use a third-party facial recognition platform, and avoiding the problem of taking too long to reduce the frame rate.

[0117] Figure 5 is a structural diagram of a video special effects processing device provided in an embodiment of the present application, see Figure 5 , the device comprises:

[0118] An acquisition module 501 is used to acquire a plurality of first facial key points of a first image of a video, where the plurality of first facial key points are manually calibrated;

[0119] An image feature determination module 502 is used to respectively determine image features of the plurality of first facial key points, where the image features are image features of image blocks corresponding to the first facial key points in the first image;

[0120] A key point determination module 503 is used to determine, for a plurality of frames of second images after the first image in the video, a plurality of second face key points in the plurality of frames of second images that match the image features of the plurality of first face key points;

[0121] A processing module 504 is used to perform special effect processing on the multiple frames of images in the video based on multiple facial key points of the multiple frames of images to obtain multiple frames of images after special effect processing;

[0122] The generating module 505 is used to generate a target video based on the multiple frames of images processed with the special effects.

[0123] In a possible implementation, the image feature determination module 502 is used to:

[0124] For each first facial key point among the plurality of first facial key points, in the first frame image, determining a target image block with the first facial key point as the center and the target value as the side length;

[0125] Based on the pixel points of the image in the target image block, the image feature of the first facial key point is calculated.

[0126] In a possible implementation, the device further includes a first image display module:

[0127] Obtain the video, decode the video, and obtain multiple frames of images of the video;

[0128] Among the multiple frames of the video, the first frame of the video is determined as the first image, and the first image is displayed.

[0129] In a possible implementation, the key point determination module 503 is used to:

[0130] Based on a plurality of image blocks in the plurality of frames of second images, determining similarities between the plurality of image blocks and image features of the plurality of first facial key points;

[0131] Determine a plurality of image blocks whose image feature similarity with the plurality of first facial key points reaches a target threshold;

[0132] The centers of the multiple image blocks are determined as the multiple second facial key points.

[0133] In a possible implementation, the processing module 504 includes:

[0134] A construction submodule, for constructing a rectangular coordinate system in each frame of the multiple frames of images based on multiple facial key points of the image;

[0135] The processing submodule is used to perform video special effects processing on the image based on the rectangular coordinate system, the target face special effects and the face special effects parameters corresponding to the target face special effects, so as to obtain multiple frames of images after special effects processing.

[0136] In a possible implementation, the processing submodule is used to:

[0137] In the rectangular coordinate system, based on the facial effect parameters corresponding to the target facial effect, determine the position information of the target facial effect in the rectangular coordinate system;

[0138] At the position corresponding to the position information, the target face special effect is rendered to obtain multiple frames of images after special effect processing.

[0139] In a possible implementation, the device further includes:

[0140] A sending module, configured to send a facial special effect acquisition request to a server in response to a determination operation on the target facial special effect, wherein the facial special effect acquisition request is used to instruct acquisition of facial special effect parameters corresponding to the target facial special effect;

[0141] The receiving module is used to receive the facial effects parameters corresponding to the target facial effects returned by the server.

[0142] The technical solution provided in the embodiment of the present application can realize automatic recognition of facial key points of multiple frames of second images by manually calibrating multiple first facial key points of the first image and matching the remaining multiple frames of second images in the video with the image features of the first facial key points respectively, thereby obtaining multiple successfully matched second facial key points, and then performing special effects processing operations on the image based on the facial key points of each frame of the image, thereby realizing special effects processing of the video without the need to use a third-party facial recognition platform, and avoiding the problem of taking too long to reduce the frame rate.

[0143] It should be noted that: the video special effects processing device provided in the above embodiment only uses the division of the above functional modules as an example when processing videos. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the video special effects processing device provided in the above embodiment and the video special effects processing method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0144] Figure 6 The structure block diagram of a terminal 600 provided by an exemplary embodiment of the present application is shown. The terminal 600 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), a laptop computer or a desktop computer. The terminal 600 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0145] Typically, the terminal 600 includes a processor 601 and a memory 602 .

[0146] The processor 601 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 601 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 601 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 601 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 601 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0147] The memory 602 may include one or more computer-readable storage media, which may be non-transitory. The memory 602 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 602 is used to store at least one instruction, which is used to be executed by the processor 601 to implement the special effects processing method of the video provided in the method embodiment of the present application.

[0148] In some embodiments, the terminal 600 may further optionally include: a peripheral device interface 603 and at least one peripheral device. The processor 601, the memory 602 and the peripheral device interface 603 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 603 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 604, a display screen 605, a camera assembly 606, an audio circuit 607, a positioning assembly 608 and a power supply 609.

[0149] The peripheral device interface 603 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 601 and the memory 602. In some embodiments, the processor 601, the memory 602, and the peripheral device interface 603 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 601, the memory 602, and the peripheral device interface 603 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0150] The radio frequency circuit 604 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 604 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 604 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 604 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 604 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 604 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0151] The display screen 605 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 605 is a touch display screen, the display screen 605 also has the ability to collect touch signals on the surface or above the surface of the display screen 605. The touch signal can be input to the processor 601 as a control signal for processing. At this time, the display screen 605 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 605 can be one, set on the front panel of the terminal 600; in other embodiments, the display screen 605 can be at least two, respectively set on different surfaces of the terminal 600 or in a folding design; in other embodiments, the display screen 605 can be a flexible display screen, set on the curved surface or folding surface of the terminal 600. Even, the display screen 605 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 605 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode, organic light-emitting diode).

[0152] The camera assembly 606 is used to capture images or videos. Optionally, the camera assembly 606 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 606 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0153] The audio circuit 607 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 601 for processing, or input them into the radio frequency circuit 604 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 600. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 601 or the radio frequency circuit 604 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 607 may also include a headphone jack.

[0154] Positioning component 608 is used to locate the current geographical location of terminal 600 to implement navigation or LBS (Location Based Service). Positioning component 608 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.

[0155] The power supply 609 is used to power various components in the terminal 600. The power supply 609 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 609 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0156] In some embodiments, the terminal 600 further includes one or more sensors 610 , including but not limited to: an acceleration sensor 611 , a gyroscope sensor 612 , a pressure sensor 613 , a fingerprint sensor 614 , an optical sensor 615 , and a proximity sensor 616 .

[0157] The acceleration sensor 611 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 600. For example, the acceleration sensor 611 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 601 can control the display screen 605 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 611. The acceleration sensor 611 can also be used for collecting game or user motion data.

[0158] The gyro sensor 612 can detect the body direction and rotation angle of the terminal 600, and the gyro sensor 612 can cooperate with the acceleration sensor 611 to collect the user's 3D actions on the terminal 600. The processor 601 can implement the following functions based on the data collected by the gyro sensor 612: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0159] The pressure sensor 613 can be set on the side frame of the terminal 600 and / or the lower layer of the display screen 605. When the pressure sensor 613 is set on the side frame of the terminal 600, it can detect the user's holding signal of the terminal 600, and the processor 601 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 613. When the pressure sensor 613 is set on the lower layer of the display screen 605, the processor 601 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 605. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0160] The fingerprint sensor 614 is used to collect the user's fingerprint, and the processor 601 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 614, or the fingerprint sensor 614 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 601 authorizes the user to perform relevant sensitive operations, including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 614 can be set on the front, back, or side of the terminal 600. When a physical button or a manufacturer logo is set on the terminal 600, the fingerprint sensor 614 can be integrated with the physical button or the manufacturer logo.

[0161] The optical sensor 615 is used to collect the ambient light intensity. In one embodiment, the processor 601 can control the display brightness of the display screen 605 according to the ambient light intensity collected by the optical sensor 615. Specifically, when the ambient light intensity is high, the display brightness of the display screen 605 is increased; when the ambient light intensity is low, the display brightness of the display screen 605 is reduced. In another embodiment, the processor 601 can also dynamically adjust the shooting parameters of the camera assembly 606 according to the ambient light intensity collected by the optical sensor 615.

[0162] The proximity sensor 616, also called a distance sensor, is usually arranged on the front panel of the terminal 600. The proximity sensor 616 is used to collect the distance between the user and the front of the terminal 600. In one embodiment, when the proximity sensor 616 detects that the distance between the user and the front of the terminal 600 is gradually decreasing, the processor 601 controls the display screen 605 to switch from the screen-on state to the screen-off state; when the proximity sensor 616 detects that the distance between the user and the front of the terminal 600 is gradually increasing, the processor 601 controls the display screen 605 to switch from the screen-off state to the screen-on state.

[0163] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the terminal 600, and the terminal 600 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.

[0164] In an exemplary embodiment, a computer-readable storage medium is also provided, such as a memory including instructions, and the instructions can be executed by a processor in a terminal or a server to complete the special effects processing method of the video in the above embodiment. For example, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device.

[0165] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0166] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for processing special effects of a video, characterized in that: The method comprises: Acquire a plurality of first facial key points of a first image of a video, wherein the plurality of first facial key points are manually calibrated; For each of the plurality of first facial key points, in the first image, determine a target image block, the target image block including the first facial key point; based on pixel points of the image in the target image block, calculate an image feature of the first facial key point, the image feature being an image feature of the image block corresponding to the first facial key point in the first image, and the image feature being used to represent image information in the corresponding image block; For multiple frames of second images after the first image in the video, determine multiple image blocks of the same size as the target image block in the multiple frames of second images, and calculate image features of the multiple image blocks respectively; and determine multiple second facial key points in the multiple frames of second images that match the image features of the multiple first facial key points according to similarities between the image features of the multiple image blocks and the image features of the multiple first facial key points; Based on multiple facial key points of multiple frames of images in the video, special effects processing is performed on the multiple frames of images to obtain multiple frames of images after special effects processing; A target video is generated based on the multiple frames of images processed with the special effects.

2. The method according to claim 1, characterized in that The method further comprises: For each first facial key point among the multiple first facial key points, in the first image, determine the target image block with the first facial key point as the center and the target value as the side length.

3. The method according to claim 1, characterized in that: Before acquiring a plurality of first facial key points of the first image of the video, the method further includes: Acquire the video, and decode the video to obtain multiple frames of images of the video; Among the multiple frames of the video, a first frame of the video is determined as the first image, and the first image is displayed.

4. The method according to claim 1, characterized in that: The method further comprises: Based on a plurality of image blocks in the plurality of frames of second images, determining similarities between the plurality of image blocks and image features of the plurality of first facial key points respectively; Determine a plurality of image blocks whose image feature similarities with the plurality of first facial key points reach a target threshold; Determine the centers of the multiple image blocks as the multiple second facial key points.

5. The method according to claim 1, characterized in that The performing special effects processing on the multiple frames of images based on multiple facial key points of the multiple frames of images in the video to obtain the multiple frames of images after special effects processing comprises: For each frame of the multiple images, constructing a rectangular coordinate system in the image based on multiple facial key points of the image; Based on the rectangular coordinate system, the target facial special effect and the facial special effect parameters corresponding to the target facial special effect, the image is subjected to video special effect processing to obtain a plurality of frames of images after special effect processing.

6. The method according to claim 5, characterized in that The performing video special effects processing on the image based on the rectangular coordinate system, the target face special effects and the face special effects parameters corresponding to the target face special effects to obtain a plurality of frames of images after the special effects processing comprises: In the rectangular coordinate system, based on the facial effect parameters corresponding to the target facial effect, determining the position information of the target facial effect in the rectangular coordinate system; The target face special effects are rendered at the position corresponding to the position information to obtain multiple frames of images after special effects processing.

7. The method according to claim 5, characterized in that Before performing special effects processing on the multiple frames of images based on multiple facial key points of the multiple frames of images in the video to obtain the multiple frames of images after special effects processing, the method further includes: In response to a determination operation on the target facial special effect, sending a facial special effect acquisition request to a server, wherein the facial special effect acquisition request is used to instruct acquisition of facial special effect parameters corresponding to the target facial special effect; Receive facial effect parameters corresponding to the target facial effect returned by the server.

8. A video special effects processing device, characterized in that: The device comprises: An acquisition module, used to acquire a plurality of first facial key points of a first image of a video, wherein the plurality of first facial key points are manually calibrated; An image feature determination module is used to determine, for each first face key point among the plurality of first face key points, a target image block in the first image, wherein the target image block includes the first face key point; and calculate an image feature of the first face key point based on pixel points of the image in the target image block, wherein the image feature is an image feature of the image block corresponding to the first face key point in the first image, and the image feature is used to represent image information in the corresponding image block; A key point determination module is used to determine, for a plurality of frames of second images following the first image in the video, a plurality of image blocks of the same size as the target image block in the plurality of frames of second images, and respectively calculate image features of the plurality of image blocks; and determine, based on similarities between the image features of the plurality of image blocks and the image features of the plurality of first facial key points, a plurality of second facial key points in the plurality of frames of second images that match the image features of the plurality of first facial key points; A processing module, configured to perform special effect processing on the multiple frames of images in the video based on multiple facial key points of the multiple frames of images, so as to obtain the multiple frames of images after special effect processing; A generation module is used to generate a target video based on the multiple frames of images processed with special effects.

9. A terminal, characterized in that: The terminal includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the special effects processing method for a video as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the operation performed by the special effects processing method for a video as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image special effect generation method, device and electronic device

    CN109064387A

  • A method and apparatus for detecting key points of a human face

    CN109241921A

  • Face tracking method and device, computer device and storage medium

    CN110544272A

  • Face gender transformation method and device in video, electronic equipment and storage medium

    CN110688948A

  • Image processing method and device, electronic equipment and readable storage medium

    CN111107278A