GithubHelp home page GithubHelp logo

yuanyuan2222 / py-c3d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from embodiedcognition/py-c3d

0.0 0.0 0.0 114 KB

Read & write C3D mocap files

Home Page: http://c3d.rtfd.org

License: MIT License

Python 100.00%

py-c3d's Introduction

py-c3d

This is a small library for reading and writing C3D binary files. C3D files are a standard format for recording 3-dimensional time sequence data, especially data recorded by a 3D motion tracking apparatus.

Installing

Install with pip:

pip install c3d

Or if you'd like to use the bleeding-edge version, just clone the github repository and build and install using the normal Python setup process:

git clone https://github.com/EmbodiedCognition/py-c3d
cd py-c3d
python setup.py install

Usage

Tools

This package includes a script for converting C3D motion data to CSV format (c3d2csv) and an OpenGL-based visualization tool for observing the motion described by a C3D file (c3d-viewer).

Library

To use the C3D library, just import the package and create a Reader or Writer depending on your intended usage

import c3d

with open('data.c3d', 'rb') as handle:
    reader = c3d.Reader(handle)
    for i, (points, analog) in enumerate(reader.read_frames()):
        print('Frame {}: {}'.format(i, points.round(2)))

You can also get and set metadata fields using the library; see the package documentation for more details.

Caveats

This library is minimally effective, in the sense that the only motion tracking system I have access to (for testing) is a Phasespace system. If you try out the library and find that it doesn't work with your motion tracking system, let me know. Pull requests are also welcome!

Also, if you're looking for more functionality than just reading and writing C3D files, there are a lot of better toolkits out there that support a lot more file formats and provide more functionality, perhaps at the cost of increased complexity. The biomechanical toolkit is a good package for analyzing motion data.

py-c3d's People

Contributors

lmjohns3 avatar rvdijk avatar akuederle avatar felixchenier avatar boyle avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.