简体   繁体   中英

Visualize Moiton Capture data with Python

Hi I have motion capture data which is saved in.mat file format. I want to write code in python to visualise motion capture data with animation or the best way to visualise. I have saved struct in.mat file in to separate.csv files and I want to visualise these data. I am new to this area and are there any libraries /packages I can use? or what are the python functions to represent mocap data?

Action1.csv with 6 Markers

(Marker1_X, Marker1_Y,Marker1_Z,Marker2_X, Marker2_Y,Marker2_Z,Marker3_X, Marker3_Y,Marker3_Z,Marker4_X, Marker4_Y,Marker4_Z ,Marker5_X, Marker5_Y,Marker5_Z,Marker6_X, Marker6_Y,Marker6_Z )

Any help would be grateful

Thank You

I've had the same problem and thus developed the PyMoCapViewer: https://github.com/justamad/PyMoCapViewer

This tool allows you to render the 3D trajectories of markers using the VTK graphics framework. It accepts exactly the format that you have in your csv file. The input should be a Pandas DataFrame.

from PyMoCapViewer import MoCapViewer

import pandas as pd

df = pd.read_csv("file_to_vicon.csv")

render = MoCapViewer(sampling_frequency=100)
render.add_skeleton(df, skeleton_connection="vicon", color="gray")
render.show_window()

If you know the joint connections, you can even pass a list of tuples with joint names as skeleton_connection argument or use a pre-set of marker-setups. For now, it supports the Vicon Plugin-Gait model ("vicon"), Azure Kinect ("azure"), and Kinect V2 ("kinect_v2"). However, for this to work, your column names should have the following format: "<joint_name> (x)".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM