Animation generation method and device, storage medium and electronic device
By collecting live broadcast scene images from different angles and generating depth information images, and combining action templates to generate special effects animations, the problem of low adaptability between special effects animations and live broadcast rooms is solved, and personalized and vivid special effects display is achieved.
Patent Information
- Application Number
- CN202111649667.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-29
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-29
AI Technical Summary
In the existing technology, the special effects animation has low adaptability to the live broadcast room, lacks personalization, and cannot match the live broadcast scene.
By collecting images of live broadcast scenes at different angles, calculating depth information images, generating target special effects images, and combining target action templates to generate matching special effects animations, the matching of special effects and live broadcast scenes is achieved.
Improved the compatibility between special effects animation and the live broadcast room, making the animation more personalized and vivid, and enhancing its relevance to the live broadcast scene.
Smart Images

Figure CN114332312B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to an animation generation method and device, a storage medium and an electronic device. Background Art
[0002] Currently, in real-time interactive fields such as chatting and live broadcasting, special effects can usually be added to increase the diversity of displayed images.
[0003] However, special effect images and special effect animations are all images or animations set by the system that are directly pasted on the display screen. The same special effect is the same for different live broadcast rooms. While lacking personalization, the special effect has no connection with the live broadcast room and has a low degree of adaptability to the live broadcast room.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide an animation generation method and device, a storage medium and an electronic device to at least solve the technical problem of low compatibility between special effect animation and a live broadcast room.
[0006] According to one aspect of an embodiment of the present invention, there is provided an animation generation method, comprising: in response to a special effect generation instruction triggered by a live scene currently undergoing screen capture, calculating a depth information image using a first image and a second image, wherein the first image and the second image are screen images obtained by capturing the live scene from different angles, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where a regional image containing the target object is located; generating a target special effect image corresponding to the target object using the depth information image, the first image and the second image; and generating a target special effect animation matching the target object using the action parameters of the target action and the target special effect image when a target action is determined from a target action template corresponding to the target object.
[0007] According to another aspect of an embodiment of the present invention, an animation generation device is also provided, including: an acquisition unit, for responding to a special effect generation instruction triggered by a live scene currently undergoing screen capture, and calculating a depth information image using a first image and a second image, wherein the first image and the second image are screen images obtained by capturing the live scene from different angles, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where the regional image containing the target object is located; an image generation unit, for generating a target special effect image corresponding to the target object using the depth information image, the first image and the second image; and an animation generation unit, for generating a target special effect animation matching the target object using the action parameters of the target action and the target special effect image when a target action is determined from a target action template corresponding to the target object.
[0008] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned animation generation method when running.
[0009] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the animation generation method through the computer program.
[0010] In an embodiment of the present invention, a high special effect generation instruction is adopted in response to the triggering of a live broadcast scene, a depth information image is calculated using the first image and the second image collected from the live broadcast scene at different angles, and a target special effect image corresponding to the target object is generated based on the first image, the second image and the depth information image. A target special effect animation matching the target object is generated based on the target action and the target special effect image determined from the target action template corresponding to the target object. By responding to the special effect generation instruction, a target special effect image with depth information corresponding to the target object in the live broadcast scene is generated, thereby generating a target special effect animation corresponding to the target object based on the target special effect image and the target action, thereby achieving the purpose of making the target special effect animation displayed in the live broadcast room correspond to the target object in the live broadcast scene, thereby achieving the technical effect of matching the special effect animation with the live broadcast scene of the live broadcast room and improving the adaptability of the special effect animation to the live broadcast room, thereby solving the technical problem of low adaptability of the special effect animation to the live broadcast room. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0012] Figure 1 is a schematic diagram of an application environment of an optional animation generation method according to an embodiment of the present invention;
[0013] Figure 2 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0014] Figure 3 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0015] Figure 4 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0016] Figure 5 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0017] Figure 6 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0018] Figure 7 is a flowchart of an optional animation generation method according to an embodiment of the present invention;
[0019] Figure 8 is a schematic structural diagram of an optional animation generating device according to an embodiment of the present invention;
[0020] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] According to one aspect of an embodiment of the present invention, an animation generation method is provided. Optionally, the animation generation method can be applied to, but is not limited to, Figure 1 In the environment shown. The terminal device 102 exchanges data with the server 112 through the network 110. The terminal device 102 is not limited to a client having a live broadcast function by capturing images of a live broadcast scene. When a special effect generation request is initiated based on the client in the terminal device 102, the terminal device 102 sends the special effect generation instruction to the server 112 through the network 110. The server 112 generates a target special effect animation based on the special effect generation instruction, and returns the target special effect animation to the terminal device 102 through the network 110, so as to realize the special effect generation in the client by playing the target special effect animation.
[0024] The server 112 runs a database 114 and a processing engine 116. The database 114 is not limited to storing data such as special effect generation instructions and target special effect animations, and the processing engine 116 is not limited to realizing the generation of target special effect animations by sequentially executing S102 to S106. S102, calculating a depth information image. In response to a special effect generation instruction triggered by a live scene currently being captured, a depth information image is calculated using a first image and a second image acquired from different angles of the live scene, the image similarity between the first image and the second image meets the image similarity condition, the target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where the area image containing the target object is located. S104, generating a target special effect image. Using the depth information image, the first image and the second image, a target special effect image corresponding to the target object is generated. S106, generating a target special effect animation. When a target action is determined from a target action template corresponding to the target object, a target special effect animation matching the target object is generated using the action parameters of the target action and the target special effect image.
[0025] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an IOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart home device, etc. The target client may be an audio client, a video client, an instant messaging client, a browser client, etc. The network 110 may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The server 112 may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and no limitation is made to this in this embodiment.
[0026] As an optional implementation, Figure 2 As shown, the above animation generation method includes:
[0027] S202, in response to a special effect generation instruction triggered by a live broadcast scene currently being captured, a depth information image is calculated using the first image and the second image.
[0028] In S202, the first image and the second image are screen images obtained by capturing the live scene from different angles, the image similarity between the first image and the second image meets the image similarity condition, the target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where the area image containing the target object is located.
[0029] The special effects generation instruction is used to instruct the generation of special effects animation for the live broadcast scene, so that the originally static objects in the live broadcast scene have dynamic special effects animation. The special effects animation generated based on the special effects generation instruction is targeted at physical or virtual objects other than the live broadcast object in the live broadcast scene. The live broadcast scene is the scene where the current live broadcast object is located, including the live broadcast object and the live broadcast background. The special effects animation is not targeted at the live broadcast object itself, but can be targeted at physical or virtual objects such as the patterns displayed on the clothes worn by the live broadcast object and the decorations worn. A virtual object is a two-dimensional image / pattern with content carried on a physical object, and a physical object is a three-dimensional object with thickness, such as a doll or decoration.
[0030] When the live broadcast background includes the real background of the live broadcast object, the live broadcast background includes various physical objects within the collection range and the patterns on each physical object. For example, objects such as sofas, paintings, pillows, dolls, microphones, and patterns on pillows, patterns on paintings, etc. When the live broadcast background is a virtual background set for the live broadcast object, the live broadcast background includes the patterns displayed by the virtual background, such as mountains, rivers, plants and trees in the virtual landscape background, and various cartoon patterns in the virtual cartoon background.
[0031] In the case where the first image and the second image are images obtained by capturing images of a live broadcast scene from different angles, the first capture angle corresponding to the first image is different from the second capture angle corresponding to the second image. The capture of the first image and the second image is not limited to a terminal device that is implementing a live broadcast function, and is not limited to adjusting the shooting angle of the terminal device shooting the live broadcast scene to achieve image capture of the live broadcast scene at different angles. Adjustment of the shooting angle is not limited to including at least one of the following: the position of a mobile terminal device, rotating the terminal device. Moving the position of the terminal device refers to changing the position of the terminal device relative to the live broadcast scene, changing the shooting position of the terminal device for the live broadcast scene. Rotating the terminal device refers to rotating the terminal device to change the shooting angle of the terminal device for the live broadcast scene without changing the position of the terminal device.
[0032] Due to the movement and / or rotation of the mobile terminal that captures the live scene image, the image content of the first image and the second image are different, but the image content similarity of the first image and the second image meets the image similarity condition. When the image content similarity of the first image and the second image meets the similarity condition, the first image and the second image include at least one identical object.
[0033] The target object identified from both the first image and the second image can be a physical object or a virtual object, such as a pattern on a physical object. The identification of the target object is not limited to performing object recognition on one of the first image and the second image. When the object is recognized, an object search is performed on the other image, and the object found on the other image is determined as the target object. For example, object recognition is first performed on the first image to identify an object with preset features, and a feature object identified on the first image is obtained. A feature object search is performed on the second image. When the number of feature objects is greater than one, each feature object is searched in turn, and the feature object found in the second image is determined as the target object.
[0034] Here, the object recognition on the first image and the second image is not limited to the detection and recognition of the characteristic objects by the target monitoring algorithm. The preset features of the characteristic objects are not limited to anthropomorphic features. The generation of special effects animation for objects with anthropomorphic features makes the special effects animation more reasonable and vivid. The anthropomorphic features are not limited to indicating objects including similar parts such as facial features and limbs. For example, dolls, cartoon characters on clothes, animal images on pillows, human ornaments, etc.
[0035] The depth information image is used to provide depth information for the target special effect image, so that the two-dimensional target special effect image has a three-dimensional effect, thereby making the special effect animation generated based on the target special effect image more vivid. The depth information image is not limited to a depth map that focuses on the area where the target object is located.
[0036] S204: Generate a target special effect image corresponding to the target object by using the depth information image, the first image and the second image.
[0037] Generating a target special effect image using the depth information image, the first image, and the second image is not limited to using an image generation model, and the depth information image, the first image, and the second image are input into the image generation model to obtain the target special effect image output by the image generation model. The image generation model is not limited to a special effect image generation model trained using sample images.
[0038] The target special effect image can be generated by using the depth information image, the first image and the second image, or by adjusting the matched preset model based on the depth information image, the first image and the second image, so as to generate the target special effect image according to the preset model. The preset model is not limited to determining a 3D model that matches the target object from a plurality of preset candidate models, and the 3D model that matches the target object is not limited to being the model with the highest similarity to the target object among the plurality of preset candidate models. When the 3D model is determined, it is not limited to fusing the object features of the target object indicated by the depth information image, the first image and the second image into the 3D model, so as to obtain the target special effect image corresponding to the target object based on the 3D model that fuses the object features of the target object. The object features of the target object indicated by the depth information image, the first image and the second image at least include the object contour features of the target object. Obtaining the target special effect image corresponding to the target object based on the 3D model that fuses the object features of the target object is not limited to using the model mapping method, and the target special effect image is obtained by mapping the 3D model at the target angle.
[0039] The target special effect image corresponds to the target object one-to-one. When the number of target object objects is greater than one, the number of target special effect images is the same as the number of target object objects. When generating a target special effect image, it is not limited to adjusting the target special effect image, and the range of adjustment is not limited to parameters including color, texture, transparency, clarity, etc. A special effect animation is generated based on the adjusted target special effect image.
[0040] S206, when the target action is determined from the target action template corresponding to the target object, the target special effect animation matching the target object is generated by using the action parameters of the target action and the target special effect image.
[0041] The target action template is an action template determined based on the target object, and is not limited to an action template determined based on the object type to which the target object belongs and the types of components included. The number of actions under each type in the action template is greater than or equal to one.
[0042] Generating a target special effect animation using a target action and a target special effect image is not limited to changing the target special effect image according to the target action, generating multiple special effect images with different action amplitudes, and then arranging and combining them at a preset frame rate to form a target special effect animation.
[0043] In an embodiment of the present application, a high special effect generation instruction is adopted in response to the triggering of the live broadcast scene, and a depth information image is calculated using the first image and the second image obtained by collecting the live broadcast scene at different angles, and a target special effect image corresponding to the target object is generated based on the first image, the second image and the depth information image. A target special effect animation matching the target object is generated based on the target action and the target special effect image determined from the target action template corresponding to the target object. By responding to the special effect generation instruction, a target special effect image with depth information corresponding to the target object in the live broadcast scene is generated, thereby generating a target special effect animation corresponding to the target object based on the target special effect image and the target action, so as to achieve the purpose of making the target special effect animation displayed in the live broadcast room correspond to the target object in the live broadcast scene, thereby achieving the technical effect of matching the special effect animation with the live broadcast scene of the live broadcast room, and improving the adaptability of the special effect animation to the live broadcast room, thereby solving the technical problem of low adaptability of the special effect animation to the live broadcast room.
[0044] As an optional implementation, Figure 3 As shown, before calculating the depth information image using the first image and the second image, the method further includes:
[0045] S302, taking a picture captured from a live broadcast scene at a first angle as a first image;
[0046] S304, acquiring a candidate image set by capturing images of the live scene at a candidate angle, wherein the candidate image set includes at least two consecutive candidate images captured at the candidate angle;
[0047] S306, calculating the image similarity between each candidate image and the first image, and obtaining the candidate similarity corresponding to the candidate image set;
[0048] S308 , when the candidate similarity satisfies the image similarity condition, determining a target candidate image from the candidate image set as the second image, wherein the image similarity between the target candidate image and the first image satisfies the image similarity condition.
[0049] Before calculating the depth information image, it is not limited to first obtaining the first image and the second image. The first angle is not limited to being the initial angle for capturing the live scene. In the case where a special effect generation request is not initiated through the terminal device, the live object is not limited to using the initial angle for live broadcast. The first angle can also be an image generated by the terminal device capturing the live scene at the initial angle when a special effect generation request is initiated.
[0050] It is not limited to responding to the special effect generation instruction, sending angle adjustment prompt information to the terminal device to notify the live broadcast object using the terminal device to adjust the angle at which the terminal device captures the live broadcast scene to obtain the second image. In the case where the terminal device is a terminal device that can be remotely controlled, it is not limited to sending an angle adjustment instruction to the terminal device so that the terminal device adjusts the angle at which the live broadcast scene is captured. The angle adjustment instruction is not limited to carrying a reference angle to instruct the terminal device to adjust the capture angle according to the reference angle.
[0051] When it is detected that the angle is adjusted from the first angle to the candidate angle, a candidate image set at the candidate angle is obtained, wherein the candidate image set includes multiple images continuously captured at the candidate angle. The similarity between each candidate image and the first image is calculated, and is not limited to similarity calculation by using a scale invariant feature transform (SIFT) descriptor. The image similarity between the candidate image and the first image is determined by matching the candidate image with the first image using SIFT descriptors.
[0052] Determining the candidate similarity of the candidate image set by the image similarity between each candidate image and the first image is not limited to statistically analyzing the image similarity corresponding to each candidate image and using the statistical result as the candidate similarity of the candidate image set. The specific form of the statistical method of the image similarity is not limited here, for example, average value statistics, median statistics, variance, mean square error statistics, etc.
[0053] Determining the target candidate image as the second image from the candidate image set is not limited to determining from the candidate images in the candidate image set whose image similarity with the first image satisfies the image similarity condition. The target candidate image may be the candidate image with the highest image similarity with the first image, or the candidate image with the lowest similarity with the first image on the basis of satisfying the image similarity condition, or any candidate image in the candidate image set that satisfies the image similarity condition.
[0054] As an optional implementation manner, after obtaining the candidate similarities corresponding to the candidate image set, the method further includes:
[0055] S1, when the candidate similarity does not meet the image similarity condition, sending angle prompt information to the terminal device that collects the live scene picture, wherein the angle prompt information is used to instruct the terminal device to continue adjusting the collection angle;
[0056] S2, when it is determined that the acquisition angle of the terminal device is adjusted, obtaining an adjusted image set obtained by capturing the live scene at the adjusted acquisition angle.
[0057] When the candidate similarities of the candidate similarity set cannot satisfy the image similarity condition, the terminal device is prompted to continue adjusting to obtain an image set that satisfies the image similarity condition, and the second image is determined from the image set. The method for determining whether the image set satisfies the image similarity condition with the first image is the same as the method for determining the candidate image set.
[0058] In an embodiment of the present application, the acquisition angle of the terminal device to the live scene is adjusted to obtain a first image and a second image with different angles, and then the image depth information is determined by the similarity in content and the difference in angle between the first image and the second image, so that the generated special effect image has depth information and a visually three-dimensional effect, thereby making the special effect animation generated based on the special effect image more vivid.
[0059] As an optional implementation, Figure 4 As shown, the above-mentioned generation of a target special effect image corresponding to the target object by using the depth information image calculated based on the first image and the second image, as well as the first image and the second image, includes:
[0060] S402, determining a first region image where the target object is located in the first image, and a second region image where the target object is located in the second image;
[0061] S404, inputting the first region image, the second region image and the depth information image into an image generation model to generate a target special effect image, wherein the image generation model is a three-dimensional image generation model using a self-supervised learning algorithm.
[0062] The first region image is the region image where the target object is located, and is not limited to being a region image including the target object captured from the first image as the first region image. Similarly, the second region image is the region image where the target object is located on the second image.
[0063] The first region image and the second region image are not limited to being the focus regions of the first image and the second image, and are input into the image generation model. The image generation model uses a self-supervised learning algorithm to fit the third-dimensional axis position of the target object on the image through the depth information image, and generates a target special effect image corresponding to the target object based on the first region image and the second region image. The target special effect image is an image with a three-dimensional effect.
[0064] As an optional implementation manner, after determining the first area image where the target object is located in the first image and the second area image where the target object is located in the second image, the method further includes:
[0065] S1, calculating the image distance between each pixel in the first region image and each pixel in the second region image to obtain an image distance set;
[0066] S2, generate a depth information image using the image distance set.
[0067] When generating the depth information image, the first area is used as the focus area of the first image, and the second area is used as the focus area of the second image, so as to generate the depth information image by calculating the image distance between the first area image and the second area image in pixels.
[0068] In an embodiment of the present application, a first image and a second image at different angles are used to determine depth information from the first image and the second image, and the depth information is used to generate a target special effects image with a three-dimensional effect, so that the generated special effects animation associated with the live broadcast room is more vivid.
[0069] As an optional implementation, Figure 5 As shown, before using the action parameters of the target action and the target special effect image to generate the target special effect animation matching the target object, the method further includes:
[0070] S502, determining at least one target component included in a target image in a target special effect image according to candidate components included in a preset type list;
[0071] S504, sequentially acquiring a set of type actions corresponding to the target component from an action database, wherein the set of type actions includes at least one candidate action corresponding to the target component;
[0072] S506: Generate a target action template corresponding to the target object by using the type action set.
[0073] In the case where the target object is an object with anthropomorphic features, the target image in the target special effect image is an image with anthropomorphic features, and the target component is not limited to the anthropomorphic parts in the preset type list. For example, hair, facial features, limbs, etc. According to the correspondence between the preset type list and the type action set, the candidate components storing the candidate actions are recorded in the preset type list. Components not recorded in the preset type list are not used as candidate components for generating special effect animations.
[0074] The target image in the target special effect image is an image that matches the target object. Different target objects correspond to different target special effect images, and the target image in each target special effect image may correspond to different target components. For example, the target image indicates a cartoon character with hidden ears, the target image indicates an animal with hidden limbs (lying down), and the target image indicates a big-headed doll with only facial features.
[0075] When the target part is determined, the type action set corresponding to the target part is obtained from the action database in sequence, and the type action set is added to the action template to generate a target action template corresponding to the target object. The candidate actions in the target action template are all actions that can be configured to the target special effect image. The corresponding target actions can be determined for the multiple target parts in the target special effect image. Each target action generates a target special effect animation independently. The display of the target special effect animation corresponding to each of the multiple target parts is not limited to the control by the display parameters, and can be displayed simultaneously, or displayed in sequence according to the configuration order, or the included target special effect animations can be combined and the display mode is determined according to the combination.
[0076] In an embodiment of the present application, a target action template corresponding to a target object is determined based on target components in a target special effect image, thereby generating a target special effect animation based on the target components to determine the target action. The special effect animation is refined to the components in the target special effect image, and the diversity of the target special effect animation is increased through the diversity of components, thereby enriching the animation content of the target special effect animation.
[0077] As an optional implementation, Figure 6 As shown, the above-mentioned use of the action parameters of the target action and the target special effect image to generate the target special effect animation matching the target object includes:
[0078] S602, determining multiple part states of the target component in the process of executing the target action according to the action parameters;
[0079] S604, adjusting target parts in the target special effect image according to the multiple part states respectively, to generate multiple target animation images;
[0080] S606, arranging a plurality of target animation images according to the execution order of the plurality of part states in the target action to generate a target special effect animation.
[0081] The target special effect animation generated by using the target action and the target special effect image is not limited to determining the various action states indicated by the target action according to the action parameters of the target action, and determining the part state of the target component corresponding to each action state according to each action state. The target parts in the target special effect image are adjusted according to the various part states to obtain multiple target animation images. The target special effect animation is generated according to the predetermined frame rate and the execution order of the multiple action states in the target action.
[0082] The component state corresponding to each action state of the target component is not limited to the state corresponding to the action state when the target component is adjusted. If the target component is an eye and the target action is blinking, then the multiple part states of the target component performing the target action are not limited to the states of the eye at different opening and closing degrees. If the target component is an arm and the target action is swinging, then the multiple part states of the target component performing the target action are not limited to the states of the arm at different swinging degrees.
[0083] In the embodiment of the present application, target animation images corresponding to the states of multiple parts of the target part in the process of executing the target action are generated based on the target special effect image, thereby generating a target special effect animation corresponding to the target object. This not only realizes the generation of target special effect animation based on the target object in the live broadcast scene, but also simplifies the generation of special effect animation. The generation of animation images avoids the establishment of dynamic models, thereby improving the generation efficiency of special effect animation.
[0084] As an optional implementation manner, after generating the target special effect image corresponding to the target object, the method further includes:
[0085] S1, upon receiving an adjustment instruction for adjusting display parameters of a target special effect image, adjusting target display parameters of the target special effect image to obtain a target adjusted image;
[0086] S2, when the target action is determined from the target action template, using the action parameters of the target action and the target adjustment image to generate a target special effect animation that matches the target object.
[0087] The adjustment instruction is not limited to being an instruction generated by a display parameter adjustment operation received by the terminal device. The display parameters are not limited to at least including the color, transparency, texture, and brightness of the target special effect image. The adjustment of the display parameters can also be the adjustment of the display parameters of a part of the target special effect image. For example, adding texture to the body area of the target image in the target special effect image. The adjustable parameters are not limited to being displayed simultaneously with the target action template. After adjusting the target special effect image to the target adjustment image, a special effect animation is generated based on the target adjustment image and the target action. The method steps for generating a special effect animation based on the target adjustment image and the target action are the same as those for generating a special effect animation based on the target special effect image and the target action.
[0088] In the embodiment of the present application, when generating a target special effect image, it is not limited to adjusting the display parameters of the target special effect image through adjustment instructions, so as to generate a target special effect animation based on the adjusted target adjustment image. In the process of generating a target special effect animation of a target object that matches the live scene, the adjustment of the generated target special effect image by the live object using the terminal device is received, so that the generation of the target special effect animation is more flexible.
[0089] As an optional implementation, Figure 7 As shown, after generating the target special effect image corresponding to the target object, the method further includes:
[0090] S702, upon receiving a template special effect instruction for generating special effects according to a candidate animation template, determining candidate components of a candidate image in the candidate animation template, candidate actions corresponding to the candidate components, and candidate image parameters of the candidate image, wherein the candidate image has the same image category as a target image in a target special effect image;
[0091] S704, when a target candidate part corresponding to the candidate part is found in at least one target part, the candidate action is determined as an animation action of the target candidate part in the target image;
[0092] S706, adjusting the target special effect image using the candidate image parameters of the candidate image to obtain a target candidate image;
[0093] S708, using the action parameters of the candidate action and the target candidate image, generating a target special effect animation that matches the target object.
[0094] The candidate animation template is not limited to the animation template generated by the candidate animation uploaded by the terminal device. When it is determined that the terminal device sends the candidate animation template, the target special effect animation is generated according to the action and display parameters indicated by the candidate animation template.
[0095] For example, if the target special effect animation is a lucky cat waving hand animation, then the candidate parts extracted based on the candidate animation template are arms, and the candidate action is waving hands. At the same time, the color parameters of the lucky cat are extracted to render the target special effect image, thereby obtaining the target special effect image, and then generating the target special effect animation based on the target special effect image.
[0096] In the embodiment of the present application, when generating a target special effect image, it is not limited to determining the target component corresponding to the special effect animation and the target action corresponding to the target component through the uploaded candidate animation template, and adjusting the display parameters of the target special effect image based on the candidate animation template, thereby generating the target special effect animation based on the adjusted target special effect image. In the process of generating a target special effect animation of a target object that matches the live broadcast scene, receiving the candidate animation template determined by the live broadcast object using the terminal device makes the generation of the target special effect animation more flexible.
[0097] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0098] According to another aspect of the embodiments of the present invention, there is also provided an animation generation device for implementing the above animation generation method. Figure 8 As shown, the device comprises:
[0099] A calculation unit 802 is used to calculate a depth information image using a first image and a second image in response to a special effect generation instruction triggered by a live scene currently being captured, wherein the first image and the second image are screen images captured from different angles of the live scene, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate a distance between the first image and the second image where a region image containing the target object is located;
[0100] The image generating unit 804 is used to generate a target special effect image corresponding to the target object by using the depth information image, the first image and the second image;
[0101] The animation generating unit 806 is used to generate a target special effect animation matching the target object by using the action parameters of the target action and the target special effect image when the target action is determined from the target action template corresponding to the target object.
[0102] Optionally, the animation generating device further includes an acquiring unit, which is used for, before calculating the depth information image using the first image and the second image, comprising:
[0103] A first module is used to use a picture captured from a live broadcast scene at a first angle as a first image;
[0104] A candidate module is used to acquire a candidate image set by capturing a live scene at a candidate angle, wherein the candidate image set includes at least two consecutive candidate images captured at the candidate angle;
[0105] A calculation module, used to calculate the image similarity between each candidate image and the first image, and obtain the candidate similarity corresponding to the candidate image set;
[0106] The second module is used to determine a target candidate image from the candidate image set as a second image when the candidate similarity satisfies an image similarity condition, wherein the image similarity between the target candidate image and the first image satisfies the image similarity condition.
[0107] Optionally, the animation generating device further includes:
[0108] A sending module, configured to, after obtaining the candidate similarities corresponding to the candidate image set, send angle prompt information to a terminal device that collects live scene images if the candidate similarities do not meet the image similarity condition, wherein the angle prompt information is used to instruct the terminal device to continue adjusting the collection angle;
[0109] The acquisition module is used to obtain an adjusted image set obtained by capturing the live scene at the adjusted acquisition angle when it is determined that the acquisition angle adjustment of the terminal device is completed.
[0110] Optionally, the image generating unit 804 includes:
[0111] An area determination module is used to determine a first area image where the target object is located in the first image, and a second area image where the target object is located in the second image;
[0112] The image generation module is used to input the first area image, the second area image and the depth information image into the image generation model to generate a target special effect image, wherein the image generation model is a three-dimensional image generation model using a self-supervised learning algorithm.
[0113] Optionally, the image generating unit 804 further includes:
[0114] A distance module is used to calculate the image distance between each pixel in the first area image and each pixel in the second area image after determining a first area image where the target object is located in the first image and a second area image where the target object is located in the second image, so as to obtain an image distance set;
[0115] The depth generation module is used to generate a depth information image using an image distance set.
[0116] Optionally, the animation generation device further includes a template generation unit, which is used for, before generating a target special effect animation matching the target object by using the action parameters of the target action and the target special effect image, comprising:
[0117] A component determination module, which determines at least one target component included in a target image in a target special effect image according to candidate components included in a preset type list;
[0118] An action acquisition module, used to sequentially acquire a set of type actions corresponding to the target component from an action database, wherein the set of type actions includes at least one candidate action corresponding to the target component;
[0119] The template generation module is used to generate a target action template corresponding to the target object by using a type action set.
[0120] Optionally, the animation generating unit 806 includes:
[0121] A state module, used to determine the states of multiple parts of the target component in the process of performing the target action according to the action parameters;
[0122] An animation image module, used for adjusting target parts in a target special effect image according to multiple part states respectively, to generate multiple target animation images;
[0123] The animation generation module is used to arrange multiple target animation images according to the execution order of multiple part states in the target action to generate a target special effect animation.
[0124] Optionally, the animation generating device further includes:
[0125] The adjustment unit is used to adjust the target display parameters of the target special effect image after generating the target special effect image corresponding to the target object, and obtain the target adjustment image when receiving an adjustment instruction to adjust the display parameters of the target special effect image; when the target action is determined from the target action template, the action parameters of the target action and the target adjustment image are used to generate a target special effect animation matching the target object.
[0126] Optionally, the animation generating device further includes:
[0127] A template special effects unit is used to determine, after generating a target special effects image corresponding to a target object, candidate components of a candidate image in a candidate animation template, candidate actions corresponding to the candidate components, and candidate image parameters of the candidate image when receiving a template special effects instruction for generating special effects according to a candidate animation template, wherein the candidate image has the same image category as the target image in the target special effects image; when a target candidate part corresponding to the candidate part is found in at least one target component, the candidate action is determined as the animation action of the target candidate part in the target image; the target special effects image is adjusted using the candidate image parameters to obtain a target candidate image; and a target special effects animation matching the target object is generated using the action parameters of the candidate action and the target candidate image.
[0128] In an embodiment of the present application, a high special effect generation instruction is adopted in response to the triggering of the live broadcast scene, and a depth information image is calculated using the first image and the second image obtained by collecting the live broadcast scene at different angles, and a target special effect image corresponding to the target object is generated based on the first image, the second image and the depth information image. A target special effect animation matching the target object is generated based on the target action and the target special effect image determined from the target action template corresponding to the target object. By responding to the special effect generation instruction, a target special effect image with depth information corresponding to the target object in the live broadcast scene is generated, thereby generating a target special effect animation corresponding to the target object based on the target special effect image and the target action, so as to achieve the purpose of making the target special effect animation displayed in the live broadcast room correspond to the target object in the live broadcast scene, thereby achieving the technical effect of matching the special effect animation with the live broadcast scene of the live broadcast room, and improving the adaptability of the special effect animation to the live broadcast room, thereby solving the technical problem of low adaptability of the special effect animation to the live broadcast room.
[0129] According to another aspect of the embodiments of the present invention, an electronic device for implementing the above animation generation method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server as an example. Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.
[0130] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0131] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0132] S1, in response to a special effect generation instruction triggered by a live scene currently being captured, a depth information image is calculated using a first image and a second image, wherein the first image and the second image are screen images captured from different angles of the live scene, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where the area image containing the target object is located;
[0133] S2, generating a target special effect image corresponding to the target object by using the depth information image, the first image and the second image;
[0134] S3, when a target action is determined from a target action template corresponding to the target object, a target special effect animation matching the target object is generated using action parameters of the target action and a target special effect image.
[0135] Alternatively, a person skilled in the art may understand that: Fig. 9 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 The structure of the electronic device is not limited. Fig. 9 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig. 9 Different configurations are shown.
[0136] Among them, the memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the animation generation method and device in the embodiment of the present invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, realizing the above-mentioned animation generation method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely located relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 can be specifically, but not limited to, used to store target special effects images, target special effects animations and other information. As an example, such as Fig. 9As shown, the memory 902 may include but is not limited to the calculation unit 802, the image generation unit 804 and the animation generation unit 806 in the animation generation device. In addition, it may also include but is not limited to other module units in the animation generation device, which will not be repeated in this example.
[0137] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0138] In addition, the electronic device further includes: a display 908 for displaying the target special effect image and target special effect animation; and a connection bus 910 for connecting various module components in the electronic device.
[0139] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.
[0140] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program comprising computer instructions, the computer instructions being 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 methods provided in various optional implementations of the above-mentioned animation generation. The computer program is configured to perform the steps of any of the above-mentioned method embodiments when it is run.
[0141] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0142] S1, in response to a special effect generation instruction triggered by a live scene currently being captured, a depth information image is calculated using a first image and a second image, wherein the first image and the second image are screen images acquired by capturing the live scene from different angles, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate the distance between the first image and the second image where the area image containing the target object is located;
[0143] S2, generating a target special effect image corresponding to the target object by using the depth information image, the first image and the second image;
[0144] S3, when a target action is determined from a target action template corresponding to the target object, a target special effect animation matching the target object is generated using action parameters of the target action and a target special effect image.
[0145] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0146] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0147] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0148] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0149] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only 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 interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0150] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0151] In addition, each functional unit in each embodiment of the present invention 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0152] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An animation generation method, characterized in that: include: In response to a special effect generation instruction triggered by a live scene currently undergoing screen capture, a depth information image is calculated using a first image and a second image, wherein the first image and the second image are screen images obtained by capturing the live scene from different angles, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate a distance between the first image and the second image where an area image containing the target object is located; Generate a target special effect image corresponding to the target object by using the depth information image, the first image and the second image; When a target action is determined from a target action template corresponding to the target object, a target special effect animation matching the target object is generated by using the action parameters of the target action and the target special effect image.
2. The method according to claim 1, characterized in that Before calculating the depth information image using the first image and the second image, the method further includes: Using a picture captured from the live broadcast scene at a first angle as the first image; Acquire a candidate image set by capturing images of the live scene at a candidate angle, wherein the candidate image set includes at least two consecutive candidate images captured at the candidate angle; Calculating the image similarity between each of the candidate images and the first image to obtain the candidate similarity corresponding to the candidate image set; In a case where the candidate similarity satisfies the image similarity condition, a target candidate image is determined from the candidate image set as the second image, wherein the image similarity between the target candidate image and the first image satisfies the image similarity condition.
3. The method according to claim 2, characterized in that After obtaining the candidate similarities corresponding to the candidate image set, the method further includes: When the candidate similarity does not satisfy the image similarity condition, angle prompt information is sent to a terminal device that captures the live scene image, wherein the angle prompt information is used to instruct the terminal device to continue adjusting the capture angle; When it is determined that the acquisition angle of the terminal device is adjusted, an adjusted image set is obtained by acquiring images of the live scene at the adjusted acquisition angle.
4. The method according to claim 1, characterized in that: The step of generating a target special effect image corresponding to the target object by using the depth information image, the first image, and the second image includes: Determine a first area image where the target object is located in the first image, and a second area image where the target object is located in the second image; The first area image, the second area image and the depth information image are input into an image generation model to generate the target special effect image, wherein the image generation model is a three-dimensional image generation model using a self-supervised learning algorithm.
5. The method according to claim 4, characterized in that After determining a first area image where the target object is located in the first image and a second area image where the target object is located in the second image, the method further includes: Calculating the image distance between each pixel in the first region image and each pixel in the second region image to obtain an image distance set; The depth information image is generated using the image distance set.
6. The method according to claim 1, characterized in that Before using the action parameters of the target action and the target special effect image to generate a target special effect animation matching the target object, the method further includes: Determining at least one target component included in the target image in the target special effect image according to the candidate components included in the preset type list; Sequentially acquiring a set of type actions corresponding to the target component from an action database, wherein the set of type actions includes at least one candidate action corresponding to the target component; The target action template corresponding to the target object is generated by using the type action set.
7. The method according to claim 6, characterized in that The step of generating a target special effect animation matching the target object by using the action parameters of the target action and the target special effect image comprises: Determining, according to the action parameters, states of multiple parts of the target component during the process of performing the target action; Adjusting the target parts in the target special effect image according to the multiple part states respectively to generate multiple target animation images; The multiple target animation images are arranged according to the execution order of the multiple part states in the target action to generate the target special effect animation.
8. The method according to claim 1, characterized in that After generating the target special effect image corresponding to the target object, the method further includes: When receiving an adjustment instruction for adjusting the display parameters of the target special effect image, adjusting the target display parameters of the target special effect image to obtain a target adjusted image; When the target action is determined from the target action template, a target special effect animation matching the target object is generated by using the action parameters of the target action and the target adjustment image.
9. The method according to claim 6, characterized in that After generating the target special effect image corresponding to the target object, the method further includes: Upon receiving a template special effect instruction for generating special effects according to a candidate animation template, determining candidate components of a candidate image in the candidate animation template, candidate actions corresponding to the candidate components, and candidate image parameters of the candidate image, wherein the candidate image has the same image category as a target image in the target special effect image; In the case where a target candidate part corresponding to the candidate part is found in the at least one target part, determining the candidate action as an animation action of the target candidate part in the target image; adjusting the target special effect image using the candidate image parameters of the candidate image to obtain a target candidate image; The action parameters of the candidate action and the target candidate image are used to generate a target special effect animation that matches the target object.
10. An animation generating device, characterized in that: include: a calculation unit, configured to calculate a depth information image using a first image and a second image in response to a special effect generation instruction triggered by a live scene currently undergoing screen capture, wherein the first image and the second image are screen images acquired by capturing the live scene from different angles, the image similarity between the first image and the second image satisfies an image similarity condition, a target object is identified in both the first image and the second image, and the depth information image is used to indicate a distance between the first image and the second image where a region image containing the target object is located; An image generating unit, configured to generate a target special effect image corresponding to the target object by using the depth information image, the first image and the second image; The animation generation unit is used to generate a target special effect animation matching the target object by using the action parameters of the target action and the target special effect image when a target action is determined from a target action template corresponding to the target object.
11. The device according to claim 10, characterized in that The image generating unit comprises: An area determination module is used to determine a first area image where the target object is located in the first image, and a second area image where the target object is located in the second image; An image generation module is used to input the first area image, the second area image and the depth information image into an image generation model to generate the target special effect image, wherein the image generation model is a three-dimensional image generation model using a self-supervised learning algorithm.
12. The device according to claim 10, characterized in that The animation generating device further includes a template generating unit, which is used for, before generating a target special effect animation matching the target object by using the action parameters of the target action and the target special effect image, comprising: A component determination module, which determines at least one target component included in the target image in the target special effect image according to the candidate components included in the preset type list; An action acquisition module, used to sequentially acquire a set of type actions corresponding to the target component from an action database, wherein the set of type actions includes at least one candidate action corresponding to the target component; The template generation module is used to generate the target action template corresponding to the target object by using the type action set.
13. The device according to claim 12, characterized in that The animation generation unit comprises: A state module, used for determining the states of multiple parts of the target component in the process of performing the target action according to the action parameters; An animation image module, used for adjusting the target parts in the target special effect image according to the multiple part states respectively, to generate multiple target animation images; The animation generation module is used to arrange the multiple target animation images according to the execution order of the multiple part states in the target action to generate the target special effect animation.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 9 when executed.
15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.
Citation Information
Patent Citations
Animation playing method and device, storage medium, electronic device
CN108619720A
Image processing method and device, computer equipment and storage medium
CN111277849A
