Method and device for generating special effect program file package, method and device for generating special effect, and electronic device
AssigneeBeijing Sensetime Technology Development Co., Ltd.
InventorsQinqin Xu, Zhanpeng Li
Life of this patent
Estimating the term…
Abstract
A method for generating a special effect program file package includes: importing a group of sub-materials, where the group of sub-materials include a plurality of sub-materials; obtaining parameter values of playback parameters of the group of sub-materials; and generating a special effect program file package according to the group of sub-materials and the parameter values of the playback parameters.
Claims25
A computer-implemented method for generating a special effect program file package, comprising:
- importing a group of sub-materials, wherein the group of sub-materials comprises a plurality of sub-materials, wherein the plurality of sub-materials have a predetermined playback time sequence;
- obtaining parameter values of playback parameters of the group of sub-materials;
- and
- generating the special effect program file package according to the group of sub-materials and the parameter values of the playback parameters,
- wherein in response to a trigger action, which corresponds to respective ones of the plurality of sub-materials and which is performed by a user, being detected, a corresponding special effect for the respective ones of the plurality of sub-materials is generated and displayed, and the playback parameters of the group of sub-materials comprise a trigger action parameter used for representing a trigger action for triggering display of the plurality of sub-materials, a position type parameter used for representing a type of a relationship between each of the plurality of sub-materials and a respective position, and any one or more of the following:
- a display parameter, used for representing whether the plurality of sub-materials are displayed;
- an interval parameter, used for representing a number of frames spaced between two adjacent sub-materials in the plurality of sub-materials for display;
- a trigger action parameter, used for representing a trigger action for triggering display of the plurality of sub-materials;
- a loop parameter, used for representing a number of times of loop playback of the plurality of sub-materials;
- a trigger delay parameter, used for representing an amount of time for which a display of the plurality of sub-materials is delayed;
- a trigger stop parameter, used for representing an action for stopping the display of the plurality of sub-materials;
- a display scale parameter, used for representing a reference basis for a change in a display size of the plurality of sub-materials;
- a position type parameter, used for representing a type of a relationship between each of the plurality of sub-materials and a respective position;
- a position relation parameter, used for representing whether the plurality of sub-materials move with a preset reference part;
- a position parameter, used for representing a position binding relationship between each of the plurality of sub-materials and a respective preset key point;
- a rotation parameter, used for representing a key point around which the plurality of sub-materials rotate;
- and or
- a beautifying/make-up effect parameter, used for representing a beautifying/make-up effect displayed at a preset part when the plurality of sub-materials are displayed,
- wherein the trigger action corresponding to the trigger action parameter comprises any one or more of the following:
- trigger without an action, an eye action, a head action, an eyebrow action, a hand action, a mouth action, or a shoulder action,
- wherein the position type parameter comprises any one of the following:
- a parameter used for representing a foreground;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a face;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a hand;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a head;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a shoulder;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of an arm;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a waist;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a leg;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a foot;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a human skeleton;
- a playback position relationship related to the preset reference part;
- or
- a parameter used for representing a background, and
- wherein the playback position relationship related to the preset reference part comprises any one or more of the following:
- the plurality of sub-materials move with the position of the preset reference part, and the plurality of sub-materials are scaled with a size of the preset reference part;
- the plurality of sub-materials move with the position of the preset reference part, the plurality of sub-materials are scaled with the size of the preset reference part, and the plurality of sub-materials are scaled in depth with rotation of the preset reference part;
- or
- the plurality of sub-materials move with the position of the preset reference part, the plurality of sub-materials are scaled with the size of the preset reference part, the plurality of sub-materials are scaled in depth with rotation of the preset reference part, and the plurality of sub-materials rotate with rotation of a plane of the preset reference part.
A computer-implemented method for generating a special effect, comprising:
- obtaining parameter values of playback parameters of at least one group of sub-materials in a special effect program file package, wherein the at least one group of sub-materials comprises a plurality of sub-materials;
- performing key-point detection on a video image;
- and
- generating a special effect based on the at least one group of sub-materials on the video image according to detected key points and the parameter values of the playback parameters of the at least one group of sub-materials,
- the method further comprises:
- importing the special effect program file package,
- wherein importing the special effect program file package comprises:
- reading the special effect program file package to a memory by invoking a first interface function for reading a sticker material;
- and parsing the special effect program file package to obtain the at least one group of sub-materials and a special effect program file, wherein the special effect program file comprises the parameter values of the playback parameters of the at least one group of sub-materials.
- wherein the plurality of sub-materials have a predetermined playback time sequence,
- wherein the playback parameters comprise:
- a trigger action parameter, used for representing a trigger action for triggering display of the plurality of sub-materials;
- the method further comprises:
- detecting whether a trigger action corresponding to a parameter value of the trigger action parameter occurs in the video image,
- wherein generating the special effect based on the at least one group of sub-materials on the video image according to detected key points and the parameter values of the playback parameters of the at least one group of sub-materials comprises:
- in response to detecting that the trigger action corresponding to the parameter value of the trigger action parameter occurs in the video image, generating the special effect of the at least one group of sub-materials on the video image according to the detected key points and the parameter values of the playback parameters of the at least one group of sub-materials.
An electronic device, comprising:
- a memory storing processor-executable instructions;
- and
- a processor arranged to execute the stored processor-executable instructions to perform operations of:
- importing a group of sub-materials, wherein the group of sub-materials comprises a plurality of sub-materials, that have a predetermined playback time sequence, obtaining parameter values of playback parameters of the group of sub-materials, and generating a special effect program file package according to the group of sub-materials and the parameter values of the playback parameters;
- or,
- obtaining parameter values of playback parameters of at least one group of sub-materials in the special effect program file package, wherein the at least one group of sub-materials comprises a plurality of sub-materials, that have a predetermined playback time sequence, performing key-point detection on a video image, and generating a special effect based on the at least one group of sub-materials on the video image according to detected key points and the parameter values of the playback parameters of the at least one group of sub-materials,
- wherein in response to a trigger, which corresponds to respective one of the plurality of sub-materials and which is performed by a user, being detected, a corresponding special effect for the respective ones of the plurality of sub-materials is generated and displayed, and the playback parameters of the group of sub-materials comprise a trigger action parameter used for representing a trigger action for triggering display of the plurality of sub-materials, a position type parameter used for representing a type of a relationship between each of the plurality of sub-materials and a respective position, and any one or more of the following:
- a display parameter, used for representing whether the plurality of sub-materials are displayed;
- an interval parameter, used for representing a number of frames spaced between two adjacent sub-materials in the plurality of sub-materials for display;
- a trigger action parameter, used for representing a trigger action for triggering display of the plurality of sub-materials;
- a loop parameter, used for representing a number of times of loop playback of the plurality of sub-materials;
- a trigger delay parameter, used for representing an amount of time for which a display of the plurality of sub-materials is delayed;
- a trigger stop parameter, used for representing an action for stopping the display of the plurality of sub-materials;
- a display scale parameter, used for representing a reference basis for a change in a display size of the plurality of sub-materials;
- a position type parameter, used for representing a type of a relationship between each of the plurality of sub-materials and a respective position;
- a position relation parameter, used for representing whether the plurality of sub-materials move with a preset reference part;
- a position parameter, used for representing a position binding relationship between each of the plurality of sub-materials and a respective preset key point;
- a rotation parameter, used for representing a key point around which the plurality of sub-materials rotate;
- and or
- a beautifying/make-up effect parameter, used for representing a beautifying/make-up effect displayed at a preset part when the plurality of sub-materials are displayed,
- wherein the trigger action corresponding to the trigger action parameter comprises any one or more of the following:
- trigger without an action, an eye action, a head action, an eyebrow action, a hand action, a mouth action, or a shoulder action,
- wherein the position type parameter comprises any one of the following:
- a parameter used for representing a foreground;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a face;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a hand;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a head;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a shoulder;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of an arm;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a waist;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a leg;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a foot;
- a parameter used for representing that the plurality of sub-materials are positioned and/or move with a position of a human skeleton;
- a playback position relationship related to the preset reference part;
- or
- a parameter used for representing a background, and
- wherein the playback position relationship related to the preset reference part comprises any one or more of the following:
- the plurality of sub-materials move with the position of the preset reference part, and the plurality of sub-materials are scaled with a size of the preset reference part;
- the plurality of sub-materials move with the position of the preset reference part, the plurality of sub-materials are scaled with the size of the preset reference part, and the plurality of sub-materials are scaled in depth with rotation of the preset reference part;
- or
- the plurality of sub-materials move with the position of the preset reference part, the plurality of sub-materials are scaled with the size of the preset reference part, the plurality of sub-materials are scaled in depth with rotation of the preset reference part, and the plurality of sub-materials rotate with rotation of a plane of the preset reference part.
Dependencies are inferred from the claim text.