File Exchange

image thumbnail


version (166 KB) by Omid Heidari
A toolbox to visualize, select and compare the data captured by motion capture cameras.


Updated 12 Apr 2017

View License

This tool box is specifically created for Robot Kinematics and Synthesis but can be used only for visualization purpose as well. First the motions of the human body parts are captured using markers on the skin and cameras like Bonita. These whole process can be done by Vicon Systems, for example. The output will be an excel file (csv) giving the coordinates of the markers. But what is important in Kinematics is orientation too. So by making an L-frame and putting three markers on it we can find the orientation of any rigid body. This toolbox uses the data of each three markers on each L-frame to make the orientation of the desired rigid body and make 4*4 transformation homogeneous matrices. Then it plots all these matrices for all the markers having data in csv file. The user can choose the color and size of the frames. Also if the user does not want the toolbox to plot any of the markers, just its box should be unchecked. The range of the plotted data can be specified too. Accordingly the slider bar changes and the user can see the whole motion or part of it by sliding the slider.
There are three sliders in the toolbox which basically do the same thing. However, the second section is for selecting the specific range of frames. It enables the user to visualize and compare the selected frames with whole motion. The last section is for the solution after doing the synthesis. The user can compare the calculated frames with the selected ones and also with whole motion.
There are two test files (test1.csv and test2.csv). The input section of MCD.m file should be changed according to the csv file and the rest of the file should remained unchanged.
The csv file must only contain numbers (no letters). The number of rows are equal to the number of frames captured by cameras and the columns contain x, y and z of each marker. Then the number of columns is equal to the number of markers multiplied by 3.
To run the toolbox, you need only run MCD.m file. The toolbox is able to plot the frames in different coordinates meaning that all the homogeneous matrices can be expressed in whatever base the user wants. Running MCD.m gives the information about the number of the final markers (each single marker is considered as one final marker and each three markers placed on L-frame is considered as one final marker as well ). Then a question should be answered. The user should define which marker is going to be the base. The numbers of the final markers define the base. If the user want to see the frames relative and expressed in camera frame then 0 is the answer.

The first part of MCD.m is for inserting the inputs. This is the only section that the user should edit based on the data.
- The name and path of the csv file.
- The names of the markers
- The order (number) of the markers
The other parts of the file and all other file should be untouched.

The following video is a demo of what the toolbox is capable of:

Cite As

Omid Heidari (2021). Mocap_toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (1)

Joko Triloka

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!