Closed chuangyu-robotics closed 3 years ago
Moving the hip position to the zero point affects all the other joints since the hip is the root joint. You would play two BVH files with and without a root transformation, then you will see the differences visually.
yes, I have played with and without it. I think for all the joints, their (x,y,z) should minus hip (x,y,z) during root transformation. but when I do minus operation between M1 "joints matrix with out root transformation" and M2 "joints position matrix with it", namely M1-M2. if i am right, they should be same difference △x, △y, △z and they should the differnece △x, △y, △z =hip (x,y,z). but they are not same. is it right?
thank you very much~
Now I understood the issue. And it's weird as you said. Could you send two BVH files you are testing? I would look into that.
if you have the original Trinity Speech-Gesture Dataset: "NaturalTalking_01.bvh" in folder "BVH_from_clap".
Thank you~
Sorry for the delayed response. I've compared processed BVH files with and without hip_centric, and those were looking fine to me. Two motions below were exactly same except the root position.
This is my script to generate processed BVH files. You would run with and without RootTransformer('hip_centric') in data_pipe. And I imported two processed BVH files in Blender and compared them.
from sklearn.pipeline import Pipeline
from pymo.parsers import BVHParser
from pymo.preprocessing import DownSampler, RootTransformer
from pymo.writers import BVHWriter
bvh_path = 'DB/Motion/Recording_001.bvh'
out_path = 'DB/temp/Recording_001_without_hip_centric.bvh'
p = BVHParser()
data_all = list()
data_all.append(p.parse(bvh_path))
data_pipe = Pipeline([
('dwnsampl', DownSampler(tgt_fps=20, keep_all=False)),
# ('root', RootTransformer('hip_centric')),
])
out_data = data_pipe.fit_transform(data_all)[0]
out_data.values = out_data.values[:1200]
writer = BVHWriter()
with open(out_path, 'w') as f:
writer.write(out_data, f)
Tks for the kind answer.
what is the visualization tool? the yellow one is without hip_centric? the other one is with hip_centric?
looks like they changed the face direction of the skeleton?
tks.
It's Blender. You can import BVH files. The highlighted one (yellow) is without hip_centric. And you're right, the root transformation changes both position and rotation.
this way. I feel at ease.
Thanks for your kind answer~
Good luck with your research~
I compared the pipeline of processing BVH with and without ('root', RootTransformer('hip_centric')).
and useuse the minus operation on two of them:
(1) 1st frame: out_data[0,0,:] - out_data_no_hip_centerlize[0,0,:]
[ -8.70151 -92.36 22.8466 -10.39751256 -91.92271148 17.93777897 -9.9069114 -92.01331065 18.83401856 -8.85100984 -92.27675895 21.76176833 -7.41557735 -92.6173533 25.48583606 -7.21810007 -93.1461758 33.03037571 -7.20744117 -93.44068702 37.31824573 -7.11192502 -93.68603708 40.81519583 -7.50652435 -93.56490843 39.39021581 -41.48320158 -90.6755312 26.71166777 -59.24560098 -88.82517754 15.12506976 -65.7639758 -89.55378643 31.41154973 -7.50652435 -93.56490843 39.39021581 27.106017 -94.99550065 30.23240403 38.51608676 -95.07362667 21.47251716 34.77629702 -96.09374976 39.60158339]
(2) 2nd frame: out_data[0,1,:] - out_data_no_hip_centerlize[0,1,:]
[ -8.7089 -92.3608 22.8468 -10.40049018 -91.9227756 17.93282527 -9.90991655 -92.01329658 18.82668927 -8.8534612 -92.27710578 21.75373938 -7.41920296 -92.61791248 25.4751766 -7.22715858 -93.14742825 33.01414725 -7.21539753 -93.44282783 37.30217912 -7.11850819 -93.68885993 40.79844885 -7.51008948 -93.56788589 39.37607352 -41.49073148 -90.68246661 26.70952861 -59.2436811 -88.83288051 15.11401733 -65.75475154 -89.56565497 31.39371763 -7.51008948 -93.56788589 39.37607352 27.10272821 -94.9907481 30.2164225 38.50972614 -95.06565673 21.4647733 34.77442387 -96.09076935 39.6032621 ]
they are similar but different. So I wonder what is the function of the RootTransformer('hip_centric'). how it works?
I see the code of pymo preprocesssing.py. it looks like only make the hip_x=0 hip_y=0 hip_z=0, but the result did not look like what I thought. why?
Thanks in advance.