3D KINEMATICS APPLIED TO THE STUDY OF INDIVIDUAL BMX GATE START TECHNIQUE
graceg17 Final Project Report
1. 1
Proceedings of the University of Portland
ME 301
December 11, 2015
graceg17@up.edu
EFFECTIVENESS OF CROSS TRAINING METHODS AT MAINTAINING RUNNING
KINEMATIC SPECIFICITY
Grace McConnochie
University of Portland
Portland, Oregon, USA
ABSTRACT
A study was conducted to determine the most effective
cross training method for runners. The position, velocity
and acceleration of the knee and ankle joint during use of
the elliptical and stationary bike were determined and
compared to the kinematics of running. Velocities of the
foot and ankle were found to be lower than what occurs
during running with the elliptical resulting in more
comparable velocities than the stationary bike. This study
suggests that both cross training methods are not able to
approximate the faster velocities that result during running.
If able, injured athletes should opt for use of an elliptical
rather than a stationary bike to best approximate running
kinematics.
INTRODUCTION
An injured runner, or person attempting to supplement
running mileage with cross training, should engage in the cross
training method that best approximates the motion of running.
Biomechanical similarities between cross training and running
are important in order for muscles to be used in a similar
manner such that the specificity of training is optimized. This
study aimed to calculate the velocity and acceleration of the
knee and ankle joint for two common methods of cross training,
a stationary bike and elliptical. Using video analysis with
MATLAB, the position of an LED would be tracked. This
position data could then be used to estimate velocity and
acceleration since velocity and acceleration are the first and
second derivatives of position with time respectively. These
results would then be compared to the velocity and acceleration
of the foot and ankle during running to evaluate how well these
cross training methods approximate running kinematics.
BACKGROUND
Advances in technology and design in the sporting industry
have resulted in an increasing variety of cross training
machines available for use. These machines are most
commonly used recreationally, or by injured athletes to
maintain cardiovascular fitness with a physical activity
involving less impact. In order to best maintain fitness, an
athlete should engage in the cross training activity that best
approximates the biomechanical aspects of running. However
limited research has been done as to which method is most
effective. This study aimed to compare the kinematics of the
foot and knee joint on a bike and elliptical. On a bike, the ankle
joint follows a circular path due to the constraint of the pedal.
Velocity is thereby given by 𝑣 = 𝑤𝑟 where w is the angular
velocity of the pedal and r is the radius of the crank arm.
Acceleration has both a centripetal and linear component and is
given by 𝑎 = 𝑤2
𝑟 +
𝑑𝑣
𝑑𝑡
. For an elliptical, the position of the
pedal follows a much more linear path such that the angular
acceleration would be minimal compared to the linear
component. In this study, linear velocity and acceleration
would be calculated from position data and compared to
running kinematics. Although data is limited, studies have
found maximal linear ankle velocity during running can range
from 2.25m/s to 2.6m/s, (1,2) whilst knee velocity can reach
1.2m/s to 2.5m/s (2,3)
ANALYSIS
Video Processing
Using a Samsung Galaxy S4 phone camera, video footage
was obtained of a subject using an elliptical and stationary with
green LED lights placed on the lateral knee and ankle joint
spaced 35cm apart. This footage was imported into MATLAB
programming software to perform video analysis. Each video
was played in MATLAB so that the pixel color of the LED
could be specified in terms of RGB values using the pixel
selector tool. To track the position of the LED, each frame of
the video was first extracted as an image. In a loop, each image
frame was cropped and a red, green and blue matrix was
extracted from the frame and converted to double precision. To
find the location of the LED, a color threshold technique was
used that found the (x,y) location where the magnitude of the
difference between the RGB color of the LED and the values
for each RGB matrix was less than a specified color tolerance
value. The original image was then converted to grayscale and
double precision. Both the image frame and the position of the
LED were displayed as seen in figure 1. Due to difficulties in
2. 2
color threshold/detection of the LED, only the position of the
knee joint of the elliptical and ankle joint on the bike were
obtained.
Figure 1: LED position tracking using MATLAB.
Velocity/Acceleration calculations.
MATLAB was used as a mathematical tool to estimate
velocity and acceleration. A time vector was created that
corresponded to the number of frames divided by the framerate.
The position measurement in pixels was converted to a
corresponding length in meters since the distance between the
two LEDs was known. Since velocity and acceleration are the
first and second derivatives of position respectively, a finite
difference method could be used for these calculations. The
finite difference method relies on estimating the first or second
derivative with use of a Taylor series expansion in terms of the
value of the function and its derivatives at neighboring data
points.(4) The mathematical formulas used shown in table 1. In
this case h was the time difference between each frame, the
function f(x) was the x or y axis position in meters and f’(x)
and f’’(x) were the velocity and acceleration respectively.
Forward and backwards difference techniques were used for the
first and last data point respectively, whilst a central difference
method was used for the interior data points
The MATLAB code is attached in Appendix one for reference.
Table 1: Finite Difference Methods for Velocity and
Acceleration Estimation.
RESULTS
The position,velocity and acceleration of the ankle joint on
a stationary bike can be seen in figures 2, 3 and 4 respectively.
As expected, the ankle joint was confined to a circular path due
to the constraint of the pedal. The velocity varied from 0.6 to
close to 0 m/s. It makes sense that the velocity is lower at the
top and bottomof the circular position traced out by the pedal,
as this is where leg extension would change to flexion or vice
versa.A one subject study found ankle velocity ranged from
around 0 to 2.25m/s during running.(2) Anotherstudy found
ankle velocity during fast running reached up to 2.6m/s.(1)
These values are a lot higher that the maximal velocity estimate
obtained for the bike of 0.6m/s. The reason for this lower
velocity may be due to the limited range of motion that results
on a stationary bike due to the short crank arm of the pedal.
During running, the effective radius is the total leg length
which is significantly longer than the pedal arm. Consequently,
for the same angular velocity, a smaller radius will result in a
lower velocity.
The acceleration of the ankle on the bike varied from
approximately 20 to 45m/s2. This seems a large value; however
given that there should be both centripetal and linear
acceleration due to the circular motion of the ankle it may be
plausible. No data on linear ankle or knee acceleration during
running could be found for comparison.
Figure 2: Plot of ankle position on a bike
Figure 3. Plot of ankle velocity on a bike
Figure 4. Plot of ankle acceleration on a bike.
3. 3
Figure 5. Plot of knee position on an elliptical
Figure 6. Plot of knee velocity on an elliptical
Figure 7. Plot of knee acceleration on an elliptical
The position, velocity and acceleration of the knee joint on
an elliptical can be seen in figures 5, 6 and 7 respectively.
When compared to the bike, it can be seen that the knee joint
follows a much more linear path in terms of position. Such a
result was expected as the pedal motion on the elliptical is
comparatively more linear. For the velocity, a larger range is
obtained compared to the bike with a peak value of
approximately 1.3m/s. One reason for this could be that the
knee pivots about the hip joint which is a longer lever
compared to the crank arm of the pedal such that a greater
linear velocity would result for the same angular velocity. A
study at the University of Michigan found that knee velocity
could reach up to 1.2m/s during running which is similar to the
result obtained. (3) However, other studies have found a higher
maximal velocity of 2.5m/s.(2)
When looking at the acceleration data, the general trend of
the graph very closely approximates the velocity graph. This
relationship makes sense as when acceleration is high or low,
velocity will be increasing or decreasing respectively. The
maximum acceleration found was even greater than for the
stationary bike, reaching up to 90m/s2.
As both methods showed a lower maximal velocity when
compared to running, these cross training methods could be
appropriate for approximating steady state running at a lower
velocity, but are not suited to mimic the faster speeds that result
during sprinting or faster running. Since the velocity on an
elliptical is more comparable to running than the stationary
bike, this suggests that the elliptical may be a more suitable
method of cross training for maintaining the running kinematic
specificity. It should also be acknowledged that maintaining
kinematic specificity is not the only important factor when
trying to maintain fitness. It is also important that the
cardiovascular system be stressed in a similar manner.
Consequently, future studies could investigate whether the
metabolic cost of the elliptical or bike was comparable to
running.
It was difficult to compare the results obtained in this study
with the kinematics of running, as much of the literature
measures position, velocity and acceleration in terms of angular
measurements. The comparisons that could be made were only
with small studies and/or non-credible sources. Consequently,
future studies could perform the same video analysis of a
subject running on a treadmill and compare the linear velocity
and acceleration values obtained to that of this study which
would allow for more accurate comparison.
Another limitation of this study was the difficulty in
obtaining position data for both LEDs. For both cases, it was
only possible to locate one LED light. Consequently, it was not
possible to compare the kinematics of both the knee and ankle
joint. Future studies could either perform video analysis with
each LED recorded separately, or refine the color tolerance
techniques such that both LEDs could be identified.
Alternatively, other methods could be used to track the
position of the knee and ankle joint which could produce more
reliable results compared to LED color detection. For example,
an optical motion tracking setup with multiple video cameras
would enable position data in 3 dimensions. Alternatively, a
non-optical method could be used such as an inertial
measurement system. Due to financial and resource constraints,
this was not possible for this study.
Finite difference methods can only estimate velocity and
acceleration and are subject to both round off and truncation
error. In an attempt to improve the accuracy of the velocity and
acceleration estimates, finite difference formulas incorporating
more data points could be used. For example, for the two point
central difference formula used to estimate velocity for the
interior data points, truncation error was on the order of h2. If a
four-point central difference technique were used, truncation
error would be on the order of h4 (4) thereby reducing the error
since h, the time-step, is less than 1.Additionally, using a video
camera with a higher framerate could improve accuracy, as
more position data could be collected over the same timeframe
thereby reducing the value of h.
ACKNOWLEDGEMENTS
4. 4
Thanks to Dr. Heather Dillon for her help in the MATLAB
coding for this project. Thanks to Anna Farello for assistance
with filming.
REFERENCES
(1) Nemtsev, O., Nemtseva, N., & Kucherenko, J. n.d.. “Comparison of Technique Characteristics of Sprint Running at Maximal and
Submaximal Speeds”.Adyghe State University. Maikop, Russia
(2) Quintic Education. n.d. “Q4E Case Study 21: Gait Analysis: Effect of an unstable shoe construction.”
http://www.quintic.com/education/case_studies/Gait%20Analysis.html
(3) Gross, M. 1999. “Results: Linear Kinematics. Biomechanics of Human Movement”
http://www.umich.edu/~mvs330/f98/offkilter/results3.html
(4) A. Gilat, V. Subramaniam, 2008, Numerical Methods for Engineers and Scientists:an Introduction with ApplicationsUsing
MATLAB, 3rd ed., Wiley, Hoboken, N.J, pp. 306–319.
5. 5
AppendixA: MATLAB code.
%graceg17@up.edu
%Grace McConnochie
%Matlab code to calculate the velocity of the ankle joint whilst using a stationary bike.
clear all
close all
% Import the movie as an object in matlab
mymovie=VideoReader('bike.mp4')
info = get(mymovie)
framerate = mymovie.framerate; %finds the framerate
% Determine the number of frames
vidFrames = read(mymovie);
numFrames = get(mymovie,'numberOfFrames');
% Loop through each frame in the move and process it.
stop =numFrames; % Loops through each frame
for k = 1 : stop
mov(k).cdata = vidFrames(:,:,:,k);
mov(k).colormap = [];
end
xposition=[];
yposition=[]; %set up empty x and y position vectors
R=137;
G=150;
B=32; %Green colour of LED we want to track.
colortolerance = 50; %sets the colour tolerance for the LED colour
% Loop through each frame and operate on it, show the movie in a matlab figure window.
%Write to video file at same time
% Create a new video file
v2 = VideoWriter('bikefoot.mp4','MPEG-4');
% Open the file for writing.
open(v2);
for j=1:stop
% First we assign the current frame the name IM and convert it to an image
IM=frame2im(mov(j));
%rotates image 90 degrees, keeps same aspect ratio
IM = imrotate(IM,90);
axis equal
6. 6
IM = IM(300:1100,100:1000,:); % crops the image
%Make each RGB color a unique matrix that we can test.
Red = IM(:,:,1);
Red = double(Red);
Green = IM(:,:,2);
Green = double(Green);
Blue = IM(:,:,3);
Blue = double(Blue);
%Find all the spots in the image within the specified color tolerance.
[y, x] = find( sqrt((Red - R).^2 + (Green - G).^2 + (Blue - B).^2) <= colortolerance );
xposition=[xposition;x(1)];
yposition=[yposition;y(1)]; %takes the first point within the color tolerance only
%Convert the original image to grayscale so we can plot it.
IM = rgb2gray(IM); % Convert to grayscale
IM = double(IM); % Convert to double precision
xposition=[xposition;x(1)];
yposition=[yposition;y(1)]; %takes the first point within dersired color tolerance only
fig=figure; %Creates the figure we want to write to the video
% Display the image (show the movie in a matlab figure window)
pcolor(IM), shading interp, colormap(gray), drawnow;
hold on
%plots the postion of the LED as a Red circle
plot(xposition,yposition,'ro');
F = getframe(fig); %Retrives the frame to add to the video
close(fig); % close figure
% Write the frame F to the video file.
writeVideo(v2,F);
end
close(v2) %close the video
x=xposition*(.35/500); %conversion 35cm =500 pixels (distance between 2 LED lights)
y=yposition*(.35/500);
t = 1:stop; % Time in unit of frames
t = t./framerate; % Time in unit of seconds if frame rate is in [frames/second]
%estimate vx
vx=[]; %creates empty velocity vector
j=1; %want velocity estimate for intial point
h1=t(j+1)-t(j); %change in time
vx=[vx,(-3*x(j)+4*x(j+1)-x(j+2))/(2*h1)]; %3 point forward difference for the initial
data point
for i=2:length(t)-1 %want velocity estimate for interior data points
h=t(i+1)-t(i); %change in time
vx=[vx,(x(i+1)-x(i-1))/(2*h)]; %finds 2 point central difference for interior data
points
end
7. 7
k=length(t); %want velocity estimate for final data point
hend=t(k)-t(k-1);%change in time
vx=[vx,((x(k-2)-4*x(k-1)+3*x(k))/(2*hend))]; %3 point backwards difference for end data
point
%repeats the process for vy
vy=[]; %creates empty velocity vector
j=1; %want velocity estimate for intial point
h1=t(j+1)-t(j);%change in time
vy=[vy,(-3*y(j)+4*y(j+1)-y(j+2))/(2*h1)]; %3 point forward difference for the initial
data point
for i=2:length(t)-1 %want velocity estimate for interior data points
h=t(i+1)-t(i); %change in time
vy=[vy,(y(i+1)-y(i-1))/2*h]; %finds 2 point central difference for interior data
points
end
k=length(t); %want velocity estimate for final data point
hend=t(k)-t(k-1); %change in time
vy=[vy,((y(k-2)-4*y(k-1)+3*y(k))/2*hend)]; %3 point backwards difference for end data
point
v=sqrt(vx.^2+vy.^2); %finds the magnitude of the velocity
%estimate acceleration in x direction
ax=[]; %creates empty acceleration vector
j=1; %want acceleration estimate for initial point
h1=t(j+1)-t(j); %change in time
ax=[ax,(x(j)-2*x(j+1)+x(j+2))/(h1^2)]; %3 point 2nd dev forward difference for initial
data point
for i=2:length(t)-1 %want acceleration estimate for interior data points
h=t(i+1)-t(i); %change in time
ax=[ax,(x(i-1)-2*x(i)+x(i+1))/h^2]; %2 point 2nd dev central difference for interior
data points
end
k=length(t); %want acceleration estimate for final data point
hend=t(k)-t(k-1); %change in time
ax=[ax,((x(k-2)-2*x(k-1)+x(k))/hend^2)]; %3 point 2nd dev backwards difference for end
data point.
%estimate acceleration in y direction
ay=[]; %creates empty acceleration vector
j=1; %want acceleration estimate for initial point
h1=t(j+1)-t(j); %change in time
ay=[ay,(y(j)-2*y(j+1)+y(j+2))/(h1^2)]; %3 point 2nd dev forward difference for initial
data point
for i=2:length(t)-1 %want acceleration estimate for interior data points
h=t(i+1)-t(i); %change in time
ay=[ay,(y(i-1)-2*y(i)+y(i+1))/h^2]; %3 point 2nd dev central difference
end
8. 8
k=length(t); %want acceleration estimate for final data point
hend=t(k)-t(k-1); %change in time
ay=[ay,((y(k-2)-2*y(k-1)+y(k))/hend^2)]; %3 point 2nd dev backwards difference
a=sqrt(ax.^2+ay.^2); %finds the magnitude of the acceleration.
figure;
%plots velocity and acceleration over time.
subplot(2,2,1), plot(x,y)
xlabel('x position (m)')
ylabel('y position (m)')
title('Plot of Ankle Position on a Bike') %plots position
subplot(2,2,2),plot(t,v)
xlabel('time(s)')
ylabel('velocity (m/s)')
title('Plot of Ankle Velocity on a Bike') %plots velocity
subplot(2,2,3),plot(t,a)
xlabel('time(s)')
ylabel('acceleration (m/s^2)')
title('Plot of Ankle Acceleration on a Bike') %plots acceleration
%Reflection: Learnt how to use MATLAB to track the position of an LED using
%a color thresholding/tolerance technique. Learnt about how an image is
%made up of a red green and blue matrix that can be used to find the
%minimum difference in pixel color.
%Learnt how to loop through a video and operate on each frame.
%Learnt how to output a video in Matlab.
%Reviewed how to use the finite difference method for to calculate velocity and
acceleration from position data. This method should be relatively accurate given the time
between frames was small
9. 9
%graceg17@up.edu
%Grace McConnochie
%Matlab code to calculate the position, velocity and acceleration of the
%knee joint on an elliptical.
clear all
close all
% Import the movie as an object in matlab
mymovie=VideoReader('elliptical.mp4')
info = get(mymovie)
framerate = mymovie.framerate; %finds the framerate
% Determine the number of frames
vidFrames = read(mymovie);
numFrames = get(mymovie,'numberOfFrames');
% Loop through each frame in the move and process it.
stop =numFrames; % Loops through each frame
for k = 1 : stop
mov(k).cdata = vidFrames(:,:,:,k);
mov(k).colormap = [];
end
xposition=[];
yposition=[]; %set up empty x and y position vectors
R=160;
G=180;
B=43; %Green colour of LED we want to track.
colortolerance = 45; %sets the colour tolerance for the LED colour
% Loop through each frame and operate on it, show the movie in a matlab figure window.
%Write to video file at same time
% Create a new video file
v2 = VideoWriter('ellipticalknee.mp4','MPEG-4');
% Open the file for writing.
open(v2)
for j=1:stop
% First we assign the current frame the name IM and convert it to an image
IM=frame2im(mov(j));
IM = imrotate(IM,90);
axis equal %rotates image 90 degrees, keeps same aspect ratio
IM = IM(1100:1600,300:1000,:); % crops the image
10. 10
% Make each color a unique matrix that we can test.
Red = IM(:,:,1);
Red = double(Red);
Green = IM(:,:,2);
Green = double(Green);
Blue = IM(:,:,3);
Blue = double(Blue);
% Find all the spots in the image within the specified color tolerance.
[y, x] = find( sqrt((Red - R).^2 + (Green - G).^2 + (Blue - B).^2) <= colortolerance );
xposition=[xposition;x(1)];
yposition=[yposition;y(1)]; %takes the first maximum point only
% Convert the original image to grayscale so we can plot it.
IM = rgb2gray(IM); % Convert to grayscale
IM = double(IM); % Convert to double precision
xposition=[xposition;x(1)];
yposition=[yposition;y(1)]; %takes the first point within the color tolerance only
fig=figure; %Creates the figure to write to the video
% Display the image (show the movie in a matlab figure window)
pcolor(IM), shading interp, colormap(gray), drawnow
hold on
%plots the position of the LED as a Red circle
plot(xposition,yposition,'ro')
F = getframe(fig); % create a figure you want to save to the video too.
close(fig); % close figure
% Write the frame F to the video file.
writeVideo(v2,F)
end
% Close the file.
close(v2)
x=xposition*(.35/300); %conversion 35cm =300 pixels
y=yposition*(.35/300);
t = 1:stop; % Time in unit of frames
t = t./framerate; % Time in unit of seconds if frame rate is in [frames/second]
vx=[]; %creates empty velocity vector
j=1; %want velocity estimate for initial point
h1=t(j+1)-t(j); %change in time
vx=[vx,(-3*x(j)+4*x(j+1)-x(j+2))/(2*h1)]; %3 point forward difference for the initial
data point
for i=2:length(t)-1 %want velocity estimate for interior data points
h=t(i+1)-t(i); %change in time
vx=[vx,(x(i+1)-x(i-1))/(2*h)]; %finds 2 point central difference for interior data
points
end
k=length(t); %want velocity estimate for final data point
11. 11
hend=t(k)-t(k-1);%change in time
vx=[vx,((x(k-2)-4*x(k-1)+3*x(k))/(2*hend))]; %3 point backwards difference for end data
point
%repeats the process for vy
vy=[]; %creates empty velocity vector
j=1; %want velocity estimate for initial point
h1=t(j+1)-t(j);%change in time
vy=[vy,(-3*y(j)+4*y(j+1)-y(j+2))/(2*h1)]; %3 point forward difference for the initial
data point
for i=2:length(t)-1 %want velocity estimate for interior data points
h=t(i+1)-t(i); %change in time
vy=[vy,(y(i+1)-y(i-1))/2*h]; %finds 2 point central difference for interior data
points
end
k=length(t); %want velocity estimate for final data point
hend=t(k)-t(k-1); %change in time
vy=[vy,((y(k-2)-4*y(k-1)+3*y(k))/2*hend)]; %3 point backwards difference for end data
point
v=sqrt(vx.^2+vy.^2); %finds the magnitude of the velocity
%estimate acceleration in x direction
ax=[]; %creates empty acceleration vector
j=1; %want acceleration estimate for initial point
h1=t(j+1)-t(j); %change in time
ax=[ax,(x(j)-2*x(j+1)+x(j+2))/(h1^2)]; %3 point 2nd dev forward difference for initial
data point
for i=2:length(t)-1 %want acceleration estimate for interior data points
h=t(i+1)-t(i); %change in time
ax=[ax,(x(i-1)-2*x(i)+x(i+1))/h^2]; %2 point 2nd dev central difference for interior
data points
end
k=length(t); %want acceleration estimate for final data point
hend=t(k)-t(k-1); %change in time
ax=[ax,((x(k-2)-2*x(k-1)+x(k))/hend^2)]; %3 point 2nd dev backwards difference for end
data point.
%estimate acceleration in y direction
ay=[]; %creates empty acceleration vector
j=1; %want acceleration estimate for initial point
h1=t(j+1)-t(j); %change in time
ay=[ay,(y(j)-2*y(j+1)+y(j+2))/(h1^2)]; %3 point 2nd dev forward difference for initial
data point
for i=2:length(t)-1 %want acceleration estimate for interior data points
h=t(i+1)-t(i); %change in time
ay=[ay,(y(i-1)-2*y(i)+y(i+1))/h^2]; %3 point 2nd dev central difference
end
k=length(t); %want acceleration estimate for final data point
12. 12
hend=t(k)-t(k-1); %change in time
ay=[ay,((y(k-2)-2*y(k-1)+y(k))/hend^2)]; %3 point 2nd dev backwards difference
a=sqrt(ax.^2+ay.^2); %finds the magnitude of the acceleration.
figure;
%plots velocity and acceleration over time.
subplot(2,2,1), plot(x,y)
xlabel('x position (m)')
ylabel('y position (m)')
title('Plot of Knee Position on an Elliptical')
subplot(2,2,2),plot(t,v)
xlabel('time(s)')
ylabel('velocity (m/s)')
title('Plot of Knee Velocity on an Elliptical')
subplot(2,2,3),plot(t,a)
xlabel('time(s)')
ylabel('acceleration (m/s^2)')
title('Plot of Knee Acceleration on an Elliptical')
%For reflection statement see bike code.
13. 13
Appendix B: Permission to display video.
I, Grace McConnochie, herby grant permission for this video to be released for display for National Engineers Week.