Mienmarken von Medienpipe zu BVHPython

Python-Programme
Anonymous
 Mienmarken von Medienpipe zu BVH

Post by Anonymous »

Ich mache ein Projekt über das Übertragen des Bildes von der Kamera auf Animation. Ich möchte die Body Pose -Bewegungen, die ich mit MediaPipe auf die Mixerumgebung entdeckt habe, als Animation übertragen. Ich werde diese Übertragung im BVH -Format durchführen. Aber wie berechnet ich die Rotationsrotationen der gewünschten Verbindungen im BVH -Dateiformat? Mit MediaPipe kann ich nur die X-, Y- und Z -Koordinaten der Gelenke sehen. Kann jemand, der Informationen zu diesem Thema hat, h e l f e n ? < / P > < b r / > < c o d e > h i e r a r c h y < b r / > R O O T h i p < b r / > { < b r / > O F F S E T 0 . 0 0 0 0 0 0 2 . 0 9 3 3 8 9 0 . 0 0 0 0 0 0 < b r / > C H A N N E L S 6 X p o s i t i o n Y p o s i t i o n Z p o s i t i o n Z r o t a t i o n Y r o t a t i o n X r o t a t i o n < b r / > J O I N T s p i n e 1 < b r / > { < b r / > O F F S E T 0 . 0 0 0 0 0 0 0 . 2 2 1 8 1 2 0 . 0 5 5 6 5 1 < b r / > C H A N N E L S 6 X p o s i t i o n Y p o s i t i o n Z p o s i t i o n Z r o t a t i o n Y r o t a t i o n X r o t a t i o n < b r / > J O I N T s p i n e 2 < b r / > { < b r / > O F F S E T 0 . 0 0 0 0 0 0 0 . 2 5 9 1 6 6 0 . 0 1 0 8 5 9 < b r / > C H A N N E L S 3 Z r o t a t i o n X r o t a t i o n Y r o t a t i o n
JOINT spine3
{
OFFSET 0.000000 0.259166 0.006787
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT shoulder.L
{
OFFSET 0.144217 0.158309 0.020963
CHANNELS 6 Xposition Yposition Zposition Zrotation Yrotation Xrotation
JOINT upperarm.L
{
OFFSET 0.233226 -0.001289 0.020344
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT lowerarm.L
{
OFFSET 0.569278 0.000000 0.028651
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT hand.L
{
OFFSET 0.530662 0.000000 -0.028651
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET 0.183393 0.000000 0.000000
}
}
}
}
}
JOINT neck
{
OFFSET 0.000000 0.259166 -0.017645
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT head
{
OFFSET 0.000000 0.206271 -0.095711
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET 0.000000 0.475892 -0.060541
}
}
}
JOINT shoulder.R
{
OFFSET -0.144217 0.158309 0.020963
CHANNELS 6 Xposition Yposition Zposition Zrotation Yrotation Xrotation
JOINT upperarm.R
{
OFFSET -0.233226 -0.001289 0.020344
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT lowerarm.R
{
OFFSET -0.569278 0.000000 0.028651
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT hand.R
{
OFFSET -0.530662 0.000000 -0.028651
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET -0.183393 0.000000 0.000000
}
}
}
}
}
}
}
}
JOINT thigh.L
{
OFFSET 0.206315 -0.157451 0.040530
CHANNELS 6 Xposition Yposition Zposition Zrotation Yrotation Xrotation
JOINT shin.L
{
OFFSET 0.000000 -0.928808 -0.019702
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT foot.L
{
OFFSET 0.000000 -0.805280 0.036120
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT toe.L
{
OFFSET 0.037360 -0.175911 -0.243095
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET 0.031738 0.000000 -0.206517
}
}
}
}
}
JOINT thigh.R
{
OFFSET -0.206315 -0.157451 0.040530
CHANNELS 6 Xposition Yposition Zposition Zrotation Yrotation Xrotation
JOINT shin.R
{
OFFSET 0.000000 -0.928808 -0.019702
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT foot.R
{
OFFSET 0.000000 -0.805280 0.036120
CHANNELS 3 Zrotation Xrotation Yrotation
JOINT toe.R
{
OFFSET -0.037360 -0.175911 -0.243095
CHANNELS 3 Zrotation Xrotation Yrotation
End Site
{
OFFSET -0.031738 0.000000 -0.206517
}
}
}
}
}
}
< /code>
#Die Code, die ich zur Berechnung der Rotation < /p>
verwendet

Code: Select all

  spine1_rotation = (hip_x + spine1_x , hip_y + spine1_y, hip_z + spine1_z)
spine2_rotation = (spine1_x + spine2_x, spine1_y + spine2_y, spine1_z + spine2_z)
spine3_rotation = (spine2_x + spine3_x, spine2_y + spine3_y, spine2_z + spine3_z)

shoulder_L_rotation = (spine3_x + shoulder_L.x , spine3_y + shoulder_L.y, spine3_z + shoulder_L.z)
upperarm_L_rotation = (shoulder_L.x + upperarm_L.x, shoulder_L.y + upperarm_L.y, shoulder_L.z + upperarm_L.z)
lowerarm_L_rotation = (upperarm_L.x + lowerarm_L.x , upperarm_L.y + lowerarm_L.y, upperarm_L.z + lowerarm_L.z)
hand_L_rotation = (lowerarm_L.x + hand_L.x , lowerarm_L.y + hand_L.y, lowerarm_L.z + hand_L.z)

Bei der Berechnung der Drehung der Gelenke, wie im BVH -Dateiformat zu sehen, habe ich die Koordinaten der miteinander verbundenen Gelenke hinzugefügt und das Skelett bewegte sich in keiner Weise.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post