WO2024000480A1 - 3d virtual object animation generation method and apparatus, terminal device, and medium - Google Patents

3d virtual object animation generation method and apparatus, terminal device, and medium Download PDF

Info

Publication number
WO2024000480A1
WO2024000480A1 PCT/CN2022/103020 CN2022103020W WO2024000480A1 WO 2024000480 A1 WO2024000480 A1 WO 2024000480A1 CN 2022103020 W CN2022103020 W CN 2022103020W WO 2024000480 A1 WO2024000480 A1 WO 2024000480A1
Authority
WO
WIPO (PCT)
Prior art keywords
skeleton
animation
preset
target
frame
Prior art date
Application number
PCT/CN2022/103020
Other languages
French (fr)
Chinese (zh)
Inventor
陈恭斌
王磊
刘薰裕
程俊
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Priority to PCT/CN2022/103020 priority Critical patent/WO2024000480A1/en
Publication of WO2024000480A1 publication Critical patent/WO2024000480A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • G06T13/403D [Three Dimensional] animation of characters, e.g. humans, animals or virtual beings

Definitions

  • the present application belongs to the field of image processing technology, and in particular relates to a method, device, terminal equipment and medium for animation generation of 3D virtual objects.
  • 3D Three-dimensional (Threee Dimensions, 3D) technology is widely used in games, movies, virtual reality (Virtual Reality, VR) and other fields.
  • 3D technology it is usually necessary to design 3D virtual objects and a series of actions of the 3D virtual objects according to the application scenarios of the 3D technology to generate animations of the 3D virtual objects.
  • 3D technology when 3D technology is applied in the game field, it is usually necessary to design a 3D game character and a series of actions of the 3D game character based on the 3D game scene, and generate animation of the 3D game character based on a series of actions of the 3D game character.
  • the usual method is to first create key animation frames corresponding to key actions of the 3D virtual object, and then generate animation frames corresponding to other actions of the 3D virtual object based on the key animation frames.
  • the production of key animation frames requires professionals, and the production process of key animation frames is complex and time-consuming, which reduces the efficiency of animation generation of 3D virtual objects.
  • the purpose of the embodiments of the present application is to provide an animation generation method, device, terminal device and medium for 3D virtual objects, aiming to solve the existing problem of low efficiency in animation generation of 3D virtual objects.
  • embodiments of the present application provide a method for generating animations of 3D virtual objects, including:
  • the preset object model includes a preset skeleton
  • Skeleton redirection is performed on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton;
  • the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
  • generating a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model includes:
  • all the first animation frames are sequentially composed into the first animation sequence.
  • the three-dimensional reconstruction information includes grid point information, bone key point information, root node position information and shooting parameter information; the video frame is based on each frame
  • the three-dimensional reconstruction information of the reference object in the first animation sequence is used to set the structural parameters of the preset object model in the first animation frame of each frame of the first animation sequence, including:
  • For each video frame determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node;
  • the posture of the preset object model in the corresponding first animation frame is set.
  • the method before performing skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton, the method further includes:
  • the target object model includes an initial skeleton
  • corresponding bones in the initial skeleton are set to obtain the target bones of the target virtual object.
  • the preset object model further includes a preset mesh; the target virtual object model further includes a target mesh; and the pair of objects based on the preset skeleton is The target skeleton of the target virtual object performs skeleton redirection to obtain the redirected skeleton, including:
  • the three-dimensional reconstruction of the reference object in each video frame of the target video is performed sequentially to obtain the three-dimensional reconstruction information of the reference object in each video frame.
  • All video frames of the target video are imported into the preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
  • an animation generation device for 3D virtual objects including:
  • a three-dimensional reconstruction unit configured to sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video, and obtain three-dimensional reconstruction information of the reference object in each video frame;
  • An animation sequence generation unit configured to generate a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model; the preset object model includes a preset skeleton;
  • a skeleton redirection unit configured to perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton;
  • the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
  • An animation redirection unit is configured to perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  • the animation sequence generating unit includes:
  • the first acquisition unit is used to acquire the preset object model
  • a parameter setting unit configured to separately set the structural parameters of the preset object model in each first animation frame of the first animation sequence based on the three-dimensional reconstruction information of the reference object in each frame of the video frame. Make settings;
  • a sorting unit configured to sequence all the first animation frames into the first animation sequence according to a preset first animation frame rate.
  • embodiments of the present application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the computer program, the Steps in any optional manner as described above in the first aspect.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program is executed by a processor, any optional method as described in the first aspect is implemented. Methods.
  • embodiments of the present application provide a computer program product, which when the computer program product is run on a terminal device, causes the terminal device to execute the method described in the above first aspect or any alternative method of the first aspect.
  • the 3D virtual object animation generation method, device, terminal equipment, computer-readable storage medium and computer program product provided by the embodiments of the present application have the following beneficial effects:
  • the animation generation method of 3D virtual characters obtains the three-dimensional reconstruction information of the reference object in each video frame by sequentially performing three-dimensional reconstruction of the reference object in each video frame of the target video, and then based on all
  • the three-dimensional reconstruction information of the reference object in the video frame and the preset object model generate a first animation sequence corresponding to the reference object; since the structure of the preset skeleton of the preset object model is the same or similar to the structure of the target skeleton of the target virtual object, therefore , convert the target video into the corresponding first animation sequence, which can provide a reference basis for the subsequent animation simulation of the target virtual object; then, first perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain the redirected skeleton, and then Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain the second animation sequence corresponding to the target virtual object, so that the actions of the reference object in the target video can be mapped to the virtual object.
  • this solution can be used to automatically realize the target video
  • the animation sequence of the target virtual object is obtained by simulating the motion of the reference object. Compared with the traditional method, there is no need for professionals to produce key animation frames of the target virtual object, thus improving the efficiency of animation generation of the target virtual object.
  • Figure 1 is an implementation flow chart of a method for generating animations of 3D virtual objects provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of a target virtual object provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of a first animation sequence generation process provided by an embodiment of the present application.
  • Figure 4 is an implementation flow chart of a method for generating a first animation sequence provided by an embodiment of the present application
  • Figure 5 is an implementation flow chart of a skeleton redirection process provided by an embodiment of the present application.
  • Figure 6 is a schematic diagram of a second animation sequence generation process provided by an embodiment of the present application.
  • Figure 7 is a schematic structural diagram of a 3D virtual object animation generation device provided by an embodiment of the present application.
  • Figure 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • 3D virtual objects provided by the embodiment of the present application can be applied in three-dimensional (Three Dimensions, 3D) digital creation or virtual reality (Virtual Reality, VR) scenes.
  • 3D digital creation can include but is not limited to 3D film and television creation or 3D game creation.
  • the animation generation method of 3D virtual objects can be used to generate an animation sequence of 3D virtual objects in the game.
  • the animation generation method of 3D virtual objects can be used to generate an animation sequence of 3D virtual objects in the game.
  • you need to construct a target 3D virtual character in a 3D game scene you can first record a video containing the character.
  • the postures of the characters in different video frames in the video can be different.
  • Three-dimensional reconstruction obtain the three-dimensional reconstruction information of the character in each video frame, and then generate the first animation sequence corresponding to the character based on the three-dimensional reconstruction information of the character in all video frames and the preset object model; due to the skeleton structure of the preset object model It is the same as or similar to the skeleton structure of the target 3D virtual character.
  • converting the video into the first animation sequence can provide a reference basis for subsequent construction of the animation model of the target 3D virtual character; after that, the prediction based on the preset object model is first Assume that the skeleton performs skeleton redirection on the target skeleton of the target 3D virtual character to obtain the redirected skeleton, and then performs animation redirection on the redirected skeleton based on the first animation sequence to obtain the second animation sequence corresponding to the target 3D virtual character, so that the redirected skeleton can be obtained
  • the actions of the characters in the video are mapped to a certain target 3D virtual character in the 3D game scene.
  • the execution subject of the animation generation method for 3D virtual objects provided by the embodiments of the present application may be a terminal device.
  • Terminal devices can include electronic devices such as mobile phones, tablets, laptops, and desktop computers. Please refer to Figure 1.
  • Figure 1 is an implementation flow chart of a 3D virtual object animation generation method provided by an embodiment of the present application.
  • the 3D virtual object animation generation method may include S101 ⁇ S104, as detailed below:
  • the terminal device can obtain the target video.
  • the target video may include several video frames, and each video frame may include a reference object.
  • the postures of the reference objects in different video frames may be the same or different.
  • the reference object refers to the object that the target virtual object refers to when simulating actions. Therefore, the skeleton structure of the reference object needs to be the same or similar to the skeleton structure of the target virtual object.
  • the target virtual object may be any 3D virtual object among the 3D virtual objects that need to be created. For example, when the target virtual object is a human-like object (for example, 21 or 22 in Figure 2), the reference object may be a human.
  • the target video can be a video containing a reference object recorded in real time, a video containing a reference object that is pre-recorded or produced, a video containing a reference object downloaded from the Internet, or it can be obtained through other methods. Videos containing reference objects. There are no special restrictions on how to obtain the target video.
  • the terminal device After the terminal device obtains the target video, it can process the target video into frames to obtain each video frame in the target video. For example, as shown in Figure 3, if 31 in Figure 3 is a target video, the terminal device can obtain multi-frame video frames 32 after performing frame segmentation processing on the target video 31.
  • the terminal device After the terminal device obtains each video frame in the target video, it can sequentially perform three-dimensional reconstruction of the reference object in each video frame.
  • the purpose of the terminal device performing three-dimensional reconstruction of the reference object in each video frame is to obtain the three-dimensional reconstruction information of the reference object in each video frame.
  • performing three-dimensional reconstruction of the reference objects in each video frame sequentially means performing three-dimensional reconstruction of the reference objects in each video frame according to the order in which each video frame is arranged in the target video.
  • the terminal device can use a three-dimensional reconstruction model to process each video frame in sequence to obtain the three-dimensional reconstruction information of the reference object in each video frame.
  • the 3D reconstruction model can be used to quickly and efficiently obtain the 3D reconstruction information of the reference object in each video frame.
  • the three-dimensional reconstruction model can be obtained by training a deep learning model using a preset sample data set.
  • Each piece of data in the preset sample data set includes a sample image and three-dimensional reconstruction information of the sample image.
  • the sample image is an image containing a reference object.
  • this preset sample data set to train the deep learning model, the sample image in each sample data is used as the input of the deep learning model, and the three-dimensional reconstruction information of the sample image in each sample data is used as the input of the deep learning model.
  • Output train the deep learning model, so that after the deep learning model training is completed, the deep learning model can learn the correspondence between the image containing the reference object and the three-dimensional reconstruction information of the reference object.
  • the terminal device can determine the trained deep learning model as a three-dimensional reconstruction model.
  • the three-dimensional reconstruction information of the reference object may include: grid point information, bone key point information, root node information, and shooting parameter information.
  • the grid point information is used to describe the outline of the reference object.
  • Skeleton keypoint information is used to describe the pose of the reference object.
  • the bone key point information may be the axis angle information of the bone key point.
  • the bone key points can include the starting point and end point of each bone of the human body.
  • the axis angle information of the bone key point is used to describe the three-dimensional space rotation information of the bone key point relative to its parent node.
  • the root node information is used to describe the pelvic position of the reference object.
  • the root node information can be described by the coordinates of the reference object's pelvic key points in the preset coordinate system.
  • the preset coordinate system can be set according to actual needs.
  • the shooting parameter information is used to describe the camera parameters when the reference object is photographed.
  • the shooting parameter information may include but is not limited to the zoom ratio of the camera.
  • the terminal device after the terminal device obtains the three-dimensional reconstruction information of the reference object in each video frame, it can store the bone key point information and root node information of the reference object in each video frame in an array respectively. And the arrays corresponding to all video frames are stored in the first preset file according to the order of each video frame in the target video.
  • the first preset file may be a file in PKL format.
  • PKL format is a file format used by python software to save files
  • python is a computer programming language.
  • a first animation sequence corresponding to the reference object is generated based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model; the preset object model includes a preset skeleton.
  • Default object models refer to standard 3D reference object templates.
  • Preset object models can be described by preset skeletons and preset meshes. Among them, the preset skeleton is the same as or similar to the skeleton of the reference object. For example, if the reference object is a human, the default object model is a standard 3D human body template.
  • the preset object model has a preset initial posture.
  • 33 in Figure 3 is a standard 3D human body template, and its current posture is the above-mentioned initial posture.
  • the terminal device can adjust the posture and/or position of the preset object model according to the three-dimensional reconstruction information of the reference object in each video frame to obtain the first animation frame corresponding to each video frame and the third animation frame corresponding to all video frames.
  • One animation frame constitutes the first animation sequence.
  • the terminal device adjusts the posture and/or position of the preset object model 33 according to the three-dimensional reconstruction information of the reference object in each video frame 32 to obtain the first animation frame 34 corresponding to each frame 32 .
  • the first animation frames 34 corresponding to all the video frames 32 constitute the first animation sequence.
  • S102 may include S41 ⁇ S43 as shown in Figure 4, as detailed below:
  • the preset object model can be stored in the object model library in advance. Based on this, the terminal device can obtain the pre-stored preset object model from the object model library.
  • setting the structural parameters of the preset object model in each first animation frame may include setting the position and posture of the preset object model in each animation frame.
  • the terminal device can first generate multiple first animation frames containing the preset object model, and the number of the first animation frames is consistent with the number of video frames included in the target video; and then set the first animation frame of each frame.
  • the position information of the preset object in the first animation frame can be determined by the shooting parameters of the reference object in the corresponding video frame and the position information of the root node; the posture of the preset object model can be determined by the grid points of the reference object in the corresponding video frame. information and bone keypoint information determined.
  • S42 may include the following steps:
  • Step a For each video frame, determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters and the position information of the root node of the reference object.
  • the terminal device after the terminal device obtains the shooting parameters and the location information of the root node of the reference object in each video frame, it can combine weak perspective projection based on the scaling ratio in the shooting parameters and the location information of the root node. Relationship, calculate the spatial position of the preset object model in the first animation frame corresponding to each video frame.
  • Step b Adjust the root node position of the preset object model in the first animation frame based on the spatial position of the preset object model in the corresponding first animation frame.
  • the terminal device After the terminal device obtains the spatial position of the preset object model in the first animation frame of each frame, it adjusts the position of the root node of the preset object model in the first animation frame of each frame so that the root node of the preset object model The position of the node is consistent with the spatial position of the preset object model in the corresponding first animation frame.
  • Step c Set the posture of the preset object model in the corresponding first animation frame based on the grid point information and the skeletal key point information.
  • the terminal device After the terminal device adjusts the spatial position of the preset object model in the first animation frame of each frame, it can based on the grid point information and bone key point information of the reference object in the video frame corresponding to the first animation frame of each frame, The posture of the preset object model in the first animation frame of each frame is adjusted so that the posture of the preset object model in the first animation frame of each frame is the same as the posture of the reference object model in the corresponding video frame.
  • the terminal device can first calculate the axis angle of each bone key point of the preset object model in the first animation frame of each frame based on the bone key point information of the reference object in the video frame corresponding to the first animation frame of each frame. Adjust so that the axis angle of each bone key point of the preset object model in the first animation frame of each frame is the same as the axis angle of each bone key point of the reference object model in the corresponding video frame; after that, the terminal device can be based on The grid point information of the reference object in the video frame corresponding to the first animation frame of each frame is adjusted to the grid points of the preset object model in the first animation frame of each frame, so that the first animation frame of each frame The grid points of the preset object model in are the same as the grid points of the reference object model in the corresponding video frame.
  • the preset first animation frame rate can be set according to actual needs.
  • the preset first animation frame rate may be the same as the frame rate of the target video, or the preset first animation frame rate may be n times the frame rate of the target video, and n may be an integer greater than 1.
  • the terminal device can sort all the first animation frames according to the order of the video frames corresponding to the first animation frames of each frame in the target video, and all the sorted first animation frames constitute the first animation sequence.
  • the first animation frame corresponding to the first video frame is regarded as the first frame of the first animation sequence
  • the first animation frame corresponding to the second video frame is regarded as the second frame of the first animation sequence
  • the corresponding first animation frames of each of the above video frames can be composed into a first animation sequence in the above order.
  • the terminal device After the terminal device obtains the first animation sequence, it can store the first animation sequence in the second preset file.
  • the second preset file may be a file in FBX format.
  • FBX format is a file format used by Filmbox software to save files.
  • Filmbox is a software that allows mutual guidance of models, materials, actions and camera information between 3D design software.
  • the video frame can be The action pose of the reference object in the animation is quickly transferred to the preset object in the first animation frame.
  • the first animation frames of each frame after the above-mentioned structural parameter setting are arranged in order. All the first animation frames after sorting constitute the first animation sequence, so that the target video can be mapped to the corresponding animation sequence, and each first animation frame can be mapped to the corresponding animation sequence.
  • the posture and position of the reference object in the video frame are quickly mapped to the preset object model in the corresponding first animation frame, so that the preset object model in the first animation frame of each frame has the same characteristics as the reference object in the corresponding video frame. attitude and position.
  • the target virtual object can be any 3D virtual object that needs to be created in the target scene, for example, it can be a 3D virtual character.
  • Target scenes can include 3D game creation scenes or VR scenes, etc.
  • Each target virtual object corresponds to a default target object model.
  • the target object model can be described by an initial skeleton and an initial mesh.
  • the terminal device can first determine the target skeleton of the target virtual object based on the preset skeleton and the initial skeleton of each target virtual object, and then perform skeleton redirection on the target skeleton of the target virtual object based on the above preset skeleton to obtain the redirected skeleton.
  • the structure of the target skeleton is the same as or similar to the structure of the preset skeleton.
  • the skeleton reorientation process on the target skeleton refers to the process of corresponding the same bone key points of the target skeleton with the preset skeleton.
  • the terminal device can obtain the target skeleton of each target virtual object through S51 ⁇ S53 as shown in Figure 5, as detailed below:
  • bones to be merged are determined from the preset skeleton, and the bones to be merged are merged to obtain merged bones.
  • the above-mentioned skeleton to be merged can be determined based on the actual situation of the preset skeleton.
  • the bones to be merged in different skeletons can be different.
  • the embodiment of the present application does not specifically limit the merging rules and merging methods of the bones to be merged in the preset skeleton.
  • the skeleton composed of the merged bones can describe the action posture of the reference object.
  • a target object model of the target virtual object is obtained; the target object model includes an initial skeleton.
  • the target object model of the target virtual object can be pre-stored in the virtual object model library corresponding to the target scene. Based on this, the terminal device can obtain the target object model of the target virtual object from the virtual object model library.
  • the corresponding bones in the initial skeleton are set based on the merged bones to obtain the target skeleton of the target virtual object.
  • the terminal device after the terminal device merges the bones to be merged in the preset skeleton, it can merge the corresponding bones in the initial skeleton based on the merge rules and merge methods of the merged bones, and the initial skeleton after the skeleton is merged Identifies the target skeleton as the target virtual object.
  • the naming rules of the key points of the target skeleton and the naming rules of the key points of the preset skeleton may be different, it is necessary to distinguish the key points of the target skeleton and the key points of the preset skeleton. Bone key points are matched to match the target skeleton with the same bone key points of the preset skeleton, thereby reorienting the target skeleton.
  • Animation redirection refers to copying action data from one skeleton to another. Therefore, animation redirection of the redirected skeleton based on the first animation sequence means copying the action data of the preset object model in the first animation sequence from The preset skeleton is copied to the redirected skeleton of the target object model, thereby obtaining a second animation sequence of the target object model.
  • the terminal device may first generate multiple frames of second animation frames containing the target object model after skeleton redirection, where the number of second animation frames is consistent with the number of first animation frames; and then set each The initial position of the target object model in the second animation frame of each frame.
  • the initial position of the target object model in the second animation frame of each frame can be set at the center of the second animation frame of each frame; and then based on each frame The position and posture of the preset object model in the first animation frame are adjusted to the movement and posture of the target object model in the second animation frame.
  • the position of the target object model in the second animation frame can be determined by the position of the root node of the preset object model in the corresponding first animation frame; the posture of the target object model can be determined by the posture of the preset object model in the corresponding first animation frame.
  • S104 may include the following steps:
  • Step d For each second animation frame, adjust the spatial position of the target object model in the second animation frame according to the spatial position of the preset object model in the first animation frame of each frame.
  • the terminal device can obtain the spatial position of the preset object model in the first animation frame of each frame, and adjust the spatial position of the target object model in the second animation frame corresponding to each frame, so that the preset object
  • the spatial position of the model in the first animation frame is the same as the spatial position of the target object model in the second animation frame, that is, even if the position of the root node of the preset object in the first animation frame is the same as the position of the target object model in the second animation frame
  • the location of the root node is the same.
  • Step e For each second animation frame, the terminal device adjusts the posture of the target object model so that the posture of the target object model is the same as the posture of the reference object model.
  • the terminal device After the terminal device adjusts the spatial position of the target object model in each second animation frame, it can use the grid point information and bone key of the preset object model in the first animation frame corresponding to each second animation frame. point information, adjust the posture of the target object model in the second animation frame of each frame, so that the posture of the target object model in the second animation frame of each frame corresponds to the posture of the preset object model in the first animation frame same.
  • the terminal device may first calculate the axes of each bone key point of the target object model in each second animation frame based on the bone key point information of the reference object in the first animation frame corresponding to each second animation frame. The angle is adjusted so that the axis angle of each bone key point of the target object model in the second animation frame of each frame is the same as the axis angle of each bone key point of the corresponding preset object model in the first animation frame; after that, the terminal The device can adjust the grid points of the target object model in each second animation frame based on the grid point information of the preset object in the first animation frame corresponding to each second animation frame, so that each The grid points of the target object model in the second animation frame are the same as the corresponding grid points of the preset object model in the first animation frame.
  • Step f According to the preset second first animation frame rate, all the adjusted second first animation frames are sequentially composed into the second animation sequence.
  • the preset second animation frame rate can be set according to actual needs.
  • the preset second animation frame rate may be the same as the first animation frame rate, or the preset second animation frame rate may be n times the first animation frame rate, and n may be an integer greater than 1.
  • the terminal device can sort all the second animation frames according to the order in which the second animation frames correspond to the first animation frames, and all the sorted second animation frames constitute the second animation sequence.
  • the second animation frame corresponding to the first animation frame of the first frame is regarded as the first frame of the second animation sequence
  • the second animation frame corresponding to the first animation frame of the second frame is regarded as the second frame of the second animation sequence.
  • the corresponding second animation frames of each of the above first animation frames can be composed in the above order to form a second animation sequence.
  • the terminal device After the terminal device obtains the second animation sequence, it can store the second animation sequence in the third preset file.
  • the third preset file may be a file in FBX format.
  • FBX format is a file format used by filmbox software to save files.
  • Filmbox is a software that allows mutual guidance of models, materials, actions and camera information between 3D design software.
  • the first animation frame obtained according to each video frame can be 621, and all the first animation frames constitute The first animation sequence 61; the second animation frame obtained according to each first animation frame may be 631, and all the second animation frames 631 constitute the second animation sequence 63.
  • the above scheme obtains the three-dimensional reconstruction information of the reference object in each video frame by sequentially performing three-dimensional reconstruction of the reference object in each video frame of the target video, and then based on the three-dimensional reconstruction information of the reference object in all video frames Generate a first animation sequence corresponding to the reference object with the preset object model; since the structure of the preset skeleton of the preset object model is the same or similar to the structure of the target skeleton of the target virtual object, the target video is converted into the corresponding first animation sequence.
  • the animation sequence can provide a reference basis for the subsequent animation simulation of the target virtual object; then, first perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain the redirected skeleton, and then perform the redirected skeleton based on the first animation sequence.
  • Animation redirection obtains the second animation sequence corresponding to the target virtual object, so that the actions of the reference object in the target video can be mapped to the virtual object. That is, this solution can be used to automatically simulate the actions of the reference object in the target video and obtain the target
  • the animation sequence of virtual objects does not require professionals to produce key animation frames of the target virtual object, thereby improving the efficiency of animation generation of the target virtual object.
  • embodiments of the present application further provide an animation generation device for 3D virtual objects that implements the above method embodiments.
  • Figure 7 shows the animation generation method of 3D virtual objects provided by the embodiments of the present application.
  • the animation generation device of 3D virtual objects may include: a three-dimensional reconstruction unit 71 , an animation sequence generation unit 72 , a skeleton reorientation unit 73 and an animation reorientation unit 74 . in:
  • the three-dimensional reconstruction unit 71 is configured to sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame.
  • the animation sequence generating unit 72 is configured to generate a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all video frames and a preset object model; the preset object model includes a preset skeleton.
  • the skeleton redirection unit 73 is configured to perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the redirected skeleton is the same as or similar to the structure of the preset skeleton.
  • the animation redirection unit 74 is configured to perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  • the animation sequence generating unit 72 includes a first obtaining unit, a parameter setting unit and a sorting unit. in:
  • the first acquisition unit is used to acquire the preset object model.
  • the parameter setting unit is configured to separately set the structural parameters of the preset object model in each first animation frame of the first animation sequence based on the three-dimensional reconstruction information of the reference object in each frame of the video frame. Make settings.
  • the sorting unit is configured to sequence all the first animation frames into the first animation sequence according to a preset first animation frame rate.
  • the parameter setting unit includes a position determination unit, a position adjustment unit and an attitude adjustment unit. in:
  • the position determination unit is configured to determine, for each video frame, the space of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node. Location.
  • the position adjustment unit is configured to adjust the position of the root node of the preset object model in the corresponding first animation frame based on the spatial position of the preset object model in the corresponding first animation frame.
  • the posture adjustment unit is configured to set the posture of the preset object model in the corresponding first animation frame based on the grid point information and skeletal key point information of the reference object in the video frame.
  • the 3D virtual object animation generation device also includes a bone merging unit, a second acquisition unit, and a bone setting unit. in:
  • the bone merging unit is used to determine the bones to be merged from the preset skeleton, and merge the bones to be merged to obtain the merged bones.
  • the second acquisition unit is used to acquire the target object model of the target virtual object; the target object model includes an initial skeleton.
  • the bone setting unit is used to set corresponding bones in the initial skeleton based on the merged bones to obtain the target skeleton of the target virtual object.
  • the skeleton redirection unit 73 is specifically used for:
  • the three-dimensional reconstruction unit 71 is specifically used for:
  • All video frames of the target video are imported into a preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
  • FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
  • the terminal device 8 provided by this embodiment may include: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and runable on the processor 80, such as a method for generating animations of 3D virtual objects. corresponding program.
  • the processor 80 executes the computer program 82, the steps in the above embodiment of the animation generation method applied to 3D virtual objects are implemented, such as S101 to S104 shown in FIG. 1 .
  • the processor 80 executes the computer program 82
  • the functions of each module/unit in the above embodiment of the animation generation device for 3D virtual objects are implemented, such as the functions of the units 71 to 74 shown in FIG. 7 .
  • the computer program 82 may be divided into one or more modules/units, and one or more modules/units are stored in the memory 81 and executed by the processor 80 to complete the present application.
  • One or more modules/units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 82 in the terminal device 8 .
  • the computer program 82 can be divided into a three-dimensional reconstruction unit, an animation sequence generation unit, a skeleton redirection unit, and an animation redirection unit.
  • an animation redirection unit For the specific functions of each unit, please refer to the relevant descriptions in the corresponding embodiment of FIG. 7 and will not be described again here. .
  • FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than shown in the figure, or some components may be combined, or different components may be used. .
  • Processor 80 may be a central processing unit (central processing unit). processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (field-programmable) gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU central processing unit
  • DSP digital signal processors
  • ASICs application specific integrated circuits
  • FPGA field-programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the memory 81 may be an internal storage unit of the terminal device 8 , such as a hard disk or memory of the terminal device 8 .
  • the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card or a flash memory card (flash card) equipped on the terminal device 8. card) etc.
  • the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device.
  • the memory 81 is used to store computer programs and other programs and data required by the terminal device.
  • the memory 81 may also be used to temporarily store data that has been output or is to be output.
  • each functional unit in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware.
  • the specific names of each functional unit are only for the convenience of distinguishing each other and are not used to limit the protection scope of the present application.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program. When executed by a processor, the computer program can implement the steps in each of the above method embodiments.
  • Embodiments of the present application provide a computer program product.
  • the terminal device implements the steps in each of the above method embodiments.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The present application is applicable to the technical field of image processing. Provided are a 3D virtual object animation generation method and apparatus, a terminal device, and a medium. The animation generation method comprises: successively performing three-dimensional reconstruction on a reference object in each video frame of a target video to obtain three-dimensional reconstruction information of the reference object in each video frame; according to the three-dimensional reconstruction information of the reference objects in all the video frames and a preset object model, generating a first animation sequence corresponding to the reference object, the preset object model comprising a preset skeleton; on the basis of the preset skeleton, performing skeleton retargeting on the target skeleton of the target virtual object to obtain a retargeted skeleton, the structure of the target skeleton being the same as or similar to the structure of the preset skeleton; and, on the basis of the first animation sequence, performing animation retargeting on the retargeted skeleton to obtain a second animation sequence corresponding to the target virtual object, thereby improving animation generation efficiency of the target virtual object.

Description

3D虚拟对象的动画生成方法、装置、终端设备及介质Animation generation method, device, terminal equipment and media for 3D virtual objects 技术领域Technical field
本申请属于图像处理技术领域,尤其涉及一种3D虚拟对象的动画生成方法、装置、终端设备及介质。The present application belongs to the field of image processing technology, and in particular relates to a method, device, terminal equipment and medium for animation generation of 3D virtual objects.
背景技术Background technique
目前,三维(Three Dimensions,3D)技术被广泛应用在游戏、电影及虚拟现实(Virtual Reality,VR)等领域。在3D技术的应用过程中,通常需要根据3D技术的应用场景来设计3D虚拟对象以及3D虚拟对象的一系列动作,以生成3D虚拟对象的动画。例如,当3D技术应用在游戏领域时,通常需要根据3D游戏场景来设计3D游戏角色以及3D游戏角色的一系列动作,并基于3D游戏角色的一系列动作生成3D游戏角色的动画。Currently, three-dimensional (Three Dimensions, 3D) technology is widely used in games, movies, virtual reality (Virtual Reality, VR) and other fields. In the application process of 3D technology, it is usually necessary to design 3D virtual objects and a series of actions of the 3D virtual objects according to the application scenarios of the 3D technology to generate animations of the 3D virtual objects. For example, when 3D technology is applied in the game field, it is usually necessary to design a 3D game character and a series of actions of the 3D game character based on the 3D game scene, and generate animation of the 3D game character based on a series of actions of the 3D game character.
在生成3D虚拟对象的动画,通常采用的方式是先制作3D虚拟对象的关键动作对应的关键动画帧,再根据关键动画帧生成3D虚拟对象的其他动作对应的动画帧。然而,关键动画帧的制作需要依赖专业人员,且关键动画帧的制作过程复杂且耗时,降低了3D虚拟对象的动画生成效率。When generating animations of 3D virtual objects, the usual method is to first create key animation frames corresponding to key actions of the 3D virtual object, and then generate animation frames corresponding to other actions of the 3D virtual object based on the key animation frames. However, the production of key animation frames requires professionals, and the production process of key animation frames is complex and time-consuming, which reduces the efficiency of animation generation of 3D virtual objects.
技术问题technical problem
本申请实施例的目的在于:提供一种3D虚拟对象的动画生成方法、装置、终端设备及介质,旨在解决现有的3D虚拟对象的动画生成效率较低的问题。The purpose of the embodiments of the present application is to provide an animation generation method, device, terminal device and medium for 3D virtual objects, aiming to solve the existing problem of low efficiency in animation generation of 3D virtual objects.
技术解决方案Technical solutions
为解决上述技术问题,本申请实施例采用的技术方案是:In order to solve the above technical problems, the technical solutions adopted in the embodiments of this application are:
第一方面,本申请实施例提供一种3D虚拟对象的动画生成方法,包括:In a first aspect, embodiments of the present application provide a method for generating animations of 3D virtual objects, including:
依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;Sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame;
根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;Generate the first animation sequence corresponding to the reference object according to the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model; the preset object model includes a preset skeleton;
基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;Skeleton redirection is performed on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
在第一方面的一种可选的实现方式中,所述根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列,包括:In an optional implementation of the first aspect, generating a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model includes:
获取预设对象模型;Get the default object model;
基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;Based on the three-dimensional reconstruction information of the reference object in each video frame, set the structural parameters of the preset object model in each first animation frame of the first animation sequence respectively;
根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。According to the preset first animation frame rate, all the first animation frames are sequentially composed into the first animation sequence.
在第一方面的一种可选的实现方式中,所述三维重建信息包括网格点信息、骨骼关键点信息、根节点的位置信息及拍摄参数信息;所述基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置,包括:In an optional implementation of the first aspect, the three-dimensional reconstruction information includes grid point information, bone key point information, root node position information and shooting parameter information; the video frame is based on each frame The three-dimensional reconstruction information of the reference object in the first animation sequence is used to set the structural parameters of the preset object model in the first animation frame of each frame of the first animation sequence, including:
针对每一帧所述视频帧,根据所述视频帧中的参考对象的拍摄参数和根节点的位置信息,确定所述预设对象模型在对应的第一动画帧中的空间位置;For each video frame, determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node;
基于所述预设对象模型在对应的第一动画帧中的空间位置,对所述预设对象模型在对应的第一动画帧中的根节点的位置进行调整;Based on the spatial position of the preset object model in the corresponding first animation frame, adjust the position of the root node of the preset object model in the corresponding first animation frame;
基于所述视频帧中的参考对象的网格点信息和骨骼关键点信息,设置对应的第一动画帧中所述预设对象模型的姿态。Based on the grid point information and skeletal key point information of the reference object in the video frame, the posture of the preset object model in the corresponding first animation frame is set.
在第一方面的一种可选的实现方式中,在所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向之前,还包括:In an optional implementation of the first aspect, before performing skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton, the method further includes:
从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼;Determine the bones to be merged from the preset skeleton, merge the bones to be merged, and obtain the merged bones;
获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架;Obtain a target object model of the target virtual object; the target object model includes an initial skeleton;
基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨骼。Based on the merged bones, corresponding bones in the initial skeleton are set to obtain the target bones of the target virtual object.
在第一方面的一种可选的实现方式中,所述预设对象模型还包括预设网格体;所述目标虚拟对象模型还包括目标网格体;所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架,包括:In an optional implementation of the first aspect, the preset object model further includes a preset mesh; the target virtual object model further includes a target mesh; and the pair of objects based on the preset skeleton is The target skeleton of the target virtual object performs skeleton redirection to obtain the redirected skeleton, including:
将所述目标骨架的骨骼关键点与所述预设骨架的骨骼关键点进行匹配。Match the bone key points of the target skeleton with the bone key points of the preset skeleton.
在第一方面的一种可选的实现方式中,所述依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息,包括:In an optional implementation of the first aspect, the three-dimensional reconstruction of the reference object in each video frame of the target video is performed sequentially to obtain the three-dimensional reconstruction information of the reference object in each video frame. ,include:
将所述目标视频的所有视频帧逐帧导入至预设三维重建模型中进行处理,分别得到每一帧所述视频帧中的参考对象的三维重建信息。All video frames of the target video are imported into the preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
第二方面,本申请实施例提供一种3D虚拟对象的动画生成装置,包括:In a second aspect, embodiments of the present application provide an animation generation device for 3D virtual objects, including:
三维重建单元,用于依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;A three-dimensional reconstruction unit, configured to sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video, and obtain three-dimensional reconstruction information of the reference object in each video frame;
动画序列生成单元,用于根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;An animation sequence generation unit, configured to generate a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model; the preset object model includes a preset skeleton;
骨架重定向单元,用于基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;a skeleton redirection unit, configured to perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
动画重定向单元,用于基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。An animation redirection unit is configured to perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
在第二方面的一种可选的实现方式中,所述动画序列生成单元包括:In an optional implementation of the second aspect, the animation sequence generating unit includes:
第一获取单元,用于获取预设对象模型;The first acquisition unit is used to acquire the preset object model;
参数设置单元,用于基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;A parameter setting unit configured to separately set the structural parameters of the preset object model in each first animation frame of the first animation sequence based on the three-dimensional reconstruction information of the reference object in each frame of the video frame. Make settings;
排序单元,用于根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。A sorting unit, configured to sequence all the first animation frames into the first animation sequence according to a preset first animation frame rate.
第三方面,本申请实施例提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面的任一可选方式的步骤。In a third aspect, embodiments of the present application provide a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the Steps in any optional manner as described above in the first aspect.
第四方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面的任一可选方式的方法。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, any optional method as described in the first aspect is implemented. Methods.
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行如上述第一方面或第一方面的任一可选方式所述的方法。In a fifth aspect, embodiments of the present application provide a computer program product, which when the computer program product is run on a terminal device, causes the terminal device to execute the method described in the above first aspect or any alternative method of the first aspect.
本申请实施例提供的3D虚拟对象的动画生成方法、装置、终端设备、计算机可读存储介质及计算机程序产品具有以下有益效果:The 3D virtual object animation generation method, device, terminal equipment, computer-readable storage medium and computer program product provided by the embodiments of the present application have the following beneficial effects:
本实施例提供的3D虚拟角色的动画生成方法,通过依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧视频帧中的参考对象的三维重建信息,再根据所有视频帧中的参考对象的三维重建信息和预设对象模型生成参考对象对应的第一动画序列;由于预设对象模型的预设骨架的结构与目标虚拟对象的目标骨架的结构相同或相似,因此,将目标视频转换为对应的第一动画序列,可以后续目标虚拟对象的动画模拟提供参考依据;之后,先基于预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架,再基于第一动画序列对重定向骨架进行动画重定向,得到目标虚拟对象对应的第二动画序列,从而能够将目标视频中参考对象的动作映射给虚拟对象,即采用该方案可以自动实现对目标视频中参考对象的动作的模拟,得到目标虚拟对象的动画序列,相对于传统方式而言,无需专业人员制作目标虚拟对象的关键动画帧,从而提高了目标虚拟对象的动画生成效率。The animation generation method of 3D virtual characters provided in this embodiment obtains the three-dimensional reconstruction information of the reference object in each video frame by sequentially performing three-dimensional reconstruction of the reference object in each video frame of the target video, and then based on all The three-dimensional reconstruction information of the reference object in the video frame and the preset object model generate a first animation sequence corresponding to the reference object; since the structure of the preset skeleton of the preset object model is the same or similar to the structure of the target skeleton of the target virtual object, therefore , convert the target video into the corresponding first animation sequence, which can provide a reference basis for the subsequent animation simulation of the target virtual object; then, first perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain the redirected skeleton, and then Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain the second animation sequence corresponding to the target virtual object, so that the actions of the reference object in the target video can be mapped to the virtual object. That is, this solution can be used to automatically realize the target video The animation sequence of the target virtual object is obtained by simulating the motion of the reference object. Compared with the traditional method, there is no need for professionals to produce key animation frames of the target virtual object, thus improving the efficiency of animation generation of the target virtual object.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或示范性技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments or exemplary technologies will be briefly introduced below. Obviously, the drawings in the following description are only for the purpose of the present application. For some embodiments, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.
图1为本申请实施例提供的一种3D虚拟对象的动画生成方法的实现流程图;Figure 1 is an implementation flow chart of a method for generating animations of 3D virtual objects provided by an embodiment of the present application;
图2为本申请实施例提供的一种目标虚拟对象的示意图;Figure 2 is a schematic diagram of a target virtual object provided by an embodiment of the present application;
图3为本申请实施例提供的一种第一动画序列的生成流程的示意图;Figure 3 is a schematic diagram of a first animation sequence generation process provided by an embodiment of the present application;
图4为本申请实施例提供的一种第一动画序列的生成方法的实现流程图;Figure 4 is an implementation flow chart of a method for generating a first animation sequence provided by an embodiment of the present application;
图5为本申请实施例提供的一种骨架重定向过程的实现流程图;Figure 5 is an implementation flow chart of a skeleton redirection process provided by an embodiment of the present application;
图6为本申请实施例提供的一种第二动画序列的生成流程的示意图;Figure 6 is a schematic diagram of a second animation sequence generation process provided by an embodiment of the present application;
图7为本申请实施例提供的一种3D虚拟对象的动画生成装置的结构示意图;Figure 7 is a schematic structural diagram of a 3D virtual object animation generation device provided by an embodiment of the present application;
图8为本申请实施例提供的一种终端设备的结构示意图。Figure 8 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
本发明的实施方式Embodiments of the invention
需要说明的是,本申请实施例使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。在本申请实施例的描述中,除非另有说明,“多个”是指两个或多于两个,“至少一个”、“一个或多个”是指一个、两个或两个以上。术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”特征可以明示或者隐含地包括一个或者更多个该特征。It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application and are not intended to limit the present application. In the description of the embodiments of this application, unless otherwise specified, "plurality" refers to two or more than two, and "at least one" and "one or more" refer to one, two or more than two. The terms “first” and “second” are used for descriptive purposes only and shall not be understood as indicating or implying relative importance or implicitly indicating the quantity of indicated technical features. Thus, defining "first" and "second" features may explicitly or implicitly include one or more of these features.
在本说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference in this specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Therefore, the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in other embodiments", etc. appearing in different places in this specification are not necessarily References are made to the same embodiment, but rather to "one or more but not all embodiments" unless specifically stated otherwise. The terms “including,” “includes,” “having,” and variations thereof all mean “including but not limited to,” unless otherwise specifically emphasized.
本申请实施例提供的一种3D虚拟对象的动画生成方法可以应用在三维(Three Dimensions,3D)数字创作或虚拟现实(Virtual Reality,VR)场景中。其中,3D数字创作可以包括但不限于3D影视创作或3D游戏创作。The animation generation method of 3D virtual objects provided by the embodiment of the present application can be applied in three-dimensional (Three Dimensions, 3D) digital creation or virtual reality (Virtual Reality, VR) scenes. Among them, 3D digital creation can include but is not limited to 3D film and television creation or 3D game creation.
示例性的,在3D游戏创作场景中,可以采用本申请实施例提供的3D虚拟对象的动画生成方法来生成游戏中的3D虚拟对象的动画序列。例如,当需要构建3D游戏场景中的某个目标3D虚拟人物时,可以先录制一个包含人物的视频,该视频中不同视频帧的人物的姿态可以不同,通过对每一帧视频帧的人物进行三维重建,得到每一帧视频帧的人物的三维重建信息,再根据所有视频帧的人物的三维重建信息和预设对象模型生成该人物对应的第一动画序列;由于预设对象模型的骨架结构与目标3D虚拟人物的骨架结构相同或相似,因此,将视频转换为对于的第一动画序列,可以为后续构建目标3D虚拟人物的动画模型提供参考依据;之后,先基于预设对象模型的预设骨架对目标3D虚拟人物的目标骨架进行骨架重定向,得到重定向骨架,再基于第一动画序列对重定向骨架进行动画重定向,得到目标3D虚拟人物对应的第二动画序列,从而能够将视频中人物的动作映射给3D游戏场景中的某个目标3D虚拟人物。For example, in a 3D game creation scenario, the animation generation method of 3D virtual objects provided by the embodiments of the present application can be used to generate an animation sequence of 3D virtual objects in the game. For example, when you need to construct a target 3D virtual character in a 3D game scene, you can first record a video containing the character. The postures of the characters in different video frames in the video can be different. Three-dimensional reconstruction: obtain the three-dimensional reconstruction information of the character in each video frame, and then generate the first animation sequence corresponding to the character based on the three-dimensional reconstruction information of the character in all video frames and the preset object model; due to the skeleton structure of the preset object model It is the same as or similar to the skeleton structure of the target 3D virtual character. Therefore, converting the video into the first animation sequence can provide a reference basis for subsequent construction of the animation model of the target 3D virtual character; after that, the prediction based on the preset object model is first Assume that the skeleton performs skeleton redirection on the target skeleton of the target 3D virtual character to obtain the redirected skeleton, and then performs animation redirection on the redirected skeleton based on the first animation sequence to obtain the second animation sequence corresponding to the target 3D virtual character, so that the redirected skeleton can be obtained The actions of the characters in the video are mapped to a certain target 3D virtual character in the 3D game scene.
本申请实施例提供的一种3D虚拟对象的动画生成方法的执行主体可以为终端设备。终端设备可以包括于手机、平板电脑、笔记本电脑及台式电脑等电子设备。请参阅图1,图1为本申请实施例提供的一种3D虚拟对象的动画生成方法的实现流程图,该3D虚拟对象的动画生成方法可以包括S101~S104,详述如下:The execution subject of the animation generation method for 3D virtual objects provided by the embodiments of the present application may be a terminal device. Terminal devices can include electronic devices such as mobile phones, tablets, laptops, and desktop computers. Please refer to Figure 1. Figure 1 is an implementation flow chart of a 3D virtual object animation generation method provided by an embodiment of the present application. The 3D virtual object animation generation method may include S101~S104, as detailed below:
在S101中,依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息。In S101, three-dimensional reconstruction is performed on the reference object in each video frame of the target video in sequence, and three-dimensional reconstruction information of the reference object in each video frame is obtained.
在目标场景(例如,3D游戏创作场景)中,当需要创建3D虚拟对象,并生成3D虚拟对象的动画序列时,终端设备可以获取目标视频。其中,目标视频可以包括若干帧视频帧,每一帧视频帧中均包括参考对象,不同视频帧中的参考对象的姿态可以相同,也可以不同。In a target scene (for example, a 3D game creation scene), when it is necessary to create a 3D virtual object and generate an animation sequence of the 3D virtual object, the terminal device can obtain the target video. The target video may include several video frames, and each video frame may include a reference object. The postures of the reference objects in different video frames may be the same or different.
参考对象指目标虚拟对象进行动作模拟时所参考的对象,因此,参考对象的骨架结构需要与目标虚拟对象的骨架结构相同或相似。其中,目标虚拟对象可以是需要创建的3D虚拟对象中的任意一个3D虚拟对象。示例性的,当目标虚拟对象为类人对象(例如,图2中的21或22)时,参考对象可以是人。The reference object refers to the object that the target virtual object refers to when simulating actions. Therefore, the skeleton structure of the reference object needs to be the same or similar to the skeleton structure of the target virtual object. The target virtual object may be any 3D virtual object among the 3D virtual objects that need to be created. For example, when the target virtual object is a human-like object (for example, 21 or 22 in Figure 2), the reference object may be a human.
目标视频可以是实时录制的包含参考对象的视频,也可以是预先录制或制作的包含参考对象的视频,也可以是从网络上下载的包含参考对象的视频,或者还可以是通过其他方式得到的包含参考对象的视频,此处对目标视频的获取方式不做特别限定。The target video can be a video containing a reference object recorded in real time, a video containing a reference object that is pre-recorded or produced, a video containing a reference object downloaded from the Internet, or it can be obtained through other methods. Videos containing reference objects. There are no special restrictions on how to obtain the target video.
终端设备获取到目标视频后,可以对目标视频分帧处理,得到目标视频中的各帧视频帧。示例性的,如图3所示,若图3中的31为目标视频,终端设备对该目标视频31进行分帧处理后可以得到多帧视频帧32。After the terminal device obtains the target video, it can process the target video into frames to obtain each video frame in the target video. For example, as shown in Figure 3, if 31 in Figure 3 is a target video, the terminal device can obtain multi-frame video frames 32 after performing frame segmentation processing on the target video 31.
终端设备得到目标视频中的各帧视频帧后,可以依次对每一帧视频帧中的参考对象进行三维重建。终端设备对每一帧视频帧中的参考对象进行三维重建的目的是为了得到每一帧视频帧中的参考对象的三维重建信息。After the terminal device obtains each video frame in the target video, it can sequentially perform three-dimensional reconstruction of the reference object in each video frame. The purpose of the terminal device performing three-dimensional reconstruction of the reference object in each video frame is to obtain the three-dimensional reconstruction information of the reference object in each video frame.
其中,依次对每一帧视频帧中的参考对象进行三维重建指,按照每一帧视频帧在目标视频中的排列次序对各帧视频帧中的参考对象进行三维重建。Wherein, performing three-dimensional reconstruction of the reference objects in each video frame sequentially means performing three-dimensional reconstruction of the reference objects in each video frame according to the order in which each video frame is arranged in the target video.
在本申请的一个实施例中,终端设备可以采用三维重建模型依次对每一帧视频帧进行处理,得到每一帧视频帧中的参考对象的三维重建信息。采用三维重建模型可以快速高效地得到每一帧视频帧中的参考对象的三维重建信息。In one embodiment of the present application, the terminal device can use a three-dimensional reconstruction model to process each video frame in sequence to obtain the three-dimensional reconstruction information of the reference object in each video frame. The 3D reconstruction model can be used to quickly and efficiently obtain the 3D reconstruction information of the reference object in each video frame.
其中,三维重建模型可以是采用预设样本数据集对深度学习模型进行训练得到的。预设样本数据集中的每条数据均包括一个样本图像和该样本图像的三维重建信息。其中,样本图像为包含参考对象的图像。在采用该预设样本数据集对深度学习模型进行训练时,将每条样本数据中的样本图像作为深度学习模型的输入,将每条样本数据中的样本图像的三维重建信息作为深度学习模型的输出,对深度学习模型进行训练,如此,在深度学习模型训练完成后,深度学习模型可以学习到包含参考对象的图像与参考对象的三维重建信息之间的对应关系。终端设备可以将训练完成深度学习模型确定为三维重建模型。Among them, the three-dimensional reconstruction model can be obtained by training a deep learning model using a preset sample data set. Each piece of data in the preset sample data set includes a sample image and three-dimensional reconstruction information of the sample image. Among them, the sample image is an image containing a reference object. When using this preset sample data set to train the deep learning model, the sample image in each sample data is used as the input of the deep learning model, and the three-dimensional reconstruction information of the sample image in each sample data is used as the input of the deep learning model. Output, train the deep learning model, so that after the deep learning model training is completed, the deep learning model can learn the correspondence between the image containing the reference object and the three-dimensional reconstruction information of the reference object. The terminal device can determine the trained deep learning model as a three-dimensional reconstruction model.
作为示例而非限定,当参考对象为人时,参考对象的三维重建信息可以包括:网格点信息、骨骼关键点信息、根节点信息及拍摄参数信息。As an example and not a limitation, when the reference object is a human, the three-dimensional reconstruction information of the reference object may include: grid point information, bone key point information, root node information, and shooting parameter information.
其中,网格点信息用于描述参考对象的轮廓。Among them, the grid point information is used to describe the outline of the reference object.
骨骼关键点信息用于描述参考对象的姿态。示例性的,骨骼关键点信息可以是骨骼关键点的轴角信息。其中,骨骼关键点可以包括人体各个骨骼的起点和终点。骨骼关键点的轴角信息用于描述骨骼关键点相对于其父节点的三维空间旋转信息。Skeleton keypoint information is used to describe the pose of the reference object. For example, the bone key point information may be the axis angle information of the bone key point. Among them, the bone key points can include the starting point and end point of each bone of the human body. The axis angle information of the bone key point is used to describe the three-dimensional space rotation information of the bone key point relative to its parent node.
根节点信息用于描述参考对象的骨盆位置。根节点信息可以通过参考对象的骨盆关键点在预设坐标系中的坐标描述。预设坐标系可以根据实际需求设置。The root node information is used to describe the pelvic position of the reference object. The root node information can be described by the coordinates of the reference object's pelvic key points in the preset coordinate system. The preset coordinate system can be set according to actual needs.
拍摄参数信息用于描述参考对象被拍摄时的相机参数。拍摄参数信息可以包括但不限于相机的缩放比例。The shooting parameter information is used to describe the camera parameters when the reference object is photographed. The shooting parameter information may include but is not limited to the zoom ratio of the camera.
本申请实施例中,终端设备得到各帧视频帧中的参考对象的三维重建信息后,可以将每一帧视频帧中的参考对象的骨骼关键点信息和根节点信息分别存储在一个数组中,并将所有视频帧对应的数组按照各个视频帧在目标视频中的次序存储在第一预设文件中。作为示例而非限定,第一预设文件可以是PKL格式的文件。PKL格式是python软件保存文件的一种文件格式,python是一种计算机编程语言。In the embodiment of this application, after the terminal device obtains the three-dimensional reconstruction information of the reference object in each video frame, it can store the bone key point information and root node information of the reference object in each video frame in an array respectively. And the arrays corresponding to all video frames are stored in the first preset file according to the order of each video frame in the target video. As an example and not a limitation, the first preset file may be a file in PKL format. PKL format is a file format used by python software to save files, and python is a computer programming language.
在S102中,根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架。In S102, a first animation sequence corresponding to the reference object is generated based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model; the preset object model includes a preset skeleton.
预设对象模型指标准的3D参考对象模板。预设对象模型可以通过预设骨架和预设网格体描述。其中,预设骨架与参考对象的骨架相同或相似。示例性的,若参考对象是人,则预设对象模型为标准的3D人体模板。Default object models refer to standard 3D reference object templates. Preset object models can be described by preset skeletons and preset meshes. Among them, the preset skeleton is the same as or similar to the skeleton of the reference object. For example, if the reference object is a human, the default object model is a standard 3D human body template.
需要说明的是,预设对象模型具有一个预先设置的初始姿态。示例性的,请继续参阅图3,图3中的33为一种标准的3D人体模板,其当前的姿态即为上述初始姿态。It should be noted that the preset object model has a preset initial posture. For example, please continue to refer to Figure 3. 33 in Figure 3 is a standard 3D human body template, and its current posture is the above-mentioned initial posture.
终端设备可以根据每一帧视频帧中的参考对象的三维重建信息对预设对象模型进行姿态和/或位置的调整,得到每一帧视频帧对应的第一动画帧,所有视频帧对应的第一动画帧即组成第一动画序列。如图3所示,终端设备根据每一帧视频帧32中的参考对象的三维重建信息对预设对象模型33进行姿态和/或位置的调整,得到每一帧32对应的第一动画帧34,所有视频帧32对应的第一动画帧34即组成第一动画序列。The terminal device can adjust the posture and/or position of the preset object model according to the three-dimensional reconstruction information of the reference object in each video frame to obtain the first animation frame corresponding to each video frame and the third animation frame corresponding to all video frames. One animation frame constitutes the first animation sequence. As shown in FIG. 3 , the terminal device adjusts the posture and/or position of the preset object model 33 according to the three-dimensional reconstruction information of the reference object in each video frame 32 to obtain the first animation frame 34 corresponding to each frame 32 . , the first animation frames 34 corresponding to all the video frames 32 constitute the first animation sequence.
在本申请的一个实施例中,S102可以包括如图4所示的S41~S43  ,详述如下:In an embodiment of the present application, S102 may include S41~S43 as shown in Figure 4, as detailed below:
在S41中,获取预设对象模型。In S41, the preset object model is obtained.
在一种可能的实现方式中,预设对象模型可以预先存储在对象模型库中。基于此,终端设备可以从对象模型库中获取预先存储的预设对象模型。In a possible implementation manner, the preset object model can be stored in the object model library in advance. Based on this, the terminal device can obtain the pre-stored preset object model from the object model library.
在S42中,基于每一帧视频帧中的参考对象的三维重建信息,分别对第一动画序列的每一帧第一动画帧中的预设对象模型的结构参数进行设置。In S42, based on the three-dimensional reconstruction information of the reference object in each video frame, the structural parameters of the preset object model in each first animation frame of the first animation sequence are respectively set.
其中,对每一帧第一动画帧中的预设对象模型的结构参数进行设置具体可以为,对每一帧动画帧中的预设对象模型的位置和姿态进行设置。Specifically, setting the structural parameters of the preset object model in each first animation frame may include setting the position and posture of the preset object model in each animation frame.
在一种可能的实现方式中,终端设备可以先生成多帧包含预设对象模型的第一动画帧,第一动画帧的数量与目标视频包括的视频帧的数量一致;再设置每一帧第一动画帧中的预设对象模型的初始位置;再基于每一帧视频帧的三维重建信息对对应的第一动画帧中的预设对象模型的位置和姿态进行调整。In a possible implementation, the terminal device can first generate multiple first animation frames containing the preset object model, and the number of the first animation frames is consistent with the number of video frames included in the target video; and then set the first animation frame of each frame. The initial position of the preset object model in an animation frame; and then adjusting the position and posture of the preset object model in the corresponding first animation frame based on the three-dimensional reconstruction information of each video frame.
其中,预设对象在第一动画帧的位置信息可以通过相应视频帧中参考对象的拍摄参数和根节点的位置信息确定;预设对象模型的姿态可以通过相应视频帧中参考对象的网格点信息和骨骼关键点信息确定。Among them, the position information of the preset object in the first animation frame can be determined by the shooting parameters of the reference object in the corresponding video frame and the position information of the root node; the posture of the preset object model can be determined by the grid points of the reference object in the corresponding video frame. information and bone keypoint information determined.
在一种可能的实现方式中,S42可以包括以下步骤:In a possible implementation, S42 may include the following steps:
步骤a,针对每一帧所述视频帧,根据所述拍摄参数与参考对象的根节点的位置信息确定所述预设对象模型在对应的第一动画帧中的空间位置。Step a: For each video frame, determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters and the position information of the root node of the reference object.
在本实现方式中,终端设备获取到每一帧视频帧中的参考对象的拍摄参数和根节点的位置信息后,可以基于该拍摄参数中的缩放比例和根节点的位置信息,结合弱透视投影关系,计算每一帧视频帧对应的第一动画帧中的预设对象模型的空间位置。In this implementation, after the terminal device obtains the shooting parameters and the location information of the root node of the reference object in each video frame, it can combine weak perspective projection based on the scaling ratio in the shooting parameters and the location information of the root node. Relationship, calculate the spatial position of the preset object model in the first animation frame corresponding to each video frame.
步骤b,基于所述预设对象模型在对应的第一动画帧中的空间位置对所述预设对象模型在第一动画帧中的根节点位置进行调整。Step b: Adjust the root node position of the preset object model in the first animation frame based on the spatial position of the preset object model in the corresponding first animation frame.
终端设备得到每一帧第一动画帧中的预设对象模型的空间位置后,对每一帧第一动画帧中的预设对象模型的根节点的位置进行调整,使预设对象模型的根节点的位置与预设对象模型在对应的第一动画帧中的空间位置一致。After the terminal device obtains the spatial position of the preset object model in the first animation frame of each frame, it adjusts the position of the root node of the preset object model in the first animation frame of each frame so that the root node of the preset object model The position of the node is consistent with the spatial position of the preset object model in the corresponding first animation frame.
步骤c,基于所述网格点信息和所述骨骼关键点信息设置对应的第一动画帧中所述预设对象模型的姿态。Step c: Set the posture of the preset object model in the corresponding first animation frame based on the grid point information and the skeletal key point information.
终端设备调整了预设对象模型在每一帧第一动画帧中的空间位置后,可以基于每一帧第一动画帧对应的视频帧中的参考对象的网格点信息和骨骼关键点信息,对每一帧第一动画帧中的预设对象模型的姿态进行调整,使每一帧第一动画帧中的预设对象模型的姿态与对应视频帧中的参考对象模型的姿态相同。After the terminal device adjusts the spatial position of the preset object model in the first animation frame of each frame, it can based on the grid point information and bone key point information of the reference object in the video frame corresponding to the first animation frame of each frame, The posture of the preset object model in the first animation frame of each frame is adjusted so that the posture of the preset object model in the first animation frame of each frame is the same as the posture of the reference object model in the corresponding video frame.
具体的,终端设备可以先基于每一帧第一动画帧对应的视频帧中参考对象的骨骼关键点信息,对每一帧第一动画帧中的预设对象模型的各个骨骼关键点的轴角进行调整,使每一帧第一动画帧中的预设对象模型的各个骨骼关键点的轴角与对应视频帧中的参考对象模型的各个骨骼关键点的轴角相同;之后,终端设备可以基于每一帧第一动画帧对应的视频帧中的参考对象的网格点信息,对每一帧第一动画帧中的预设对象模型的网格点进行调整,使每一帧第一动画帧中的预设对象模型的网格点与对应视频帧中的参考对象模型的网格点相同。Specifically, the terminal device can first calculate the axis angle of each bone key point of the preset object model in the first animation frame of each frame based on the bone key point information of the reference object in the video frame corresponding to the first animation frame of each frame. Adjust so that the axis angle of each bone key point of the preset object model in the first animation frame of each frame is the same as the axis angle of each bone key point of the reference object model in the corresponding video frame; after that, the terminal device can be based on The grid point information of the reference object in the video frame corresponding to the first animation frame of each frame is adjusted to the grid points of the preset object model in the first animation frame of each frame, so that the first animation frame of each frame The grid points of the preset object model in are the same as the grid points of the reference object model in the corresponding video frame.
在S43中,根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。In S43, all the first animation frames are sequentially composed into the first animation sequence according to the preset first animation frame rate.
本申请实施例中,预设的第一动画帧率可以根据实际需求设置。示例性的,预设的第一动画帧率可以与目标视频的帧率相同,或者预设的第一动画帧率可以为目标视频的帧率的n倍,n可以为大于1的整数。In this embodiment of the present application, the preset first animation frame rate can be set according to actual needs. For example, the preset first animation frame rate may be the same as the frame rate of the target video, or the preset first animation frame rate may be n times the frame rate of the target video, and n may be an integer greater than 1.
终端设备可以按照各帧第一动画帧对应的视频帧在目标视频中的次序,将所有第一动画帧进行排序,排序后的所有第一动画帧即构成第一动画序列。具体的,将第一帧视频帧对应的第一动画帧作为第一动画序列的第一帧,将第二帧视频帧对应的第一动画帧作为第一动画序列的第二帧,以此类推,即可将上述各个视频帧的对应的第一动画帧按照上述顺序组成第一动画序列。The terminal device can sort all the first animation frames according to the order of the video frames corresponding to the first animation frames of each frame in the target video, and all the sorted first animation frames constitute the first animation sequence. Specifically, the first animation frame corresponding to the first video frame is regarded as the first frame of the first animation sequence, the first animation frame corresponding to the second video frame is regarded as the second frame of the first animation sequence, and so on. , that is, the corresponding first animation frames of each of the above video frames can be composed into a first animation sequence in the above order.
终端设备得到第一动画序列后,可以将第一动画序列存储在第二预设文件中。示例性的,第二预设文件可以为FBX格式的文件。FBX格式是Filmbox软件保存文件所使用的一种文件格式。Filmbox是一种在三维设计软件之间进行模型、材质、动作和摄影机信息的互导的软件。After the terminal device obtains the first animation sequence, it can store the first animation sequence in the second preset file. For example, the second preset file may be a file in FBX format. FBX format is a file format used by Filmbox software to save files. Filmbox is a software that allows mutual guidance of models, materials, actions and camera information between 3D design software.
上述方案,通过获取预设对象模型,基于每一帧视频帧的参考对象的三维重建信息对每一帧对应的第一动画帧中的上述预设对象的结构参数进行设置,从而能够将视频帧中的参考对象的动作姿态快速迁移到第一动画帧中的预设对象中。随后将上述进行结构参数设置后的每一帧第一动画帧按顺序排列,排序后的所有第一动画帧即构成第一动画序列,从而能够将目标视频映射为对应的动画序列,且将每帧视频帧中的参考对象的姿态和位置快速映射到对应第一动画帧中的预设对象模型上,使得每帧第一动画帧中的预设对象模型与对应视频帧中的参考对象具有相同的姿态和位置。In the above scheme, by obtaining the preset object model and setting the structural parameters of the above-mentioned preset object in the first animation frame corresponding to each frame based on the three-dimensional reconstruction information of the reference object of each video frame, the video frame can be The action pose of the reference object in the animation is quickly transferred to the preset object in the first animation frame. Then, the first animation frames of each frame after the above-mentioned structural parameter setting are arranged in order. All the first animation frames after sorting constitute the first animation sequence, so that the target video can be mapped to the corresponding animation sequence, and each first animation frame can be mapped to the corresponding animation sequence. The posture and position of the reference object in the video frame are quickly mapped to the preset object model in the corresponding first animation frame, so that the preset object model in the first animation frame of each frame has the same characteristics as the reference object in the corresponding video frame. attitude and position.
在S103中,基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述重定向骨架的结构与所述预设骨架的结构相同或相似。In S103, perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the redirected skeleton is the same as or similar to the structure of the preset skeleton.
目标虚拟对象可以为目标场景中需要创建的任意一个3D虚拟对象,例如,可以为3D虚拟人物。目标场景可以包括3D游戏创作场景或VR场景等。The target virtual object can be any 3D virtual object that needs to be created in the target scene, for example, it can be a 3D virtual character. Target scenes can include 3D game creation scenes or VR scenes, etc.
每个目标虚拟对象均对应一个默认的目标对象模型。目标对象模型可以通过初始骨架和初始网格体描述。Each target virtual object corresponds to a default target object model. The target object model can be described by an initial skeleton and an initial mesh.
终端设备可以先根据预设骨架以及每个目标虚拟对象的初始骨架确定该目标虚拟对象的目标骨架,再基于上述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架。The terminal device can first determine the target skeleton of the target virtual object based on the preset skeleton and the initial skeleton of each target virtual object, and then perform skeleton redirection on the target skeleton of the target virtual object based on the above preset skeleton to obtain the redirected skeleton.
其中,目标骨架的结构与预设骨架的结构相同或相似。The structure of the target skeleton is the same as or similar to the structure of the preset skeleton.
本申请实施例中,对目标骨架进行骨架重定向过程指,将目标骨架与预设骨架的相同骨骼关键点进行对应的过程。In the embodiment of the present application, the skeleton reorientation process on the target skeleton refers to the process of corresponding the same bone key points of the target skeleton with the preset skeleton.
在本申请的一个实施例中,终端设备可以通过如图5所示的S51~ S53来得到每个目标虚拟对象的目标骨架,详述如下:In one embodiment of the present application, the terminal device can obtain the target skeleton of each target virtual object through S51~S53 as shown in Figure 5, as detailed below:
在S51中,从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼。In S51, bones to be merged are determined from the preset skeleton, and the bones to be merged are merged to obtain merged bones.
在本申请实施例中,上述待合并骨骼可以根据预设骨架的实际情况确定。不同骨架中的待合并骨骼可以不同。本申请实施例对预设骨架中待合并骨骼的合并规则与合并方式不做特别限定,合并后的骨骼构成的骨架能够描述参考对象的动作姿态。In this embodiment of the present application, the above-mentioned skeleton to be merged can be determined based on the actual situation of the preset skeleton. The bones to be merged in different skeletons can be different. The embodiment of the present application does not specifically limit the merging rules and merging methods of the bones to be merged in the preset skeleton. The skeleton composed of the merged bones can describe the action posture of the reference object.
在S52中,获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架。In S52, a target object model of the target virtual object is obtained; the target object model includes an initial skeleton.
在一种可能的实现方式中,目标虚拟对象的目标对象模型可以预先存储在目标场景对应的虚拟对象模型库中。基于此,终端设备可以从虚拟对象模型库中获取目标虚拟对象的目标对象模型。In a possible implementation manner, the target object model of the target virtual object can be pre-stored in the virtual object model library corresponding to the target scene. Based on this, the terminal device can obtain the target object model of the target virtual object from the virtual object model library.
在S53中,基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨架。In S53, the corresponding bones in the initial skeleton are set based on the merged bones to obtain the target skeleton of the target virtual object.
本申请实施例中,终端设备对预设骨架的待合并骨骼进行合并后,可以基于合并后的骨骼的合并规则与合并方式对初始骨架中的相应骨骼进行合并,将进行骨骼合并后的初始骨架确定为目标虚拟对象的目标骨架。In the embodiment of this application, after the terminal device merges the bones to be merged in the preset skeleton, it can merge the corresponding bones in the initial skeleton based on the merge rules and merge methods of the merged bones, and the initial skeleton after the skeleton is merged Identifies the target skeleton as the target virtual object.
在本申请的一个实施例中,由于目标骨架的骨骼关键点的命名规则与预设骨架的骨骼关键点的命名规则可能不一样,因此,需要可以将目标骨架的骨骼关键点与预设骨架的骨骼关键点进行匹配,以将目标骨架与预设骨架的相同骨骼关键点进行对应,进而实现对目标骨架的重定向。In one embodiment of the present application, since the naming rules of the key points of the target skeleton and the naming rules of the key points of the preset skeleton may be different, it is necessary to distinguish the key points of the target skeleton and the key points of the preset skeleton. Bone key points are matched to match the target skeleton with the same bone key points of the preset skeleton, thereby reorienting the target skeleton.
在S104中,基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。In S104, perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
动画重定向指的是将动作数据从一个骨架复制到另外一个骨架,因此,基于第一动画序列对重定向骨架进行动画重定向是指,将第一动画序列中预设对象模型的动作数据从预设骨架复制到目标对象模型的重定向骨架上,从而得到目标对象模型的第二动画序列。Animation redirection refers to copying action data from one skeleton to another. Therefore, animation redirection of the redirected skeleton based on the first animation sequence means copying the action data of the preset object model in the first animation sequence from The preset skeleton is copied to the redirected skeleton of the target object model, thereby obtaining a second animation sequence of the target object model.
在本申请实施例中,终端设备可以先生成多帧包含骨架重定向后的目标对象模型的第二动画帧,其中,第二动画帧的数量与第一动画帧的数量一致;再设置每一帧第二动画帧中的目标对象模型的初始位置,例如,可以将每一帧第二动画帧中的目标对象模型的初始位置设置在每一帧第二动画帧的中央;再基于每一帧第一动画帧的预设对象模型的位置和姿态对第二动画帧中的目标对象模型的动作和姿态进行调整。In this embodiment of the present application, the terminal device may first generate multiple frames of second animation frames containing the target object model after skeleton redirection, where the number of second animation frames is consistent with the number of first animation frames; and then set each The initial position of the target object model in the second animation frame of each frame. For example, the initial position of the target object model in the second animation frame of each frame can be set at the center of the second animation frame of each frame; and then based on each frame The position and posture of the preset object model in the first animation frame are adjusted to the movement and posture of the target object model in the second animation frame.
其中,目标对象模型在第二动画帧的位置可以通过相应第一动画帧中预设对象模型的根节点的位置确定;目标对象模型的姿态可以通过相应第一动画帧中预设对象模型的姿态确定。Wherein, the position of the target object model in the second animation frame can be determined by the position of the root node of the preset object model in the corresponding first animation frame; the posture of the target object model can be determined by the posture of the preset object model in the corresponding first animation frame. Sure.
在一种可能的实现方式中,S104可以包括以下步骤:In a possible implementation, S104 may include the following steps:
步骤d:针对每一帧第二动画帧,根据每一帧第一动画帧中预设对象模型的空间位置调整对应第二动画帧中目标对象模型的空间位置。Step d: For each second animation frame, adjust the spatial position of the target object model in the second animation frame according to the spatial position of the preset object model in the first animation frame of each frame.
在本实现方式中,终端设备可以获取每一帧第一动画帧中预设对象模型的空间位置,对每一帧对应的第二动画帧中目标对象模型的空间位置进行调整,使预设对象模型在第一动画帧中的空间位置与目标对象模型在第二动画帧的空间位置相同,也即使预设对象在第一动画帧中的根节点的位置与目标对象模型在第二动画帧中的根节点的位置相同。In this implementation, the terminal device can obtain the spatial position of the preset object model in the first animation frame of each frame, and adjust the spatial position of the target object model in the second animation frame corresponding to each frame, so that the preset object The spatial position of the model in the first animation frame is the same as the spatial position of the target object model in the second animation frame, that is, even if the position of the root node of the preset object in the first animation frame is the same as the position of the target object model in the second animation frame The location of the root node is the same.
步骤e:针对每一帧第二动画帧,终端设备对目标对象模型的姿态进行调整,使目标对象模型的姿态与参考对象模型的姿态相同。Step e: For each second animation frame, the terminal device adjusts the posture of the target object model so that the posture of the target object model is the same as the posture of the reference object model.
终端设备调整了目标对象模型在每一帧第二动画帧中的空间位置后,可以基于每一帧第二动画帧对应的第一动画帧中的预设对象模型的网格点信息和骨骼关键点信息,对每一帧第二动画帧中的目标对象模型的姿态进行调整,使每一帧第二动画帧中的目标对象模型的姿态与对应第一动画帧中的预设对象模型的姿态相同。After the terminal device adjusts the spatial position of the target object model in each second animation frame, it can use the grid point information and bone key of the preset object model in the first animation frame corresponding to each second animation frame. point information, adjust the posture of the target object model in the second animation frame of each frame, so that the posture of the target object model in the second animation frame of each frame corresponds to the posture of the preset object model in the first animation frame same.
具体的,终端设备可以先基于每一帧第二动画帧对应的第一动画帧中参考对象的骨骼关键点信息,对每一帧第二动画帧中的目标对象模型的各个骨骼关键点的轴角进行调整,使每一帧第二动画帧中的目标对象模型的各个骨骼关键点的轴角与对应第一动画帧中的预设对象模型的各个骨骼关键点的轴角相同;之后,终端设备可以基于每一帧第二动画帧对应的第一动画帧中的预设对象的网格点信息,对每一帧第二动画帧中的目标对象模型的网格点进行调整,使每一帧第二动画帧中的目标对象模型的网格点与对应第一动画帧中的预设对象模型的网格点相同。Specifically, the terminal device may first calculate the axes of each bone key point of the target object model in each second animation frame based on the bone key point information of the reference object in the first animation frame corresponding to each second animation frame. The angle is adjusted so that the axis angle of each bone key point of the target object model in the second animation frame of each frame is the same as the axis angle of each bone key point of the corresponding preset object model in the first animation frame; after that, the terminal The device can adjust the grid points of the target object model in each second animation frame based on the grid point information of the preset object in the first animation frame corresponding to each second animation frame, so that each The grid points of the target object model in the second animation frame are the same as the corresponding grid points of the preset object model in the first animation frame.
步骤f:根据预设的第二第一动画帧率,将所有调整后的第二第一动画帧按序组成所述第二动画序列。Step f: According to the preset second first animation frame rate, all the adjusted second first animation frames are sequentially composed into the second animation sequence.
本申请实施例中,预设的第二动画帧率可以根据实际需求设置。示例性的,预设的第二动画帧率可以与第一动画的帧率相同,或者预设的第二动画帧率可以为第一动画帧率的n倍,n可以为大于1的整数。In this embodiment of the present application, the preset second animation frame rate can be set according to actual needs. For example, the preset second animation frame rate may be the same as the first animation frame rate, or the preset second animation frame rate may be n times the first animation frame rate, and n may be an integer greater than 1.
终端设备可以按照各帧第二动画帧对应第一动画帧中的次序,将所有第二动画帧进行排序,排序后的所有第二动画帧即构成第二动画序列。具体的,将第一帧第一动画帧对应的第二动画帧作为第二动画序列的第一帧,将第二帧第一动画帧对应的第二动画帧作为第二动画序列的第二帧,以此类推,即可将上述各个第一动画帧的对应的第二动画帧按照上述顺序组成第二动画序列。The terminal device can sort all the second animation frames according to the order in which the second animation frames correspond to the first animation frames, and all the sorted second animation frames constitute the second animation sequence. Specifically, the second animation frame corresponding to the first animation frame of the first frame is regarded as the first frame of the second animation sequence, and the second animation frame corresponding to the first animation frame of the second frame is regarded as the second frame of the second animation sequence. , and by analogy, the corresponding second animation frames of each of the above first animation frames can be composed in the above order to form a second animation sequence.
终端设备得到第二动画序列后,可以将第二动画序列存储在第三预设文件中。示例性的,第三预设文件可以为FBX格式的文件。FBX格式是filmbox软件保存文件所使用的一种文件格式。Filmbox是一种在三维设计软件之间进行模型、材质、动作和摄影机信息的互导的软件。After the terminal device obtains the second animation sequence, it can store the second animation sequence in the third preset file. For example, the third preset file may be a file in FBX format. FBX format is a file format used by filmbox software to save files. Filmbox is a software that allows mutual guidance of models, materials, actions and camera information between 3D design software.
示例性的,如图6所示,若图6中的611为目标视频61的多个视频帧,则根据每一帧视频帧得到的第一动画帧可以为621,所有第一动画帧组成了第一动画序列61;根据每一帧第一动画帧得到的第二动画帧可以为631,所有第二动画帧631组成了第二动画序列63。For example, as shown in Figure 6, if 611 in Figure 6 is multiple video frames of the target video 61, the first animation frame obtained according to each video frame can be 621, and all the first animation frames constitute The first animation sequence 61; the second animation frame obtained according to each first animation frame may be 631, and all the second animation frames 631 constitute the second animation sequence 63.
上述方案,通过依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧视频帧中的参考对象的三维重建信息,再根据所有视频帧中的参考对象的三维重建信息和预设对象模型生成参考对象对应的第一动画序列;由于预设对象模型的预设骨架的结构与目标虚拟对象的目标骨架的结构相同或相似,因此,将目标视频转换为对应的第一动画序列,可以后续目标虚拟对象的动画模拟提供参考依据;之后,先基于预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架,再基于第一动画序列对重定向骨架进行动画重定向,得到目标虚拟对象对应的第二动画序列,从而能够将目标视频中参考对象的动作映射给虚拟对象,即采用该方案可以自动实现对目标视频中参考对象的动作的模拟,得到目标虚拟对象的动画序列,相对于传统方式而言,无需专业人员制作目标虚拟对象的关键动画帧,从而提高了目标虚拟对象的动画生成效率。The above scheme obtains the three-dimensional reconstruction information of the reference object in each video frame by sequentially performing three-dimensional reconstruction of the reference object in each video frame of the target video, and then based on the three-dimensional reconstruction information of the reference object in all video frames Generate a first animation sequence corresponding to the reference object with the preset object model; since the structure of the preset skeleton of the preset object model is the same or similar to the structure of the target skeleton of the target virtual object, the target video is converted into the corresponding first animation sequence. The animation sequence can provide a reference basis for the subsequent animation simulation of the target virtual object; then, first perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain the redirected skeleton, and then perform the redirected skeleton based on the first animation sequence. Animation redirection obtains the second animation sequence corresponding to the target virtual object, so that the actions of the reference object in the target video can be mapped to the virtual object. That is, this solution can be used to automatically simulate the actions of the reference object in the target video and obtain the target Compared with traditional methods, the animation sequence of virtual objects does not require professionals to produce key animation frames of the target virtual object, thereby improving the efficiency of animation generation of the target virtual object.
基于上述实施例提供的3D虚拟对象的动画生成方法,本申请实施例进一步给出实现上述方法实施例的3D虚拟对象的动画生成装置,请参阅图7,图7示出了本申请实施例提供的一种3D虚拟对象的动画生成装置的结构示意图。如图7所示,3D虚拟对象的动画生成装置可以包括:三维重建单元71、动画序列生成单元72、骨架重定向单元73以及动画重定向单元74。其中:Based on the animation generation method of 3D virtual objects provided by the above embodiments, embodiments of the present application further provide an animation generation device for 3D virtual objects that implements the above method embodiments. Please refer to Figure 7. Figure 7 shows the animation generation method of 3D virtual objects provided by the embodiments of the present application. A schematic structural diagram of an animation generation device for 3D virtual objects. As shown in FIG. 7 , the animation generation device of 3D virtual objects may include: a three-dimensional reconstruction unit 71 , an animation sequence generation unit 72 , a skeleton reorientation unit 73 and an animation reorientation unit 74 . in:
三维重建单元71用于依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧视频帧中的参考对象的三维重建信息。The three-dimensional reconstruction unit 71 is configured to sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame.
动画序列生成单元72用于根据所有视频帧中的参考对象的三维重建信息和预设对象模型生成参考对象对应的第一动画序列;预设对象模型包括预设骨架。The animation sequence generating unit 72 is configured to generate a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all video frames and a preset object model; the preset object model includes a preset skeleton.
骨架重定向单元73用于基于预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;重定向骨架的结构与所述预设骨架的结构相同或相似。The skeleton redirection unit 73 is configured to perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the redirected skeleton is the same as or similar to the structure of the preset skeleton.
动画重定向单元74用于基于第一动画序列对重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。The animation redirection unit 74 is configured to perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
可选的,动画序列生成单元72包括第一获取单元、参数设置单元以及排序单元。其中:Optionally, the animation sequence generating unit 72 includes a first obtaining unit, a parameter setting unit and a sorting unit. in:
第一获取单元用于获取预设对象模型。The first acquisition unit is used to acquire the preset object model.
参数设置单元用用于基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置。The parameter setting unit is configured to separately set the structural parameters of the preset object model in each first animation frame of the first animation sequence based on the three-dimensional reconstruction information of the reference object in each frame of the video frame. Make settings.
排序单元用于根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。The sorting unit is configured to sequence all the first animation frames into the first animation sequence according to a preset first animation frame rate.
可选的,参数设置单元包括位置确定单元、位置调整单元以及姿态调整单元。其中:Optionally, the parameter setting unit includes a position determination unit, a position adjustment unit and an attitude adjustment unit. in:
位置确定单元用于针对每一帧所述视频帧,根据所述视频帧中的参考对象的拍摄参数和根节点的位置信息,确定所述预设对象模型在对应的第一动画帧中的空间位置。The position determination unit is configured to determine, for each video frame, the space of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node. Location.
位置调整单元用于基于所述预设对象模型在对应的第一动画帧中的空间位置,对所述预设对象模型在对应的第一动画帧中的根节点的位置进行调整。The position adjustment unit is configured to adjust the position of the root node of the preset object model in the corresponding first animation frame based on the spatial position of the preset object model in the corresponding first animation frame.
姿态调整单元用于基于所述视频帧中的参考对象的网格点信息和骨骼关键点信息,设置对应的第一动画帧中所述预设对象模型的姿态。The posture adjustment unit is configured to set the posture of the preset object model in the corresponding first animation frame based on the grid point information and skeletal key point information of the reference object in the video frame.
可选的,3D虚拟对象的动画生成装置还包括骨骼合并单元、第二获取单元以及骨骼设置单元。其中:Optionally, the 3D virtual object animation generation device also includes a bone merging unit, a second acquisition unit, and a bone setting unit. in:
骨骼合并单元用于从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼。The bone merging unit is used to determine the bones to be merged from the preset skeleton, and merge the bones to be merged to obtain the merged bones.
第二获取单元用于获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架。The second acquisition unit is used to acquire the target object model of the target virtual object; the target object model includes an initial skeleton.
骨骼设置单元用于基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨架。The bone setting unit is used to set corresponding bones in the initial skeleton based on the merged bones to obtain the target skeleton of the target virtual object.
可选的,骨架重定向单元73具体用于:Optionally, the skeleton redirection unit 73 is specifically used for:
将所述目标骨架的骨骼关键点与所述预设骨架的骨骼关键点进行匹配。Match the bone key points of the target skeleton with the bone key points of the preset skeleton.
可选的,三维重建单元71具体用于:Optionally, the three-dimensional reconstruction unit 71 is specifically used for:
将所述目标视频的所有视频帧逐帧导入至预设三维重建模型中进行处理,分别得到每一帧所述视频帧中的参考对象的三维重建信息。All video frames of the target video are imported into a preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
需要说明的是,上述单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参照方法实施例部分,此处不再赘述。It should be noted that the information interaction, execution process, etc. between the above units are based on the same concept as the method embodiments of the present application. For details of their specific functions and technical effects, please refer to the method embodiments section, which will not be discussed here. Again.
请参阅图8,图8为本申请实施例提供的一种终端设备的结构示意图。如图8所示,本实施例提供的终端设备8可以包括:处理器80、存储器81以及存储在存储器81中并可在处理器80上运行的计算机程序82,例如3D虚拟对象的动画生成方法对应的程序。处理器80执行计算机程序82时实现上述应用于3D虚拟对象的动画生成方法实施例中的步骤,例如图1所示的S101~S104。或者,处理器80执行计算机程序82时实现上述3D虚拟对象的动画生成装置实施例中各模块/单元的功能,例如图7所示的单元71~74的功能。Please refer to FIG. 8 , which is a schematic structural diagram of a terminal device provided by an embodiment of the present application. As shown in Figure 8, the terminal device 8 provided by this embodiment may include: a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and runable on the processor 80, such as a method for generating animations of 3D virtual objects. corresponding program. When the processor 80 executes the computer program 82, the steps in the above embodiment of the animation generation method applied to 3D virtual objects are implemented, such as S101 to S104 shown in FIG. 1 . Alternatively, when the processor 80 executes the computer program 82 , the functions of each module/unit in the above embodiment of the animation generation device for 3D virtual objects are implemented, such as the functions of the units 71 to 74 shown in FIG. 7 .
示例性的,计算机程序82可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器81中,并由处理器80执行,以完成本申请。一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述计算机程序82在终端设备8中的执行过程。例如,计算机程序82可以被分割成三维重建单元、动画序列生成单元、骨架重定向单元以及动画重定向单元,各单元的具体功能请参阅图7对应的实施例中的相关描述,此处不赘述。For example, the computer program 82 may be divided into one or more modules/units, and one or more modules/units are stored in the memory 81 and executed by the processor 80 to complete the present application. One or more modules/units may be a series of computer program instruction segments capable of completing specific functions. The instruction segments are used to describe the execution process of the computer program 82 in the terminal device 8 . For example, the computer program 82 can be divided into a three-dimensional reconstruction unit, an animation sequence generation unit, a skeleton redirection unit, and an animation redirection unit. For the specific functions of each unit, please refer to the relevant descriptions in the corresponding embodiment of FIG. 7 and will not be described again here. .
本领域技术人员可以理解,图8仅仅是终端设备8的示例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件。Those skilled in the art can understand that FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or less components than shown in the figure, or some components may be combined, or different components may be used. .
处理器80可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Processor 80 may be a central processing unit (central processing unit). processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (field-programmable) gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
存储器81可以是终端设备8的内部存储单元,例如终端设备8的硬盘或内存。存储器81也可以是终端设备8的外部存储设备,例如终端设备8上配备的插接式硬盘、智能存储卡(smart media card,SMC)、安全数字(secure digital,SD)卡或闪存卡(flash card)等。进一步地,存储器81还可以既包括终端设备8的内部存储单元也包括外部存储设备。存储器81用于存储计算机程序以及终端设备所需的其他程序和数据。存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the terminal device 8 , such as a hard disk or memory of the terminal device 8 . The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card or a flash memory card (flash card) equipped on the terminal device 8. card) etc. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store computer programs and other programs and data required by the terminal device. The memory 81 may also be used to temporarily store data that has been output or is to be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元完成,即将供电控制装置的内部结构划分成不同的功能单元,以完成以上描述的全部或者部分功能。实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional units is used as an example. In practical applications, the above functions can be allocated to different functional units according to needs, that is, The internal structure of the power supply control device is divided into different functional units to complete all or part of the functions described above. Each functional unit in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware. , can also be implemented in the form of software functional units. In addition, the specific names of each functional unit are only for the convenience of distinguishing each other and are not used to limit the protection scope of the present application. For the specific working processes of the units in the above system, reference can be made to the corresponding processes in the foregoing method embodiments, which will not be described again here.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有计算机程序,该计算机程序被处理器执行时可实现上述各个方法实施例中的步骤。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When executed by a processor, the computer program can implement the steps in each of the above method embodiments.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备实现上述各个方法实施例中的步骤。Embodiments of the present application provide a computer program product. When the computer program product is run on a terminal device, the terminal device implements the steps in each of the above method embodiments.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参照其它实施例的相关描述。In the above embodiments, each embodiment is described with its own emphasis. For parts that are not detailed or recorded in a certain embodiment, you can refer to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-described embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of this application, and should be included in within the protection scope of this application.

Claims (20)

  1. 一种3D虚拟对象的动画生成方法,其特征在于,包括: An animation generation method for 3D virtual objects, which is characterized by including:
    依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;Sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame;
    根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;Generate the first animation sequence corresponding to the reference object according to the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model; the preset object model includes a preset skeleton;
    基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;Skeleton redirection is performed on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
    基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  2. 根据权利要求1所述的3D虚拟对象的动画生成方法,其特征在于,所述根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列,包括: The animation generation method of 3D virtual objects according to claim 1, characterized in that the first animation corresponding to the reference object is generated according to the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model. Sequences, including:
    获取预设对象模型;Get the default object model;
    基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;Based on the three-dimensional reconstruction information of the reference object in each video frame, set the structural parameters of the preset object model in each first animation frame of the first animation sequence respectively;
    根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。According to the preset first animation frame rate, all the first animation frames are sequentially composed into the first animation sequence.
  3. 根据权利要求2所述的3D虚拟对象的动画生成方法,其特征在于,所述三维重建信息包括网格点信息、骨骼关键点信息、根节点的位置信息及拍摄参数信息;所述基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置,包括: The animation generation method of 3D virtual objects according to claim 2, characterized in that the three-dimensional reconstruction information includes grid point information, bone key point information, root node position information and shooting parameter information; Frame the three-dimensional reconstruction information of the reference object in the video frame, and separately set the structural parameters of the preset object model in the first animation frame of each frame of the first animation sequence, including:
    针对每一帧所述视频帧,根据所述视频帧中的参考对象的拍摄参数和根节点的位置信息,确定所述预设对象模型在对应的第一动画帧中的空间位置;For each video frame, determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node;
    基于所述预设对象模型在对应的第一动画帧中的空间位置,对所述预设对象模型在对应的第一动画帧中的根节点的位置进行调整;Based on the spatial position of the preset object model in the corresponding first animation frame, adjust the position of the root node of the preset object model in the corresponding first animation frame;
    基于所述视频帧中的参考对象的网格点信息和骨骼关键点信息,设置对应的第一动画帧中所述预设对象模型的姿态。Based on the grid point information and skeletal key point information of the reference object in the video frame, the posture of the preset object model in the corresponding first animation frame is set.
  4. 根据权利要求1所述的3D虚拟对象的动画生成方法,其特征在于,在所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向之前,还包括: The animation generation method of 3D virtual objects according to claim 1, characterized in that, before performing skeleton reorientation on the target skeleton of the target virtual object based on the preset skeleton, it further includes:
    从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼;Determine the bones to be merged from the preset skeleton, merge the bones to be merged, and obtain the merged bones;
    获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架;Obtain a target object model of the target virtual object; the target object model includes an initial skeleton;
    基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨架。Based on the merged bones, corresponding bones in the initial skeleton are set to obtain a target skeleton of the target virtual object.
  5. 根据权利要求4所述的3D虚拟对象的动画生成方法,其特征在于,所述预设对象模型还包括预设网格体;所述目标虚拟对象模型还包括目标网格体;所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架,包括: The animation generation method of 3D virtual objects according to claim 4, characterized in that the preset object model further includes a preset mesh; the target virtual object model further includes a target mesh; The above-mentioned preset skeleton performs skeleton redirection on the target skeleton of the target virtual object to obtain the redirected skeleton, including:
    将所述目标骨架的骨骼关键点与所述预设骨架的骨骼关键点进行匹配。Match the bone key points of the target skeleton with the bone key points of the preset skeleton.
  6. 根据权利要求1至5任一项所述的3D虚拟对象的动画生成方法,其特征在于,所述依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息,包括: The animation generation method of 3D virtual objects according to any one of claims 1 to 5, characterized in that the reference object in each video frame of the target video is sequentially three-dimensionally reconstructed to obtain the said Three-dimensional reconstruction information of the reference object in the video frame, including:
    将所述目标视频的所有视频帧逐帧导入至预设三维重建模型中进行处理,分别得到每一帧所述视频帧中的参考对象的三维重建信息。All video frames of the target video are imported into the preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
  7. 一种3D虚拟对象的动画生成装置,其特征在于,包括: An animation generation device for 3D virtual objects, which is characterized by including:
    三维重建单元,用于依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;A three-dimensional reconstruction unit, configured to sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video, and obtain three-dimensional reconstruction information of the reference object in each video frame;
    动画序列生成单元,用于根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;An animation sequence generation unit, configured to generate a first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and a preset object model; the preset object model includes a preset skeleton;
    骨架重定向单元,用于基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;a skeleton redirection unit, configured to perform skeleton redirection on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
    动画重定向单元,用于基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。An animation redirection unit is configured to perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  8. 根据权利要求7所述的3D虚拟对象的动画生成装置,其特征在于,所述动画序列生成单元包括: The animation generation device for 3D virtual objects according to claim 7, wherein the animation sequence generation unit includes:
    第一获取单元,用于获取预设对象模型;The first acquisition unit is used to acquire the preset object model;
    参数设置单元,用于基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;A parameter setting unit configured to separately set the structural parameters of the preset object model in each first animation frame of the first animation sequence based on the three-dimensional reconstruction information of the reference object in each frame of the video frame. Make settings;
    排序单元,用于根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。A sorting unit, configured to sequence all the first animation frames into the first animation sequence according to a preset first animation frame rate.
  9. 根据权利要求8所述的3D虚拟对象的动画生成装置,其特征在于,所述参数设置单元包括: The animation generation device for 3D virtual objects according to claim 8, wherein the parameter setting unit includes:
    位置确定单元,用于针对每一帧所述视频帧,根据所述视频帧中的参考对象的拍摄参数和根节点的位置信息,确定所述预设对象模型在对应的第一动画帧中的空间位置;A position determination unit configured to, for each video frame, determine the position of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node. Spatial location;
    位置调整单元,用于基于所述预设对象模型在对应的第一动画帧中的空间位置,对所述预设对象模型在对应的第一动画帧中的根节点的位置进行调整;A position adjustment unit configured to adjust the position of the root node of the preset object model in the corresponding first animation frame based on the spatial position of the preset object model in the corresponding first animation frame;
    姿态调整单元,用于基于所述视频帧中的参考对象的网格点信息和骨骼关键点信息,设置对应的第一动画帧中所述预设对象模型的姿态。A posture adjustment unit configured to set the posture of the preset object model in the corresponding first animation frame based on the grid point information and skeletal key point information of the reference object in the video frame.
  10. 根据权利要求7所述的3D虚拟对象的动画生成装置,其特征在于,所述3D虚拟对象的动画生成装置还包括: The device for generating animation of 3D virtual objects according to claim 7, characterized in that the device for generating animation of 3D virtual objects further includes:
    骨骼合并单元,用于从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼;A bone merging unit is used to determine the bones to be merged from the preset skeleton, and merge the bones to be merged to obtain the merged bones;
    第二获取单元,用于获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架;a second acquisition unit, configured to acquire the target object model of the target virtual object; the target object model includes an initial skeleton;
    骨骼设置单元,用于基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨架。A skeleton setting unit is configured to set the corresponding bones in the initial skeleton based on the merged skeleton to obtain the target skeleton of the target virtual object.
  11. 根据权利要求10所述的3D虚拟对象的动画生成装置,其特征在于,所述骨架重定向单元具体用于: The animation generation device for 3D virtual objects according to claim 10, wherein the skeleton reorientation unit is specifically used to:
    将所述目标骨架的骨骼关键点与所述预设骨架的骨骼关键点进行匹配。Match the bone key points of the target skeleton with the bone key points of the preset skeleton.
  12. 根据权利要求7至11任一项所述的3D虚拟对象的动画生成装置,其特征在于,所述三维重建单元具体用于: The animation generation device for 3D virtual objects according to any one of claims 7 to 11, wherein the three-dimensional reconstruction unit is specifically used for:
    将所述目标视频的所有视频帧逐帧导入至预设三维重建模型中进行处理,分别得到每一帧所述视频帧中的参考对象的三维重建信息。All video frames of the target video are imported into the preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
  13. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如下步骤: A terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, the following steps are implemented:
    依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;Sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame;
    根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;Generate the first animation sequence corresponding to the reference object according to the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model; the preset object model includes a preset skeleton;
    基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;Skeleton redirection is performed on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
    基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  14. 根据权利要求13所述的终端设备,其特征在于,所述根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列,包括: The terminal device according to claim 13, wherein generating the first animation sequence corresponding to the reference object based on the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model includes:
    获取预设对象模型;Get the default object model;
    基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;Based on the three-dimensional reconstruction information of the reference object in each video frame, set the structural parameters of the preset object model in each first animation frame of the first animation sequence respectively;
    根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。According to the preset first animation frame rate, all the first animation frames are sequentially composed into the first animation sequence.
  15. 根据权利要求14所述的终端设备,其特征在于,所述三维重建信息包括网格点信息、骨骼关键点信息、根节点的位置信息及拍摄参数信息;所述基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置,包括: The terminal device according to claim 14, characterized in that the three-dimensional reconstruction information includes grid point information, bone key point information, root node position information and shooting parameter information; the video frame is based on each frame The three-dimensional reconstruction information of the reference object in the first animation sequence is used to set the structural parameters of the preset object model in the first animation frame of each frame of the first animation sequence, including:
    针对每一帧所述视频帧,根据所述视频帧中的参考对象的拍摄参数和根节点的位置信息,确定所述预设对象模型在对应的第一动画帧中的空间位置;For each video frame, determine the spatial position of the preset object model in the corresponding first animation frame according to the shooting parameters of the reference object in the video frame and the position information of the root node;
    基于所述预设对象模型在对应的第一动画帧中的空间位置,对所述预设对象模型在对应的第一动画帧中的根节点的位置进行调整;Based on the spatial position of the preset object model in the corresponding first animation frame, adjust the position of the root node of the preset object model in the corresponding first animation frame;
    基于所述视频帧中的参考对象的网格点信息和骨骼关键点信息,设置对应的第一动画帧中所述预设对象模型的姿态。Based on the grid point information and skeletal key point information of the reference object in the video frame, the posture of the preset object model in the corresponding first animation frame is set.
  16. 根据权利要求13所述的终端设备,其特征在于,所述处理器执行所述计算机程序时实现所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向之前,还包括: The terminal device according to claim 13, wherein when the processor executes the computer program and before implementing the skeleton redirection of the target skeleton of the target virtual object based on the preset skeleton, the processor further includes:
    从所述预设骨架中确定待合并骨骼,将所述待合并骨骼进行合并,得到合并后的骨骼;Determine the bones to be merged from the preset skeleton, merge the bones to be merged, and obtain the merged bones;
    获取所述目标虚拟对象的目标对象模型;所述目标对象模型包括初始骨架;Obtain a target object model of the target virtual object; the target object model includes an initial skeleton;
    基于所述合并后的骨骼对所述初始骨架中的相应骨骼进行设置,得到所述目标虚拟对象的目标骨架。Based on the merged bones, corresponding bones in the initial skeleton are set to obtain a target skeleton of the target virtual object.
  17. 根据权利要求16所述的终端设备,其特征在于,所述预设对象模型还包括预设网格体;所述目标虚拟对象模型还包括目标网格体;所述基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架,包括: The terminal device according to claim 16, wherein the preset object model further includes a preset mesh; the target virtual object model further includes a target mesh; and the pair of objects based on the preset skeleton is The target skeleton of the target virtual object performs skeleton redirection to obtain the redirected skeleton, including:
    将所述目标骨架的骨骼关键点与所述预设骨架的骨骼关键点进行匹配。Match the bone key points of the target skeleton with the bone key points of the preset skeleton.
  18. 根据权利要求13至17任一项所述的终端设备,其特征在于,所述依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息,包括: The terminal device according to any one of claims 13 to 17, characterized in that the reference object in each video frame of the target video is sequentially three-dimensionally reconstructed to obtain the reference object in each video frame. 3D reconstruction information of the object, including:
    将所述目标视频的所有视频帧逐帧导入至预设三维重建模型中进行处理,分别得到每一帧所述视频帧中的参考对象的三维重建信息。All video frames of the target video are imported into a preset three-dimensional reconstruction model frame by frame for processing, and the three-dimensional reconstruction information of the reference object in each video frame is obtained respectively.
  19. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如下步骤: A computer-readable storage medium stores a computer program, wherein the computer program implements the following steps when executed by a processor:
    依次对目标视频的每一帧视频帧中的参考对象进行三维重建,得到每一帧所述视频帧中的参考对象的三维重建信息;Sequentially perform three-dimensional reconstruction of the reference object in each video frame of the target video to obtain three-dimensional reconstruction information of the reference object in each video frame;
    根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列;所述预设对象模型包括预设骨架;Generate the first animation sequence corresponding to the reference object according to the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model; the preset object model includes a preset skeleton;
    基于所述预设骨架对目标虚拟对象的目标骨架进行骨架重定向,得到重定向骨架;所述目标骨架的结构与所述预设骨架的结构相同或相似;Skeleton redirection is performed on the target skeleton of the target virtual object based on the preset skeleton to obtain a redirected skeleton; the structure of the target skeleton is the same as or similar to the structure of the preset skeleton;
    基于所述第一动画序列对所述重定向骨架进行动画重定向,得到所述目标虚拟对象对应的第二动画序列。Perform animation redirection on the redirected skeleton based on the first animation sequence to obtain a second animation sequence corresponding to the target virtual object.
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述根据所有所述视频帧中的参考对象的三维重建信息和预设对象模型生成所述参考对象对应的第一动画序列,包括: The computer-readable storage medium according to claim 19, wherein the first animation sequence corresponding to the reference object is generated based on the three-dimensional reconstruction information of the reference object in all the video frames and the preset object model, include:
    获取预设对象模型;Get the default object model;
    基于每一帧所述视频帧中的参考对象的三维重建信息,分别对所述第一动画序列的每一帧第一动画帧中的所述预设对象模型的结构参数进行设置;Based on the three-dimensional reconstruction information of the reference object in each video frame, set the structural parameters of the preset object model in each first animation frame of the first animation sequence respectively;
    根据预设的第一动画帧率,将所有所述第一动画帧按序组成所述第一动画序列。According to the preset first animation frame rate, all the first animation frames are sequentially composed into the first animation sequence.
PCT/CN2022/103020 2022-06-30 2022-06-30 3d virtual object animation generation method and apparatus, terminal device, and medium WO2024000480A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/103020 WO2024000480A1 (en) 2022-06-30 2022-06-30 3d virtual object animation generation method and apparatus, terminal device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/103020 WO2024000480A1 (en) 2022-06-30 2022-06-30 3d virtual object animation generation method and apparatus, terminal device, and medium

Publications (1)

Publication Number Publication Date
WO2024000480A1 true WO2024000480A1 (en) 2024-01-04

Family

ID=89383821

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/103020 WO2024000480A1 (en) 2022-06-30 2022-06-30 3d virtual object animation generation method and apparatus, terminal device, and medium

Country Status (1)

Country Link
WO (1) WO2024000480A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150178988A1 (en) * 2012-05-22 2015-06-25 Telefonica, S.A. Method and a system for generating a realistic 3d reconstruction model for an object or being
CN111028317A (en) * 2019-11-14 2020-04-17 腾讯科技(深圳)有限公司 Animation generation method, device and equipment for virtual object and storage medium
CN111968207A (en) * 2020-09-25 2020-11-20 魔珐(上海)信息科技有限公司 Animation generation method, device, system and storage medium
CN113920232A (en) * 2021-10-29 2022-01-11 上海商汤智能科技有限公司 Animation generation method and device, computer equipment and storage medium
CN114219878A (en) * 2021-12-14 2022-03-22 魔珐(上海)信息科技有限公司 Animation generation method and device for virtual character, storage medium and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150178988A1 (en) * 2012-05-22 2015-06-25 Telefonica, S.A. Method and a system for generating a realistic 3d reconstruction model for an object or being
CN111028317A (en) * 2019-11-14 2020-04-17 腾讯科技(深圳)有限公司 Animation generation method, device and equipment for virtual object and storage medium
CN111968207A (en) * 2020-09-25 2020-11-20 魔珐(上海)信息科技有限公司 Animation generation method, device, system and storage medium
CN113920232A (en) * 2021-10-29 2022-01-11 上海商汤智能科技有限公司 Animation generation method and device, computer equipment and storage medium
CN114219878A (en) * 2021-12-14 2022-03-22 魔珐(上海)信息科技有限公司 Animation generation method and device for virtual character, storage medium and terminal

Similar Documents

Publication Publication Date Title
WO2022002032A1 (en) Image-driven model training and image generation
JP7337104B2 (en) Model animation multi-plane interaction method, apparatus, device and storage medium by augmented reality
WO2020125567A1 (en) Automatic animation generation method, and automatic animation generation system
CN106200983B (en) A kind of system of combination virtual reality and BIM realization virtual reality scenario architectural design
JP7457806B2 (en) Lens division realization method, device and related products
CN112884881B (en) Three-dimensional face model reconstruction method and device, electronic equipment and storage medium
CN112819944A (en) Three-dimensional human body model reconstruction method and device, electronic equipment and storage medium
JP7483301B2 (en) Image processing and image synthesis method, device, and computer program
US20220126447A1 (en) Data generation method and apparatus, and storage medium
WO2022075859A1 (en) Facial model mapping with a neural network trained on varying levels of detail of facial scans
CN115331265A (en) Training method of posture detection model and driving method and device of digital person
KR102358464B1 (en) 3d image converter that automaically generates 3d character animation from image infomation using artificial intelligence and 3d image converting system including the same
CN117372602B (en) Heterogeneous three-dimensional multi-object fusion rendering method, equipment and system
CN115775300B (en) Human body model reconstruction method, human body model reconstruction training method and device
WO2024000480A1 (en) 3d virtual object animation generation method and apparatus, terminal device, and medium
JP2023089947A (en) Feature tracking system and method
WO2024027063A1 (en) Livestream method and apparatus, storage medium, electronic device and product
CN109360274A (en) Immersive VR construction method, device, intelligent elevated table and storage medium
CN115239856A (en) Animation generation method and device for 3D virtual object, terminal device and medium
CN113705379A (en) Gesture estimation method and device, storage medium and equipment
CN115714888B (en) Video generation method, device, equipment and computer readable storage medium
CN113805532B (en) Method and terminal for manufacturing physical robot actions
US12017145B2 (en) Method and system of automatic animation generation
CN116152447B (en) Face modeling method and device, electronic equipment and storage medium
Takács Animation of Avatar Face based on Human Face Video

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22948583

Country of ref document: EP

Kind code of ref document: A1