Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ezc3d mocap writer and occluded points #227

Closed
nghorbani opened this issue Dec 10, 2021 · 12 comments
Closed

ezc3d mocap writer and occluded points #227

nghorbani opened this issue Dec 10, 2021 · 12 comments

Comments

@nghorbani
Copy link

Hi,
I am facing an issue with occluded points in the c3d writer. When a marker is occluded I the point value to nan and residual to -1. However, when I open the file in MOKKA the occluded marker's label is not greyed out during occlusion.

Furthermore, I can preproduce the issue by opening a c3d file using the ezc3d reader and writing it directly back using the writer. The newly written c3d file shows the same symptoms.
I would appreciate any help in this regard.

@pariterre
Copy link
Member

Hi @nghorbani !
I assume that MOKKA reads a special token that carries the information that the markers is occluded... Could you provide me with a C3D that behaves as you want? I will try to find where I lose this information.
You can send it to [email protected] :)

Thanks for pointing out this problem!

@nghorbani
Copy link
Author

nghorbani commented Dec 14, 2021

Thanks for your prompt reply!

I send it here for the sake of completeness:
RightTurn01.zip

I use the following code to create the mocap_rewrite.c3d from mocap.c3d:

def rewrite_test(mocap_fname):
    import ezc3d
    out_mocap_fname = mocap_fname.replace('.c3d', '_rewrite.c3d')
    mocap_a = ezc3d.c3d(mocap_fname)
    print(mocap_a.keys())
    mocap_a.write(out_mocap_fname)

Thanks!

@pariterre
Copy link
Member

Hi!
I had a look at your c3d file and found that unlike the standard suggest missing markers are not coded as -1 but as -16512. Mokka interpret this exact value as missing marker (instead of the standard -1). I have no clue why this value was chosen in the first place.

To improve compatibility to Mokka, I decided to align the exported C3D to this unusual choice. So #228 fix this issue as such.

This will be fix in the 1.4.7 release!

Thanks for pointing this weird fact :)

@nghorbani
Copy link
Author

Great! when is the release planned?
BW, I saw the same issue in Vicon Shogun as well.

@pariterre
Copy link
Member

Yes I noticed just after that I sent the message that Vicon had used the same weird convention... Whatever, once one is done, so the other :)
Just so you know though. I noticed that Qualisys does not set the values of the points when they are occluded. This means that the c3d contains part of the RAM as it was allocated. That actually threw me off guard thinking that they were actually storing information in the xyz position of occluded marker, because there were Python code at these places.
I ultimately understood that it was Python code that you had wrote for something else. I you have never done C or C++, this may sound gibberish to you.
A part of your RAM is stored in the C3D file created by Qualisys. Therefore I would refrain from giving any C3D file to anyone before they patch this as the RAM could actually contain sensitive information such as your name, password, any copy-pasted text or information from software you used before running Qualisys.
I will delete your C3D file so I do not keep any personal information from you :)

For the release, it should be today!

@nghorbani
Copy link
Author

Sounds scary! I am not using Qualisys on my side, so I am not sure how to avoid this in future. But thanks for pointing it out anyways.

@nghorbani
Copy link
Author

Dude, I am a huge fan of your release titles and comments! I actually just stop by to read them as a refresher! :D

@nghorbani
Copy link
Author

BTW, when release 1.4.7 (TheMagicNumber) will be available through anaconda?

@pariterre
Copy link
Member

Hahaha! Thanks 😂
I think you are the first to ever read the release notes 😁

I should be already there, but conda-forge has currently an issue.. I will ping you on the PR of conda-forge so you can follow the thread. I am waiting for an answer from the team. But if I were you, I would do compile it locally. If you don't know how, I did show it on YouTube on my channel (pariterre), so you are not dependent on conda team to get the release

@pariterre
Copy link
Member

The PR was accepted in conda-forge, but it always take 4 to 5 hours to be available in anaconda, so during the day!

@pariterre
Copy link
Member

@nghorbani
I contacted Qualisys to tell them about the issue, but they need a sample, can I share your c3d file to them?

@nghorbani
Copy link
Author

sure

@nghorbani nghorbani reopened this Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants