TW202247104A - Animation migration method and equipment and computer-readable storage medium - Google Patents

Animation migration method and equipment and computer-readable storage medium Download PDF

Info

Publication number
TW202247104A
TW202247104A TW110146183A TW110146183A TW202247104A TW 202247104 A TW202247104 A TW 202247104A TW 110146183 A TW110146183 A TW 110146183A TW 110146183 A TW110146183 A TW 110146183A TW 202247104 A TW202247104 A TW 202247104A
Authority
TW
Taiwan
Prior art keywords
bone
node
source
target
initial
Prior art date
Application number
TW110146183A
Other languages
Chinese (zh)
Other versions
TWI795116B (en
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 大陸商深圳市慧鯉科技有限公司
Publication of TW202247104A publication Critical patent/TW202247104A/en
Application granted granted Critical
Publication of TWI795116B publication Critical patent/TWI795116B/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/203D [Three Dimensional] animation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • G06T17/205Re-meshing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Generation (AREA)

Abstract

The embodiments of the present disclosure disclose an animation migration method and equipment, and a computer-readable storage medium. The animation migration method includes: obtaining an initial source bone, an initial target bone, and a node mapping relationship between the initial source bone and the initial target bone; updating the node topology structure of at least one of the initial source bone and the initial target bone based on the node mapping relationship, obtain the final source bone and the final target bone, wherein the target nodes in the final target bone can be mapped to the source nodes in the final source bone; the first animation-driven data related to the initial source bone is migrated to the final target bone to obtain the second animation driving data of the final target bone. The above solution can realize the animation migration between different bones and improve the applicability of the animation migration between the bones

Description

動畫遷移方法和設備、電腦可讀儲存介質Animation migration method and device, computer-readable storage medium

本發明實施例關於但不限於電腦圖形學領域,特別是關於一種動畫遷移方法和設備、電腦可讀儲存介質。The embodiments of the present invention relate to but are not limited to the field of computer graphics, and in particular relate to an animation migration method and device, and a computer-readable storage medium.

從一個現有的骨骼模型向一個新的骨骼模型遷移動畫,使得現有的骨骼模型所具有的動畫在新的骨骼模型上以自然合理的方式呈現,是電腦圖形學中的一個很有實用價值的技術。但是,相關技術的動畫遷移方案中,現有的具備動畫資料的骨骼模型向新的骨骼模型遷移動畫時適用性較低。Migrate animation from an existing skeleton model to a new skeleton model, so that the animation of the existing skeleton model can be presented in a natural and reasonable way on the new skeleton model, which is a very practical technology in computer graphics . However, in the animation migration scheme of the related art, the applicability is low when the animation is transferred from the existing skeleton model with animation data to the new skeleton model.

本發明實施例至少提供一種動畫遷移方法和設備、電腦可讀儲存介質。Embodiments of the present invention at least provide an animation migration method and device, and a computer-readable storage medium.

本發明實施例提供了一種動畫遷移方法,包括:獲取初始源骨骼、初始目標骨骼以及初始源骨骼和初始目標骨骼之間的節點映射關係;基於節點映射關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,最終目標骨骼中的目標節點均能夠映射於最終源骨骼中的源節點;將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料。An embodiment of the present invention provides an animation migration method, including: obtaining the initial source bone, the initial target bone, and the node mapping relationship between the initial source bone and the initial target bone; updating at least one of the initial source bone and the initial target bone based on the node mapping relationship The node topology structure of the first one can obtain the final source bone and the final target bone, wherein, the target nodes in the final target bone can all be mapped to the source nodes in the final source bone; the first animation driving data related to the initial source bone is migrated Go to the final target bone to get the second animation driving data of the final target bone.

因此,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。Therefore, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone, In order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone to be migrated and the target bone The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

在一些實施例中,最終目標骨骼與最終源骨骼的節點拓撲結構一致,和/或,最終目標骨骼與最終源骨骼之間的節點一一映射。In some embodiments, the node topology of the final target bone is consistent with that of the final source bone, and/or, the node-to-node mapping between the final target bone and the final source bone.

因此,通過保障最終目標骨骼中的節點在最終源骨骼中具有對應的節點與之映射,且映射關係為一一映射,不存在一個目標節點對應多個源節點的情況,使得後續最終目標骨骼中的節點上均有對應動畫驅動資料,且每個節點上的動畫驅動資料的數量為1,不存在一個節點有多個動畫驅動的情況,從而使得最終目標骨骼的動畫驅動更自然。Therefore, by ensuring that the nodes in the final target bone have corresponding nodes mapped to them in the final source bone, and the mapping relationship is one-to-one mapping, there is no situation where one target node corresponds to multiple source nodes, so that the subsequent final target bone There are corresponding animation driving data on each node, and the number of animation driving data on each node is 1. There is no case that a node has multiple animation drivers, so that the animation driving of the final target bone is more natural.

在一些實施例中,節點映射關係包括初始源骨骼和初始目標骨骼中的節點之間的映射關係;基於節點對應關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,包括以下至少之一:在兩個骨骼之間存在多個節點映射於同一節點的情況下,更新其中一個骨骼的節點拓撲結構;在骨骼中存在未有映射關係的情況下,更新未有映射關係的節點所在骨骼的節點拓撲結構;其中,兩個骨骼包括初始源骨骼和初始目標骨骼,經更新之後的兩個骨骼之間的節點一一映射。In some embodiments, the node mapping relationship includes the mapping relationship between the nodes in the initial source bone and the initial target bone; based on the node correspondence, the node topology of at least one of the initial source bone and the initial target bone is updated to obtain the final source The bone and the final target bone, including at least one of the following: when there are multiple nodes mapped to the same node between the two bones, update the node topology of one of the bones; if there is no mapping relationship in the bone , update the node topology structure of the bone where the node with no mapping relationship is located; wherein, the two bones include the initial source bone and the initial target bone, and the updated nodes between the two bones are mapped one by one.

因此,通過更新骨骼的節點拓撲結構能夠使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,以減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。Therefore, by updating the node topology of the bone, the situation where multiple nodes between two bones are mapped to the same node can be adjusted to a node-to-one mapping between the two bones, so as to reduce the process of subsequent animation driving the final target bone Unreasonable situations arise.

在一些實施例中,更新未有映射關係的節點所在骨骼的節點拓撲結構,包括:將未有映射關係的節點合併至具有映射關係的相鄰節點,其中,相鄰節點為未有映射關係的節點在所在骨骼中的父節點或子節點;和/或,更新其中一個骨骼的節點拓撲結構,包括:在多個節點位於同一骨骼分支的情況下,更新多個節點所在的第一骨骼;在多個節點位於不同骨骼分支的情況下,更新不包含多個節點的第二骨骼;其中,第一骨骼和第二骨骼中的其中一個為初始源骨骼,另一個為初始目標骨骼。In some embodiments, updating the node topology of the bone where the node without a mapping relationship is located includes: merging the node without a mapping relationship into an adjacent node with a mapping relationship, wherein the adjacent node is a node without a mapping relationship The parent node or child node of the node in the bone where it is located; and/or, updating the node topology of one of the bones, including: when multiple nodes are located in the same bone branch, updating the first bone where multiple nodes are located; When multiple nodes are located in different bone branches, update the second bone that does not contain multiple nodes; wherein, one of the first bone and the second bone is the initial source bone, and the other is the initial target bone.

因此,通過更新多個節點所在的第一骨骼,使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,進而減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。Therefore, by updating the first bone where multiple nodes are located, the situation that multiple nodes between two bones are mapped to the same node is adjusted to a node-to-one mapping between two bones, thereby reducing the subsequent animation driving the final target bone Unreasonable situations appear in the process.

在一些實施例中,更新多個節點所在的第一骨骼,包括:將第一骨骼中的多個節點合併為一個第一節點,其中,第一節點保留合併前多個節點的映射關係;和/或,更新不包含多個節點的第二骨骼,包括:在第一骨骼中查找出多個節點所在的骨骼分支匯合的第二節點,並在第二骨骼中查找出映射於第二節點的第三節點;按照多個節點對應的節點拓撲結構,在第三節點處新增至少一條骨骼分支,其中,多個節點與第三節點處新增的骨骼分支和原始的骨骼分支中的節點一一映射。In some embodiments, updating the first bone where the multiple nodes are located includes: merging the multiple nodes in the first bone into one first node, wherein the first node retains the mapping relationship of the multiple nodes before merging; and /or, update the second bone that does not contain multiple nodes, including: find out in the first bone the second node where the bone branches where the multiple nodes are located converge, and find out in the second bone that is mapped to the second node The third node; according to the node topology corresponding to the multiple nodes, add at least one bone branch at the third node, wherein the multiple nodes are the same as the new bone branch at the third node and the nodes in the original bone branch a map.

因此,通過此種方式在實現節點一一映射的情況下,還能夠最大化的保留第一骨骼的節點拓撲結構。Therefore, in the case of implementing node-to-node mapping in this way, the node topology of the first bone can also be preserved to the greatest extent.

在一些實施例中,在將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料之前,方法還包括:按照從根源節點到葉源節點的順序,分別將最終源骨骼中的各源節點與最終目標骨骼中對應映射的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係;將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料,包括:利用第一動畫驅動資料和第一位姿變換關係,得到最終目標骨骼的第二動畫驅動資料。In some embodiments, before migrating the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone, the method further includes: Align each source node in the final source bone with the corresponding mapped target node in the final target bone to obtain the first pose transformation relationship between each source node and the mapped target node; The first animation driving data related to the bone is transferred to the final target bone to obtain the second animation driving data of the final target bone, including: using the first animation driving data and the first pose transformation relationship to obtain the second animation of the final target bone Driver data.

因此,通過進行源節點與目標節點之間的對齊,就能夠得到各源節點與映射的目標節點之間的第一位姿變換關係,由此實現利用第一動畫驅動資料和第一位姿變換關係,得到最終目標骨骼的第二動畫驅動資料。Therefore, by aligning the source node and the target node, the first pose transformation relationship between each source node and the mapped target node can be obtained, thereby realizing the use of the first animation driving data and the first pose transformation relationship to get the second animation-driven data of the final target bone.

在一些實施例中,分別將最終源骨骼中的各源節點與最終目標骨骼中對應的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係,包括:對於最終源骨骼中的每個源節點,獲取使源節點對齊於映射的目標節點所需的偏移量,其中,偏移量包括平移分量和旋轉分量中的至少一者;基於源節點對應的偏移量,得到源節點的第一位姿變換關係。In some embodiments, each source node in the final source bone is aligned with the corresponding target node in the final target bone, so as to obtain the first pose transformation relationship between each source node and the mapped target node, including: For each source node in the final source bone, obtain the offset required to align the source node to the mapped target node, where the offset includes at least one of a translation component and a rotation component; based on the corresponding Offset, get the first pose transformation relationship of the source node.

因此,偏移量包括平移分量和旋轉分量,使得獲取到的第一位姿變換關係更準確。Therefore, the offset includes a translation component and a rotation component, so that the obtained first pose transformation relationship is more accurate.

在一些實施例中,最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,第一位姿變換關係為源節點與映射的目標節點在第一座標系中的變換關係;源節點對應的偏移量為:在源節點的第一父節點對齊且第一父節點作為第二座標系的原點的情況下,源節點與映射的目標節點在第二座標系中的偏移量。In some embodiments, both the root node of the final source bone and the root target node of the final target bone are translated to the origin of the first coordinate system, and the first pose transformation relationship is that the source node and the mapped target node are in the first coordinate system The transformation relationship in ; the offset corresponding to the source node is: when the first parent node of the source node is aligned and the first parent node is the origin of the second coordinate system, the source node and the mapped target node are in the second The offset in the coordinate system.

因此,通過最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,能夠獲取最終源骨骼的根源節點和最終目標骨骼的根目標節點之間的偏移量。Therefore, by translating the root node of the final source bone and the root target node of the final target bone to the origin of the first coordinate system, the offset between the root node of the final source bone and the root target node of the final target bone can be obtained .

在一些實施例中,獲取使源節點對齊於映射的目標節點所需的偏移量,包括:獲取經對齊的第一父節點與根源節點之間的第二位姿變換關係、以及源節點映射的目標節點的第二父節點與根目標節點之間的第三位姿變換關係,基於源節點以及映射的目標節點在第一座標系中的位姿以及第二位姿變換關係和第三位姿變換關係,得到源節點對應的偏移量;和/或,基於源節點對應的偏移量,得到源節點的第一位姿變換關係,包括:基於源節點以及源節點的上級節點分別對應的偏移量,得到源節點的第一位姿變換關係,其中,源節點的上級節點為最終源骨骼中源節點的第一父節點、根源節點以及第一父節點與根源節點之間的節點。In some embodiments, obtaining the offset required to align the source node to the mapped target node includes: obtaining the second pose transformation relationship between the aligned first parent node and the root node, and the source node mapping The third pose transformation relationship between the second parent node of the target node and the root target node, based on the pose of the source node and the mapped target node in the first coordinate system, the second pose transformation relationship and the third position and/or, based on the offset corresponding to the source node, obtain the first pose transformation relationship of the source node, including: based on the source node and the parent node of the source node corresponding to , to get the first pose transformation relationship of the source node, where the superior node of the source node is the first parent node of the source node in the final source bone, the root node, and the nodes between the first parent node and the root node .

因此,通過結合源節點以及源節點的上級節點對應的偏移量,就能夠得到源節點在第一座標系中與映射的目標節點的第一位姿變換關係。Therefore, the first pose transformation relationship between the source node and the mapped target node in the first coordinate system can be obtained by combining the source node and the offset corresponding to the source node's superior node.

在一些實施例中,第一動畫驅動資料是基於最終源骨骼與初始源骨骼之間的拓撲結構差異,對初始源骨骼的原始動畫資料進行調整得到的;和/或最終目標骨骼的第二動畫驅動資料是基於第一動畫驅動資料以及第一位姿變換關係得到,其中,第一位姿變換關係為最終源骨骼的源節點與最終目標骨骼中映射的目標節點之間的變換關係;最終目標骨骼為目標對象的骨骼;將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料,包括:基於目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊。In some embodiments, the first animation driving data is obtained by adjusting the original animation data of the initial source bone based on the topology difference between the final source bone and the initial source bone; and/or the second animation of the final target bone The driving data is obtained based on the first animation driving data and the first pose transformation relationship, wherein the first pose transformation relationship is the transformation relationship between the source node of the final source bone and the target node mapped in the final target bone; the final target The bone is the bone of the target object; the first animation driving data related to the initial source bone is transferred to the final target bone to obtain the second animation driving data of the final target bone, including: the first animation driving data based on the geometric mesh vertices in the target object The first position information, the first animation driving data and the first pose transformation relationship are used to obtain the second position information about the vertices of the geometric mesh in the second animation driving data.

因此,通過結合目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,就能夠得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊,過程方便。Therefore, by combining the first position information of the geometric mesh vertices in the target object, the first animation driving data and the first pose transformation relationship, the second position information about the geometric mesh vertices in the second animation driving data can be obtained , the process is convenient.

在一些實施例中,基於目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊,包括:獲取與幾何網格頂點距離滿足預設條件的至少一個目標節點作為參考節點,並獲得參考節點的影響權重;基於第一動畫驅動資料中關於參考節點的第四位姿變換關係和參考節點對應的第一位姿變換關係,得到參考節點對應的第五位姿變換關係;以及利用第一位置資訊、各參考節點對應的第五位姿變換關係和影響權重,得到幾何網格頂點的第二位置資訊。In some embodiments, based on the first position information of the geometric mesh vertex in the target object, the first animation driving data and the first pose transformation relationship, the second position of the geometric mesh vertex in the second animation driving data is obtained The information includes: obtaining at least one target node whose distance from the vertex of the geometric grid satisfies a preset condition as a reference node, and obtaining the influence weight of the reference node; based on the fourth pose transformation relationship and The first pose transformation relationship corresponding to the reference node is obtained to obtain the fifth pose transformation relationship corresponding to the reference node; and the first position information, the fifth pose transformation relationship corresponding to each reference node and the influence weight are used to obtain the geometric mesh vertices Secondary location information for .

因此,通過考慮參考節點對頂點的影響權重,使得獲取得到的幾何網格頂點的第二位置資訊更為準確。Therefore, by considering the influence weight of the reference node on the vertex, the obtained second position information of the vertex of the geometric mesh is more accurate.

在一些實施例中,獲取初始源骨骼,包括:對包含目標對象的圖像進行分類,得到目標對象的類別,並選擇與類別匹配的骨骼模型作為初始源骨骼,其中,最終目標骨骼為目標對象的骨骼;和/或,獲取初始目標骨骼,包括:對包含目標對象的圖像進行輪廓提取,得到目標對象的輪廓;利用輪廓,為目標對象生成三維網格模型;從三維網格模型中提取得到初始目標骨骼。In some embodiments, obtaining the initial source bone includes: classifying the image containing the target object to obtain the category of the target object, and selecting a bone model matching the category as the initial source bone, wherein the final target bone is the target object and/or, obtaining the initial target bone, including: extracting the outline of the image containing the target object to obtain the outline of the target object; using the outline to generate a three-dimensional mesh model for the target object; extracting from the three-dimensional mesh model Get the initial target bone.

因此,通過獲取目標對象的類別,並從與類別匹配的骨骼模型中選擇初始源骨骼,方便快捷。通過按照骨骼分支數量從多到少的順序,依序對初始骨骼和初始目標骨骼中的節點進行映射,能夠提高映射的準確度。Therefore, it is convenient and quick to obtain the category of the target object and select the initial source bone from the bone model matching the category. By sequentially mapping the nodes in the initial bone and the initial target bone in order of the number of bone branches from large to small, the accuracy of mapping can be improved.

本發明實施例提供了一種動畫遷移裝置,包括:獲取模組,被配置為獲取初始源骨骼、初始目標骨骼以及初始源骨骼和初始目標骨骼之間的節點映射關係;模型更新模組,被配置為基於節點映射關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,最終目標骨骼中的目標節點均能夠映射於最終源骨骼中的源節點;動畫遷移模組,被配置為將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料。An embodiment of the present invention provides an animation migration device, including: an acquisition module configured to acquire an initial source bone, an initial target bone, and a node mapping relationship between the initial source bone and the initial target bone; a model update module configured to In order to update the node topology of at least one of the initial source bone and the initial target bone based on the node mapping relationship, the final source bone and the final target bone are obtained, wherein the target nodes in the final target bone can all be mapped to the source in the final source bone A node; an animation migration module configured to migrate the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone.

本發明實施例提供了一種電子設備,包括記憶體和處理器,處理器用於執行記憶體中儲存的程式指令,以實現上述動畫遷移方法。An embodiment of the present invention provides an electronic device, including a memory and a processor, and the processor is used to execute program instructions stored in the memory, so as to realize the above-mentioned animation transition method.

本發明實施例提供了一種電腦可讀儲存介質,其上儲存有程式指令,程式指令被處理器執行時實現上述動畫遷移方法。An embodiment of the present invention provides a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the above animation transition method is realized.

本發明實施例還提供一種電腦程式產品,包括儲存了程式碼的電腦可讀儲存介質,所述程式碼包括的指令被電腦設備的處理器運行時,實現上述動畫遷移方法的步驟。The embodiment of the present invention also provides a computer program product, which includes a computer-readable storage medium storing program codes, and when instructions included in the program codes are executed by a processor of a computer device, the steps of the above-mentioned animation transition method are realized.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

應當理解的是,以上的一般描述和後文的細節描述僅是示例性和解釋性的,而非限制本發明實施例。It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only, rather than limiting the embodiments of the present invention.

下面結合說明書附圖,對本發明實施例的方案進行詳細說明。The solutions of the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.

以下描述中,為了說明而不是為了限定,提出了諸如特定系統結構、介面、技術之類的具體細節,以便透徹理解本發明實施例。In the following description, specific details such as specific system structures, interfaces, and technologies are presented for illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention.

本文中術語“和/或”,僅僅是一種描述關聯對象的關聯關係,表示可以存在三種關係,例如,A和/或B,可以表示:單獨存在A,同時存在A和B,單獨存在B這三種情況。另外,本文中字元“/”,一般表示前後關聯對象是一種“或”的關係。此外,本文中的“多”表示兩個或者多於兩個。另外,本文中術語“至少一種”表示多種中的任意一種或多種中的至少兩種的任意組合,例如,包括A、B、C中的至少一種,可以表示包括從A、B和C構成的集合中選擇的任意一個或多個元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. three conditions. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship. In addition, "many" herein means two or more than two. In addition, the term "at least one" herein means any one or any combination of at least two of the plurality, for example, including at least one of A, B, and C, may mean including the composition consisting of A, B, and C Any one or more elements selected in the collection.

相關技術中的動畫遷移技術要求現有的骨骼模型與新的骨骼模型的拓撲結構需要完全一致,即只有在兩個骨骼模型的拓撲結構完全一致的基礎上才能實現動畫遷移。但是,新的骨骼模型的形式多種多樣,無法對每種骨骼模型都構建拓撲結構一模一樣的具有動畫資料的骨骼模型,導致相關技術中現有的具備動畫資料的骨骼模型的適用性較低。The animation migration technology in the related art requires that the topological structures of the existing skeleton model and the new skeleton model need to be completely consistent, that is, the animation migration can only be realized on the basis that the topological structures of the two skeleton models are completely consistent. However, the new skeletal models come in a variety of forms, and it is impossible to construct skeletal models with the same topological structure with animation data for each of the skeletal models, resulting in low applicability of the existing skeletal models with animation data in the related art.

針對以上方案所存在的缺陷,均是發明人在經過實踐並仔細研究後得出的結果,因此,上述問題的發現過程以及下文中本發明實施例針對上述問題所提出的解決方案,都應該是發明人在本發明過程中對本發明做出的貢獻。The defects in the above solutions are all the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions to the above problems proposed by the embodiments of the present invention below should be Contributions made by the inventors to the invention during the course of the invention.

請參閱圖1,圖1是本發明實施例提供的一種動畫遷移方法的實現流程示意圖。動畫遷移方法可以包括如下步驟。Please refer to FIG. 1 . FIG. 1 is a schematic diagram of an implementation flow of an animation transition method provided by an embodiment of the present invention. The animation migration method may include the following steps.

步驟S11:獲取初始源骨骼、初始目標骨骼以及初始源骨骼和初始目標骨骼之間的節點映射關係。Step S11: Obtain the initial source bone, the initial target bone, and the node mapping relationship between the initial source bone and the initial target bone.

其中,這裡的初始源骨骼指的是攜帶有動畫驅動資料的骨骼,而初始目標骨骼指的是沒有攜帶動畫驅動資料的骨骼。其中,本發明實施例提出的動畫遷移方法實際上就是為了將初始源骨骼攜帶的動畫驅動資料遷移到初始目標骨骼上,以驅動初始目標骨骼依照動畫驅動資料運動。Among them, the initial source bone here refers to the bone that carries the animation driving data, and the initial target bone refers to the bone that does not carry the animation driving data. Among them, the animation transfer method proposed by the embodiment of the present invention is actually to transfer the animation driving data carried by the initial source bone to the original target bone, so as to drive the initial target bone to move according to the animation driving data.

初始源骨骼和初始目標骨骼均可以看做是多個節點構建而成,初始源骨骼和初始目標骨骼之間的節點映射關係也就指的是兩個骨骼的節點之間的對應關係。Both the initial source bone and the initial target bone can be regarded as constructed from multiple nodes, and the node mapping relationship between the initial source bone and the initial target bone refers to the corresponding relationship between the nodes of the two bones.

步驟S12:基於節點映射關係更新初始源骨骼和目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,最終目標骨骼中的目標節點均能夠映射於所述最終源骨骼中的源節點。Step S12: Update the node topology of at least one of the initial source bone and the target bone based on the node mapping relationship to obtain the final source bone and the final target bone, wherein the target nodes in the final target bone can all be mapped to the final source bone source node in .

初始源骨骼的拓撲結構和初始目標骨骼的拓撲結構可能不相同。例如,初始源骨骼中存在沒有與初始目標骨骼構建映射關係的冗餘的節點,而初始目標骨骼中同樣也可能存在沒有與初始源骨骼構建映射關係的冗餘的節點。如果此時不對初始源骨骼和初始目標骨骼進行更新,直接將初始源骨骼攜帶的動畫驅動資料遷移到初始目標骨骼上,很可能導致初始目標骨骼的動畫驅動效果與初始源骨骼的動畫驅動效果存在較大的差異,無法實現原本動畫遷移的目的。The topology of the initial source bone may not be the same as the topology of the initial target bone. For example, there are redundant nodes in the initial source bone that do not establish a mapping relationship with the initial target bone, and there may also be redundant nodes in the initial target bone that do not establish a mapping relationship with the initial source bone. If the initial source bone and initial target bone are not updated at this time, and the animation driving data carried by the initial source bone is directly migrated to the initial target bone, it is likely to cause the animation driving effect of the initial target bone and the animation driving effect of the initial source bone to exist. The large difference cannot achieve the purpose of the original animation migration.

因此,本發明實施例基於二者之間的節點映射關係更新初始源骨骼和/或初始目標骨骼,使得最終目標骨骼中的目標節點均能映射於最終源骨骼中的源節點。Therefore, the embodiment of the present invention updates the initial source bone and/or the initial target bone based on the node mapping relationship between them, so that all target nodes in the final target bone can be mapped to source nodes in the final source bone.

步驟S13:將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二驅動資料。Step S13: Migrating the first animation driving data related to the initial source bone to the final target bone to obtain the second driving data of the final target bone.

其中,如果最終源骨骼的拓撲結構與初始源骨骼的拓撲結構一致,則與初始源骨骼相關的第一動畫驅動資料與初始源骨骼的動畫驅動資料相同。如果,最終源骨骼的拓撲結構被更新過,則最終源骨骼的第一動畫驅動資料則與初始源骨骼的動畫驅動資料不同。當然,最終源骨骼的第一動畫驅動資料可根據其拓撲結構的變化,相應的做出變化。例如,初始源骨骼的源節點A與其子節點B融合為了一個節點C,得到最終源骨骼的拓撲結構,此時,最終源骨骼中節點C的動畫資料可以是源節點A與其子節點B的動畫資料的融合。當然,在其他實施例中,若出現兩個源節點合併的情況時,還可刪除兩個源節點中的子節點的動畫驅動資料。Wherein, if the topology structure of the final source bone is consistent with the topology structure of the initial source bone, then the first animation driving data related to the initial source bone is the same as the animation driving data of the initial source bone. If the topology structure of the final source bone is updated, the first animation driving data of the final source bone is different from the animation driving data of the initial source bone. Of course, the first animation driving data of the final source bone can be changed accordingly according to the change of its topological structure. For example, the source node A of the initial source bone and its child node B are fused into a node C to obtain the topology of the final source bone. At this time, the animation data of node C in the final source bone can be the animation of source node A and its child node B Fusion of data. Of course, in other embodiments, if two source nodes are merged, the animation driving data of the child nodes in the two source nodes can also be deleted.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

在本發明的一些實施例中,獲取初始源骨骼的方式可以是:對包含目標對象的圖像進行分類,得到目標對象的類別,並選擇與類別匹配的骨骼模型作為初始源骨骼。其中,最終目標骨骼為目標對象的骨骼。本發明實施例可以採用預測標籤映射,也可以採用資料集標籤映射。二者不同的是,預測標籤映射對目標對象的分類結果包括目標對象的預測骨骼拓撲結構類型,例如預測骨骼拓撲結構類型包括二足、四足等等。也就是,預測標籤映射的過程主要是預測目標對象的骨骼拓撲結構特點。而資料集標籤映射的分類結果需要給出輸入圖像中目標對象的具體種類,例如目標對象為貓、狗、大熊貓、狗熊等等。本發明實施例選擇採用預測標籤映射,應用過程中,若目標對象為大熊貓,而預測標籤映射給出的目標對象類別為四足,並選擇與類別匹配的骨骼模型作為初始源骨骼,若選擇的初始源骨骼為四足的狗熊。雖然大熊貓和狗熊不同,但是他們實際上具有大致相同的骨骼拓撲結構,因此,將狗熊的動畫驅動資料遷移到大熊貓上也能夠以自然合理的形式出現。也就是通過預測標籤映射雖然無法得到完全正確的目標對象的類別,但是也不影響對最終目標骨骼的驅動。同時,因為預測標籤映射沒有進一步獲知目標對象的具體類別,從而降低了計算成本。In some embodiments of the present invention, the manner of obtaining the initial source skeleton may be: classify the image containing the target object, obtain the category of the target object, and select a bone model matching the category as the initial source skeleton. Wherein, the final target bone is the bone of the target object. In the embodiment of the present invention, prediction label mapping may be used, or data set label mapping may be used. The difference between the two is that the classification result of the target object by the predicted label mapping includes the predicted skeletal topology type of the target object, for example, the predicted skeletal topology type includes biped, quadruped and so on. That is, the process of predicting label mapping is mainly to predict the skeletal topological structure characteristics of the target object. The classification result of the label mapping of the dataset needs to give the specific type of the target object in the input image, for example, the target object is a cat, a dog, a giant panda, a bear, and so on. The embodiment of the present invention chooses to use predicted label mapping. During the application process, if the target object is a giant panda, and the category of the target object given by the predicted label mapping is quadruped, and the bone model matching the category is selected as the initial source bone, if selected The initial source skeleton for is a quadruped bear. Although giant pandas and bears are different, they actually have roughly the same bone topology. Therefore, migrating the animation-driven data of bears to giant pandas can also appear in a natural and reasonable form. That is, although the completely correct category of the target object cannot be obtained by predicting the label mapping, it does not affect the driving of the final target bone. At the same time, the computational cost is reduced because the predicted label map does not further learn the specific category of the target object.

獲取初始目標骨骼的方式可以是:對包含目標對象的圖像進行輪廓提取,得到目標對象的輪廓。其中,提取輪廓的方式可以是進行目標分割,得到清晰的目標對象的輪廓。利用輪廓,為目標對象生成三維網格模型。一般地,可以將目標對象的輪廓簡化為多邊形,並應用三角剖分得到對應二維的三角形網格。然後三角形法線方向從二維的三角形中擠出三維網格模型。並從三維網格模型中提取得到初始目標骨骼。在本發明的一些實施例中,可以使用平均曲率法從三維網格中提取初始目標骨骼。其中,在提取得到初始目標骨骼之後,判斷提取得到的初始目標骨骼是否滿足解剖結構是否相差過大。例如,骨骼拓撲結構中,對於連續的、長度相差過大的骨骼進行重新採樣,以得到長度均勻的骨骼拓撲結構,例如連續的三個骨骼節點為A、B、C,其中,節點A與節點B之間的骨骼長度為2米,而節點B和節點C之間的骨骼長度為0.1米,因此,可以對節點A至C之間的骨骼進行重新採樣,使得節點A與節點B之間的骨骼長度為1.05米,節點A與節點B之間的骨骼長度為1.05米。當然,還可以在節點A至C之間增加新的節點,從而縮短相鄰節點之間的骨骼長度。同理,若連續相鄰節點之間的骨骼長度過短,不符合常規的解剖結構,可以將其中部分節點合併,減少節點數量,從而增加相鄰節點之間的骨骼結構。A manner of obtaining the initial target skeleton may be: performing contour extraction on an image containing the target object to obtain the contour of the target object. Wherein, the manner of extracting the contour may be to perform target segmentation to obtain a clear contour of the target object. Using the outline, a 3D mesh model is generated for the target object. Generally, the outline of the target object can be simplified into a polygon, and the corresponding two-dimensional triangular mesh can be obtained by applying triangulation. The triangle normal direction then extrudes the 3D mesh from the 2D triangles. And extract the initial target bone from the 3D mesh model. In some embodiments of the present invention, the average curvature method can be used to extract the initial target bone from the three-dimensional mesh. Wherein, after the initial target bone is extracted, it is judged whether the extracted initial target bone satisfies the anatomical structure or whether the difference is too large. For example, in the skeletal topology, resample continuous bones with large length differences to obtain a skeletal topology with uniform length. For example, three consecutive bone nodes are A, B, and C, where node A and node B The bone length between nodes A and C is 2 meters, and the bone length between nodes B and C is 0.1 meters. Therefore, the bones between nodes A and C can be resampled so that the bones between nodes A and B The length is 1.05 meters, and the length of the bone between node A and node B is 1.05 meters. Of course, new nodes can also be added between nodes A to C, so as to shorten the bone length between adjacent nodes. Similarly, if the bone length between consecutive adjacent nodes is too short and does not conform to the conventional anatomical structure, some of the nodes can be merged to reduce the number of nodes, thereby increasing the bone structure between adjacent nodes.

在本發明的一些實施例中,獲取初始源骨骼和初始目標骨骼之間的節點映射關係的方式可以有多種: 例如,確定初始源骨骼和初始目標骨骼中各節點所在的骨骼分支數量。按照骨骼分支數量從多到少的順序,依序對初始源骨骼和初始目標骨骼中的節點進行映射。其中,所在的骨骼分支數量最多的節點一般稱之為根節點。其中,暫且將節點所在的骨骼分支數量稱之為度數。也就是先構建兩個骨骼中度數較大的節點之間的映射關係,再構建度數較少的節點之間的映射關係。又或者,可以採用骨骼分支映射誤差值最小的原則進行映射。其中,如果初始源骨骼和初始目標骨骼之間的節點數不同,則選擇成本最低的最小多對一映射。例如,可以通過在發生多對一或跳過映射的序列中執行一對一的聯合匹配的方式進行映射。 In some embodiments of the present invention, there are multiple ways to obtain the node mapping relationship between the initial source bone and the initial target bone: For example, determine the number of bone branches for each node in the initial source bone and the initial target bone. The nodes in the initial source bone and the initial target bone are mapped sequentially in descending order of the number of bone branches. Among them, the node with the largest number of bone branches is generally called the root node. Among them, for the time being, the number of skeletal branches where the nodes are located is called the degree. That is, first construct the mapping relationship between nodes with larger degrees in the two bones, and then construct the mapping relationship between nodes with less degrees. Alternatively, the principle of minimum error value of bone branch mapping can be used for mapping. Among them, if the number of nodes between the initial source bone and the initial target bone is different, the smallest many-to-one mapping with the lowest cost is chosen. For example, mapping can be done by performing a one-to-one joint matching in the sequence in which many-to-one or skip mapping occurs.

在本發明的一些實施例中,可以使用以下方式進一步為沒有構建映射關係的節點構建映射關係。In some embodiments of the present invention, the following methods may be used to further construct mapping relationships for nodes that have not established mapping relationships.

例如,若當前源節點只有一個子節點的情況下,也就是當前源節點不是骨骼分支的匯合點的情況下,可以參考其子節點的映射關係。例如構建與其子節點具備映射關係的目標節點之間的映射關係。或者,當前源節點是骨骼分支的匯合點的情況下,則根據多條骨骼分支的節點進行合併,去上限節點。又或者,不滿足上述任何條件的情況下,則預設映射初始目標骨骼的根節點。當然,在本發明的一些實施例中,若按照骨骼分支數量從多到少的順序得到二者之間的映射關係之後,有的源節點沒有對應的目標節點與之映射的情況下,也可以不對其進一步構建映射關係。For example, if the current source node has only one child node, that is, when the current source node is not the meeting point of the skeletal branches, the mapping relationship of its child nodes can be referred to. For example, construct a mapping relationship between target nodes that have a mapping relationship with their child nodes. Or, if the current source node is the confluence point of the skeletal branch, merge according to the nodes of multiple skeletal branches, and remove the upper limit node. Or, if any of the above conditions are not met, the root node of the initial target bone is preset to be mapped. Of course, in some embodiments of the present invention, after obtaining the mapping relationship between the two according to the order of the number of skeletal branches from more to less, some source nodes do not have corresponding target nodes to map with, you can also No further mapping relationship is built on it.

通過獲取目標對象的類別,並從與類別匹配的骨骼模型中選擇初始源骨骼,方便快捷。通過按照骨骼分支數量從多到少的順序,依序對初始骨骼和初始目標骨骼中的節點進行映射,能夠提高映射的準確度。It is convenient and quick by getting the category of the target object and selecting the initial source bone from the bone model matching the category. By sequentially mapping the nodes in the initial bone and the initial target bone in order of the number of bone branches from large to small, the accuracy of mapping can be improved.

在本發明的一些實施例中,最終目標骨骼與最終源骨骼的節點拓撲結構一致,和/或,最終目標骨骼與最終源骨骼之間的節點一一映射。也就是,最終目標骨骼與最終源骨骼的節點拓撲結構可能存在兩種形式,一種是最終目標骨骼與最終源骨骼的節點拓撲結構完全一致,另一種是最終目標骨骼中的節點均有最終源骨骼的節點與之對應,但是最終源骨骼中存在一些沒有構建映射關係的節點。即,需要保證在動畫遷移後,最終目標骨骼的節點上均有對應的動畫驅動資料。In some embodiments of the present invention, the node topology of the final target bone is consistent with that of the final source bone, and/or, the nodes between the final target bone and the final source bone are mapped one by one. That is to say, there may be two forms of the node topology of the final target bone and the final source bone, one is that the node topology of the final target bone is completely consistent with the final source bone, and the other is that the nodes in the final target bone have the final source bone The nodes correspond to it, but there are some nodes in the final source bone that do not have a mapping relationship. That is, it is necessary to ensure that after animation migration, the nodes of the final target bone have corresponding animation driving data.

在本發明的一些實施例中,節點映射關係包括初始源骨骼和初始目標骨骼中的節點之間的映射關係。In some embodiments of the present invention, the node mapping relationship includes a mapping relationship between nodes in the initial source bone and the initial target bone.

基於節點對應關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,包括以下至少之一: 一是在兩個骨骼之間存在多個節點映射於同一節點的情況下,更新其中一個骨骼的節點拓撲結構。其中,兩個骨骼包括初始源骨骼和初始目標骨骼,經更新之後的兩個骨骼之間的節點一一映射。通過更新骨骼的節點拓撲結構能夠使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,以減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。 The node topology structure of at least one of the initial source bone and the initial target bone is updated based on the node correspondence to obtain the final source bone and the final target bone, including at least one of the following: One is to update the node topology of one of the bones when there are multiple nodes mapped to the same node between the two bones. Wherein, the two bones include an initial source bone and an initial target bone, and the updated nodes between the two bones are mapped one by one. By updating the node topology of the bone, the situation that multiple nodes between two bones are mapped to the same node can be adjusted to a node-to-one mapping between the two bones, so as to reduce the occurrence of inconsistencies in the process of driving the final target bone in the subsequent animation. Reasonable situations arise.

在本發明的一些實施例中,更新其中一個骨骼的節點拓撲結構又可分為多種情況:第一種情況是在多個節點位於同一骨骼分支的情況下,更新多個節點所在的第一骨骼。其中,第一骨骼和第二骨骼中的其中一個為初始源骨骼,另一個為目標骨骼。通過更新多個節點所在的第一骨骼,使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,進而減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。In some embodiments of the present invention, updating the node topology of one of the bones can be divided into multiple cases: the first case is to update the first bone where multiple nodes are located when multiple nodes are located in the same bone branch . Wherein, one of the first bone and the second bone is the initial source bone, and the other is the target bone. By updating the first bone where multiple nodes are located, the situation that multiple nodes between two bones are mapped to the same node is adjusted to a node-to-one mapping between two bones, thereby reducing the process of subsequent animation driving the final target bone Unreasonable situations occur.

在本發明的一些實施例中,更新多個節點所在的第一骨骼的方式可以是將第一骨骼中的多個節點合併為一個第一節點。其中,第一節點保留合併前多個節點的映射關係。並且,第一節點的位置取所有被合併節點的位置的平均值。同時參見圖2,圖2是本發明實施例提供的一種動畫遷移方法中映射關係示意圖。如圖2所示,初始目標骨骼中的第二個節點201和第三個節點202同時映射於初始源骨骼中的第二個節點211時。在這種情況下,將初始目標骨骼中的第二個節點201和第三個節點202進行合併為一個第一節點。其中,第一節點的位置取初始目標骨骼中第二個節點201和第三個節點202的位置的平均值。其中,當第一骨骼為初始源骨骼時,因為初始源骨骼中的節點攜帶有動畫驅動資料,所以當節點合併之後,需要獲取第一節點的動畫驅動資料,此時,可以將被合併的所有節點的動畫驅動資料進行合併。在本發明一些實施例中,動畫驅動資料一般可以用矩陣表示,矩陣的合併可以用矩陣乘法表示,即將動畫驅動資料進行相乘,即可得到第一節點的動畫驅動資料。第二種情況是在多個節點位於不同骨骼分支的情況下,更新不包括多個節點的第二骨骼。其中,第一骨骼和第二骨骼中的其中一個為初始源骨骼,另一個為目標骨骼。在本發明一些實施例中,在第一骨骼中查找出多個節點所在的骨骼分支匯合的第二節點。具體做法可以是依次父節點遍歷,從而得到第二節點。並在第二骨骼中查找出映射於第二節點的第三節點。然後找找多個節點對應的節點拓撲結構,在第三節點處新增至少一條骨骼分支。本發明實施例中,一個節點的父節點指的是在一條骨骼分支中,與該節點相鄰且比該節點更靠近根節點的節點。其中,多個節點與第三節點處新增的骨骼分支和原始的骨骼分支中的節點一一映射。其中,新增的骨骼分支可以是複製原始的骨骼分支。複製的內容包括動畫資料、以及該節點與其父節點之間的變換關係。例如,原始的骨骼分支中包括三個節點,則新增的骨骼分支中也包括三個節點,且新增的骨骼分支中的三個節點的動畫驅動資料是通過複製原始的骨骼分支中對應節點的動畫資料得到。同時參見圖3,圖3是本發明實施例提供的一種動畫遷移方法中映射關係示意圖。如圖3所示,左邊的節點拓撲結構為初始源骨骼的節點拓撲結構,右邊的節點拓撲結構為初始目標骨骼的節點拓撲結構。圖3中,初始目標骨骼的第一個節點301映射於初始源骨骼的第一個節點311,初始目標骨骼的第二個節點302映射於初始源骨骼的第二個節點312,初始目標骨骼的第二個節點302下包括兩個分支,即左分支與右分支,其中,左分支中的第一個節點3021和右分支中的第一個節點3022映射於初始源骨骼的第三個節點313,左分支中的第二個節點3023和右分支中的第二個節點3024映射於初始源骨骼的第四個節點314。這也就出現了初始目標骨骼中兩個節點映射於初始源骨骼的第三個節點313,且這兩個節點屬於不同的分支,以及初始目標骨骼中兩個節點映射於初始源骨骼的第四個節點314,且這兩個節點屬於不同的分支。其中,這兩個分支匯合在初始目標骨骼的第二個節點302。在初始源骨骼中找出映射於初始目標骨骼的第二個節點302為第二個節點。按照初始目標骨骼這兩個節點對應的節點拓撲結構,在初始源骨骼的第二個節點處新增一條骨骼分支。其中,新增的一條骨骼分支中的節點有兩個。此時,初始目標骨骼中所有的節點均一一對應與初始源骨骼中的節點。因此,通過此種方式在實現節點一一映射的情況下,還能夠最大化的保留第一骨骼的節點拓撲結構。In some embodiments of the present invention, the manner of updating the first bone where the multiple nodes are located may be to merge the multiple nodes in the first bone into one first node. Wherein, the first node retains the mapping relationship of multiple nodes before merging. And, the position of the first node is the average value of the positions of all merged nodes. Also refer to FIG. 2 . FIG. 2 is a schematic diagram of a mapping relationship in an animation migration method provided by an embodiment of the present invention. As shown in FIG. 2 , the second node 201 and the third node 202 in the initial target bone are mapped to the second node 211 in the initial source bone at the same time. In this case, the second node 201 and the third node 202 in the initial target bone are merged into one first node. Wherein, the position of the first node is the average value of the positions of the second node 201 and the third node 202 in the initial target bone. Among them, when the first bone is the initial source bone, because the nodes in the initial source bone carry animation driving data, after the nodes are merged, it is necessary to obtain the animation driving data of the first node. At this time, all merged The animation driver data for the node is merged. In some embodiments of the present invention, the animation driving data can generally be represented by a matrix, and the combination of the matrices can be represented by matrix multiplication, that is, the animation driving data of the first node can be obtained by multiplying the animation driving data. The second case is to update the second bone that does not include the multiple nodes when the multiple nodes are located on different bone branches. Wherein, one of the first bone and the second bone is the initial source bone, and the other is the target bone. In some embodiments of the present invention, the second node where the branches of the bones where the multiple nodes are located converges is found in the first bone. A specific method may be to traverse the parent nodes in turn to obtain the second node. And find out the third node mapped to the second node in the second bone. Then find the node topology corresponding to multiple nodes, and add at least one bone branch at the third node. In the embodiment of the present invention, a parent node of a node refers to a node adjacent to the node and closer to the root node than the node in a skeletal branch. Wherein, multiple nodes are mapped one by one with the nodes in the newly added bone branch at the third node and the original bone branch. Wherein, the newly-added bone branch may copy the original bone branch. The copied content includes animation data and the transformation relationship between this node and its parent node. For example, if the original bone branch includes three nodes, the new bone branch also includes three nodes, and the animation driving data of the three nodes in the new bone branch is copied from the corresponding nodes in the original bone branch The animation data obtained. Also refer to FIG. 3 . FIG. 3 is a schematic diagram of a mapping relationship in an animation transition method provided by an embodiment of the present invention. As shown in Figure 3, the node topology on the left is the node topology of the initial source bone, and the node topology on the right is the node topology of the initial target bone. In Fig. 3, the first node 301 of the initial target bone is mapped to the first node 311 of the initial source bone, the second node 302 of the initial target bone is mapped to the second node 312 of the initial source bone, and the The second node 302 includes two branches, namely the left branch and the right branch, wherein the first node 3021 in the left branch and the first node 3022 in the right branch are mapped to the third node 313 of the initial source bone , the second node 3023 in the left branch and the second node 3024 in the right branch are mapped to the fourth node 314 of the original source bone. This means that two nodes in the initial target bone are mapped to the third node 313 of the initial source bone, and these two nodes belong to different branches, and two nodes in the initial target bone are mapped to the fourth node of the initial source bone. nodes 314, and these two nodes belong to different branches. Wherein, these two branches converge at the second node 302 of the initial target bone. Find the second node 302 mapped to the initial target bone in the initial source bone as the second node. According to the node topology corresponding to the two nodes of the initial target bone, a new bone branch is added at the second node of the initial source bone. Among them, there are two nodes in the newly added bone branch. At this point, all the nodes in the initial target bone correspond to the nodes in the initial source bone. Therefore, in the case of implementing node-to-node mapping in this way, the node topology of the first bone can also be preserved to the greatest extent.

二是在骨骼中存在未有映射關係的情況下,更新未有映射關係的節點所在骨骼的節點拓撲結構。其中,兩個骨骼包括初始源骨骼和初始目標骨骼,經更新之後的兩個骨骼之間的節點一一映射。通過更新沒有映射關係的節點所在骨骼的節點拓撲結構,減少沒有映射關係的節點,使得更新後的兩個骨骼之間的節點一一映射,從而減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。在本發明一些實施例中,將未有映射關係的節點合併至具有映射關係的相鄰節點。其中,相鄰節點為未有映射關係的節點在所在骨骼中的父節點或子節點。本發明實施例中將未有映射關係的節點向其父節點合併。請參見圖4,圖4是本發明實施例提供的一種動畫遷移方法中映射關係示意圖。如圖4所示,初始目標骨骼的第一個節點401映射於初始源骨骼的第一個節點411,初始目標骨骼的第二個節點402映射於初始源骨骼的第三個節點413,初始目標骨骼的第三個節點403映射於初始源骨骼的第四個節點414。其中,初始源骨骼的第二個節點412沒有映射關係。可以將初始源骨骼的第二個節點412向其父節點合併,也就是向初始源骨骼的第一個節點401合併。當然,初始源骨骼中的節點合併都會伴隨著動畫驅動資料之間的合併。The second is to update the node topology of the bone where the node without the mapping relationship exists when there is no mapping relationship in the bone. Wherein, the two bones include an initial source bone and an initial target bone, and the updated nodes between the two bones are mapped one by one. By updating the node topology of the bone where the node without the mapping relationship is located, the number of nodes without the mapping relationship is reduced, so that the nodes between the updated two bones are mapped one by one, thereby reducing the irrationality in the process of driving the final target bone in the subsequent animation situation occurs. In some embodiments of the present invention, nodes without a mapping relationship are merged into adjacent nodes with a mapping relationship. Among them, the adjacent node is the parent node or child node in the bone where the node has no mapping relationship. In the embodiment of the present invention, nodes without a mapping relationship are merged to their parent nodes. Please refer to FIG. 4 . FIG. 4 is a schematic diagram of a mapping relationship in an animation transition method provided by an embodiment of the present invention. As shown in Figure 4, the first node 401 of the initial target bone is mapped to the first node 411 of the initial source bone, the second node 402 of the initial target bone is mapped to the third node 413 of the initial source bone, and the initial target The third node 403 of the bone maps to the fourth node 414 of the original source bone. Wherein, the second node 412 of the initial source bone has no mapping relationship. The second node 412 of the original source bone can be merged with its parent node, that is, merged with the first node 401 of the original source bone. Of course, any node merging in the original source skeleton will be accompanied by a merging between animation-driven materials.

在本發明一些實施例中,在將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料之前,需要確定最終源骨骼和最終目標骨骼之間的第一位姿變換關係。在實施時,按照從根源節點到葉源節點的順序,分別將最終源骨骼中的各源節點與最終目標骨骼中對應映射的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係。如上述實施例中的描述,根節點為所在的骨骼分支數量最多的節點,則根源節點指的是最終源骨骼中的根節點。同理,根目標節點指的是最終目標骨骼的根節點。其中,葉節點指的是具有父節點但沒有子節點的節點。葉源節點指的是最終源骨骼中的葉節點,葉目標節點指的是最終目標骨骼中的葉節點。即,先對齊根源節點以及與根源節點有映射關係的根目標節點。然後再對齊與根源節點連接的葉源節點以及與該葉源節點之間具備映射關係的葉目標節點,以此類推,直至最終目標骨骼中所有節點均與最終源骨骼的節點一一對齊為止。其中,如果該源節點在目標骨骼中沒有對應的目標節點時,可以跳過該源節點,直接進行下一源節點的對齊。當然,在其他實施例中,若該源節點在目標骨骼中沒有對應的目標節點時,則將該源節點向其相鄰的父節點或子節點合併,保留該父節點或子節點的映射關係,並將合併後的源節點與對應的目標節點對齊。通過進行源節點與目標節點之間的對齊,就能夠得到各源節點與映射的目標節點之間的第一位姿變換關係,由此實現利用第一動畫驅動資料和第一位姿變換關係,得到最終目標骨骼的第二動畫驅動資料。In some embodiments of the present invention, before transferring the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone, it is necessary to determine the difference between the final source bone and the final target bone. The first pose transformation relationship among them. During implementation, each source node in the final source bone is aligned with the corresponding mapped target node in the final target bone according to the order from the root node to the leaf source node, so as to obtain the distance between each source node and the mapped target node. The first pose transformation relation of . As described in the above embodiment, the root node is the node with the largest number of bone branches, and the root node refers to the root node in the final source bone. Similarly, the root target node refers to the root node of the final target bone. Wherein, a leaf node refers to a node that has a parent node but no child nodes. The leaf source node refers to the leaf node in the final source bone, and the leaf target node refers to the leaf node in the final target bone. That is, first align the root node and the root target node that has a mapping relationship with the root node. Then align the leaf source node connected to the root node and the leaf target node that has a mapping relationship with the leaf source node, and so on, until all nodes in the final target bone are aligned with the nodes of the final source bone. Wherein, if the source node does not have a corresponding target node in the target bone, the source node can be skipped and the alignment of the next source node can be performed directly. Of course, in other embodiments, if the source node does not have a corresponding target node in the target bone, the source node is merged with its adjacent parent node or child node, and the mapping relationship of the parent node or child node is retained , and align the merged source node with the corresponding target node. By aligning the source node and the target node, the first pose transformation relationship between each source node and the mapped target node can be obtained, thereby realizing the use of the first animation driving data and the first pose transformation relationship, Get the second animation driver data of the final target bone.

在本發明一些實施例中,最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系中的原點。然後對齊最終源骨骼的根源節點和最終目標骨骼的根目標節點。在本發明一些實施例中,可以直接將最終目標骨骼的根目標節點作為第一座標系原點。第一位姿變換關係為源節點與映射的目標節點在第一座標系中的變換關係。通過最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,能夠獲取最終源骨骼的根源節點和最終目標骨骼的根目標節點之間的偏移量。In some embodiments of the present invention, both the root node of the final source bone and the root target node of the final target bone are translated to the origin in the first coordinate system. Then align the root node of the final source bone with the root target node of the final target bone. In some embodiments of the present invention, the root target node of the final target bone can be directly used as the origin of the first coordinate system. The first pose transformation relationship is the transformation relationship between the source node and the mapped target node in the first coordinate system. By translating the root node of the final source bone and the root target node of the final target bone to the origin of the first coordinate system, the offset between the root node of the final source bone and the root target node of the final target bone can be obtained.

在本發明一些實施例中,對於最終源骨骼中的每個源節點,獲取使源節點對齊於映射的目標節點所需的偏移量。其中,偏移量包括平移分量和旋轉分量。平移分量中包括縮放分量。然後基於源節點對應的偏移量,得到源節點的第一位姿變換關係。偏移量包括平移分量和旋轉分量,使得獲取到的第一位姿變換關係更準確。其中,源節點對應的偏移量為:在源節點的第一父節點對齊且第一父節點作為第二座標系的原點的情況下,源節點與映射的目標節點在第二座標系中的偏移量。這裡出現了第一座標系以及第二座標系,因為根源節點與根目標節點已經移動至第一座標系原點,即第一座標系為以根目標節點為原點的座標系,在節點拓撲結構中,除了根源節點和根目標節點以外,所有的葉源節點和葉目標節點均有對應的父節點。並且每一葉節點最多只有一個父節點,不存在一個葉節點對應有多個父節點的情況。第二座標系即為以葉節點的父節點為座標系原點的座標系。其中,第一座標系可以看作是世界空間,第二座標系可以看作是局部空間。對於最終源骨骼中的某個節點而言,世界空間指的是以根源節點為原點的座標系,而局部空間指的是以該節點的父節點為原點的座標系。In some embodiments of the invention, for each source node in the final source bone, the offset required to align the source node to the mapped target node is obtained. Wherein, the offset includes a translation component and a rotation component. The translation component includes a scaling component. Then, based on the offset corresponding to the source node, the first pose transformation relationship of the source node is obtained. The offset includes a translation component and a rotation component, so that the obtained first pose transformation relationship is more accurate. Among them, the offset corresponding to the source node is: when the first parent node of the source node is aligned and the first parent node is the origin of the second coordinate system, the source node and the mapped target node are in the second coordinate system offset. The first coordinate system and the second coordinate system appear here, because the root node and the root target node have moved to the origin of the first coordinate system, that is, the first coordinate system is the coordinate system with the root target node as the origin, in the node topology In the structure, except the root node and root target node, all leaf source nodes and leaf target nodes have corresponding parent nodes. And each leaf node has at most one parent node, and there is no situation where a leaf node corresponds to multiple parent nodes. The second coordinate system is the coordinate system with the parent node of the leaf node as the origin of the coordinate system. Among them, the first coordinate system can be regarded as the world space, and the second coordinate system can be regarded as the local space. For a node in the final source bone, the world space refers to the coordinate system with the root node as the origin, and the local space refers to the coordinate system with the parent node of the node as the origin.

在本發明一些實施例中,獲取經對齊的第一父節點與根源節點之間的第二位姿變換關係,以及源節點映射的目標節點的第二父節點與根目標節點之間的第三位姿變換關係。基於源節點以及映射的目標節點在第一座標系中的位姿以及第二位姿變換關係和第三位姿變換關係,得到源節點對應的偏移量。其中,這裡的位姿包括位置和旋轉。In some embodiments of the present invention, the second pose transformation relationship between the aligned first parent node and the root node, and the third pose transformation relationship between the second parent node of the target node mapped to the source node and the root target node are obtained. Pose transformation relationship. Based on the pose of the source node and the mapped target node in the first coordinate system, the second pose transformation relationship and the third pose transformation relationship, the offset corresponding to the source node is obtained. Among them, the pose here includes position and rotation.

在實施時,可以採用如公式(1)和(2)將最終源骨骼與最終目標骨骼之間節點對齊:

Figure 02_image001
=
Figure 02_image003
(1); s.t.
Figure 02_image005
(
Figure 02_image007
=(
Figure 02_image009
(2); 其中,
Figure 02_image011
為源節點i的父節點索引,
Figure 02_image013
表示經對齊的第一父節點與根源節點之間的第二位姿變換關係,
Figure 02_image015
表示源節點映射的目標節點的第二父節點與根目標節點之間的第三位姿變換關係,
Figure 02_image017
為源節點i在第一座標系下的位姿,
Figure 02_image019
為源節點映射的目標節點在第一座標系下的位姿,
Figure 02_image021
指的是將括弧內的內容取逆。
Figure 02_image005
指的是在其第二座標系中,源節點與目標節點對齊的偏移量。
Figure 02_image023
指的是根源節點與根目標節點對齊的偏移量。上述公式(1)與公式(2)交替求解。其中,公式(1)求解的
Figure 02_image001
將作為其子節點的第二位姿變換關係。即,將上述公式(2)求解的
Figure 02_image005
代入公式(1)求解
Figure 02_image001
,然後再將公式(1)求解的
Figure 02_image001
代入公式(2)中求解下一個節點的
Figure 02_image005
,以此達到公式(1)和公式(2)交替求解。 During implementation, formulas (1) and (2) can be used to align the nodes between the final source bone and the final target bone:
Figure 02_image001
=
Figure 02_image003
(1);
Figure 02_image005
(
Figure 02_image007
=(
Figure 02_image009
(2); where,
Figure 02_image011
is the parent node index of source node i,
Figure 02_image013
Indicates the second pose transformation relationship between the aligned first parent node and the root node,
Figure 02_image015
Represents the third pose transformation relationship between the second parent node of the target node mapped by the source node and the root target node,
Figure 02_image017
is the pose of the source node i in the first coordinate system,
Figure 02_image019
The pose of the target node mapped to the source node in the first coordinate system,
Figure 02_image021
Refers to inverting the content inside the brackets.
Figure 02_image005
Refers to the offset at which the source node is aligned with the target node in its second coordinate system.
Figure 02_image023
Refers to the offset where the root node is aligned with the root target node. The above formula (1) and formula (2) are solved alternately. Among them, formula (1) solves for
Figure 02_image001
The second pose transformation relationship that will be its child node. That is, the solution of the above formula (2)
Figure 02_image005
Substitute into formula (1) to solve
Figure 02_image001
, and then solve the formula (1) for
Figure 02_image001
Substitute into formula (2) to solve the next node
Figure 02_image005
, so as to solve formula (1) and formula (2) alternately.

基於源節點對應的偏移量,得到源節點的第一位姿變換關係。在本發明一些實施例中,基於源節點以及源節點的上級節點分別對應的偏移量,得到源節點的第一位姿變換關係。其中,源節點的上級節點為最終源骨骼中源節點的第一父節點、根源節點以及第一父節點與根源節點之間的節點。其中,偏移量均可以用矩陣表示,在本發明一些實施例中,通過將源節點以及源節點的上級節點分別對應的偏移量進行矩陣乘法,即可得到源節點的第一位姿變換關係。Based on the offset corresponding to the source node, the first pose transformation relationship of the source node is obtained. In some embodiments of the present invention, the first pose transformation relationship of the source node is obtained based on the offsets corresponding to the source node and the parent node of the source node respectively. Wherein, the parent node of the source node is the first parent node of the source node, the root node and the nodes between the first parent node and the root node in the final source bone. Wherein, the offset can be represented by a matrix. In some embodiments of the present invention, the first pose transformation of the source node can be obtained by matrix multiplication of the offsets corresponding to the source node and the source node's superior node respectively. relation.

在本發明一些實施例中,最終目標骨骼的第二動畫驅動資料是基於第一動畫驅動資料以及第一位姿變換關係得到的。如上述實施例中的描述,第一位姿變換關係為最終源骨骼的源節點與最終目標骨骼中映射的目標節點之間的變換關係。其中,最終目標骨骼為目標對象的骨骼。其中,第一動畫驅動資料是基於最終源骨骼與初始源骨骼之間的拓撲結構差異,對初始源骨骼的原始動畫資料進行調整得到的。在最終源骨骼的拓撲結構與初始源骨骼的拓撲結構一致的情況下,則與初始源骨骼相關的第一動畫驅動資料與初始源骨骼的動畫驅動資料相同。在最終源骨骼的拓撲結構與初始源骨骼不同的情況下,即源骨骼被更新過,最終源骨骼的第一動畫驅動資料則與初始源骨骼的動畫驅動資料不同。其中,最終源骨骼的第一動畫驅動資料可以根據最終源骨骼和初始源骨骼之間的拓撲結構差異確定。也就是最終源骨骼的第一動畫驅動資料可根據其拓撲結構的變化,相應的做出變化。例如,初始源骨骼的源節點A與其子節點B融合為了一個節點C,得到最終源骨骼的拓撲結構,此時,最終源骨骼中節點C的動畫資料可以是源節點A與其子節點B的動畫資料的融合。當然,在其他實施例中,若出現兩個源節點合併的情況時,還可刪除兩個源節點中的子節點的動畫驅動資料。關於得到與初始源骨骼相關的第一動畫驅動資料的方式此處不做規定。In some embodiments of the present invention, the second animation driving data of the final target bone is obtained based on the first animation driving data and the first pose transformation relationship. As described in the above embodiment, the first pose transformation relationship is the transformation relationship between the source node of the final source bone and the target node mapped in the final target bone. Wherein, the final target bone is the bone of the target object. Wherein, the first animation driving data is obtained by adjusting the original animation data of the initial source bone based on the topology difference between the final source bone and the initial source bone. In the case that the topology structure of the final source bone is consistent with that of the initial source bone, the first animation driving data related to the initial source bone is the same as the animation driving data of the initial source bone. In the case that the topology structure of the final source bone is different from that of the initial source bone, that is, the source bone has been updated, the first animation driving data of the final source bone is different from the animation driving data of the initial source bone. Wherein, the first animation driving data of the final source bone may be determined according to the topology difference between the final source bone and the initial source bone. That is, the first animation driving data of the final source bone can be changed accordingly according to the change of its topology. For example, the source node A of the initial source bone and its child node B are fused into a node C to obtain the topology of the final source bone. At this time, the animation data of node C in the final source bone can be the animation of source node A and its child node B Fusion of data. Of course, in other embodiments, if two source nodes are merged, the animation driving data of the child nodes in the two source nodes can also be deleted. The way of obtaining the first animation driving data related to the initial source skeleton is not specified here.

其中,將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料的方式包括: 基於目標對象中的幾何網格頂點的第一位置資訊,第一動畫驅動資料以及第一位姿變換關係,得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊。其中,這裡的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係可以使用矩陣表示,通過矩陣乘法就能夠得到幾何網格頂點的第二位置資訊。通過結合目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,就能夠得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊,過程方便。 Among them, the method of migrating the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone includes: Based on the first position information of the geometric mesh vertices in the target object, the first animation driving data and the first pose transformation relationship, the second position information about the geometric mesh vertices in the second animation driving data is obtained. Wherein, the first position information, the first animation driving data and the first pose transformation relationship here can be represented by a matrix, and the second position information of the vertices of the geometric mesh can be obtained through matrix multiplication. By combining the first position information of the geometric mesh vertices in the target object, the first animation driving data and the first pose transformation relationship, the second position information about the geometric mesh vertices in the second animation driving data can be obtained. Convenience.

其中,在利用初始源骨骼相關的第一動畫驅動資料驅動最終目標骨骼運動之前,需要進行骨骼蒙皮。其中,骨骼蒙皮的常見方法很多,此處不做一一列舉。在本發明一些實施例中,當一個幾何網格頂點受到多個目標節點的影響時,需要計算各目標節點對幾何網格頂點的影響權重。其中,可以使用線性混合蒙皮方法,在標準的線性混合蒙皮中,使用創作工具為每個頂點分配了一組能夠影響頂點的目標節點對應的權重。當然,在其他實施例中也可以通過熱量平衡方法確定權重,例如將影響頂點的節點溫度設置為1,沒有影響頂點的節點溫度設置為0,然後解決網格表面的熱量平衡問題。Among them, before using the first animation driving data related to the initial source bone to drive the motion of the final target bone, it is necessary to perform bone skinning. Among them, there are many common methods of bone skinning, so I won't list them here. In some embodiments of the present invention, when a geometric grid vertex is influenced by multiple target nodes, it is necessary to calculate the influence weight of each target node on the geometric grid vertex. Among them, the linear blend skinning method can be used. In the standard linear blend skinning, authoring tools are used to assign a set of weights corresponding to target nodes that can affect the vertex to each vertex. Of course, in other embodiments, weights can also be determined by a heat balance method, for example, the temperature of nodes that affect vertices is set to 1, and the temperature of nodes that do not affect vertices is set to 0, and then solve the problem of heat balance on the mesh surface.

在本發明一些實施例中,獲取與幾何網格頂點距離滿足預設條件的至少一個目標節點作為參考節點,並獲得參考節點的影響權重。在實施時,一個頂點可能受到多個節點的影響,但是現代圖形處理器(Graphics Processing Unit,GPU)最終支援能夠影響單個頂點的節點數為4,即一個頂點最多受到4個節點的影響。其中,這四個節點的影響權重之和為1。當計算出影響頂點的參考節點數大於4時,將各影響權重進行排序,選擇最高的四個權重對應的節點作為參考節點,並重新計算這四個參考節點的影響權重,使得這四個參考節點的影響權重之和為1。In some embodiments of the present invention, at least one target node whose distance from the vertex of the geometric grid satisfies a preset condition is obtained as a reference node, and the influence weight of the reference node is obtained. In implementation, a vertex may be affected by multiple nodes, but the modern Graphics Processing Unit (GPU) finally supports 4 nodes that can affect a single vertex, that is, a vertex is affected by up to 4 nodes. Among them, the sum of the influence weights of these four nodes is 1. When it is calculated that the number of reference nodes affecting the vertices is greater than 4, sort the influence weights, select the nodes corresponding to the four highest weights as reference nodes, and recalculate the influence weights of these four reference nodes, so that the four reference nodes The sum of influence weights of nodes is 1.

其中,可以採用公式(3)解決網格表面的熱量平衡問題:

Figure 02_image025
(3); 其中,如果節點i滿足預設條件的情況下,pi等於1,否則為0。
Figure 02_image027
是離散表面上的拉普拉斯運算元。H是對角矩陣。其中,H一般等於c/d,c可以取值0.22或者1等,d為節點i與頂點之間的距離,H的目的是權重係數與骨骼和頂點之間的距離呈反比。通過此種方式即可得到參考節點的權重。 Among them, formula (3) can be used to solve the heat balance problem on the grid surface:
Figure 02_image025
(3); Among them, if node i satisfies the preset condition, pi is equal to 1, otherwise it is 0.
Figure 02_image027
is the Laplace operator on discrete surfaces. H is a diagonal matrix. Among them, H is generally equal to c/d, c can take a value of 0.22 or 1, etc., d is the distance between node i and the vertex, and the purpose of H is that the weight coefficient is inversely proportional to the distance between the bone and the vertex. In this way, the weight of the reference node can be obtained.

基於第一動畫驅動資料中關於參考節點的第四位姿變換關係和參考節點對應的第一位姿變換關係,得到參考節點對應的第五位姿變換關係。然後根據第一位姿變換關係以及源節點的第四位姿變換關係得到參考節點的第五位姿變換關係。其中,這裡的關於參考節點的第四位姿變換關係可以是動畫關鍵幀中攜帶的源骨骼各節點的變換關係。例如,可以是源節點與其父節點之間的變換關係,通過將源節點至根源節點之間所有相鄰節點之間的變換關係相乘,並結合源節點與目標節點之間的第一位姿變換關係,就能得到目標節點的第五位姿變換關係。第四位姿變換關係包括平移和/或旋轉。Based on the fourth pose transformation relation about the reference node in the first animation driving data and the first pose transformation relation corresponding to the reference node, a fifth pose transformation relation corresponding to the reference node is obtained. Then, the fifth pose transformation relation of the reference node is obtained according to the first pose transformation relation and the fourth pose transformation relation of the source node. Wherein, the fourth pose transformation relation about the reference node here may be the transformation relation of each node of the source bone carried in the animation key frame. For example, it can be the transformation relationship between the source node and its parent node, by multiplying the transformation relationship between all adjacent nodes between the source node and the root node, and combining the first pose between the source node and the target node transformation relationship, the fifth pose transformation relationship of the target node can be obtained. The fourth pose transformation relationship includes translation and/or rotation.

利用第一位置資訊,各參考節點對應的第五位姿變換關係和影響權重,得到幾何網格頂點的第二位置資訊。通過考慮參考節點對頂點的影響權重,使得獲取得到的幾何網格頂點的第二位置資訊更為準確。Using the first position information, the fifth pose transformation relationship and influence weight corresponding to each reference node, the second position information of the vertices of the geometric mesh is obtained. By considering the influence weight of the reference node on the vertex, the obtained second position information of the vertex of the geometric mesh is more accurate.

可以採用公式(4)確定幾何網格頂點的第二位置資訊V 2

Figure 02_image029
(4);
Figure 02_image031
為參考節點j的影響權重,
Figure 02_image033
為參考節點j的第五位姿變換關係,V 1為幾何網格頂點在靜止姿勢時的第一位置資訊。 Formula (4) can be used to determine the second position information V 2 of the vertices of the geometric grid:
Figure 02_image029
(4);
Figure 02_image031
is the influence weight of the reference node j,
Figure 02_image033
is the fifth pose transformation relation of the reference node j, and V 1 is the first position information of the geometric mesh vertex in the static pose.

為更好地理解本發明實施例提供的動畫遷移方法,請參見下例。請參見圖5,圖5是本發明實施例提供的一種動畫遷移方法實現流程示意圖。For a better understanding of the animation transition method provided by the embodiment of the present invention, please refer to the following example. Please refer to FIG. 5 . FIG. 5 is a schematic diagram of an implementation flow of an animation transition method provided by an embodiment of the present invention.

如圖5所述,本發明實施例提供的動畫遷移方法包括以下步驟。As shown in FIG. 5 , the animation migration method provided by the embodiment of the present invention includes the following steps.

步驟S21:獲取包含目標對象的圖像。Step S21: Acquiring an image containing the target object.

其中,獲取的方式可以是利用繪圖工具、3D建模工具或相機拍攝、經由其他設備通信傳輸得到等等。包含目標對象的圖像可以是2D圖、也可以是3D圖,此處不做限定。Wherein, the manner of obtaining may be to use a drawing tool, a 3D modeling tool or a camera to take pictures, to obtain through communication and transmission of other devices, and so on. The image containing the target object may be a 2D image or a 3D image, which is not limited here.

步驟S22:提取目標對象輪廓。Step S22: extract the outline of the target object.

其中,提取目標對象輪廓的方式有很多,例如目標分割、或先進行目標檢測、再進行目標提取等方式均可,任意能夠從圖像中提取出所需要的目標對象的方式均可,此處不做限定。Among them, there are many ways to extract the outline of the target object, such as target segmentation, or target detection first, and then target extraction, etc., any method that can extract the desired target object from the image can be used. Do limited.

步驟S23:進行三角剖分。Step S23: Perform triangulation.

通過對目標對象進行三角剖分,即可得到二維的三角形網格。從而可以利用二維的三角形網格得到三維網格模型。實現方式請參見上述實施例中獲取三維網格的方式。By triangulating the target object, a two-dimensional triangular mesh can be obtained. Thus, the three-dimensional mesh model can be obtained by using the two-dimensional triangular mesh. For the implementation manner, please refer to the manner of obtaining the three-dimensional grid in the above-mentioned embodiments.

步驟S24:提取初始目標骨骼。Step S24: Extract the initial target bone.

其中,從三維網格模型中提取初始目標骨骼的方式請參見上述實施例中的描述。Wherein, for the manner of extracting the initial target bone from the three-dimensional mesh model, please refer to the description in the foregoing embodiments.

步驟S25:對包含目標對象的圖像進行分類。Step S25: Classify the images containing the target object.

其中,對包含目標對象的圖像進行分類的方式請參見上述實施例中的描述。其中,為節省動畫遷移的時間,步驟S25可以與步驟S22同步進行。For the manner of classifying the images containing the target object, please refer to the description in the foregoing embodiments. Wherein, in order to save time for animation transition, step S25 can be performed synchronously with step S22.

步驟S26:選取初始源骨骼。Step S26: Select the initial source bone.

其中,對包含目標對象的圖像進行分類可以得到目標對象的類別,以從該類別中選擇初始源骨骼。Among them, classifying the image containing the target object can obtain the category of the target object, so as to select the initial source bone from this category.

步驟S27:骨骼映射以及骨骼對齊。Step S27: bone mapping and bone alignment.

其中,這裡的骨骼映射主要是為了獲取初始源骨骼和初始目標骨骼之間的映射關係,而骨骼對齊指的是根據二者之間的映射關係更新初始源骨骼和/或初始目標骨骼。Among them, the bone mapping here is mainly to obtain the mapping relationship between the initial source bone and the initial target bone, and the bone alignment refers to updating the initial source bone and/or the initial target bone according to the mapping relationship between the two.

步驟S28:骨骼蒙皮。Step S28: Bone skinning.

其中,骨骼蒙皮主要是為了獲取幾何網格頂點與目標節點之間的關係。確定幾何網格頂點與目標節點的影響權重。獲取影響權重的實現過程請參見上述實施例中的描述。Among them, bone skinning is mainly to obtain the relationship between geometric mesh vertices and target nodes. Determines the influence weights of geometry mesh vertices and target nodes. For the implementation process of obtaining influence weights, please refer to the descriptions in the foregoing embodiments.

步驟S29:獲取第一動畫驅動資料。Step S29: Obtain the first animation driving data.

關鍵幀中儲存有第一動畫驅動資料,讀取關鍵幀中的資料即可得到第一動畫驅動資料。其中,在源骨骼的拓撲結構發生變更的情況下,需要將動畫驅動資料也進行變更。變更動畫驅動資料的方式如上述實施例中的描述。The first animation driving data is stored in the key frame, and the first animation driving data can be obtained by reading the data in the key frame. Among them, when the topological structure of the source bone changes, the animation driving data also needs to be changed. The way of changing animation driving data is as described in the above-mentioned embodiment.

步驟S30:確定各幾何網格頂點動畫遷移後的位置資訊。Step S30: Determine the location information of each geometric mesh vertex after animation transition.

其中,這裡的位置資訊即為上述第二位置資訊。其中,獲取各幾何網格頂點動畫第二位置資訊的過程請參見上述實施例中的描述。Wherein, the location information here is the above-mentioned second location information. For the process of obtaining the second position information of the vertex animation of each geometric mesh, please refer to the description in the above embodiment.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

本領域技術人員可以理解,在實施方式的上述方法中,各步驟的撰寫順序並不意味著嚴格的執行順序而對實施過程構成任何限定,各步驟的執行順序應當以其功能和可能的內在邏輯確定。Those skilled in the art can understand that in the above method of implementation, the writing order of each step does not mean a strict execution order and constitutes any limitation on the implementation process. The execution order of each step should be based on its function and possible internal logic. Sure.

動畫遷移方法的執行主體可以是動畫遷移裝置,例如,動畫遷移方法可以由終端設備或伺服器或其它處理設備執行,其中,終端設備可以為使用者設備(User Equipment,UE)、移動設備、使用者終端、終端、蜂窩電話、無線電話、個人數位助理(Personal Digital Assistant,PDA)、手持設備、計算設備、車載設備、可穿戴設備以及自動駕駛汽車,有定位及建圖需求的機器人,有配准需求的醫療成像系統,用於增強現實或虛擬實境的眼鏡、頭盔等產品等。在一些可能的實現方式中,該動畫遷移方法可以通過處理器調用記憶體中儲存的電腦可讀指令的方式來實現。The execution subject of the animation migration method may be an animation migration device. For example, the animation migration method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (User Equipment, UE), a mobile device, an Reader terminals, terminals, cellular phones, wireless phones, personal digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, vehicle-mounted devices, wearable devices and self-driving cars, robots with positioning and mapping requirements, and accessories Quasi-needed medical imaging systems, glasses, helmets and other products for augmented reality or virtual reality. In some possible implementation manners, the animation transition method may be implemented by the processor invoking computer-readable instructions stored in the memory.

請參閱圖6,圖6是本發明實施例提供的一種動畫遷移裝置的結構示意圖。動畫遷移裝置30包括獲取模組31、模型更新模組32、動畫遷移模組33。獲取模組31,被配置為獲取初始源骨骼、初始目標骨骼以及初始源骨骼和初始目標骨骼之間的節點映射關係;模型更新模組32,被配置為基於節點映射關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,最終目標骨骼中的目標節點均能夠映射於最終源骨骼中的源節點;動畫遷移模組33,被配置為將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料。Please refer to FIG. 6 . FIG. 6 is a schematic structural diagram of an animation transition device provided by an embodiment of the present invention. The animation migration device 30 includes an acquisition module 31 , a model update module 32 , and an animation migration module 33 . The obtaining module 31 is configured to obtain the initial source bone, the initial target bone, and the node mapping relationship between the initial source bone and the initial target bone; the model updating module 32 is configured to update the initial source bone and the initial The node topology structure of at least one of the target bones obtains the final source bone and the final target bone, wherein, the target nodes in the final target bone can all be mapped to the source nodes in the final source bone; the animation migration module 33 is configured as Migrate the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

在本發明一些實施例中,最終目標骨骼與最終源骨骼的節點拓撲結構一致,和/或,最終目標骨骼與最終源骨骼之間的節點一一映射。In some embodiments of the present invention, the node topology of the final target bone is consistent with that of the final source bone, and/or, the nodes between the final target bone and the final source bone are mapped one by one.

上述方案,通過保障最終目標骨骼中的節點在最終源骨骼中具有對應的節點與之映射,且映射關係為一一映射,不存在一個目標節點對應多個源節點的情況,使得後續最終目標骨骼中的節點上均有對應動畫驅動資料,且每個節點上的動畫驅動資料的數量為1,不存在一個節點有多個動畫驅動的情況,從而使得最終目標骨骼的動畫驅動更自然。The above scheme, by ensuring that the nodes in the final target bone have corresponding nodes in the final source bone, and the mapping relationship is one-to-one mapping, there is no situation where one target node corresponds to multiple source nodes, so that the subsequent final target bone Each node in has corresponding animation driving data, and the number of animation driving data on each node is 1. There is no case that a node has multiple animation drivers, so that the animation driving of the final target bone is more natural.

在本發明一些實施例中,節點映射關係包括初始源骨骼和初始目標骨骼中的節點之間的映射關係;模型更新模組32,還被配置為在兩個骨骼之間存在多個節點映射於同一節點的情況下,更新其中一個骨骼的節點拓撲結構;模型更新模組32,還被配置為在骨骼中存在未有映射關係的情況下,更新未有映射關係的節點所在骨骼的節點拓撲結構;其中,兩個骨骼包括初始源骨骼和初始目標骨骼,經更新之後的兩個骨骼之間的節點一一映射。In some embodiments of the present invention, the node mapping relationship includes the mapping relationship between the nodes in the initial source bone and the initial target bone; the model update module 32 is also configured to have multiple node mappings between the two bones In the case of the same node, update the node topology structure of one of the bones; the model update module 32 is also configured to update the node topology structure of the bone where the node without the mapping relationship exists when there is no mapping relationship in the bone ; Wherein, the two bones include the initial source bone and the initial target bone, and the updated nodes between the two bones are mapped one by one.

上述方案,通過更新骨骼的節點拓撲結構能夠使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,以減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。In the above solution, by updating the node topology of the bones, the situation where multiple nodes between two bones are mapped to the same node can be adjusted to a node-to-one mapping between the two bones, so as to reduce the process of subsequent animation driving the final target bone Unreasonable situations occur.

在本發明一些實施例中,模型更新模組32,還被配置為將未有映射關係的節點合併至具有映射關係的相鄰節點,其中,相鄰節點為未有映射關係的節點在所在骨骼中的父節點或子節點;和/或,模型更新模組32,還被配置為在多個節點位於同一骨骼分支的情況下,更新多個節點所在的第一骨骼;在多個節點位於不同骨骼分支的情況下,更新不包含多個節點的第二骨骼;其中,第一骨骼和第二骨骼中的其中一個為初始源骨骼,另一個為初始目標骨骼。In some embodiments of the present invention, the model update module 32 is further configured to merge nodes without mapping relationships into adjacent nodes with mapping relationships, wherein the adjacent nodes are nodes without mapping relationships in the bone parent node or child node in; and/or, the model update module 32 is also configured to update the first bone where multiple nodes are located when multiple nodes are located at the same bone branch; when multiple nodes are located at different In the case of a bone branch, update the second bone that does not contain multiple nodes; where one of the first bone and the second bone is the initial source bone, and the other is the initial target bone.

上述方案,通過更新多個節點所在的第一骨骼,使得兩個骨骼之間的多個節點映射於同一節點的情況調整為兩個骨骼之間的節點一一映射,進而減少後續動畫驅動最終目標骨骼的過程中出現不合理的情況出現。In the above solution, by updating the first bone where multiple nodes are located, the situation that multiple nodes between two bones are mapped to the same node is adjusted to a one-to-one mapping of nodes between two bones, thereby reducing the final goal of subsequent animation drives Unreasonable situations appear in the process of bones.

在本發明一些實施例中,模型更新模組32,還被配置為將第一骨骼中的多個節點合併為一個第一節點,其中,第一節點保留合併前多個節點的映射關係;和/或,模型更新模組32,還被配置為在第一骨骼中查找出多個節點所在的骨骼分支匯合的第二節點,並在第二骨骼中查找出映射於第二節點的第三節點;按照多個節點對應的節點拓撲結構,在第三節點處新增至少一條骨骼分支,其中,多個節點與第三節點處新增的骨骼分支和原始的骨骼分支中的節點一一映射。In some embodiments of the present invention, the model update module 32 is further configured to merge multiple nodes in the first skeleton into one first node, wherein the first node retains the mapping relationship of the multiple nodes before the merge; and /or, the model updating module 32 is also configured to find out the second node where the branches of the bones where the multiple nodes are located converge in the first bone, and find out the third node mapped to the second node in the second bone ; Add at least one bone branch at the third node according to the node topology structure corresponding to the multiple nodes, wherein the multiple nodes are mapped one by one with the newly added bone branch at the third node and the nodes in the original bone branch.

上述方案,通過此種方式在實現節點一一映射的情況下,還能夠最大化的保留第一骨骼的節點拓撲結構。In the above solution, in the case of one-to-one mapping of nodes in this way, the node topology of the first bone can be preserved to the greatest extent.

在本發明一些實施例中,動畫遷移模組33,還被配置為:按照從根源節點到葉源節點的順序,分別將最終源骨骼中的各源節點與最終目標骨骼中對應映射的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係;利用第一動畫驅動資料和第一位姿變換關係,得到最終目標骨骼的第二動畫驅動資料。In some embodiments of the present invention, the animation migration module 33 is further configured to: in the order from the root node to the leaf source node, each source node in the final source bone and the corresponding mapped target node in the final target bone Align to obtain the first pose transformation relationship between each source node and the mapped target node; use the first animation driving data and the first pose transformation relationship to obtain the second animation driving data of the final target bone.

上述方案,通過進行源節點與目標節點之間的對齊,就能夠得到各源節點與映射的目標節點之間的第一位姿變換關係,由此實現利用第一動畫驅動資料和第一位姿變換關係,得到最終目標骨骼的第二動畫驅動資料。In the above solution, by aligning the source node and the target node, the first pose transformation relationship between each source node and the mapped target node can be obtained, thereby realizing the use of the first animation driving data and the first pose Transform the relationship to get the second animation driving data of the final target bone.

在本發明一些實施例中,動畫遷移模組33,還被配置為:對於最終源骨骼中的每個源節點,獲取使源節點對齊於映射的目標節點所需的偏移量,其中,偏移量包括平移分量和旋轉分量中的至少一者;基於源節點對應的偏移量,得到源節點的第一位姿變換關係。In some embodiments of the present invention, the animation migration module 33 is further configured to: for each source node in the final source bone, obtain the offset required to align the source node with the mapped target node, wherein, the offset The displacement includes at least one of a translation component and a rotation component; based on the offset corresponding to the source node, a first pose transformation relationship of the source node is obtained.

上述方案,偏移量包括平移分量和旋轉分量,使得獲取到的第一位姿變換關係更準確。In the above solution, the offset includes a translation component and a rotation component, so that the obtained first pose transformation relationship is more accurate.

在本發明一些實施例中,最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,第一位姿變換關係為源節點與映射的目標節點在第一座標系中的變換關係;源節點對應的偏移量為:在源節點的第一父節點對齊且第一父節點作為第二座標系的原點的情況下,源節點與映射的目標節點在第二座標系中的偏移量。In some embodiments of the present invention, the root node of the final source bone and the root target node of the final target bone are both translated to the origin of the first coordinate system, and the first pose transformation relationship is that the source node and the mapped target node are at the first The transformation relationship in the coordinate system; the offset corresponding to the source node is: when the first parent node of the source node is aligned and the first parent node is the origin of the second coordinate system, the source node and the mapped target node are at The offset in the second coordinate system.

上述方案,通過最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,能夠獲取最終源骨骼的根源節點和最終目標骨骼的根目標節點之間的偏移量。In the above scheme, the root node of the final source bone and the root target node of the final target bone are both translated to the origin of the first coordinate system, and the offset between the root node of the final source bone and the root target node of the final target bone can be obtained quantity.

在本發明一些公開實施例中,動畫遷移模組33,還被配置為:獲取經對齊的第一父節點與根源節點之間的第二位姿變換關係、以及源節點映射的目標節點的第二父節點與根目標節點之間的第三位姿變換關係,基於源節點以及映射的目標節點在第一座標系中的位姿以及第二位姿變換關係和第三位姿變換關係,得到源節點對應的偏移量;和/或,基於源節點以及源節點的上級節點分別對應的偏移量,得到源節點的第一位姿變換關係,其中,源節點的上級節點為最終源骨骼中源節點的第一父節點、根源節點以及第一父節點與根源節點之間的節點。In some disclosed embodiments of the present invention, the animation migration module 33 is further configured to: obtain the second pose transformation relationship between the aligned first parent node and the root node, and the second pose transformation relationship of the target node mapped by the source node The third pose transformation relationship between the second parent node and the root target node, based on the pose of the source node and the mapped target node in the first coordinate system, the second pose transformation relationship and the third pose transformation relationship, is obtained The offset corresponding to the source node; and/or, based on the offset corresponding to the source node and the parent node of the source node, the first pose transformation relationship of the source node is obtained, wherein the parent node of the source node is the final source bone The first parent node of the source node, the root node, and the nodes between the first parent node and the root node.

上述方案,通過結合源節點以及源節點的上級節點對應的偏移量,就能夠得到源節點在第一座標系中與映射的目標節點的第一位姿變換關係。In the above solution, by combining the source node and the offset corresponding to the source node's superior node, the first pose transformation relationship between the source node and the mapped target node in the first coordinate system can be obtained.

在本發明一些實施例中,第一動畫驅動資料是基於最終源骨骼與初始源骨骼之間的拓撲結構差異,對初始源骨骼的原始動畫資料進行調整得到的;和/或,最終目標骨骼的第二動畫驅動資料是基於第一動畫驅動資料以及第一位姿變換關係得到,其中,第一位姿變換關係為最終源骨骼的源節點與最終目標骨骼中映射的目標節點之間的變換關係;最終目標骨骼為目標對象的骨骼;動畫遷移模組33,被配置為:基於目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊。In some embodiments of the present invention, the first animation driving data is obtained by adjusting the original animation data of the initial source bone based on the topology difference between the final source bone and the initial source bone; and/or, the final target bone's The second animation driving data is obtained based on the first animation driving data and the first pose transformation relationship, wherein the first pose transformation relationship is the transformation relationship between the source node of the final source bone and the target node mapped in the final target bone The final target bone is the bone of the target object; the animation migration module 33 is configured to: obtain the first position information, the first animation driving data and the first pose transformation relationship based on the first position information of the geometric mesh vertices in the target object; 2. Second position information about the vertices of the geometric mesh in the animation driving data.

上述方案,通過結合目標對象中的幾何網格頂點的第一位置資訊、第一動畫驅動資料以及第一位姿變換關係,就能夠得到第二動畫驅動資料中關於幾何網格頂點的第二位置資訊,過程方便。In the above solution, by combining the first position information of the geometric mesh vertices in the target object, the first animation driving data and the first pose transformation relationship, the second position of the geometric mesh vertices in the second animation driving data can be obtained Information, convenient process.

在本發明一些實施例中,動畫遷移模組33,還被配置為:獲取與幾何網格頂點距離滿足預設條件的至少一個目標節點作為參考節點,並獲得參考節點的影響權重;基於第一動畫驅動資料中關於參考節點的第四位姿變換關係和參考節點對應的第一位姿變換關係,得到參考節點對應的第五位姿變換關係;以及利用第一位置資訊、各參考節點對應的第五位姿變換關係和影響權重,得到幾何網格頂點的第二位置資訊。In some embodiments of the present invention, the animation migration module 33 is further configured to: obtain at least one target node whose distance from the vertex of the geometric grid satisfies the preset condition as a reference node, and obtain the influence weight of the reference node; based on the first The fourth pose transformation relation of the reference node in the animation driving data and the first pose transformation relation corresponding to the reference node are obtained to obtain the fifth pose transformation relation corresponding to the reference node; The fifth pose transformation relation and influence weight are used to obtain the second position information of the vertices of the geometric mesh.

上述方案,通過考慮參考節點對頂點的影響權重,使得獲取得到的幾何網格頂點的第二位置資訊更為準確。In the above solution, by considering the influence weight of the reference node on the vertex, the obtained second position information of the vertex of the geometric mesh is more accurate.

在本發明一些實施例中,獲取模組31,還被配置為:對包含目標對象的圖像進行分類,得到目標對象的類別,並選擇與類別匹配的骨骼模型作為初始源骨骼,其中,最終目標骨骼為目標對象的骨骼;和/或,獲取模組31,還被配置為:對包含目標對象的圖像進行輪廓提取,得到目標對象的輪廓;利用輪廓,為目標對象生成三維網格模型;從三維網格模型中提取得到初始目標骨骼;和/或,獲取模組31,還被配置為:確定初始源骨骼和初始目標骨骼中各節點所在的骨骼分支數量;按照骨骼分支數量從多到少的順序,依序對初始源骨骼和初始目標骨骼中的節點進行映射,得到節點映射關係。In some embodiments of the present invention, the acquisition module 31 is further configured to: classify the image containing the target object, obtain the category of the target object, and select the bone model matching the category as the initial source bone, wherein, finally The target bone is the bone of the target object; and/or, the acquisition module 31 is also configured to: extract the contour of the image containing the target object to obtain the contour of the target object; use the contour to generate a three-dimensional mesh model for the target object ; Extract the initial target bone from the three-dimensional mesh model; and/or, the acquisition module 31 is also configured to: determine the number of bone branches where each node in the initial source bone and the initial target bone is located; The nodes in the initial source bone and the initial target bone are mapped sequentially in order of least to obtain the node mapping relationship.

上述方案,通過獲取目標對象的類別,並從與類別匹配的骨骼模型中選擇初始源骨骼,方便快捷。通過按照骨骼分支數量從多到少的順序,依序對初始骨骼和初始目標骨骼中的節點進行映射,能夠提高映射的準確度。The above solution is convenient and quick by obtaining the category of the target object and selecting the initial source bone from the bone model matching the category. By sequentially mapping the nodes in the initial bone and the initial target bone in order of the number of bone branches from large to small, the accuracy of mapping can be improved.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

請參閱圖7,圖7是本發明實施例提供的一種電子設備的結構示意圖。電子設備40包括記憶體41和處理器42,處理器42用於執行記憶體41中儲存的程式指令,以實現上述動畫遷移方法實施例中的步驟。在一個具體的實施場景中,電子設備40可以包括但不限於:微型電腦、伺服器,此外,電子設備40還可以包括筆記型電腦、平板電腦等移動設備,在此不做限定。Please refer to FIG. 7 . FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 40 includes a memory 41 and a processor 42, and the processor 42 is configured to execute the program instructions stored in the memory 41, so as to realize the steps in the above-mentioned embodiment of the animation transition method. In a specific implementation scenario, the electronic device 40 may include, but is not limited to: a microcomputer, a server. In addition, the electronic device 40 may also include mobile devices such as notebook computers and tablet computers, which are not limited here.

處理器42用於控制其自身以及記憶體41以實現上述動畫遷移方法實施例中的步驟。處理器42還可以稱為中央處理單元(Central Processing Unit,CPU)。處理器42可能是一種積體電路晶片,具有信號的處理能力。處理器42還可以是通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等。另外,處理器42可以由積體電路晶片共同實現。The processor 42 is used to control itself and the memory 41 to implement the steps in the above animation transition method embodiment. The processor 42 may also be called a central processing unit (Central Processing Unit, CPU). The processor 42 may be an integrated circuit chip with signal processing capabilities. The processor 42 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. In addition, the processor 42 may be jointly realized by an integrated circuit chip.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

請參閱圖8,圖8為本發明實施例提供的電腦可讀儲存介質的結構示意圖。電腦可讀儲存介質50儲存有能夠被處理器運行的程式指令501,程式指令501用於實現上述動畫遷移方法實施例中的步驟。Please refer to FIG. 8 . FIG. 8 is a schematic structural diagram of a computer-readable storage medium provided by an embodiment of the present invention. The computer-readable storage medium 50 stores program instructions 501 that can be executed by the processor, and the program instructions 501 are used to implement the steps in the above-mentioned animation transition method embodiments.

上述方案,通過依據初始源骨骼和初始目標骨骼之間的節點映射關係更新初始源骨骼和/或初始目標骨骼的拓撲結構,使得最終目標骨骼的目標節點均能夠映射於最終源骨骼中的源節點,以便將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,故實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。In the above scheme, by updating the topology structure of the initial source bone and/or the initial target bone according to the node mapping relationship between the initial source bone and the initial target bone, the target nodes of the final target bone can be mapped to the source nodes in the final source bone , in order to migrate the first animation driving data related to the initial source bone to the final target bone, thereby driving the movement of the final target bone, so the animation migration between different bones is realized, and there is no need to require the source bone and target bone to be migrated The initial topology between bones is completely consistent, which improves the applicability of animation migration between bones.

本發明實施例還提供一種電腦程式產品,包括儲存了程式碼的電腦可讀儲存介質,所述程式碼包括的指令被電腦設備的處理器運行時,實現上述動畫遷移方法的步驟,具體可參見上述方法實施例。An embodiment of the present invention also provides a computer program product, including a computer-readable storage medium storing program codes. When the instructions contained in the program codes are executed by the processor of the computer device, the steps of the above-mentioned animation transition method are realized. For details, please refer to Embodiment of the above-mentioned method.

該電腦程式產品可以具體通過硬體、軟體或其結合的方式實現。在一個可選實施例中,所述電腦程式產品具體體現為電腦儲存介質,在另一個可選實施例中,電腦程式產品具體體現為軟體產品,例如軟體發展包(Software Development Kit,SDK)等等。The computer program product can be realized by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium. In another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.

在一些實施例中,本發明實施例提供的裝置具有的功能或包含的模組可以用於執行上文方法實施例描述的方法,其實現可以參照上文方法實施例的描述。In some embodiments, the functions of the device provided in the embodiments of the present invention or the included modules can be used to execute the methods described in the above method embodiments, and the implementation can refer to the descriptions of the above method embodiments.

上文對各個實施例的描述傾向於強調各個實施例之間的不同之處,其相同或相似之處可以互相參考。The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments, and the same or similar points can be referred to each other.

在本發明所提供的幾個實施例中,應該理解到,所揭露的方法和裝置,可以通過其它的方式實現。例如,以上所描述的裝置實施方式僅僅是示意性的,例如,模組或單元的劃分,僅僅為一種邏輯功能劃分,實際實現時可以有另外的劃分方式,例如單元或元件可以結合或者可以集成到另一個系統,或一些特徵可以忽略,或不執行。另一點,所顯示或討論的相互之間的耦合或直接耦合或通信連接可以是通過一些介面,裝置或單元的間接耦合或通信連接,可以是電性、機械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementations described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

另外,在本發明各個實施例中的各功能單元可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用軟體功能單元的形式實現。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented not only in the form of hardware, but also in the form of software functional units.

集成的單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存介質中。基於這樣的理解,本發明實施例的技術方案本質上或者說對相關技術做出貢獻的部分或者該技術方案的全部或部分可以以軟體產品的形式體現出來,該電腦軟體產品儲存在一個儲存介質中,包括若干指令用以使得一台電腦設備(可以是個人電腦,伺服器,或者網路設備等)或處理器(processor)執行本發明各個實施方式方法的全部或部分步驟。而前述的儲存介質包括:U盤、移動硬碟、唯讀記憶體(ROM,Read-Only Memory)、隨機存取記憶體(RAM,Random Access Memory)、磁碟或者光碟等各種可以儲存程式碼的介質。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the embodiment of the present invention or the part that contributes to the related technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium Among them, several instructions are included to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc., which can store program codes. medium.

工業實用性 本發明實施例一種動畫遷移方法和設備、電腦可讀儲存介質。其中,動畫遷移方法,包括:獲取初始源骨骼、初始目標骨骼以及初始源骨骼和初始目標骨骼之間的節點映射關係;基於節點映射關係更新初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,最終目標骨骼中的目標節點均能夠映射於最終源骨骼中的源節點;將與初始源骨骼相關的第一動畫驅動資料遷移至最終目標骨骼上,得到最終目標骨骼的第二動畫驅動資料。通過本發明實施例,能夠將與初始源骨骼相關的第一動畫驅動資料遷移到最終目標骨骼上,從而驅動最終目標骨骼運動,實現了不同骨骼之間的動畫遷移,而且無需要求待遷移的源骨骼和目標骨骼之間的初始拓撲結構完全一致,從而提高了骨骼之間的動畫遷移的適用性。 Industrial Applicability Embodiments of the present invention provide an animation migration method and device, and a computer-readable storage medium. Among them, the animation migration method includes: obtaining the initial source bone, the initial target bone, and the node mapping relationship between the initial source bone and the initial target bone; updating the node topology of at least one of the initial source bone and the initial target bone based on the node mapping relationship structure, to obtain the final source bone and the final target bone, wherein, the target nodes in the final target bone can all be mapped to the source nodes in the final source bone; the first animation driving data related to the initial source bone is transferred to the final target bone , get the second animation driving data of the final target bone. Through the embodiment of the present invention, the first animation driving data related to the initial source bone can be migrated to the final target bone, thereby driving the movement of the final target bone, realizing animation migration between different bones, and without requiring the source to be migrated The initial topology between the bone and the target bone is completely consistent, which improves the applicability of animation transfer between bones.

201:初始目標骨骼中的第二個節點 202:初始目標骨骼中的第三個節點 211:初始源骨骼中的第二個節點 301:初始目標骨骼的第一個節點 302:初始目標骨骼的第二個節點 3021:左分支中的第一個節點 3022:右分支中的第一個節點 3023:左分支中的第二個節點 3024:右分支中的第二個節點 311:初始源骨骼的第一個節點 312:初始源骨骼的第二個節點 313:初始源骨骼的第三個節點 314:初始源骨骼的第四個節點 401:初始目標骨骼的第一個節點 402:初始目標骨骼的第二個節點 403:初始目標骨骼的第三個節點 411:初始源骨骼的第一個節點 412:初始源骨骼的第二個節點 413:初始源骨骼的第三個節點 414:初始源骨骼的第四個節點 30:動畫遷移裝置 31:獲取模組 32:模型更新模組 33:動畫遷移模組 40:電子設備 41:記憶體 42:處理器 50:電腦可讀儲存介質 501:程式指令 S11~S13,S21~S30:步驟 201: The second node in the initial target bone 202: The third node in the initial target bone 211: The second node in the original source bone 301: The first node of the initial target bone 302: The second node of the initial target bone 3021: The first node in the left branch 3022: The first node in the right branch 3023: The second node in the left branch 3024: The second node in the right branch 311: The first node of the initial source bone 312: The second node of the initial source bone 313: The third node of the initial source bone 314: The fourth node of the initial source bone 401: The first node of the initial target bone 402: The second node of the initial target bone 403: The third node of the initial target bone 411: The first node of the initial source bone 412: The second node of the initial source bone 413: The third node of the initial source bone 414: The fourth node of the initial source bone 30: Animation Migration Device 31: Get the module 32:Model update module 33: Animation Migration Module 40: Electronic equipment 41: Memory 42: Processor 50: computer readable storage medium 501: Program instruction S11~S13, S21~S30: steps

此處的附圖被併入說明書中並構成本說明書的一部分,這些附圖示出了符合本發明的實施例,並與說明書一起用於說明本發明實施例的技術方案。 圖1是本發明實施例提供的一種動畫遷移方法的實現流程示意圖; 圖2是本發明實施例提供的一種動畫遷移方法中映射關係示意圖; 圖3是本發明實施例提供的一種動畫遷移方法中映射關係示意圖; 圖4是本發明實施例提供的一種動畫遷移方法中映射關係示意圖; 圖5是本發明實施例提供的一種動畫遷移方法的實現流程示意圖; 圖6是本發明實施例提供的一種動畫遷移裝置的結構示意圖; 圖7是本發明實施例提供的一種電子設備的結構示意圖; 圖8是本發明實施例提供的一種電腦可讀儲存介質的結構示意圖。 The accompanying drawings here are incorporated into the specification and constitute a part of the specification. These drawings show embodiments consistent with the present invention, and are used together with the description to illustrate the technical solutions of the embodiments of the present invention. FIG. 1 is a schematic diagram of an implementation flow of an animation transition method provided by an embodiment of the present invention; FIG. 2 is a schematic diagram of a mapping relationship in an animation migration method provided by an embodiment of the present invention; 3 is a schematic diagram of a mapping relationship in an animation migration method provided by an embodiment of the present invention; 4 is a schematic diagram of a mapping relationship in an animation migration method provided by an embodiment of the present invention; FIG. 5 is a schematic diagram of an implementation flow of an animation migration method provided by an embodiment of the present invention; Fig. 6 is a schematic structural diagram of an animation migration device provided by an embodiment of the present invention; Fig. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention; Fig. 8 is a schematic structural diagram of a computer-readable storage medium provided by an embodiment of the present invention.

S11~S13:步驟 S11~S13: Steps

Claims (14)

一種動畫遷移方法,包括: 獲取初始源骨骼、初始目標骨骼以及所述初始源骨骼和初始目標骨骼之間的節點映射關係; 基於所述節點映射關係更新所述初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,其中,所述最終目標骨骼中的目標節點均能夠映射於所述最終源骨骼中的源節點; 將與所述初始源骨骼相關的第一動畫驅動資料遷移至所述最終目標骨骼上,得到所述最終目標骨骼的第二動畫驅動資料。 A method of animation migration, comprising: Obtain an initial source bone, an initial target bone, and a node mapping relationship between the initial source bone and the initial target bone; Updating the node topology of at least one of the initial source bone and the initial target bone based on the node mapping relationship to obtain the final source bone and the final target bone, wherein the target nodes in the final target bone can be mapped to the Describe the source node in the final source bone; Migrating the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone. 根據請求項1所述的方法,其中,所述最終目標骨骼與所述最終源骨骼的節點拓撲結構一致,和/或,所述最終目標骨骼與所述最終源骨骼之間的節點一一映射。The method according to claim 1, wherein the node topology of the final target bone is consistent with the final source bone, and/or, the node-to-one mapping between the final target bone and the final source bone . 根據請求項1或2所述的方法,其中,所述節點映射關係包括所述初始源骨骼和初始目標骨骼中的節點之間的映射關係;所述基於所述節點對應關係更新所述初始源骨骼和初始目標骨骼中至少一者的節點拓撲結構,得到最終源骨骼和最終目標骨骼,包括以下至少之一: 在兩個骨骼之間存在多個節點映射於同一節點的情況下,更新其中一個所述骨骼的節點拓撲結構; 在所述骨骼中存在未有映射關係的情況下,更新所述未有映射關係的節點所在骨骼的節點拓撲結構; 其中,所述兩個骨骼包括初始源骨骼和初始目標骨骼,經更新之後的所述兩個骨骼之間的節點一一映射。 The method according to claim 1 or 2, wherein the node mapping relationship includes the mapping relationship between nodes in the initial source bone and the initial target bone; the updating of the initial source based on the node correspondence The node topology of at least one of the bone and the initial target bone to obtain the final source bone and the final target bone, including at least one of the following: In the case that there are multiple nodes mapped to the same node between the two bones, update the node topology of one of the bones; In the case that there is no mapping relationship in the bone, update the node topology of the bone where the node without the mapping relationship is located; Wherein, the two bones include an initial source bone and an initial target bone, and the updated nodes between the two bones are mapped one by one. 根據請求項3所述的方法,其中,所述更新所述未有映射關係的節點所在骨骼的節點拓撲結構,包括: 將所述未有映射關係的節點合併至具有映射關係的相鄰節點,其中,所述相鄰節點為所述未有映射關係的節點在所在骨骼中的父節點或子節點;和/或, 所述更新其中一個所述骨骼的節點拓撲結構,包括: 在所述多個節點位於同一骨骼分支的情況下,更新所述多個節點所在的第一骨骼; 在所述多個節點位於不同骨骼分支的情況下,更新不包含所述多個節點的第二骨骼; 其中,所述第一骨骼和第二骨骼中的其中一個為初始源骨骼,另一個為初始目標骨骼。 According to the method described in claim 3, wherein said updating the node topology of the bone where the node without a mapping relationship is located comprises: Merging the node without a mapping relationship into an adjacent node with a mapping relationship, wherein the adjacent node is the parent node or child node of the node without a mapping relationship in the bone where it is located; and/or, The updating of the node topology of one of the bones includes: In the case where the multiple nodes are located on the same bone branch, update the first bone where the multiple nodes are located; In the case where the plurality of nodes are located on different bone branches, updating a second bone that does not contain the plurality of nodes; Wherein, one of the first bone and the second bone is an initial source bone, and the other is an initial target bone. 根據請求項4所述的方法,其中,所述更新所述多個節點所在的第一骨骼,包括: 將所述第一骨骼中的多個節點合併為一個第一節點,其中,所述第一節點保留合併前所述多個節點的映射關係;和/或, 所述更新不包含所述多個節點的第二骨骼,包括: 在所述第一骨骼中查找出所述多個節點所在的骨骼分支匯合的第二節點,並在所述第二骨骼中查找出映射於所述第二節點的第三節點; 按照所述多個節點對應的節點拓撲結構,在所述第三節點處新增至少一條骨骼分支,其中,所述多個節點與所述第三節點處新增的骨骼分支和原始的骨骼分支中的節點一一映射。 The method according to claim 4, wherein said updating the first bones where the multiple nodes are located includes: Merging a plurality of nodes in the first bone into a first node, wherein the first node retains the mapping relationship of the plurality of nodes before merging; and/or, The update does not include a second bone of the plurality of nodes, including: Finding, in the first bone, a second node at which the branches of the bones where the multiple nodes converge; and finding, in the second bone, a third node mapped to the second node; Add at least one skeletal branch at the third node according to the node topology corresponding to the multiple nodes, wherein the multiple nodes are related to the new skeletal branch and the original skeletal branch at the third node The nodes in are mapped one-to-one. 根據請求項1或2所述的方法,其中,在所述將與所述初始源骨骼相關的第一動畫驅動資料遷移至所述最終目標骨骼上,得到所述最終目標骨骼的第二動畫驅動資料之前,所述方法還包括: 按照從根源節點到葉源節點的順序,分別將所述最終源骨骼中的各源節點與所述最終目標骨骼中對應映射的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係; 所述將與所述初始源骨骼相關的第一動畫驅動資料遷移至所述最終目標骨骼上,得到所述最終目標骨骼的第二動畫驅動資料,包括: 利用所述第一動畫驅動資料和所述第一位姿變換關係,得到所述最終目標骨骼的第二動畫驅動資料。 According to the method described in claim 1 or 2, wherein, when the first animation driving data related to the initial source bone is transferred to the final target bone, the second animation driving data of the final target bone is obtained Before the data, the method also includes: According to the order from the root node to the leaf source node, each source node in the final source bone is aligned with the corresponding mapped target node in the final target bone to obtain the distance between each source node and the mapped target node. The first pose transformation relationship of ; The step of migrating the first animation driving data related to the initial source bone to the final target bone to obtain the second animation driving data of the final target bone includes: The second animation driving data of the final target bone is obtained by using the first animation driving data and the first pose transformation relationship. 根據請求項6所述的方法,其中,所述分別將所述最終源骨骼中的各源節點與所述最終目標骨骼中對應映射的目標節點進行對齊,以得到各源節點與映射的目標節點之間的第一位姿變換關係,包括: 對於所述最終源骨骼中的每個源節點,獲取使所述源節點對齊於映射的目標節點所需的偏移量,其中,所述偏移量包括平移分量和旋轉分量中的至少一者; 基於所述源節點對應的偏移量,得到所述源節點的第一位姿變換關係。 According to the method described in claim 6, wherein, the respective source nodes in the final source bone are aligned with the corresponding mapped target nodes in the final target bone, so as to obtain the source nodes and the mapped target nodes The first pose transformation relationship between, including: For each source node in the final source bone, obtain an offset required to align the source node to a mapped target node, wherein the offset includes at least one of a translation component and a rotation component ; Based on the offset corresponding to the source node, a first pose transformation relationship of the source node is obtained. 根據請求項7所述的方法,其中,所述最終源骨骼的根源節點和最終目標骨骼的根目標節點均平移至第一座標系的原點,所述第一位姿變換關係為所述源節點與映射的目標節點在所述第一座標系中的變換關係;所述源節點對應的偏移量為:在所述源節點的第一父節點對齊且所述第一父節點作為第二座標系的原點的情況下,所述源節點與映射的目標節點在所述第二座標系中的偏移量。According to the method described in claim 7, wherein, the root node of the final source bone and the root target node of the final target bone are both translated to the origin of the first coordinate system, and the first pose transformation relationship is the source The transformation relationship between the node and the mapped target node in the first coordinate system; the offset corresponding to the source node is: the first parent node of the source node is aligned and the first parent node is the second In the case of the origin of the coordinate system, the offset between the source node and the mapped target node in the second coordinate system. 根據請求項8所述的方法,其中,所述獲取使所述源節點對齊於映射的目標節點所需的偏移量,包括: 獲取經對齊的所述第一父節點與根源節點之間的第二位姿變換關係、以及所述源節點映射的目標節點的第二父節點與根目標節點之間的第三位姿變換關係,基於所述源節點以及映射的目標節點在第一座標系中的位姿以及所述第二位姿變換關係和第三位姿變換關係,得到所述源節點對應的偏移量;和/或, 所述基於所述源節點對應的偏移量,得到所述源節點的第一位姿變換關係,包括: 基於所述源節點以及所述源節點的上級節點分別對應的所述偏移量,得到所述源節點的第一位姿變換關係,其中,所述源節點的上級節點為所述最終源骨骼中所述源節點的第一父節點、根源節點以及所述第一父節點與根源節點之間的節點。 The method according to claim 8, wherein said acquiring the offset required to align the source node with the mapped target node comprises: Obtaining the aligned second pose transformation relationship between the first parent node and the root node, and the third pose transformation relationship between the second parent node of the target node mapped by the source node and the root target node , based on the poses of the source node and the mapped target node in the first coordinate system and the second pose transformation relationship and the third pose transformation relationship, the offset corresponding to the source node is obtained; and/ or, The obtaining the first pose transformation relationship of the source node based on the offset corresponding to the source node includes: Obtain the first pose transformation relationship of the source node based on the offsets respectively corresponding to the source node and the parent node of the source node, wherein the parent node of the source node is the final source bone The first parent node of the source node, the root node, and the nodes between the first parent node and the root node. 根據請求項1或2所述的方法,其中,所述第一動畫驅動資料是基於所述最終源骨骼與所述初始源骨骼之間的拓撲結構差異,對所述初始源骨骼的原始動畫資料進行調整得到的;和/或, 所述最終目標骨骼的第二動畫驅動資料是基於所述第一動畫驅動資料以及第一位姿變換關係得到,其中,所述第一位姿變換關係為最終源骨骼的源節點與最終目標骨骼中映射的目標節點之間的變換關係;所述最終目標骨骼為目標對象的骨骼;所述將與所述初始源骨骼相關的第一動畫驅動資料遷移至所述最終目標骨骼上,得到所述最終目標骨骼的第二動畫驅動資料,包括: 基於所述目標對象中的幾何網格頂點的第一位置資訊、所述第一動畫驅動資料以及第一位姿變換關係,得到所述第二動畫驅動資料中關於所述幾何網格頂點的第二位置資訊。 According to the method described in claim 1 or 2, wherein the first animation driving data is based on the topology difference between the final source bone and the initial source bone, the original animation data of the initial source bone adjusted; and/or, The second animation driving data of the final target bone is obtained based on the first animation driving data and the first pose transformation relationship, wherein the first pose transformation relationship is the source node of the final source bone and the final target bone The transformation relationship between the target nodes mapped in; the final target bone is the bone of the target object; the first animation driving data related to the initial source bone is migrated to the final target bone to obtain the The second animation-driven data for the final target bone, including: Based on the first position information of the geometric mesh vertex in the target object, the first animation driving data and the first pose transformation relationship, obtain the second animation driving data about the geometric mesh vertex. 2. location information. 根據請求項10所述的方法,其中,所述基於所述目標對象中的幾何網格頂點的第一位置資訊、所述第一動畫驅動資料以及第一位姿變換關係,得到所述第二動畫驅動資料中關於所述幾何網格頂點的第二位置資訊,包括: 獲取與所述幾何網格頂點距離滿足預設條件的至少一個目標節點作為參考節點,並獲得所述參考節點的影響權重; 基於所述第一動畫驅動資料中關於所述參考節點的第四位姿變換關係和所述參考節點對應的第一位姿變換關係,得到所述參考節點對應的第五位姿變換關係;以及 利用所述第一位置資訊、各所述參考節點對應的第五位姿變換關係和所述影響權重,得到所述幾何網格頂點的第二位置資訊。 According to the method described in claim 10, wherein, the second is obtained based on the first position information of the geometric mesh vertices in the target object, the first animation driving data and the first pose transformation relationship. The second position information about the geometric mesh vertices in the animation driving data includes: Obtaining at least one target node whose distance from the vertex of the geometric grid satisfies a preset condition as a reference node, and obtaining the influence weight of the reference node; Obtaining a fifth pose transformation relation corresponding to the reference node based on the fourth pose transformation relation about the reference node in the first animation driving data and the first pose transformation relation corresponding to the reference node; and Using the first position information, the fifth pose transformation relationship corresponding to each of the reference nodes, and the influence weights, the second position information of the vertices of the geometric mesh is obtained. 根據請求項1或2所述的方法,其中,所述獲取初始源骨骼,包括: 對包含目標對象的圖像進行分類,得到所述目標對象的類別,並選擇與所述類別匹配的骨骼模型作為所述初始源骨骼,其中,所述最終目標骨骼為目標對象的骨骼;和/或, 所述獲取初始目標骨骼,包括: 對包含目標對象的圖像進行輪廓提取,得到所述目標對象的輪廓; 利用所述輪廓,為所述目標對象生成三維網格模型; 從所述三維網格模型中提取得到所述初始目標骨骼。 According to the method described in claim item 1 or 2, wherein said obtaining the initial source skeleton includes: Classifying the image containing the target object to obtain the category of the target object, and selecting a bone model matching the category as the initial source bone, wherein the final target bone is the bone of the target object; and/ or, The acquisition of the initial target bone includes: performing contour extraction on the image containing the target object to obtain the contour of the target object; generating a three-dimensional mesh model for the target object using the outline; The initial target bone is extracted from the three-dimensional mesh model. 一種電子設備,包括記憶體和處理器,所述處理器用於執行所述記憶體中儲存的程式指令,以實現請求項1至12任一項所述的方法。An electronic device, comprising a memory and a processor, the processor is configured to execute program instructions stored in the memory, so as to implement the method described in any one of claims 1 to 12. 一種電腦可讀儲存介質,其上儲存有程式指令,所述程式指令被處理器執行時實現請求項1至12任一項所述的方法。A computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the method described in any one of claims 1 to 12 is realized.
TW110146183A 2021-05-19 2021-12-09 Animation migration method and equipment and computer-readable storage medium TWI795116B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110547693.6 2021-05-19
CN202110547693.6A CN113313794B (en) 2021-05-19 2021-05-19 Animation migration method and device, equipment and storage medium

Publications (2)

Publication Number Publication Date
TW202247104A true TW202247104A (en) 2022-12-01
TWI795116B TWI795116B (en) 2023-03-01

Family

ID=77373759

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110146183A TWI795116B (en) 2021-05-19 2021-12-09 Animation migration method and equipment and computer-readable storage medium

Country Status (5)

Country Link
JP (1) JP2023540577A (en)
KR (1) KR20230035385A (en)
CN (1) CN113313794B (en)
TW (1) TWI795116B (en)
WO (1) WO2022242038A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113313794B (en) * 2021-05-19 2022-11-08 深圳市慧鲤科技有限公司 Animation migration method and device, equipment and storage medium
CN113727187B (en) * 2021-08-31 2022-10-11 平安科技(深圳)有限公司 Animation video processing method and device based on skeleton migration and related equipment
CN113744375A (en) * 2021-09-10 2021-12-03 北京爱奇艺科技有限公司 Data migration method and device, electronic equipment and readable storage medium
CN114225420A (en) * 2021-11-19 2022-03-25 达闼科技(北京)有限公司 Action data acquisition method, system, device, equipment and storage medium
CN116152404B (en) * 2023-04-19 2023-07-14 苏州浪潮智能科技有限公司 Animation redirection method, device, computer equipment and storage medium
CN116206026B (en) * 2023-05-06 2023-07-18 腾讯科技(深圳)有限公司 Track information processing method, track information processing device, computer equipment and readable storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI288893B (en) * 2005-12-23 2007-10-21 Inst Information Industry Method for generating animation pictures using vector graphs
US8564534B2 (en) * 2009-10-07 2013-10-22 Microsoft Corporation Human tracking system
US9196076B1 (en) * 2010-11-17 2015-11-24 David MacLeod Method for producing two-dimensional animated characters
CN103530897B (en) * 2013-09-30 2017-02-15 华为软件技术有限公司 Movement redirection processing method and device
CN104183000B (en) * 2014-08-14 2017-04-19 合肥工业大学 Full-automatic multi-source heterogeneous motion redirecting method of quasi-man character
KR101998059B1 (en) * 2017-08-31 2019-07-09 한국과학기술원 Motion retargeting method for character animation and apparatus thereof
CN109978975A (en) * 2019-03-12 2019-07-05 深圳市商汤科技有限公司 A kind of moving method and device, computer equipment of movement
CN111325819A (en) * 2020-02-17 2020-06-23 网易(杭州)网络有限公司 Motion data processing method, device, equipment and storage medium
CN111739132B (en) * 2020-07-02 2020-12-11 江苏原力数字科技股份有限公司 Whole body bone movement effect modification method based on local controller
CN111899317A (en) * 2020-08-07 2020-11-06 北京中科深智科技有限公司 Movement data redirection method based on neural network
CN112164129A (en) * 2020-09-02 2021-01-01 北京电影学院 No-pairing action migration method based on deep convolutional network
CN111968207B (en) * 2020-09-25 2021-10-29 魔珐(上海)信息科技有限公司 Animation generation method, device, system and storage medium
CN112560962B (en) * 2020-12-17 2024-03-22 咪咕文化科技有限公司 Gesture matching method and device for bone animation, electronic equipment and storage medium
CN112634419B (en) * 2020-12-31 2022-03-25 魔珐(上海)信息科技有限公司 Motion redirection method and device, electronic equipment and storage medium
CN112819971B (en) * 2021-01-26 2022-02-25 北京百度网讯科技有限公司 Method, device, equipment and medium for generating virtual image
CN113313794B (en) * 2021-05-19 2022-11-08 深圳市慧鲤科技有限公司 Animation migration method and device, equipment and storage medium

Also Published As

Publication number Publication date
TWI795116B (en) 2023-03-01
CN113313794B (en) 2022-11-08
WO2022242038A1 (en) 2022-11-24
KR20230035385A (en) 2023-03-13
JP2023540577A (en) 2023-09-25
CN113313794A (en) 2021-08-27

Similar Documents

Publication Publication Date Title
TWI795116B (en) Animation migration method and equipment and computer-readable storage medium
JP6745328B2 (en) Method and apparatus for recovering point cloud data
US11704802B2 (en) Multi-dimensional model merge for style transfer
WO2021057743A1 (en) Map fusion method, apparatus, device and storage medium
WO2021057745A1 (en) Map fusion method and apparatus, device and storage medium
CN108122277B (en) Modeling method and device
CN112819971B (en) Method, device, equipment and medium for generating virtual image
WO2022001222A1 (en) Three-dimensional model generation method, neural network generation method, and devices
EP1560163B1 (en) Wrap deformation using subdivision surfaces
CN111127649B (en) Method and device for constructing three-dimensional block model and server
RU2701710C1 (en) Data processing system and method
TWI778895B (en) Saliency detection method and model training method, equipment and computer readable storage medium
GB2566443A (en) Cross-source point cloud registration
Stekovic et al. General 3d room layout from a single view by render-and-compare
US11605200B2 (en) System for optimizing a 3D mesh
CN115330979A (en) Expression migration method and device, electronic equipment and storage medium
Sun et al. Sequential fusion of multi-view video frames for 3D scene generation
CN113592987A (en) Skeleton mapping method and device, equipment and storage medium
US20230154102A1 (en) Representing 3d shapes with probabilistic directed distance fields
Kunert et al. Neural network adaption for depth sensor replication
JP6482620B1 (en) Method and program for generating an image obtained by interpolating a plurality of images
CN107103642B (en) Three-dimensional model voxelization entity filling method
Ma et al. Research and application of personalized human body simplification and fusion method
CN116740300B (en) Multi-mode-based prime body and texture fusion furniture model reconstruction method
CN118149840B (en) Lane line generation method, lane line generation device, electronic device, storage medium and program product