Special-effect generation method and apparatus, and computer device and storage medium
By obtaining and updating the preview effects of special effects materials and face images, the problem of diversity and quality of special effects generation in short videos is solved, efficient and diverse special effects generation is achieved, and the user experience is improved.
Patent Information
- Application Number
- PCT/CN2024/084017
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-28
- Filing Date
- 2024-03-27
- Publication Date
- 2024-10-31
AI Technical Summary
In short video shooting, the production and selection of special effects have a significant impact on the video playback effect. However, existing technology is difficult to effectively assist users in achieving efficient and diversified special effects generation.
By obtaining the special effects material selected by the user, the preview effect of the face image and the special effects material is displayed, and based on the selection and editing operation of the target part, the special effect preview effect is updated, and finally the target special effect is generated. The method includes identifying the contour information in the video frame, separating the human body region image, superimposing it on the background image, or using the camera processing module to render and generate a special effects preview effect.
It improves the diversity and quality of special effects generation, meets users' various display needs for special effects, simplifies the special effects production process, and enhances user experience.
Smart Images

Figure CN2024084017_31102024_PF_FP_ABST
Abstract
Description
Special effects generation method, device, computer equipment and storage medium
[0001] This application claims priority to Chinese Patent Application No. 202310484117.0 filed on April 28, 2023, and the contents of the above-mentioned Chinese patent application disclosure are hereby incorporated by reference in their entirety as a part of this application. Technical Field
[0002] The present disclosure relates to a special effect generation method, device, computer equipment and storage medium. Background Art
[0003] With the development of short video technology, more and more users are using it to obtain information and share their daily lives. When shooting short videos, users often need to use special effects to beautify the videos. In practical applications, different special effects may have different presentation forms, and the playback quality of a video depends largely on the choice of special effects. Therefore, this poses a severe challenge for the production of special effects.
[0004] Summary of the Invention
[0005] The embodiments of the present disclosure at least provide a special effect generation method, apparatus, computer equipment, and storage medium.
[0006] In a first aspect, an embodiment of the present disclosure provides a special effect generation method, comprising:
[0007] In response to a user's selection operation, obtaining a selected special effect material;
[0008] Displaying a special effect preview including a face image and the special effect material on the special effect editing page;
[0009] In response to a selection operation for a target part, determining a target part image corresponding to the target part from the face image, and updating the special effect preview effect based on the target part image;
[0010] In response to a determination operation on the updated special effect preview effect, a target special effect is generated based on the display information of the target part in the updated special effect preview effect and the special effect material.
[0011] In a possible implementation manner, when the selected special effect material is a background image, the method further includes generating the special effect preview effect according to the following method:
[0012] The camera collects video;
[0013] Contour information in the video frame of the video is identified, a human body region image is separated from the video frame based on the contour information, and the human body region image is superimposed on the background image to obtain the special effect preview effect.
[0014] In a possible implementation, when the selected special effect material is a background image, the method further includes displaying the background image in the special effect preview according to the following method:
[0015] In a case where it is detected that the background image contains a target object, determining display information of the background image based on a target position of the target object in the background image and size information of the background image;
[0016] The background image is displayed according to the display information.
[0017] In a possible implementation, when the special effect material is a key point control material, the face image is a reference image, and the special effect preview effect is displayed at a first position;
[0018] The method further comprises:
[0019] Displaying a real-time special effect preview including the special effect material and the face image at a second position on the special effect editing page;
[0020] After responding to the selection operation on the target site, the method further includes:
[0021] The special effect preview effect is displayed at the second position, and the real-time special effect preview effect is displayed at the first position, wherein the display area at the first position is larger than the display area at the second position.
[0022] In one possible implementation, the response to the selection operation of the target site includes:
[0023] In response to a target part selection operation performed on the face image in the special effect preview effect; or
[0024] In response to a triggering operation of a target button corresponding to the target part.
[0025] In a possible implementation manner, the display information of the target part includes a relative position relationship between the target part image and the special effect material;
[0026] The method further includes determining the relative position relationship between the target part image and the special effect material according to the following method:
[0027] Determining first position information of the target part image in the updated special effect preview effect; and determining second position information of the special effect material in the updated special effect preview effect;
[0028] The relative position relationship between the target part image and the special effect material is determined based on the first position information and the second position information.
[0029] In a possible implementation, after updating the special effect preview based on the target part image, the method further includes:
[0030] In response to an editing operation on the target part image, display information of the edited target part is determined, and a display form of the target part is adjusted according to the display information.
[0031] In a possible implementation, obtaining the special effect preview effect includes:
[0032] Rendering the background image based on a background orthogonal camera processing module to obtain a background texture;
[0033] Inputting the background texture and the video into a main perspective camera processing module;
[0034] The main perspective camera processing module replaces other textures except the outline texture corresponding to the outline information based on the background texture, and renders to obtain the special effect preview effect.
[0035] In a possible implementation, updating the special effect preview effect based on the target part image includes:
[0036] Rendering the target part image based on a foreground orthogonal camera processing module to obtain a target part texture;
[0037] The target part texture is superimposed on the screen texture of the special effect preview effect currently being displayed.
[0038] In a second aspect, the embodiments of the present disclosure further provide a special effect generation device, comprising:
[0039] An acquisition module, configured to acquire a selected special effect material in response to a user's selection operation;
[0040] A first display module is used to display a special effect preview including a face image and the special effect material on a special effect editing page;
[0041] a second display module, configured to respond to a selection operation on a target part, determine a target part image corresponding to the target part from the face image, and update the special effect preview effect based on the target part image;
[0042] The generating module is configured to generate a target special effect based on the display information of the target part in the updated special effect preview effect and the special effect material in response to a determination operation on the updated special effect preview effect.
[0043] In a third aspect, an embodiment of the present disclosure further provides a computer device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are performed.
[0044] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned first aspect or any possible implementation of the first aspect are executed.
[0045] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.
[0047] FIG1 shows a flow chart of a special effect generation method provided by an embodiment of the present disclosure;
[0048] FIG2 a shows a schematic diagram of a special effect type selection page in the special effect generation method provided by an embodiment of the present disclosure;
[0049] FIG2 b shows a schematic diagram of a special effect preview effect in the special effect generation method provided by an embodiment of the present disclosure;
[0050] FIG2c shows a schematic diagram of displaying a target part image in the special effect generation method provided by an embodiment of the present disclosure;
[0051] FIG3 shows a flow chart of a method for determining the relative position relationship between a target part image and a special effect material provided by an embodiment of the present disclosure;
[0052] FIG4 shows a schematic diagram of the architecture of a special effect generation device provided by an embodiment of the present disclosure; and
[0053] FIG5 shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure generally described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the disclosure for which protection is sought, but merely represents selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0056] The term "and / or" herein simply describes an association relationship, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, and the existence of B alone. In addition, the term "at least one" herein refers to any combination of at least two of any one or more of a plurality of items. For example, "at least one of A, B, and C" can represent any one or more elements selected from the set consisting of A, B, and C.
[0057] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0058] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0059] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0060] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0061] To facilitate understanding of this embodiment, a special effect generation method disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the special effect generation method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities. The computer device includes, for example, a terminal device or a server or other processing device. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the special effect generation method can be implemented by a processor calling computer-readable instructions stored in a memory.
[0062] 1 is a flowchart of a special effect generation method provided by an embodiment of the present disclosure. The method includes steps 101 to 104, wherein:
[0063] Step 101: In response to a user's selection operation, obtain the selected special effect material.
[0064] Step 102: Display a special effect preview including the face image and the special effect material on the special effect editing page.
[0065] Step 103 : In response to a selection operation for a target part, a target part image corresponding to the target part is determined from the face image, and the special effect preview effect is updated based on the target part image.
[0066] Step 104 : In response to a determination operation on the updated special effect preview effect, a target special effect is generated based on the display information of the target part in the updated special effect preview effect and the special effect material.
[0067] The following is a detailed description of the above steps.
[0068] With respect to step 101 , the special effect material may be a component of a special effect. In a possible implementation, different types of special effects may correspond to different selectable special effect materials.
[0069] Here, the user's selection operation may include two, one is a selection operation for selecting a special effect type, and the other is a selection operation for selecting a specific special effect material.
[0070] Exemplarily, the selection interface can be as shown in Figure 2a. In Figure 2a, the type 1 stickers, type 2 stickers, type 3 stickers, type 4 stickers, etc. can all refer to different special effect types. After any special effect type is triggered, the user can choose to trigger the special effect material again to realize the selection of special effect material.
[0071] Here, the special effects material triggered by the user can refer to any one of the special effects materials provided by the system (i.e., the application), or any media content can be selected locally from the user end as the special effects material, for example, any picture can be selected locally as the special effects material.
[0072] It should be noted that, here, the special effects materials may include but are not limited to static pictures, dynamic pictures, videos, animations, etc.
[0073] In a possible implementation, when the special effects material is a locally uploaded material, the size of the special effects material (here may refer to the size of the memory occupied, and / or the resolution, etc.) will affect the amount of memory occupied by the target special effects finally generated. Since the generated target special effects need to be adapted to all devices, for some devices with poor performance, if the target special effects occupy too much memory, it may affect the normal use of the device.
[0074] Therefore, after responding to the user's selection operation, if the special effects material is obtained by uploading it locally, the size of the media content selected by the user can be detected first. If the size does not exceed the preset size, the special effects material uploaded locally can be obtained; and / or, the resolution of the media content selected by the user can be detected first. If the resolution does not exceed the preset resolution, the special effects material uploaded locally can be obtained.
[0075] With respect to step 102 , the facial image may refer to a reference image and / or a physical facial image, which may be specifically determined according to different special effect types.
[0076] When the special effect preview effect is displayed on the special effect editing page, the special effect preview effect generated based on the face image and the special effect material is different under different special effect types.
[0077] For example, when the special effects material is a background image, the special effects preview effect may be to use the background image as the background and superimpose the facial image on the background image; when the special effects material is other material other than the background image (such as key point control material), the special effects preview effect may refer to displaying the special effects material directly on the facial image according to a preset position.
[0078] The key point control material may refer to a material whose display position is related to the key points of the face. Specifically, when the position of the key points of the face changes, the corresponding display position may also change accordingly, for example, it may be a face sticker.
[0079] It should be noted that when the special effects material is a key point control material, since the special effects material is generally displayed on a face image, the face image is located in the bottom layer, and the special effects material is located in the layer above the layer where the face image is located; and when the special effects material is a background image, the background image is located on the bottom layer, and the layer where the face image is located is above the layer where the background image is located.
[0080] When the selected special effects material is a background image, since the user has set the background, the user may not want to display other content besides the user's face. Therefore, the user's facial contour can be extracted separately and superimposed on the background image.
[0081] In a possible implementation, when the selected special effects material is a background image, when generating a special effects preview effect, you can first obtain a reference image (the reference image can be a facial image of a standard model), then identify the human body contour information in the reference image, and based on the human body contour information, separate the human body area image from the reference image, and then superimpose the human body area image on the background image to obtain the special effects preview effect.
[0082] In another possible implementation, to enhance the presentation of facial images, a video captured by a camera can be directly used. Specifically, when the selected special effects material is a background image, when generating a special effects preview, the camera-captured video can be first acquired / controlled, and then contour information within the video frame can be identified. Based on this contour information, a human body region image can be separated from the video frame and superimposed on the background image to produce the special effects preview.
[0083] Alternatively, in another possible implementation, special effect previews generated based on the two aforementioned implementations can be displayed simultaneously. For example, as shown in FIG2b , a special effect preview generated based on a reference image can be displayed in a first position, while a special effect preview generated based on a face video can be displayed in a second position. The user can switch between the two special effect preview display positions by triggering the first position.
[0084] Here, the face video may be a beautified face video, for example, a face video that has been beautified and / or deformed.
[0085] In practical applications, the raw, unprocessed video captured by the camera can be directly obtained, and then different camera processing modules can be used to perform different processing on the raw video to obtain the face video. For example, the beauty camera processing module can be used for beauty processing, and the face deformation camera processing module can be used for face deformation processing (such as enlarging eyes, slimming the face, etc.).
[0086] Optionally, when displaying the special effect preview effect, different rendering processes can be performed based on different camera processing modules.
[0087] For example, the main perspective camera processing module can be used to identify human body contour information in the video frame, and based on the human body contour information, the human body area image can be separated from the video frame; based on the background orthogonal camera processing module, the background image can be rendered onto a texture to display the background image.
[0088] Optionally, when superimposing the facial image on the background image, the background image can be rendered based on the background orthogonal camera processing module to obtain the background texture, and then the rendered background texture and the video are input into the main perspective camera processing module. Then, the main perspective camera processing module can render the video to obtain the video texture, and replace the other textures in the video texture except the contour texture corresponding to the contour information based on the background texture, and render to obtain the special effects preview effect, thereby realizing the superposition of the human body area image and the background image.
[0089] When the special effect material is a key point control material, the special effect preview effect may be superimposing the special effect material on the face image.
[0090] Specifically, the special effect material may be pre-set with a corresponding display position, and when the special effect material is superimposed on the face image, it may be superimposed on the face image according to the corresponding display position. The preset display positions corresponding to different special effect materials may be different or the same.
[0091] After the special effect preview effect is displayed on the special effect editing page, the user can adjust the display information of the special effect material by triggering the special effect material.
[0092] The display information may include, for example, display location, display size, display direction, etc.
[0093] In the case where the special effects material is a background image, the background image may include some objects. The purpose of using the image containing the object as the background is to synthesize a photo with the object. Therefore, if the object is blocked when the background image is rendered, the purpose of generating a photo may not be achieved.
[0094] Therefore, in one possible implementation, when displaying the background image in the special effects preview background, when it is detected that the background image contains a target object, the display information of the background image can be determined based on the target position of the target object in the background image and the size information of the background image, and then the background image can be displayed according to the display information.
[0095] Here, the object may be a physical object, such as a building, a flower, etc., or a virtual object, such as a virtual character, a virtual building, etc. The display information may include, for example, a horizontal stretch ratio, a vertical stretch ratio, a cropping area range, etc.
[0096] The target position of the object in the background image can be represented by regional coordinates, for example, the coordinates of the vertices of the smallest rectangle that can enclose the object. Optionally, when determining the background display information based on the target position of the object in the background image and the size information of the background image, the display ratio of the screen interface can also be taken into consideration.
[0097] For step 103, the target part may be a physical part on the face that needs to be displayed separately, such as the eyes, nose, mouth, etc., or the target part may be a combination of multiple physical parts, such as the facial features, etc.
[0098] The selection operation for the target part may refer to a selection operation for the target part performed on the face image in the special effect preview effect; or a triggering operation for a target button corresponding to the target part.
[0099] The target part selection operation performed on the facial image in the special effect preview may, for example, be a direct selection operation on the facial image, such as a smearing operation on the facial image. If the selection operation is a direct selection operation on the facial image, then before performing the selection operation, it is necessary to first trigger a part selection button to enter part selection mode.
[0100] For example, the special effects editing page may display a "part selection" button. After triggering the button, the user can directly paint and select on the face image to achieve free selection of the target part.
[0101] Or in another possible implementation, a plurality of triggerable part buttons may be pre-set, and after any part button is detected to be triggered, the part button may be used as the target button, and the part corresponding to the part button may be used as the target part.
[0102] In a specific implementation, after any button is triggered, the position information of the target part corresponding to the button in the facial image can be detected, and the target part image corresponding to the target part can be extracted from the facial image, and the special effect preview effect can be updated based on the target part image. If the facial image does not contain the target part, the special effect preview effect cannot be updated. Therefore, before responding to the triggered target button, it can be determined that the facial image contains the target part.
[0103] For example, when there are multiple part buttons, it can be determined in advance whether the face image contains the parts corresponding to the various part buttons. If any part is included, the part button corresponding to the part is set to a triggerable state. If a part is not included, the part button corresponding to the part can be set to a non-triggerable state.
[0104] Optionally, after responding to the selection operation for the target part, key point detection can be performed on the target part in the facial image to determine the position information of the target part in the facial image, and a target part image corresponding to the target part can be segmented from the facial image based on the position information. The target part image can then be input into a foreground orthogonal camera, and the foreground orthogonal camera renders the target part image onto a texture to display the target part image.
[0105] Here, when updating the special effect preview effect based on the target part image, different updates can be performed according to different occlusion conditions of the target part, which can be specifically divided into:
[0106] Case 1: The special effects material is a background image.
[0107] When the special effect material is a background image, since the face image is superimposed on the background image, each part of the face image must not be blocked by the special effect material.
[0108] In this case, when updating the special effects preview based on the target part image, for example, the target part image can be directly displayed in any area other than the initial display area of the facial image. For example, if the target part is initially displayed in area A of the facial image, then when updating the special effects preview, the target part image can be directly superimposed in any area other than area A.
[0109] Alternatively, the target part image may be displayed in an area that satisfies a preset relative positional relationship with the initial display area. For example, if the target part is initially displayed in area A of the facial image, then when updating the special effects preview, the target part image may be directly displayed in area B, where area B satisfies a preset relative positional relationship with area A.
[0110] Here, when the target part image is displayed in the above two ways, the facial image can still display the target part, that is, the target part image is not an image separated from the facial image, but a copy of the area image corresponding to the target part in the facial image.
[0111] Alternatively, in another possible implementation, when the special effect preview effect is updated based on the target part image, the display of the face image may be directly canceled and the target part image may be displayed.
[0112] Here, canceling the display of the facial image and displaying the target part image may, for example, refer to adjusting the transparency of the remaining area images of the facial image except the target part image to 100%.
[0113] Optionally, in this embodiment, rendering can also be performed by multiple camera processing modules. For example, the foreground orthographic camera processing module can be used to render the target area image to obtain a target area texture, which can then be overlaid on the screen texture of the currently displayed special effect preview. Here, the screen texture can include the background texture rendered by the background orthographic camera processing module and the human body outline texture rendered by the main perspective camera overlaid on the background texture.
[0114] When the facial image is a video frame in a captured facial video, the display position of the target part image may move based on the movement of the display position of the target part in the facial video.
[0115] Case 2: the special effect material is a key point control material, and the target part is not blocked by the special effect material.
[0116] In this case, since the purpose of selecting the target part is to display it separately, if the target part is not blocked by the special effects material, one possible implementation method is to directly display a prompt message to inform the user that the target part cannot be displayed separately. For example, the prompt message may be "Please block the xx part before cutting out the image."
[0117] Therefore, in this embodiment, before responding to the selection operation on the target part, it can also be determined whether the target part is blocked by the special effect material.
[0118] In another possible implementation, when the special effects material is a key point control material and the target part is not blocked by the special effects material, the relative position relationship between the target part and the special effects sticker can be set in advance. When the special effects preview effect is updated based on the target part image, the target part image can be directly displayed at the corresponding position according to the relative position relationship.
[0119] Case 3: The special effect material is a key point control material, and the target part is blocked by the special effect material.
[0120] In this case, since the target part is blocked by the special effects material, the layer where the special effects material is located is above the image where the face image is located. When the special effects preview effect is updated based on the target part image, a new layer can be created and superimposed on the layer where the special effects material is located, and the target part image can be displayed on the newly created layer. The display effect can be exemplified as shown in Figure 2c.
[0121] When the facial image is a reference image, since the reference image may dynamically display the display effect of the special effect material, the reference image and the physical facial image may be combined at the same time.
[0122] When displaying the special effect preview, if the special effect material is a key point control material, the special effect preview can be displayed at the first position of the special effect editing page, and a real-time special effect preview including the special effect material and the facial image can be displayed at the second position of the special effect editing page. The display area at the first position is larger than the display area at the second position.
[0123] After responding to the selection operation for the target part, in order to more clearly display the target part image, the display positions of the special effect preview effect and the real-time special effect preview effect can be exchanged, that is, the special effect preview effect is displayed at the second position, and the real-time special effect preview effect is displayed at the first position.
[0124] Correspondingly, when the special effect preview effect is updated based on the target part image, the real-time special effect preview effect can also be updated based on the target part image at the same time.
[0125] Because the face in the reference image is more standard, if the special effects material is a key point control material, the special effects preview containing the reference image can be displayed at the first position by default. This facilitates adjustment of the key point control material's display position and accurately establishes the relative positional relationship between the key point control material and the reference image. The larger display area at the first position allows the real-time special effects preview to more comprehensively and dynamically display the special effects. Therefore, after selecting the target area, the real-time special effects preview can be displayed at the first position to fully demonstrate the special effects.
[0126] When displaying the special effects preview effect, if the special effects material is a background image, since the user may prefer to dynamically view the display effect of the background image when performing the special effects preview, the face image in the special effects preview effect can be an image in the face video, that is, the special effects preview effect itself is a special effects preview effect generated based on a physical face.
[0127] In one possible implementation, after updating the special effect preview based on the target part image, the user can also manually edit the target part image. For example, in response to the editing operation on the target part image, the display information of the edited target part can be determined, and the display form of the target part can be adjusted according to the display information.
[0128] Here, the display information may refer to, for example, a display position, a display size, a display triggering condition (such as blinking to trigger the display, etc.), a display direction, etc.
[0129] It should be noted that the types of information included in the above-mentioned multiple display information can be the same or different, and can be specifically set according to actual conditions.
[0130] In another possible implementation, after the special effect preview effect is updated based on the target part image, at least a portion of the target part image may be hidden in response to a user trigger operation.
[0131] For example, if the target part includes facial features, the user can hide the nose and / or eyes by performing a trigger operation.
[0132] The trigger operation here may be, for example, a trigger operation for a hidden button in a certain part, and the present disclosure is not limited to other triggering methods.
[0133] For step 104,
[0134] The operation of confirming the updated special effect preview effect may be, for example, a triggering operation of a completion button in the special effect editing page. The updated special effect preview effect is the currently displayed special effect preview effect.
[0135] In a possible implementation, when the special effect material is a key point control material, the display information may further include a relative positional relationship between the target part image and the special effect material. The relative positional relationship between the target part image and the special effect material may be determined according to the method shown in FIG3 , including the following steps:
[0136] Step 301: Determine the first position information of the target part image in the updated special effect preview effect; and determine the second position information of the key point control material in the updated special effect preview effect.
[0137] Here, the second position information may be position information of the key point control material associated with the target part image. When there are multiple key point control materials added, the user may manually select the key point control material associated with the target part image. For example, the association guide lines between each key point control material and the target part image may be displayed, and the user may trigger the selection of the association guide line to establish an association between the target part image and the key point control material. The key point control materials associated with different target part images may not be exactly the same, and the same target part image may be associated with at least one key point control material.
[0138] Step 302: Determine the relative position relationship between the target part image and the special effect material based on the first position information and the second position information.
[0139] In another possible implementation, the relative positional relationship between the target part image and the special effect material may also be related to the type of the special effect material.
[0140] For example, if the special effects material is a foreground sticker, the display position of the special effects material on the screen interface is fixed, and the relative position relationship between the target part image and the special effects material is empty; if the special effects material is a facial sticker, the relative position relationship is determined based on the method shown in Figure 3.
[0141] After generating a target special effect based on the display information of the target part and the special effect material, when the target special effect is applied, the target part in the face video captured by the camera can be extracted and displayed according to the display information of the target part, and the special effect material can be displayed.
[0142] In the special effects generation method provided by the disclosed embodiments, users can freely select special effects materials and preview the special effects by displaying a special effects preview containing a face image and special effects materials on the special effects editing page. Furthermore, users can freely select target areas within the displayed face image to display only the target areas. This approach enriches the generation methods of special effects and improves the diversity and quality of generated special effects.
[0143] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0144] Based on the same inventive concept, the embodiment of the present disclosure also provides a special effect generation device corresponding to the special effect generation method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned special effect generation method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0145] 4 is a schematic diagram of the architecture of a special effect generation device provided by an embodiment of the present disclosure, the device includes: an acquisition module 401, a first display module 402, a second display module 403, and a generation module 404; wherein,
[0146] The acquisition module 401 is used to acquire the selected special effect material in response to the user's selection operation;
[0147] A first display module 402 is used to display a special effect preview including a face image and the special effect material on a special effect editing page;
[0148] The second display module 403 is configured to respond to a selection operation on a target part, determine a target part image corresponding to the target part from the face image, and update the special effect preview based on the target part image;
[0149] The generating module 404 is configured to generate a target special effect based on the display information of the target part in the updated special effect preview effect and the special effect material in response to a determination operation on the updated special effect preview effect.
[0150] In a possible implementation manner, when the selected special effect material is a background image, the first display module 402 is further configured to generate the special effect preview effect according to the following method:
[0151] The camera collects video;
[0152] Contour information in the video frame of the video is identified, a human body region image is separated from the video frame based on the contour information, and the human body region image is superimposed on the background image to obtain the special effect preview effect.
[0153] In a possible implementation manner, when the selected special effect material is a background image, the first display module 402 is further configured to display the background image in the special effect preview according to the following method:
[0154] In a case where it is detected that the background image contains a target object, determining display information of the background image based on a target position of the target object in the background image and size information of the background image;
[0155] The background image is displayed according to the display information.
[0156] In a possible implementation, when the special effect material is a key point control material, the face image is a reference image, and the special effect preview effect is displayed at a first position;
[0157] The second display module 403 is further configured to:
[0158] Displaying a real-time special effect preview including the special effect material and the face image at a second position on the special effect editing page;
[0159] After responding to the selection operation on the target part, the second display module 403 is further used to:
[0160] The special effect preview effect is displayed at the second position, and the real-time special effect preview effect is displayed at the first position, wherein the display area at the first position is larger than the display area at the second position.
[0161] In a possible implementation, the second display module 403, in response to a selection operation on a target part, is configured to:
[0162] In response to a target part selection operation performed on the face image in the special effect preview effect; or
[0163] In response to a triggering operation of a target button corresponding to the target part.
[0164] In a possible implementation manner, the display information of the target part includes a relative position relationship between the target part image and the special effect material;
[0165] The generating module 404 is further configured to determine the relative position relationship between the target part image and the special effect material according to the following method:
[0166] Determining first position information of the target part image in the updated special effect preview effect; and determining second position information of the special effect material in the updated special effect preview effect;
[0167] The relative position relationship between the target part image and the special effect material is determined based on the first position information and the second position information.
[0168] In a possible implementation, after updating the special effect preview effect based on the target part image, the second display module is further configured to:
[0169] In response to an editing operation on the target part image, display information of the edited target part is determined, and a display form of the target part is adjusted according to the display information.
[0170] In a possible implementation, the first display module 402 is configured to generate the special effect preview effect according to the following method:
[0171] Rendering the background image based on a background orthogonal camera processing module to obtain a background texture;
[0172] Inputting the background texture and the video into a main perspective camera processing module;
[0173] The main perspective camera processing module replaces other textures except the outline texture corresponding to the outline information based on the background texture, and renders to obtain the special effect preview effect.
[0174] In a possible implementation, when the second display module 403 updates the special effect preview effect based on the target part image, it is configured to:
[0175] Rendering the target part image based on a foreground orthogonal camera processing module to obtain a target part texture;
[0176] The target part texture is superimposed on the screen texture of the special effect preview effect currently being displayed.
[0177] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0178] Based on the same technical concept, the embodiment of the present disclosure also provides a computer device. Referring to Figure 5, there is a schematic diagram of the structure of the computer device 500 provided in the embodiment of the present disclosure. The computer device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc., or various forms of servers, such as independent servers or server clusters. The computer device shown in Figure 5 is only an example and should not bring any limitations to the functions and scope of use of the embodiment of the present disclosure.
[0179] As shown in FIG5 , a computer device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory device (ROM) 502 or a program loaded from a storage device 505 into a random access memory device (RAM) 503. Various programs and data required for the operation of the computer device 500 are also stored in the RAM 503. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0180] Typically, the following devices may be connected to I / O interface 505: input device 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output device 507 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 508 including, for example, a magnetic tape, hard disk, etc.; and communication device 509. Communication device 509 may allow computer device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG5 illustrates computer device 500 with various devices, it should be understood that not all of the illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0181] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing a word recommendation method. In such an embodiment, the computer program can be downloaded and installed from a network via the communication device 509, or installed from the storage device 505, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0182] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the special effect generation method described in the above method embodiment. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0183] The embodiments of the present disclosure also provide a computer program product, which carries program code. The instructions included in the program code can be used to execute the steps of the special effects generation method described in the above method embodiment. For details, please refer to the above method embodiment and will not be repeated here.
[0184] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0185] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0186] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0187] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0188] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0189] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims
1. A special effect generation method, include: In response to a selection operation by a user, obtaining a selected special effect material; Displaying a special effect preview including a face image and the special effect material on a special effect editing page; In response to a selection operation on a target part, determining a target part image corresponding to the target part from the face image, and updating the special effect preview effect based on the target part image; as well as In response to a determination operation on an updated special effect preview effect, a target special effect is generated based on the display information of the target part in the updated special effect preview effect and the special effect material.
2. The method according to claim 1, in, In the case where the selected special effect material is a background image, the method further comprises generating the special effect preview effect according to the following method: The camera collects video; Contour information in the video frame of the video is identified, a human body region image is separated from the video frame based on the contour information, and the human body region image is superimposed on the background image to obtain the special effect preview effect.
3. The method according to claim 1 or 2, in, In the case where the selected special effect material is a background image, the method further comprises displaying the background image in the special effect preview effect according to the following method: In a case where it is detected that the background image contains a target object, based on a target position of the target object in the background image and size information of the background image, determining display information of the background image; The background image is displayed according to the display information.
4. The method according to claim 1, in, In the case where the special effect material is a key point control material, the face image is a reference image, and the special effect preview effect is displayed at a first position; The method further comprises: Displaying a real-time special effect preview including the special effect material and the face image at a second position on the special effect editing page; After the response to the selection operation on the target site, the method further includes: The special effect preview effect is displayed at the second position, and the real-time special effect preview effect is displayed at the first position, wherein the display area at the first position is larger than the display area at the second position.
5. The method according to claim 1, in, The response to the selection operation on the target site includes: In response to a selection operation of the target part performed on the face image in the special effect preview effect; or, In response to a triggering operation of a target button corresponding to the target part.
6. The method according to claim 1, in, The display information of the target part includes the relative position relationship between the target part image and the special effect material; The method further includes determining the relative position relationship between the target part image and the special effect material according to the following method: Determine the first position information of the target part image in the updated special effect preview effect; and determine the second position information of the special effect material in the updated special effect preview effect; The relative position relationship between the target part image and the special effect material is determined based on the first position information and the second position information.
7. The method according to claim 1, in, After updating the special effect preview effect based on the target part image, the method further includes: In response to an editing operation on the target part image, display information of the edited target part is determined, and a display form of the target part is adjusted according to the display information.
8. The method according to claim 2, in, The obtaining of the special effect preview effect includes: Rendering the background image based on a background orthogonal camera processing module to obtain a background texture; Inputting the background texture and the video into a main perspective camera processing module; The main perspective camera processing module replaces other textures except the outline texture corresponding to the outline information based on the background texture, and renders to obtain the special effect preview effect.
9. The method according to claim 1, in, The updating of the special effect preview effect based on the target part image includes: The target part image is rendered based on the foreground orthogonal camera processing module to obtain the target part image. bit texture; The target part texture is superimposed on the screen texture of the special effect preview effect currently being displayed.
10. A special effect generating device, include: An acquisition module, configured to acquire the selected special effect material in response to a selection operation of a user; A first display module is configured to display a special effect preview effect including a face image and the special effect material on a special effect editing page; A second display module is configured to determine a target part image corresponding to the target part from the face image in response to a selection operation on the target part, and update the special effect preview effect based on the target part image; as well as The generation module is configured to generate a target special effect based on the display information of the target part in the updated special effect preview effect and the special effect material in response to a determination operation on the updated special effect preview effect.
11. A computer device, include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the special effect generation method as described in any one of claims 1 to 9 are performed.
12. A computer-readable storage medium, in, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the special effect generation method according to any one of claims 1 to 9 are executed.
Citation Information
Patent Citations
Video image processing method and device and terminal
CN107888845A
Sticker generation method and device, medium and electronic equipment
CN112132859A
Video playing method, device and equipment
CN113068072A
Special effect processing method and device, electronic equipment and storage medium
CN115904193A
Special effect generation method and device, computer equipment and storage medium
CN116471366A
Cited By
Multimedia interaction method and device, electronic equipment and storage medium
CN119967276A
A multimedia interactive method, device, electronic device and storage medium
CN119967276B
Video processing method, video processor, storage medium and program product
CN121194029A
