This is an elec onic ep in o he o iginal a icle.
This ep in may di e om he o iginal in pagina ion and ypog aphic de ail.
Au ho (s):
Ti le:
Yea :
Ve sion:
Please ci e he o iginal e sion:
All ma e ial supplied ia JYX is p o ec ed by copy igh and o he in ellec ual p ope y igh s, and
duplica ion o sale o all o pa o any o he eposi o y collec ions is no pe mi ed, excep ha
ma e ial may be duplica ed by you o you esea ch use o educa ional pu poses in elec onic o
p in o m. You mus ob ain pe mission o any o he use. Elec onic o p in copies may no be
o e ed, whe he o sale o o he wise o anyone who is no an au ho ised use .
MoCap Toolbox - A Ma lab oolbox o compu a ional analysis o mo emen da a
Bu ge , Bi gi a; Toi iainen, Pe i
Bu ge , B., & Toi iainen, P. (2013). MoCap Toolbox - A Ma lab oolbox o
compu a ional analysis o mo emen da a. In R. B esin (Ed.), P oceedings o he
Sound and Music Compu ing Con e ence 2013, SMC 2013, Logos Ve lag Be lin,
S ockholm, Sweden (pp. 172-178). Logos Ve lag Be lin. P oceedings o he Sound and
Music Compu ing Con e ences.
h p://smcne wo k.o g/sys em/ iles/MOCAP%20TOOLBOX%20%E2%80%93%20A%2
0MATLAB%20TOOLBOX%20FOR%20COMPUTATIONAL%20ANALYSIS%20OF%20MOV
EMENT%20DATA.pd
2013
MOCAP TOOLBOX – A MATLAB TOOLBOX FOR
COMPUTATIONAL ANALYSIS OF MOVEMENT
DATA
Bi gi a Bu ge
Pe i Toi iainen
Finnish Cen e o Excellence in In e disciplina y Music Resea ch, Depa men o Music,
Uni e si y o Jy äskylä, Jy äskylä, Finland
[email p o ec ed] [email p o ec ed]
ABSTRACT
The MoCap Toolbox is a se o unc ions w i en in
Ma lab o analyzing and isualizing mo ion cap u e da a.
I is aimed a in es iga ing music- ela ed mo emen , bu
can be bene icial o o he esea ch a eas as well. Since
he oolbox code is a ailable as open sou ce, use s can
eely adap he unc ions acco ding o hei needs. Use s
can also make use o he addi ional unc ionali y ha
Ma lab o e s, such as o he oolboxes, o u he analyze
he ea u es ex ac ed wi h he MoCap Toolbox wi hin he
same en i onmen . This pape desc ibes he s uc u e o
he oolbox and i s da a ep esen a ions, and gi es an in-
oduc ion o he use o he oolbox o esea ch and anal-
ysis pu poses. The examples co e basic isualiza ion
and analysis app oaches, such as gene al da a handling,
c ea ing s ick- igu e images and anima ions, kinema ic
and kine ic analysis, and pe o ming P incipal Compo-
nen Analysis (PCA) on mo emen da a, om which a
complexi y- ela ed mo emen ea u e is de i ed.
1. MOTIVATION AND OVERVIEW
The MoCap Toolbox is a Ma lab1 oolbox dedica ed o he
analysis and isualiza ion o mo ion cap u e (MoCap)
da a. I has been de eloped o he analysis o music-
ela ed mo emen , bu is po en ially use ul in o he a eas
o s udies as well. I is open sou ce, dis ibu ed unde
GPL license, and eely a ailable o download a :
www.jyu. i/music/coe/ma e ials/mocap oolbox.
The MoCap Toolbox is mainly in ended o wo king
wi h eco dings made wi h an in a ed ma ke -based op-
ical mo ion cap u e sys em. Such mo ion cap u e sys ems
a e based on an ac i e sou ce emi ing pulses o in a ed
ligh a a e y high equency, which is e lec ed by
small, usually sphe ical ma ke s a ached o he acked
objec (e.g., a pa icipan dancing o playing an ins u-
men ). Wi h each came a cap u ing he posi ion o he
e lec i e ma ke s in wo-dimensional, a ne wo k o se -
e al came as can be used o ob ain posi ion da a in h ee
1 www.ma hwo ks.com
2 www.c-mo ion.com/p oduc s/ isual3d/
dimensions. Besides op ical mo ion cap u e, he MoCap
Toolbox can also be used o analyzing da a cap u ed
wi h o he acke echnologies, such as ine ial o mag-
ne ic acke s. Howe e , some ea u es o he oolbox will
be limi ed, since such acke s do no p oduce posi ion
da a, bu de i a i e da a, (e.g., accele a ion). Fu he -
mo e, he oolbox is op imized o he use o 3-
dimensional posi ion da a, so using da a wi h six deg ees
o eedom (posi ion and o a ion) migh equi e cus om-
ized adjus men s o unc ions.
The e a e p op ie a y (closed sou ce) so wa e solu ions
a ailable o mo ion cap u e analysis and isualiza ion,
such as Visual3D2 o Mo ionBuilde 3, and applica ions
ha a e p ima ily used o eco ding da a (such as Qual-
isys T ack Manage 4 o Vicon Nexus5). Howe e , such
applica ions a e usually ei he oo limi ed in hei unc-
ionali y, oo ocused on isualiza ion and/o oo es ic-
i e o adap o he needs o he esea che , such as de el-
oping new mo emen ea u es use ul o hei indi idual
esea ch ques ions. To o e come hese issues, we imple-
men ed his oolbox in Ma lab, a gene ic scien i ic com-
pu ing en i onmen , and made i a ailable o o he e-
sea che s o be used in a o o hei needs. The Mocap
Toolbox is no he only Ma lab oolbox a ailable o mo-
ion cap u e analysis; one o he oolbox wo h men ioning
is he oolbox c ea ed by Cha les Ve on [1]. This oolbox
is mo e limi ed han he MoCap Toolbox, bu o e s a
g aphical use in e ace (GUI).
Ma lab o e s p e-buil isualiza ion oppo uni ies and
gi es access o a la ge ange o o he unc ionali y. Some
unc ions included in he MoCap Toolbox use, o exam-
ple, he Signal P ocessing Toolbox p o ided by Ma h-
Wo ks, o he Fas ICA package6, a eely a ailable hi d-
pa y oolbox o Independen Componen Analysis. Fu -
he mo e, he use s hemsel es can make immedia e use
o he addi ional unc ionali y and oolboxes p o ided by
Ma lab, o example he S a is ics Toolbox, o u he
analyze ea u es ex ac ed wi h he MoCap Toolbox wi h-
ou he need o swi ch be ween di e en applica ions.
MoCap Toolbox code is w i en using he gene ic Ma lab
syn ax and is openly assessable, so use s can add and
adap unc ions o hei own needs.
2 www.c-mo ion.com/p oduc s/ isual3d/
3 www.au odesk.com/mo ionbuilde
4 www.qualisys.com/p oduc s/so wa e/q m/
5 www. icon.com/p oduc s/nexus.h ml
6 www.cis.hu . i/p ojec s/ica/ as ica/
Copy igh : © 2013 Bu ge e al. This is an open-access a icle dis ibu ed
unde he e ms o he C ea i e Commons A ibu ion License 3.0 Unpo -
ed, which pe mi s un es ic ed use, dis ibu ion, and ep oduc ion in any
medium, p o ided he o iginal au ho and sou ce a e c edi ed.
172
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
The MoCap Toolbox suppo s a ious mo ion cap u e
da a o ma s, in pa icula he .c3d7 ile o ma (which,
e.g., Vicon8 o Op iT ack9 op ical mo ion cap u e sys ems
can p oduce), he . s o ma and he .ma o ma , bo h
p oduced by he Qualisys mo ion cap u e sys em10, and
he .wii da a o ma p oduced by he WiiDa aCap u e
so wa e11.
The MoCap Toolbox p o ides 64 unc ions o analyz-
ing and isualizing mo ion cap u e da a. The main ca e-
go ies can be summa ized as da a inpu and edi unc-
ions, coo dina e ans o ma ion and coo dina e sys em
con e sion unc ions, kinema ic and kine ic analysis
unc ions, ime-se ies analysis unc ions, isualiza ion
unc ions, and p ojec ion unc ions. Fu he mo e, i uses
h ee di e en da a s uc u es, he MoCap da a s uc u e,
he no m da a s uc u e, and he segm da a s uc u e. To
con e be ween he di e en da a ep esen a ions and
enable ce ain isualiza ions, h ee di e en pa ame e
s uc u es a e used, he m2jpa , he j2spa , and he anim-
pa s uc u es. Bo h he da a and he pa ame e s uc u es
will be discussed and explained in he nex sec ion.
2. DATA REPRESENTATIONS
The MoCap Toolbox uses h ee di e en da a s uc u es,
he MoCap da a s uc u e, he no m da a s uc u e, and
he segm da a s uc u e. A MoCap da a s uc u e in-
s ance is c ea ed when mocap da a is ead om a ile o
he Ma lab wo kspace using he unc ion mc ead. A
MoCap da a s uc u e con ains he 3-dimensional loca-
ions o he ma ke s (in he .da a ield) as well as basic
in o ma ion, including he ype o s uc u e, he ile
name, numbe o ames o he eco ding, he numbe o
came as used o he eco ding, he numbe o ma ke s in
he da a, he ame a e, he names o he ma ke s, and he
o de o ime di e en ia ion o he da a. Addi ionally, he
MoCap da a s uc u e con ains ields o da a cap u ed
wi h analog da a, such as EMG. Finally, he ime s amp
o he eco ding and he da a ype (e.g., 3D) can be add-
ed.
A MoCap da a s uc u e ins ance is also c ea ed when
he unc ion mcm2j is used. This unc ion ans o ms a
ma ke ep esen a ion o a join ep esen a ion. These wo
ep esen a ions use he same da a s uc u e, al hough hey
a e concep ually di e en : he ma ke ep esen a ion e-
lec s he ac ual ma ke loca ions, whe eas he join ep-
esen a ion is ela ed o loca ions de i ed om ma ke
loca ions. A join can consis o one ma ke , bu i can
also be de i ed om mo e han one ma ke s. I can, o
example, be used o calcula ing he loca ion o a body
pa whe e i is impossible o a ach a ma ke . The mid-
poin o a join , o ins ance, can be hen de i ed as he
cen oid o ou ma ke s a ound he join .
The no m da a s uc u e, c ea ed by he unc ion
mcno m, is simila o he MoCap da a s uc u e, excep
ha i s .da a ield has only one column pe ma ke .
This column con ains he Euclidean no m o he ec o
7 www.c3d.o g
8 www. icon.com
9 www.na u alpoin .com/op i ack/
10 www.qualisys.com
11 www.jyu. i/music/coe/ma e ials/mocap oolbox
da a om which i was de i ed. I , o ins ance, mcno m
is applied o eloci y da a, he esul ing no m da a s uc-
u e holds he magni udes o eloci ies, o speeds, o each
ma ke .
The hi d da a s uc u e, he segm da a s uc u e, is no ,
like he o he wo, ela ed o poin s in space (ma ke s o
join s), bu o segmen s o he body (see, e.g., [2]). The
unc ion mcj2s pe o ms a ans o ma ion om a join
ep esen a ion o a segmen ep esen a ion and p oduces
as ou pu a segm da a s uc u e ins ance. Mos ields o a
segm da a s uc u e a e simila o he ones o a MoCap
da a s uc u e, howe e , he .da a ield is eplaced by
ou o he ields. The .pa en ield con ains in o -
ma ion abou he kinema ic chains o he body, i.e., how
he join s a e connec ed o o m segmen s, and how seg-
men s a e connec ed o each o he . The ields
. oo ans and . oo o s o e he loca ion and
o ien a ion o he cen e o he body, he oo . The
.segm ield consis s o se e al sub ields ha s o e he
o ien a ion o he body segmen s in se e al ways. The
.eucl sub ield con ains o each segmen he Euclidean
ec o poin ing om he p oximal o he dis al join o he
segmen . The leng h o each segmen is s o ed in he .
sub ield. The .qua sub ield includes he o a ion o
each segmen as a qua e nion ep esen a ion (see, e.g., [3]
and [4]). Finally, he .angle sub ield con ains he an-
gles be ween each segmen and i s p oximal segmen .
To con e be ween he di e en ep esen a ions and o
enable ce ain isualiza ions, he MoCap Toolbox o e s
h ee di e en pa ame e s uc u es: m2jpa , j2spa , and
he animpa s uc u es.
The m2jpa s uc u e is used by he unc ion mcm2j
and con ains he in o ma ion needed o pe o m he ans-
o ma ion om ma ke o join ep esen a ion. Besides
ields holding he numbe o join s and he names o he
join s, i includes a ield wi h he numbe s o he ma ke s
de ining he loca ion o each join .
The j2spa s uc u e is used by he unc ion mcj2s and
con ains he in o ma ion needed o pe o m he ans o -
ma ion om join o segmen ep esen a ion. Besides he
ields con aining he segmen names and he numbe o
he oo (cen e o he body) join , i includes ields wi h
he numbe s o he h ee join s ha de ine he on al
plane o he body and a ec o indica ing he numbe o
he pa en segmen ( he segmen ha is p oximal in he
kinema ic chain) o each segmen .
The animpa s uc u e is used by he unc ions
mcplo ame and mcanima e and con ains he in-
o ma ion needed o c ea e ame (s ick igu e) plo s and
anima ions. The s uc u e includes ields o he sc een
size, limi s o he plo ed a ea, iewing angles, ma ke
sizes, plo ing colo s, connec ion line con igu a ions and
wid hs, and plo ing o ma ke and ame numbe s. Addi-
ionally, he s uc u e con ains ields ela ed o c ea ing
anima ions, such as he ames pe second, a subs uc u e
o pe spec i e p ojec ion pa ame e s, and se ings o
plo ing ma ke aces.
173
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
3. USING THE TOOLBOX
In wha ollows, we will gi e an in oduc ion o he use o
he oolbox o esea ch and analysis pu poses.
The MoCap Toolbox manual, p o ided wi h he down-
load o he oolbox, o e s an example chap e wi h ele -
en demos explaining he basic usage o he oolbox. Ad-
di ionally, a demo da a se called mcdemoda a, includ-
ing mo ion cap u e da a and associa ed pa ame e s uc-
u es, is p o ided wi h he download. The MoCap da a
s uc u es dance1 and dance2 used below a e a aila-
ble in he mcdemoda a da a se .
3.1 Reading Da a and Filling Gaps
Reco ded mo ion cap u e iles can be impo ed in o
Ma lab using he unc ion mc ead s o ing he con en o
he ile as a MoCap da a s uc u e, i.e.,
d = mc ead(' ile. s ');
An essen ially use ul i s s ep is usually o check o
missing ames in he eco ding. Taking he mocap da a
s uc u e d, we can use
mcmissing(d)
o de ec missing ames in he eco ding. In case o
missing da a, we can ill hem using linea in e pola ion
wi h he unc ion mc illgaps:
d = mc illgaps(d);
F om his poin onwa ds, we will use he wo MoCap
da a s uc u es dance1 and dance2 om he
mcdemoda a. Since hey a e al eady a ailable as
MoCap da a s uc u es and do no con ain missing da a,
bo h impo ing and gap illing a e no equi ed anymo e.
3.2 Visualizing and Anima ing Da a
A good app oach o ge an o e iew o he da a is o is-
ualize and anima e da a. Using he MoCap Toolbox,
mocap da a can be plo ed in di e en wo ways: as a
ime se ies o as single ames. As a unc ion o ime,
ma ke loca ion da a can be plo ed wi h he unc ion
mcplo imese ies, e.g.,
mcplo imese ies(dance1,[1 20 28],
'dim',3)
which plo s he hi d/ e ical dimension o ma ke s 1,
20, and 28 (le on head, igh hand, and igh oo ) (see
Fig. 1).
Ma ke loca ions as single ames can be plo ed using
he unc ion mcplo ame (using he (x,y) p ojec ion
o he ma ke s):
mcplo ame(dance1,450);
Figu e 1. Ma ke loca ion da a plo ed as unc ion
o ime using mcplo imese ies.
This call, plo ing he 450 h ame o he eco ding (see
Fig 2a), uses he de aul anima ion pa ame e s uc u e.
Howe e , i a cus omized animpa s uc u e is used, we
can, o ins ance, se he connec ion lines be ween he
ma ke s o ob ain a isualiza ion ha is easie o unde -
s and and ha looks mo e human-like (see Fig. 2b):
ap = mcini animpa ;
ap.conn = [1 2; 2 4; 3 4; 3 1; 5 6; 9
10; 10 12; 11 12; 11 9; 8 9; 8 10; 8
5; 8 6; 5 9; 5 11; 6 10; 6 12; 7 11;
7 12; 7 5; 7 6; 5 13; 13 15; 13 16;
16 19; 15 19; 6 14; 14 17; 14 18; 17
20; 18 20; 9 21; 11 21; 10 22; 12 22;
21 23; 23 25; 23 26; 25 26; 22 24; 24
27; 24 28; 27 28];
mcplo ame(dance1,450,ap);
In case use s collec ed he da a wi h a Qualisys mo ion
cap u e sys em and c ea ed a bone s uc u e du ing he
labeling p ocess in he Qualisys so wa e, hey can expo
he so-called label lis (which con ains he ma ke con-
nec ions) and use his ile o c ea e he connec ion ma ix
by employing he unc ion mcc ea econnma ix.
We can change he gene al colo scheme and he colo s
o indi idual ma ke s, connec o lines, aces, and num-
be s by adjus ing he alues o he espec i e ields o he
animpa s uc u e, o example (see Fig. 2c):
ap.colo s = 'w bgy';
ap.ma ke colo s = 'bmgy kk';
mcplo ame(dance1,450,ap);
Figu e 2. Ma ke loca ion da a plo ed as ame
using mcplo ame: a) using he de aul pa-
ame e s; b) using a connec ion ma ix; c) chang-
ing colo s; d) join ans o ma ion.
174
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
The unc ion mcanima e is used o c ea e anima ions:
mcanima e(dance1,an);
The MoCap Toolbox p oduces he single anima ion
ames as .png iles. They ha e o be compiled in o a
mo ie using o he so wa e, such as QuickTime P o on
Mac, o Mo ieMake on Windows.
Anima ions can be c ea ed as 2D p ojec ions in wo
ways, ei he o hog aphic (de aul ) o pe spec i e, he
la e one by including he pe spec i e p ojec ion pa ame-
e :
mcanima e(dance1,an,1);
3.3 Kinema ic Analysis
Kinema ic a iables, such as eloci y and accele a ion,
a e es ima ed using he ime-de i a i e unc ion
mc imede :
d1 = mc imede (dance1,1); % el.
d2 = mc imede (dance2,1);
d1a = mc imede (dance1,2); %acc.
d2a = mc imede (dance2,2);
To analyze such ime se ies, we can calcula e hei
means and s anda d de ia ions using mcmean and
mcs d (igno ing e en ual missing ames). Fo his
sample analysis, we will ake he no m da a, ha is, he
magni udes o he 3-dimensional da a o eloci y and
accele a ion. To simpli y he app oach, we i s combine
he da a om ma ke 1 (le on head) o he ou
MoCap da a s uc u es using mcconca ena e:
d a = mcconca ena e(d1 ,1,d1a,1,d2 ,1,
d2a,1);
d a_mean = mcmean(mcno m(d a));
d a_s d = mcs d(mcno m(d a));
The esul s (see Table 1) show ha bo h mean and
s anda d de ia ion o eloci y and accele a ion o he le
on head ma ke a e highe o dance2 han o
dance1, so he dance in dance2 mo ed as e and a a
wide ange o speeds and also used mo e and la ge di-
ec ional changes.
mean
SD
eloci y
dance1
235.85
110.79
dance2
520.24
192.27
accele a ion
dance1
2233.66
1326.55
dance2
3347.21
1423.19
Table 1. Means and s anda d de ia ions o eloci-
y and accele a ion (magni udes) o he le on
head ma ke da a o dance1 and dance2.
The cumula i e dis ance a elled by a ma ke can be
calcula ed wi h he unc ion mccumdis ( e u ning a
no m da a s uc u e):
d1dis = mccumdis (dance1);
d2dis = mccumdis (dance2);
We use he Ma lab unc ion ba h o plo ing ma ke s
1 (le on head), 20 ( igh inge ), and 28 ( igh oo )
(see Fig. 3):
igu e, ba h([d1dis .da a(1500,[1 20
28]); d2dis .da a(1500,[1 20
28])],'b');
Figu e 3. Cumula ed dis ance a elled by ma k-
e s 1, 20, and 28 o mocap da a dance1 and
dance2 (labels and i le we e added sepa a ely).
We can see in Figu e 3 ha he h ee ma ke s, especial-
ly he igh hand ma ke , a elled mo e o dance2 han
o dance1, so we can assume ha he amoun o
mo emen was highe in dance2.
A measu e ela ed o he amoun o mo emen is he a -
ea co e ed by he mo emen , which can be calcula ed
using mcbound ec . I we wan o calcula e he bound-
ing ec angle o he ou hip ma ke s, we do:
b 1 = mean(mean(mcbound ec (dance1,[9
10 11 12])));
b 2 = mean(mean(mcbound ec (dance2,[9
10 11 12])));12
The bounding ec angle alue o dance1 equals .1806
and o dance2, i equals .9724. Since he alue o
dance2 is highe , dance2 no only had a highe
amoun o mo emen , bu also used mo e space han
dance1. The bounding ec angle measu e was ound o
be a ele an mo emen ea u e in [5] and [6].
We can also calcula e dis ances be ween ma ke s using
mcma ke dis . The s anda d de ia ion o he dis ance
be ween le and igh inge ,
md1 = s d(mcma ke dis (dance1,19,20));
md2 = s d(mcma ke dis (dance2,19,20));
gi es us in o ma ion abou he a iabili y o he ma ke
dis ance. The s anda d de ia ion o he inge ma ke
dis ance o dance1 equals 49.0 and o dance2
175.65, so he inge s in dance2 exhibi ed mo e a ia-
ble dis ances.
Pe iodici y o mo emen can be es ima ed using he
unc ion mcpe iod. I is based on au oco ela ion, and
12 mcbound ec uses window decomposi ion. The unc ion ou pu
he e is a e aged ac oss he windows and he ou ma ke s.
175
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
ei he he i s o highes peak o he au oco ela ion unc-
ion is aken as pe iodici y es ima ion dependen on he
pa ame e inpu . Wi h
d1m1 = mcge ma ke (d1a,20);
d2m1 = mcge ma ke (d2a,20);
[pe 1 ac1 eac1] = mcpe iod(d1m1,2,
'highes ');
[pe 2 ac2 eac2] = mcpe iod(d2m1,2,
'highes ');
we calcula e he pe iodici y o he accele a ion o he
igh inge ma ke . mcpe iod esul ed in a pe iodici y
es ima e o each dimension being [1.04, 0.53, 0.52] o
dance1 and [1.04, 1.01, 1.06] o dance2. While he
i s dimension is simila , he second and hi d dimen-
sions a e oughly hal o dance1, sugges ing ha in his
case he inge mo ed in double empo in y and z di ec-
ions.
A mo e accu a e pe iodici y analysis can be pe o med
using windowed au oco ela ion:
[pe 1 ac1 eac1] = mcwindow(@mcpe iod,
d1m1,2,0.25);
[pe 2 ac2 eac2] = mcwindow(@mcpe iod,
d2m1,2,0.25);
To allow isual inspec ion o he ime de elopmen o
he pe iodici y, he enhanced au oco ela ion (eac) ma ix
can be plo ed as an image (see Fig. 4). The colo s indi-
ca e he egula i y o pe iodic mo emen , wi h wa m col-
o s co esponding o egions o egula pe iodic mo e-
men in he pe iod- ime plane:
igu e, imagesc(eac1(:,:,3)), axis xy
se (gca, 'XTick',0:4:46, 'XTickLabel',
0.5*(0:4:46), 'YTick',[0 30 60 90
120], 'YTickLabel',[0 0.5 1 1.5 2.0])
igu e, imagesc(eac2(:,:,3)), axis xy
se (gca, 'XTick',0:4:46, 'XTickLabel',
0.5*(0:4:46), 'YTick',[0 30 60 90
120], 'YTickLabel',[0 0.5 1 1.5 2.0])
Figu e 4. Enhanced au oco ela ion unc ion o
he e ical componen s o he igh inge accel-
e a ion in dance1 and dance2.
We can see in Figu e 4 ha he e ical componen o
he igh inge accele a ion o dance1 shows qui e clea
pe iodic mo emen wi h a pe iod o abou 500 millisec-
onds, whe eas he pe iodici y o dance2 is weake and
mo e i egula .
3.4 Kine ic Analysis
The MoCap oolbox o e s he possibili y o calcula e
kine ic a iables using Demps e ’s body-segmen model
[7]. To make ou p esen da a compa ible wi h Demp-
s e ’s model, we i s ha e o educe he amoun o ma k-
e s om 28 o 20. We will accomplish his wi h a ma ke -
o-join ans o ma ion, implemen ed in he unc ion
mcm2j. The m2jpa pa ame e s uc u e equi ed o his
ans o ma ion is c ea ed like his:
m2j = mcini m2jpa ;
m2j.nMa ke s = 20;
m2j.ma ke Num = {[9 10 11 12],[9 11],
21,23,26,[10 12],22,24,28,[7 8 7 8 9
10 11 12],[5 6],[1 2 3 4],5,13,[15
16],19,6,14,[17 18],20};
m2j.ma ke Name = {' oo ', 'lhip',
'lknee','lankle','l oe',' hip',
' knee',' ankle',' oe','mid o so',
'neck','head','lshoulde ','lelbow',
'lw is ','l inge ',' shoulde ',
' elbow',' w is ',' inge '};
The join ' oo ', o example, is ob ained by calcu-
la ing he cen oid o ma ke s 9, 10, 11, and 12. The
ma ke - o-join ans o ma ion is ca ied ou as ollows:
d1j = mcm2j(dance1,m2j);
d2j = mcm2j(dance2,m2j);
Figu e 2d isualizes ame 450 o he join ep esen a-
ion o dance1. The nex s ep is o do he join - o-
segmen ans o ma ion. The j2spa pa ame e s uc u e
equi ed o he ans o ma ion is c ea ed like his:
j2s = mcini j2spa ;
j2s. oo Ma ke = 1;
j2s. on alPlane = [6 2 10];
j2s.pa en = [0 1 2 3 4 1 6 7 8 1 10
11 11 13 14 15 11 17 18 19];
j2s.segmen Name = {'lhip','l high',
'lleg','l oo ',' hip',' high',
' leg',' oo ','l o so','u o so',
'neck','lshoulde ','lua m','lla m',
'lhand',' shoulde ',' ua m',' la m',
' hand'};
The join - o-segmen ans o ma ion is accomplished
using he unc ion mcj2s:
d1s = mcj2s(d1j,j2s);
d2s = mcj2s(d2j,j2s);
In o de o calcula e kine ic a iables, such as ene gy,
each body pa has o be associa ed o i s pa ame e (i.e.,
masses and leng hs) speci ied by he Demps e model.
The e o e, a a iable is c ea ed speci ying he ypes o he
segmen s13:
13 Fo a lis o he segmen ypes, see he MoCap Toolbox manual.
176
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
s_ind = [0 0 8 7 6 0 8 7 6 13 12 10 11
3 2 1 11 3 2 1];
This a iable associa es each join wi h a segmen ype.
Each componen indica es he ype o body segmen o
which he espec i e join is a dis al join . Join s ha a e
no dis al o any segmen ha e ze o alues.
The pa ame e s o each body segmen can be hen ob-
ained using he unc ion mcge segmpa :
spa = mcge segmpa ('Demps e ',s_ind);
Wi h his body-segmen ep esen a ion we can es ima e
kine ic a iables o each segmen indi idually. The ime-
a e age o he kine ic ene gy o he whole body, o ex-
ample, can be calcula ed like his:
[ ans1 o 1] = mckinene gy(d1j,d1s,
spa );
[ ans2 o 2] = mckinene gy(d2j,d2s,
spa );
kinEn1 = sum(mcmean( ans1)) +
sum(mcmean( o 1));
kinEn2 = sum(mcmean( ans2)) +
sum(mcmean( o 2));
The alue o he o e all kine ic ene gy o dance1
equals 2.21, and he alue o dance2 is 11.37, hus
mo e ene gy was used in dance2, which suppo s ou
a gumen a ion d awn ea lie , ha he e is mo e mo e-
men in dance2 han in dance1.
3.5 P incipal Componen Analysis (PCA)
P incipal componen analysis can be used o decompose
mo ion cap u e da a in o componen s ha a e o hogonal
o each o he . By using
[pc1 p1] = mcpcap oj(d1j,1:5);
[pc2 p2] = mcpcap oj(d2j,1:5);
we calcula e he i s i e p inciple componen p ojec-
ions o he posi ion da a (as join ep esen a ions) o d1j
and d2j. p1.l and p2.l con ain he amoun o a i-
ance explained by each componen . F om hese a i-
ances, we can de i e, o ins ance, a measu e o mo e-
men complexi y, de ined as he cumula i e sum o he
p opo ion o explained a iance con ained in he i s
i e PCs (see, e.g., [5] and [8]):
pcap op a 1 = cumsum(p1.l(1:5));
pcap op a 2 = cumsum(p2.l(1:5));
The esul s, p esen ed in Table 2, indica e ha , in case
o pcap op a 1, mos mo emen is al eady explained
wi h he i s componen , and he i s i e componen s
explain almos all mo emen . In case o pcap op a 2,
howe e , only abou 50% o he mo emen is explained
wi h he i s componen , and he i s i e componen s
explain less han he i s i e componen s o
pcap op a 1, so mo e componen s a e needed o ully
explain he mo emen s o dance2. Such a mo emen
would be cha ac e ized as complex, since a high numbe
o PCs is needed o explain he mo emen su icien ly,
whe eas a low p opo ion o unexplained a iance
(dance1 case) implies a simple mo emen .
pcap op a 1
pcap op a 2
cumsum(1)
0.79
0.48
cumsum(1:2)
0.90
0.78
cumsum(1:3)
0.95
0.85
cumsum(1:4)
0.97
0.90
cumsum(1:5)
0.98
0.93
Table 2. Cumula i e a iances o he i s i e p inciple
componen s o dance1 (pcap op a 1) and
dance2 (pcap op a 2).
4. CONCLUSION
The MoCap Toolbox is a Ma lab oolbox dedica ed o he
analysis and isualiza ion o mo ion cap u e da a. I has
been de eloped o he analysis o music- ela ed mo e-
men , bu is po en ially use ul in o he a eas o s udies as
well. I has a ac ed esea che s’ a en ion wo king in
a ious ields and has been downloaded o being used in
a wide ange o di e en esea ch pu poses; music-
ela ed, bu also, o ins ance, ace ecogni ion, spo s,
gai , o biomechanics esea ch. I has also gained a ac-
ion in a i icial in elligence esea ch, such as obo ic
mo ion, human- obo in e ac ion, and machine lea ning.
The MoCap Toolbox has con inuously been de eloped
u he since i s i s launch in 2008 by bo h he au ho s
and he use s, whose bug epo s and sugges ions o new
unc ionali y has g ea ly helped o imp o e and ex end i .
In he u u e e o handling will be imp o ed, o in-
s ance, when w ong da a s uc u es a e used. Toolbox
unc ions usually ecognize he mis ake, bu in he p e-
sen e sion, some unc ions do no e u n su icien ly
clea e o messages.
Fu he mo e, some unc ions will be adap ed o s and-
a d Ma lab con en ions, as i is al eady done in, o in-
s ance, mcplo imese ies (speci ying he plo ing
pa ame e s as a s ings- alue combina ion).
Indi idual unc ions will be imp o ed, such as
mc illgaps, ha would bene i om he implemen a-
ion o mo e ad anced gap- illing me hods han linea
illing, o example spline in e pola ion. Addi ionally,
mo e body segmen models besides Demps e ’s model
will be included, such as models p oposed in [9] o [10].
As comme cial ools (e.g., Visual3D) commonly p o-
ide GUIs ins ead o ope a ing on a command-line basis,
a g aphical use in e ace could also be implemen ed o
he MoCapToolbox. I would make he oolbox mo e us-
e - iendly – o example, connec ion ma ices o s ick
igu es could be d awn in he GUI, o gap illing could be
g aphically suppo ed.
Acknowledgmen s
This s udy was suppo ed by he Academy o Finland
(p ojec 118616).
177
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden
5. REFERENCES
[1] C. Ve on, T ai emen e Visualisa ion de Vonnées
Ges uelles Cap ées pa Op o ak. IDMIL Repo ,
2005.
[2] D.G.E. Robe son, G.E. Caldwell, J. Hamill, G.
Kamen, and S.N. Whi lesey, Resea ch Me hods in
Biomechanics. Human Kine ics, 2004.
[3] P. Kelland, In oduc ion o Qua e nions, wi h
Nume ous Examples. Ra ebooksclub.com, 2012.
[4] A.J. Hanson, Visualizing Qua e nions. Mo gan
Kau mann Publishe s, 2005.
[5] B. Bu ge , S. Saa ikallio, G. Luck, M.R. Thompson,
and P. Toi iainen, “Rela ionships be ween pe cei ed
emo ions in music and music-induced mo emen ,”
in Music Pe cep ion 30, 2013, pp. 519-535.
[6] G. Luck, S. Saa ikallio, B. Bu ge , M.R. Thompson,
and P. Toi iainen, “E ec s o he Big Fi e and
musical gen e on music-induced mo emen ,” in
Resea ch in Pe sonali y 44, 2010, pp. 714-720.
[7] W.T. Demps e , Space Requi emen s o he Sea ed
Ope a o : Geome ical, Kinema ic, and Mechanical
Aspec s o he Body wi h Special Re e ence o he
Limbs. WADC Technical Repo 55-159, W igh -
Pa e son Ai Fo ce Base, 1955.
[8] S. Saa ikallio, G. Luck, B. Bu ge , M.R. Thompson,
and P. Toi iainen, “Dance mo es e lec cu en
a ec i e s a e illus a i e o app oach-a oidance
mo i a ion,” in Psychology o Aes he ics, C ea i i y,
and he A s, in p ess.
[9] C.E. Clause , J.T. McCon ille, and J.W. Young,
Weigh , olume and cen e o mass o segmen s o
he human body. AMRL Technical Repo 69-70,
W igh -Pa e son Ai Fo ce Base, 1969.
[10] C.L. Vaughan, B.L. Da is, and J.C. O’Conno ,
Dynamics o Human Gai . Human Kine ics, 1992.
178
P oceedings o he Sound and Music Compu ing Con e ence 2013, SMC 2013, S ockholm, Sweden