meshonline / kinect-openni-bvh-saver

This project is based on OpenNI2, NITE2, and OpenCV2, it will automatically save many skeleton animation clips to bvh files.
MIT License
206 stars 57 forks source link

Question about the initial pose #5

Closed wkindling closed 5 years ago

wkindling commented 5 years ago

Hi! Recently I have done some work about transforming Kinect move data into bvh file format. Because I am using Kinect Version 2, it is a pity that your project cannot work for me:( I have studied your code and feel confused about your implementation. It is known that the initial pose of the skeleton will have great influence on animation effect. Which means we cannot decide the initial pose by ourselves. I tried to reconstruct the initial pose from the moving data, but the results vary from one experiment to another, and they don't make sense. However, in your project, the initial pose is fixed. So I wonder why your code can solve this problem. Is it caused by the difference between Kinect v2 and Kinect v1.8? Thx~

meshonline commented 5 years ago

Hello Jiahao,

The fixed skeleton works, because I use only rotation data to drive the bones, it is a pure rotation skeleton, we just need to obtain relative rotation information between bones.

Kinect Version 2 should work, but I cannot test it, for I have only three Kinect 1 devices, if you can get positions of all the joints, the algorithm can calculate rotation information from scratch.

Kind Regards,

在 2019年5月14日,上午11:07,Jiahao notifications@github.com 写道:

Hi! Recently I have done some work about transforming Kinect move data into bvh file format. Because I am using Kinect Version 2, it is a pity that your project cannot work for me:( I have studied your code and feel confused about your implementation. It is known that the initial pose of the skeleton will have great influence on animation effect. Which means we cannot decide the initial pose by ourselves. I tried to reconstruct the initial pose from the moving data, but the results vary from one experiment to another, and they don't make sense. However, in your project, the initial pose is fixed. So I wonder why your code can solve this problem. Is it caused by the difference between Kinect v2 and Kinect v1.8? Thx~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/meshonline/kinect-openni-bvh-saver/issues/5?email_source=notifications&email_token=ADJTTQ6HRSVRUKYZGI5FALTPVIUG7A5CNFSM4HMVAOZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GTSE3UA, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJTTQ2EKIXBAPXSZOSNKU3PVIUG7ANCNFSM4HMVAOZQ.

meshonline commented 5 years ago

The algorithm assumes ’T’ pose, you can find it from the code.

在 2019年5月14日,下午4:59,Art Golf artgolf1000@gmail.com 写道:

Hello Jiahao,

The fixed skeleton works, because I use only rotation data to drive the bones, it is a pure rotation skeleton, we just need to obtain relative rotation information between bones.

Kinect Version 2 should work, but I cannot test it, for I have only three Kinect 1 devices, if you can get positions of all the joints, the algorithm can calculate rotation information from scratch.

Kind Regards,

在 2019年5月14日,上午11:07,Jiahao <notifications@github.com mailto:notifications@github.com> 写道:

Hi! Recently I have done some work about transforming Kinect move data into bvh file format. Because I am using Kinect Version 2, it is a pity that your project cannot work for me:( I have studied your code and feel confused about your implementation. It is known that the initial pose of the skeleton will have great influence on animation effect. Which means we cannot decide the initial pose by ourselves. I tried to reconstruct the initial pose from the moving data, but the results vary from one experiment to another, and they don't make sense. However, in your project, the initial pose is fixed. So I wonder why your code can solve this problem. Is it caused by the difference between Kinect v2 and Kinect v1.8? Thx~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/meshonline/kinect-openni-bvh-saver/issues/5?email_source=notifications&email_token=ADJTTQ6HRSVRUKYZGI5FALTPVIUG7A5CNFSM4HMVAOZ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GTSE3UA, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJTTQ2EKIXBAPXSZOSNKU3PVIUG7ANCNFSM4HMVAOZQ.

wkindling commented 5 years ago

Thanks very much for your reply! So do you mean that the initial pose of the skeleton in Kinect is a 'T' pose? (In fact I have looked up quantities of documents but none of them clarify this point.) Some documents say that Kinect assumes all the bones initially point straight upward.

I know bvh file uses the relative rotation data to drive the bones, but the rotation data only match with the initial pose. (If the hierarchy part is changed, the animation will make an error.) So can I assume that if I set the initial pose to an 'A' pose or other forms, the animation will go wrong?

meshonline commented 5 years ago

Hi,

The function of mat3_rotation_z() implements ’T’ pose, for example, in line 543 of kinectbvh.h, I use:

mat3_rotation_z(kPiDiv2)

To make a bend from up direction to left direction, rotate 90 degrees counterclockwise, thus make ’T’ pose of the left side, if you want to make ‘A’ pose, you can use a greater angle instead kPiDiv2(90 degrees), such as kPiDiv2 * 160.0 / 90.0, which is 160 degrees.

Kinect does not have any default poses, we can define our own bind pose, I just hard coded the ’T’ pose for convenience.

Regards,

Art

在 2019年5月14日,下午5:23,Jiahao notifications@github.com 写道:

Thanks very much for your reply! So do you mean that the initial pose of the skeleton in Kinect is a 'T' pose? (In fact I have looked up quantities of documents but none of them clarify this point.) Some documents say that Kinect assumes all the bones initially point straight upward.

I know bvh file uses the relative rotation data to drive the bones, but the rotation data only match with the initial pose. (If the hierarchy part is changed, the animation will make an error.) So can I assume that if I set the initial pose to an 'A' pose or other forms, the animation will go wrong?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/meshonline/kinect-openni-bvh-saver/issues/5?email_source=notifications&email_token=ADJTTQZG775L2ZFYP6ISZADPVKAJLA5CNFSM4HMVAOZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVK4FIY#issuecomment-492159651, or mute the thread https://github.com/notifications/unsubscribe-auth/ADJTTQ35WYI3VS7COFQ5G3DPVKAJLANCNFSM4HMVAOZQ.

wkindling commented 5 years ago

I really appreciate your specific explanation. After reading the source code again, I think I indeed misunderstand something. In your project, the rotation information is calculated by your own according to the given 'T' pose, while I would have thought to get the rotation information directly through using Kinect's structure _jointOrientation. So I wrongly concentrate on looking for the initial pose for the _jointOrientation. Thanks again for your time and consideration. Have a nice day!