SlideShare a Scribd company logo
1
Modeling Motion in MATLAB
Anthony Taylor
Dept. of Computer Science and Mathematics
Central State University
Wilberforce, Ohio 45384 USA
Email: ant.taylor2@gmail.com
Abstract
A MATLAB program was created using algebraic techniques for solving inverse problems.
Through these algorithms, the MATLAB program was structured to import the lengths of the
upper arm, forearm, thigh, and calf from a text file and output the two dimensional joint angles to
determine the position of the wrist and ankle in space. This paper, then, will explain how the
MATLAB program was designed and discuss future applications in gait analysis.
1. Introduction
Gait analysis is the study of human locomotion by means of measuring, data collection,
and computer applications to determine abnormalities in human walking patterns, gender, or
medical disabilities. To understand gait analysis one must first know the basic gait cycle which is
heel touch- toe off, heel touch-toe off. There have been many advances in the study of gait
analysis since its pioneer Aristotle first introduced the knowledge and techniques for measuring
and predicting such patterns in human locomotion. Although major developments of gait
analysis weren’t made until the twentieth century, (Inman et al., 1981; Eberhart et. al., 1951;
Sutherland et. al., 1980) modified sophisticated measuring instruments such as force plates for
clinical applications of gait analysis. Since then, a wide range of temporal and linear techniques
have been created to represent models of gait data that describe body movements in relation to
joint angles.
2
The techniques used in today’s society have been modernized by the use of high
performance computers, digital imaging, and computer software applications. Each technique
makes gait behavior easier to study. There are various methods used for gait analysis: collecting
sensor data, collecting anatomical data, modeling, digital image processing, video tracking, and
computer applicable techniques.
Sensor data is a major entity of gait analysis. Sensors are responsive devices that
measure, signal, or indicate the properties of an object. There are various types of sensors that
can be used to collect data for acceleration, tracking, and pressure. When using sensors to study
human locomotion, sensors give the observer the ability to track a specific angle or joint of a
subject with the help of active or passive markers.
(Figure1. Various types of sensors used for measuring, signaling, and indicating properties.)
Anatomical data is data collected from the human body. Examples include the lengths of
a limb, degree of joint rotation, etc.
Modeling uses the data derived from sensors or anatomical data to replicate a linear or
nonlinear structure of motion. Models can be projected onto graphs of two dimensional or three
dimensional surfaces.
Video tracking records an individual’s gait behavior. The video is then analyzed using
image processing techniques which input data from sensors, tracking markers, and specialized
digital cameras. Generally a study is conducted with a parameter that is composed of video
surveillance. This method can be time efficient, although it is not always accurate due to lighting,
shadows, or the natural elements of the experimental field of view.
3
Computer applied techniques are also used to process gait data. These techniques could
involve little or no human interaction, and are programmed to run self-sufficiently to import,
manipulate, and translate gait data from sensors or video tracking devices.
The technique discussed in this paper is a computer applied technique called MOTION, a
MATLAB program that uses kinematic and anatomical data from a human subject to predict
wrist and ankle placement during the gait cycle. The kinematic data used in MOTION is
generated from a VICON Motion Analysis file. The anatomical data of a human subject is
collected prior to the gait experiment. Through MOTION the joint angles to predict wrist and
ankle coordinates are calculated using algebraic techniques for solving inverse problems. The
results are stored in a text file for access and manipulation. The Motion program, then, integrates
several gait analysis techniques through one platform.
2. Literature Review
Significant research has shown that there are various software techniques for studying and
modeling human motion. Researchers (Figueroa et al.,2002), introduced a technique for tracking
the passive or active markers on a human subject through a windows based computer application
to efficiently measure and study video captured data. (Taylor et. al.,2006), introduced a modeling
technique that used a linear dynamical system due to the continuous hidden variables to compute
hidden and visible angles of a human subject to resemble motion. (Bowden, 2000) applied the
methods of non-linear formations to movements. Bowden used models of deformation to provide
a pre-existing state of movements in which an objects motion can be traced and used to simulate
motion. The various software techniques mentioned above are related entities of the software
application introduced in this paper due to the nature and technique used in the work. The
4
MOTION application is unique from the methods described above because the program is
capable of importing VICON Motion Analysis data, and plotting a graphical representation of
the data in a single platform as opposed to using different software applications simultaneously.
This program can also run on multiple operating systems making it easily accessible, as well as
user friendly.
3. Methods
To analyze the VICON Motion Analysis data, a program was designed using the
MATLAB software environment and programming language. MATLAB is short for Matrix
Laboratory. The software is programmer friendly with an environment that meets the demand of
high performance computing. MATLAB can import highly complex numerical values for data
analysis and simulation. The software also allows users to develop programs to input and output
data for graphical representation or visualization of the data. MATLAB also assists in the
development of applications in which programmers can create graphical user interfaces (GUI)
for manipulating and loading data sets.
MATLAB can run on three operating systems: Windows, Mac, and Linux. The system
requirements include:
Windows
o Can be installed on 32 or 64 bit systems with Windows XP, Windows Vista,
Windows Server 2003/2008, and Windows 7. Intel or AMD x86 Processors are
needed, as well as 3 to 5 GB of disk space and 1024 RAM.
Mac
5
o Can be installed on a 64 bit system with MAC OS X Snow Leopard with an Intel
Core 2 Processor or later versions are needed, as well as 3 to 5 GB disk space and
1024 RAM.
Linux
o Can be installed on 32 or 64 bit systems with Ubuntu 10.04 LTS and 10.10 Red
Hat Enterprise, Linux 5.x and 6.x, SUSE Linux Enterprise Desktop 11.x, Debian
5.x, an Intel or AMD x86 Processors are needed, as well as 3 to 5 GB of disk
space and 1024 RAM.
Of these systems, we installed the MATLAB 7.5.0 software package onto a 64 bit
Windows 7 operating system with an AMD processor. The text files containing the inputs were
imported through MATLAB’s import wizard and separated so the numerical data could be used
explicitly. A simple code was created to process the data inputs—lengths of the upper arm,
forearm, thigh, and calf--- through algebraic algorithms derived by (Kendricks et. al.,2010), then
display the numerical outputs-- the joint angles that determine the position and orientation of the
wrist and ankle during the gait cycle. The values were processed through a time delayed loop,
and plotted onto a graph. The graph was then traced by a red marker simulating live motion.
4. Results
The MOTION program operates by importing a Microsoft Excel file containing anatomical
data provided by the VICON Motion Analysis System. This data is located on the operating
system’s hard drive and synced with MATLAB. The data in the file is then processed through
the algebraic algorithms and exports joint angles describing the position of the wrist and ankle in
6
space. This export file is processed through a for loop in which the loop plots each coordinate
of the wrist and ankle onto a graph. Once each point is plotted along the x- and y- axis
respectively a marker traces the path of wrist, simulating arm swing.
MOTION Code for Plotting the Position and Orientation of the Wrist or Ankle
%Program Name: MOTION
%Author: Anthony A. Taylor
%Date: 6/20/2011
%Description: Inverse Kinematics of human motion. This program will take
%the known positions of the wrist, elbow, and shoulder from a .txt file and
%apply the variables to algebraic formulas to find the unknown variables:
%cos1, cos2, sin1, & sin2. Once all the variables are known, further
%algebraic calculations are done to find the degrees of the elbow and
%shoulder angles.
%Allows users to select .xls file.
[z, pathname] = uigetfile('*.xls','Select Excel File');
if isequal(z,0)
disp('User selected Cancel')
else
disp(['User selected', fullfile(pathname, z)])
end
%Reads in columns of data, These are the "Known" Variables L1, L2, a, & b.
L1 = xlsread(z, 'J:J');
L2 = xlsread(z, 'K:K');
a = xlsread(z,'A:A');
b = xlsread(z,'B:B');
OERplot = xlsread(z,'Kin. Model _Fwd & Inv_Cycle 1','Z:Z');
OSRplot = xlsread(z,'Kin. Model _Fwd & Inv_Cycle 1','AA:AA');
%Apply the "Known" variables to the equation solution sets.
SinTheta2Sqr= -((0.25).*L1.^4 - (0.5).*L1.^2.*L2.^2 -(0.5).*(L1.^2.*b.^2)-
(0.5).*(L1.^2.* a.^2) + (0.25).*L2.^4 - (0.5).*(L2.^2.*b.^2) -
(0.5).*(L2.^2.*a.^2) + (0.25).*b.^4 +0.5.*(b.^2.*
a.^2)+0.25.*a.^4)./(L1.^2.*L2.^2);
SinTheta2P = sqrt(SinTheta2Sqr);
SinTheta2M = SinTheta2P*-1;
CosTheta1P = (L2.*a)./(a.^2+b.^2).*SinTheta2P-(-1.*L1.^2.*b+L2.^2.*b-b.^3-
b.*a.^2)./(2.*L1.*(a.^2+b.^2));
CosTheta1M = (L2.*a)./(a.^2+b.^2).*SinTheta2M-(-1.*L1.^2.*b+L2.^2.*b-b.^3-
b.*a.^2)./(2.*L1.*(a.^2+b.^2));
CosTheta2P = -1.*((L1.^2+L2.^2)-(b.^2-a.^2))./(2.*L1.*L2);
7
SinTheta1P = -1.*(L2.*(b)).*(SinTheta2P)./ ((b).^2 +a.^2) - (-1.*L1.^2.* a +
L2.^2.*a - (b).^2.* a-a.^3)./(2.*L1.*((b).^2 +a.^2));
SinTheta1M = -1.*(L2.*(b)).*(SinTheta2M)./ ((b).^2 +a.^2) - (-1.*L1.^2.* a +
L2.^2.*a - (b).^2.* a-a.^3)./(2.*L1.*((b).^2 +a.^2));
%Take the inverse to find the Shoulder and Elbow angles Theta 1 & Theta 2
SAThetaOne1 = atan(SinTheta1P./CosTheta1P);
EAThetaTwo1 = atan(SinTheta2P./CosTheta2P);
ShoulderThetaOne2 = atan(SinTheta1M./CosTheta1M);
ElbowThetaTwo2 = atan(SinTheta2M./CosTheta2P);
%Actual angle in degrees
ElbowAngleDegrees =EAThetaTwo1.*(180./pi);
ShoulderAngleDegrees = SAThetaOne1.*(180./pi);
ElbowRadian = ElbowAngleDegrees.*(pi./180);
ShoulderRadian = ShoulderAngleDegrees.*(pi./180);
E = ElbowRadian;
S = ShoulderRadian;
%Outputs data in an excel file with the following headings and plots the
projected shoulder and elbow angles
headers = {'Cosine of Theta 1_value 1 Plus','Cosine of theta 1_value 2
Minus','Sine of theta 1 _value1 Plus','Sine of theta 1_value 2
Minus','Shoulder Angles (Theta 1_1)','Elbow Angles (Theta 2_1)','Shoulder
(Theta 1_2)','Elbow (Theta 2_2)','Cosine of theta 2','Sine of theta 2
(Squared)','Sine of theta 2_1 Plus','Sine of theta 2_2 Minus','Elbow Angles
in Degrees','Shoulder Angles in Degrees','Elbow Angles in Radians','Shoulder
Angles in Radians'};
data =
[CosTheta1P,CosTheta1M,SinTheta1P,SinTheta1M,SAThetaOne1,EAThetaTwo1,Shoulder
ThetaOne2,ElbowThetaTwo2,CosTheta2P,SinTheta2Sqr,SinTheta2P,SinTheta2M,ElbowA
ngleDegrees,ShoulderAngleDegrees,ElbowRadian,ShoulderRadian];
xlswrite('DataOutput.xls',headers);
xlswrite('DataOutput.xls',data,1,'A2');
%Start plot from position 1 to 100.
%Track plot from 1 to 100.
x=1:100;
DELAY = 0.05;
for i = 1:numel(x)
clf;
plot(x,S,'--r');
hold on;
plot(x(i),S(i),'b*');
hold on;
plot(x,OSRplot,'.b');
hold on;
plot(x(i),OSRplot(i),'r*');
grid on
ylabel('Angle in radians')
8
xlabel('% of the gait cycle')
title('Shoulder positions')
legend('Predicted Shoulder','Marker','Measured Shoulder','Marker')
pause(DELAY);
end
(Figure 2. Shoulder Angles: Measured vs. Predicted)
(Figure 3. A two dimensional view of the predicted position of the wrist moving in space.)
The code for plotting the joint angles of the shoulder and elbow can also be used to plot
the joint angles of the hip and knee. The lower extremity angles can be found by adjusting the
input values of L1, L2, which is hip to knee, and knee to ankle, to determine the position of the
ankle denoted (a,b). Look for future versions of MOTION to include these modifications so that
the positions of the wrist and ankle can be predicted simultaneously.
5. Discussion
Through further research with additional human subjects (of various height, weight, race,
gender) the MOTION program will simultaneously generate multiple coordinates of the wrist
and ankle in space. Advanced functionality of the program will be an asset for generating and
synchronizing gait patterns to accurately distinguish abnormalities in real time, and in the future
identify a human subject’s height, weight, race, etc. Such modifications can influence clinical
studies that can accurately and effectively distinguish abnormal walking patterns caused by
stooped posture, muscular disorders, or fractures. Motion analysis can also benefit with an
enhanced system for studying video captured data. By accurately measuring video captured data
9
without physical measuring instruments, an identification system can be created to assist with
distinguishing criminal terrorist or missing persons, as well as in the field of professional sports
to enhance an athlete’s performance.
6. Conclusion
This paper provides an overview of gait analysis and the methods used to measure gait.
Using the computer applied technique, a MATLAB program called MOTION was created to
simplify the analysis of human gait patterns by using algebraic techniques for solving inverse
problems. The program imported the lengths and exported the joint angles that determine wrist
or ankle position. The program also plotted the position and orientation of the wrist and ankle on
a graph.
Though MOTION is among many computer applied techniques, future applications will
be seen in various branches of law enforcement, medical treatment and research, and
professional sports. The need for an accurate and efficient system of measuring walking patterns
will be in high demand for many government agencies and software developers, by combining
the various methods of obtaining gait data and enhancing the performance of measuring
techniques, MOTION will increase the efficiency of gait analysis and computational procedures.
7. References
10
Baker, R. (2007). The history of gait analysis before the advent of modern computers. Gait and
Posture, 26(3), 331-342.
Benabdelkader, C. Cutler, R. Davism, L. (2004). Gait Recognition Using Image Self-Similarity.
Eurasip Journal on Applied Signal Processing, 4, 572-585.
Bowden, R. (2000). Learning statistical models of human motion. In IEEE Workshop on Human
Modeling, Analysis, and Synthesis, CVPR 2000, IEEE Computer Society.
Dugdale, D. Hoch, D. Zieve, D. (2009). Walking Abnormalities. The A.D.A.M. Medical
Encyclopedia, Bethesda, MD.
Eberhart, H. D. & Inman, V. T. (1951). An evaluation of experimental procedures used in a
fundamental study of human locomotion. Ann. N. Y. Acad. Sci. 51, 1213-1228
Figueroa, P. Leite, N.L. Barros, M.L. R. (2002). A flexible software for tracking of markers used
in human motion analysis. Computer Methods and Programs in Biomedicine 72 (2003) 155-165.
Inman, V. T., Ralston, Henry J. (1981). In Human Walking. Williams & Wilkins, Baltimore.
11
Kendricks, D.K. Fullenkamp, M.A. McGrellis, R. Juhl, J. and Tuttle, F.R. (2010). An Inverse
Kinematic Mathematical Model Using Groebner Basis Theory for Arm Swing Movement in the
Gait Cycle. Battlespace Acoustics and Magnetic Sensors.
Koopman, B. Helm, F. Horsman, K.M. Laboratory Biomechanical Engineering. (2010,
September 7). Analysis and Modeling of Gait Disorders. Retrieved May 25, 2011 from
http://www.bw.ctw.utwente.nl/research/projects/Analysis.doc/index.html
Pallejà, T. Teixidó, M. Tresanchez, M. and Palacín, J. (2009). Measuring Gait Using a Ground
Laser Range Sensor. Sensors. 9 (11), 9133-9146.
Pollo, F. (2007, April 30). Gait Analysis: Techniques and Recognition of Abnormal Gait. Baylor
University Medical Center. Retrieved May 20, 2011 from
http://www.scribd.com/doc/46943381/Gait-Analysis-Techniques-and-Abnormal-Patterns-AAA
Sutherland, H. D, Olshen, R., Cooper, L. and Wo, SL. (1980) The Development of Mature Gait.
The Journal of Bone and Joint Surgery, 62:336-353
Taylor, G.W. Hinton, G.E. and Roweis, S.T. (2006). Modeling human motion using binary
latent variables. Advances in Neural Information Processing. MIT Press.
12
Teplitsk, S. (2009). Cluster 3. COSMOS 2009, University of California. Retrieved May 25, 2011
from http://cosmos.ucdavis.edu/archives/2009/cluster3/teplitsky_sarah.pdf

More Related Content

Viewers also liked

The use of Specks in Gait Analysis
The use of Specks in Gait AnalysisThe use of Specks in Gait Analysis
The use of Specks in Gait Analysis
arcticfire
 
フリーソフトを用いた姿勢分析の検討
フリーソフトを用いた姿勢分析の検討 フリーソフトを用いた姿勢分析の検討
フリーソフトを用いた姿勢分析の検討
Kazuhiro Kurosawa
 
OpenSim の 使い方 (Static optimization 編)
OpenSim の 使い方 (Static optimization 編) OpenSim の 使い方 (Static optimization 編)
OpenSim の 使い方 (Static optimization 編)
Yuichi Kurita
 
OpenSim の 使い方 (scaling編)
OpenSim の 使い方 (scaling編) OpenSim の 使い方 (scaling編)
OpenSim の 使い方 (scaling編)
Yuichi Kurita
 
OpenSim の使い方 (動作確認編)
OpenSim の使い方 (動作確認編)OpenSim の使い方 (動作確認編)
OpenSim の使い方 (動作確認編)
Yuichi Kurita
 
OpenSim の 使い方 (IK 編)
OpenSim の 使い方 (IK 編)OpenSim の 使い方 (IK 編)
OpenSim の 使い方 (IK 編)
Yuichi Kurita
 
OpenSim の 使い方 (筋骨格モデル編集 編)
OpenSim の 使い方 (筋骨格モデル編集 編)OpenSim の 使い方 (筋骨格モデル編集 編)
OpenSim の 使い方 (筋骨格モデル編集 編)
Yuichi Kurita
 

Viewers also liked (7)

The use of Specks in Gait Analysis
The use of Specks in Gait AnalysisThe use of Specks in Gait Analysis
The use of Specks in Gait Analysis
 
フリーソフトを用いた姿勢分析の検討
フリーソフトを用いた姿勢分析の検討 フリーソフトを用いた姿勢分析の検討
フリーソフトを用いた姿勢分析の検討
 
OpenSim の 使い方 (Static optimization 編)
OpenSim の 使い方 (Static optimization 編) OpenSim の 使い方 (Static optimization 編)
OpenSim の 使い方 (Static optimization 編)
 
OpenSim の 使い方 (scaling編)
OpenSim の 使い方 (scaling編) OpenSim の 使い方 (scaling編)
OpenSim の 使い方 (scaling編)
 
OpenSim の使い方 (動作確認編)
OpenSim の使い方 (動作確認編)OpenSim の使い方 (動作確認編)
OpenSim の使い方 (動作確認編)
 
OpenSim の 使い方 (IK 編)
OpenSim の 使い方 (IK 編)OpenSim の 使い方 (IK 編)
OpenSim の 使い方 (IK 編)
 
OpenSim の 使い方 (筋骨格モデル編集 編)
OpenSim の 使い方 (筋骨格モデル編集 編)OpenSim の 使い方 (筋骨格モデル編集 編)
OpenSim の 使い方 (筋骨格モデル編集 編)
 

Similar to Modeling Motion in Matlab 7.19.11_v4_Taylor_KKedits

Analysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
Analysis of Inertial Sensor Data Using Trajectory Recognition AlgorithmAnalysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
Analysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
ijcisjournal
 
Draft activity recognition from accelerometer data
Draft activity recognition from accelerometer dataDraft activity recognition from accelerometer data
Draft activity recognition from accelerometer data
Raghu Palakodety
 
Final Thesis Presentation
Final Thesis PresentationFinal Thesis Presentation
Final Thesis Presentation
Sajid Rasheed
 
IRJET- Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
IRJET-  	  Recognition of Theft by Gestures using Kinect Sensor in Machine Le...IRJET-  	  Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
IRJET- Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
IRJET Journal
 
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
IRJET Journal
 
Human Activity Recognition Using Smartphone
Human Activity Recognition Using SmartphoneHuman Activity Recognition Using Smartphone
Human Activity Recognition Using Smartphone
IRJET Journal
 
E010122431
E010122431E010122431
E010122431
IOSR Journals
 
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
IOSR Journals
 
Control Buggy using Leap Sensor Camera in Data Mining Domain
Control Buggy using Leap Sensor Camera in Data Mining DomainControl Buggy using Leap Sensor Camera in Data Mining Domain
Control Buggy using Leap Sensor Camera in Data Mining Domain
IRJET Journal
 
Ls3520052009
Ls3520052009Ls3520052009
Ls3520052009
IJERA Editor
 
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and DumbIRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
IRJET Journal
 
IRJET- Survey Paper on Vision based Hand Gesture Recognition
IRJET- Survey Paper on Vision based Hand Gesture RecognitionIRJET- Survey Paper on Vision based Hand Gesture Recognition
IRJET- Survey Paper on Vision based Hand Gesture Recognition
IRJET Journal
 
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
IAEME Publication
 
human activity recognization using machine learning with data analysis
human activity recognization using machine learning with data analysishuman activity recognization using machine learning with data analysis
human activity recognization using machine learning with data analysis
Venkat Projects
 
Research.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
Research.Essay_Chien-Chih_Weng_v3_by Prof. KarkoubResearch.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
Research.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
Chien-Chih Weng
 
Experts Vision- Portfolio Jan23
Experts Vision- Portfolio Jan23Experts Vision- Portfolio Jan23
Experts Vision- Portfolio Jan23
Hafsa Asad
 
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
IJMER
 
Mems Sensor Based Approach for Gesture Recognition to Control Media in Computer
Mems Sensor Based Approach for Gesture Recognition to Control Media in ComputerMems Sensor Based Approach for Gesture Recognition to Control Media in Computer
Mems Sensor Based Approach for Gesture Recognition to Control Media in Computer
IJARIIT
 
IRJET- Behavior Analysis from Videos using Motion based Feature Extraction
IRJET-  	  Behavior Analysis from Videos using Motion based Feature ExtractionIRJET-  	  Behavior Analysis from Videos using Motion based Feature Extraction
IRJET- Behavior Analysis from Videos using Motion based Feature Extraction
IRJET Journal
 
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1) C6
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1)  C6⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1)  C6
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1) C6
Victor Asanza
 

Similar to Modeling Motion in Matlab 7.19.11_v4_Taylor_KKedits (20)

Analysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
Analysis of Inertial Sensor Data Using Trajectory Recognition AlgorithmAnalysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
Analysis of Inertial Sensor Data Using Trajectory Recognition Algorithm
 
Draft activity recognition from accelerometer data
Draft activity recognition from accelerometer dataDraft activity recognition from accelerometer data
Draft activity recognition from accelerometer data
 
Final Thesis Presentation
Final Thesis PresentationFinal Thesis Presentation
Final Thesis Presentation
 
IRJET- Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
IRJET-  	  Recognition of Theft by Gestures using Kinect Sensor in Machine Le...IRJET-  	  Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
IRJET- Recognition of Theft by Gestures using Kinect Sensor in Machine Le...
 
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
IRJET-V9I114.pdfA Review Paper on Economical Bionic Arm with Predefined Grasp...
 
Human Activity Recognition Using Smartphone
Human Activity Recognition Using SmartphoneHuman Activity Recognition Using Smartphone
Human Activity Recognition Using Smartphone
 
E010122431
E010122431E010122431
E010122431
 
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
Digital Pen for Handwritten Digit and Gesture Recognition Using Trajectory Re...
 
Control Buggy using Leap Sensor Camera in Data Mining Domain
Control Buggy using Leap Sensor Camera in Data Mining DomainControl Buggy using Leap Sensor Camera in Data Mining Domain
Control Buggy using Leap Sensor Camera in Data Mining Domain
 
Ls3520052009
Ls3520052009Ls3520052009
Ls3520052009
 
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and DumbIRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
IRJET- Hand Gesture Recognition and Voice Conversion for Deaf and Dumb
 
IRJET- Survey Paper on Vision based Hand Gesture Recognition
IRJET- Survey Paper on Vision based Hand Gesture RecognitionIRJET- Survey Paper on Vision based Hand Gesture Recognition
IRJET- Survey Paper on Vision based Hand Gesture Recognition
 
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
DEVELOPMENT OF CONTROL SOFTWARE FOR STAIR DETECTION IN A MOBILE ROBOT USING A...
 
human activity recognization using machine learning with data analysis
human activity recognization using machine learning with data analysishuman activity recognization using machine learning with data analysis
human activity recognization using machine learning with data analysis
 
Research.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
Research.Essay_Chien-Chih_Weng_v3_by Prof. KarkoubResearch.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
Research.Essay_Chien-Chih_Weng_v3_by Prof. Karkoub
 
Experts Vision- Portfolio Jan23
Experts Vision- Portfolio Jan23Experts Vision- Portfolio Jan23
Experts Vision- Portfolio Jan23
 
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
Real Time Vision Hand Gesture Recognition Based Media Control via LAN & Wirel...
 
Mems Sensor Based Approach for Gesture Recognition to Control Media in Computer
Mems Sensor Based Approach for Gesture Recognition to Control Media in ComputerMems Sensor Based Approach for Gesture Recognition to Control Media in Computer
Mems Sensor Based Approach for Gesture Recognition to Control Media in Computer
 
IRJET- Behavior Analysis from Videos using Motion based Feature Extraction
IRJET-  	  Behavior Analysis from Videos using Motion based Feature ExtractionIRJET-  	  Behavior Analysis from Videos using Motion based Feature Extraction
IRJET- Behavior Analysis from Videos using Motion based Feature Extraction
 
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1) C6
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1)  C6⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1)  C6
⭐⭐⭐⭐⭐ LECCIÓN SISTEMAS EMBEBIDOS, 2do Parcial (2020 PAO 1) C6
 

Modeling Motion in Matlab 7.19.11_v4_Taylor_KKedits

  • 1. 1 Modeling Motion in MATLAB Anthony Taylor Dept. of Computer Science and Mathematics Central State University Wilberforce, Ohio 45384 USA Email: ant.taylor2@gmail.com Abstract A MATLAB program was created using algebraic techniques for solving inverse problems. Through these algorithms, the MATLAB program was structured to import the lengths of the upper arm, forearm, thigh, and calf from a text file and output the two dimensional joint angles to determine the position of the wrist and ankle in space. This paper, then, will explain how the MATLAB program was designed and discuss future applications in gait analysis. 1. Introduction Gait analysis is the study of human locomotion by means of measuring, data collection, and computer applications to determine abnormalities in human walking patterns, gender, or medical disabilities. To understand gait analysis one must first know the basic gait cycle which is heel touch- toe off, heel touch-toe off. There have been many advances in the study of gait analysis since its pioneer Aristotle first introduced the knowledge and techniques for measuring and predicting such patterns in human locomotion. Although major developments of gait analysis weren’t made until the twentieth century, (Inman et al., 1981; Eberhart et. al., 1951; Sutherland et. al., 1980) modified sophisticated measuring instruments such as force plates for clinical applications of gait analysis. Since then, a wide range of temporal and linear techniques have been created to represent models of gait data that describe body movements in relation to joint angles.
  • 2. 2 The techniques used in today’s society have been modernized by the use of high performance computers, digital imaging, and computer software applications. Each technique makes gait behavior easier to study. There are various methods used for gait analysis: collecting sensor data, collecting anatomical data, modeling, digital image processing, video tracking, and computer applicable techniques. Sensor data is a major entity of gait analysis. Sensors are responsive devices that measure, signal, or indicate the properties of an object. There are various types of sensors that can be used to collect data for acceleration, tracking, and pressure. When using sensors to study human locomotion, sensors give the observer the ability to track a specific angle or joint of a subject with the help of active or passive markers. (Figure1. Various types of sensors used for measuring, signaling, and indicating properties.) Anatomical data is data collected from the human body. Examples include the lengths of a limb, degree of joint rotation, etc. Modeling uses the data derived from sensors or anatomical data to replicate a linear or nonlinear structure of motion. Models can be projected onto graphs of two dimensional or three dimensional surfaces. Video tracking records an individual’s gait behavior. The video is then analyzed using image processing techniques which input data from sensors, tracking markers, and specialized digital cameras. Generally a study is conducted with a parameter that is composed of video surveillance. This method can be time efficient, although it is not always accurate due to lighting, shadows, or the natural elements of the experimental field of view.
  • 3. 3 Computer applied techniques are also used to process gait data. These techniques could involve little or no human interaction, and are programmed to run self-sufficiently to import, manipulate, and translate gait data from sensors or video tracking devices. The technique discussed in this paper is a computer applied technique called MOTION, a MATLAB program that uses kinematic and anatomical data from a human subject to predict wrist and ankle placement during the gait cycle. The kinematic data used in MOTION is generated from a VICON Motion Analysis file. The anatomical data of a human subject is collected prior to the gait experiment. Through MOTION the joint angles to predict wrist and ankle coordinates are calculated using algebraic techniques for solving inverse problems. The results are stored in a text file for access and manipulation. The Motion program, then, integrates several gait analysis techniques through one platform. 2. Literature Review Significant research has shown that there are various software techniques for studying and modeling human motion. Researchers (Figueroa et al.,2002), introduced a technique for tracking the passive or active markers on a human subject through a windows based computer application to efficiently measure and study video captured data. (Taylor et. al.,2006), introduced a modeling technique that used a linear dynamical system due to the continuous hidden variables to compute hidden and visible angles of a human subject to resemble motion. (Bowden, 2000) applied the methods of non-linear formations to movements. Bowden used models of deformation to provide a pre-existing state of movements in which an objects motion can be traced and used to simulate motion. The various software techniques mentioned above are related entities of the software application introduced in this paper due to the nature and technique used in the work. The
  • 4. 4 MOTION application is unique from the methods described above because the program is capable of importing VICON Motion Analysis data, and plotting a graphical representation of the data in a single platform as opposed to using different software applications simultaneously. This program can also run on multiple operating systems making it easily accessible, as well as user friendly. 3. Methods To analyze the VICON Motion Analysis data, a program was designed using the MATLAB software environment and programming language. MATLAB is short for Matrix Laboratory. The software is programmer friendly with an environment that meets the demand of high performance computing. MATLAB can import highly complex numerical values for data analysis and simulation. The software also allows users to develop programs to input and output data for graphical representation or visualization of the data. MATLAB also assists in the development of applications in which programmers can create graphical user interfaces (GUI) for manipulating and loading data sets. MATLAB can run on three operating systems: Windows, Mac, and Linux. The system requirements include: Windows o Can be installed on 32 or 64 bit systems with Windows XP, Windows Vista, Windows Server 2003/2008, and Windows 7. Intel or AMD x86 Processors are needed, as well as 3 to 5 GB of disk space and 1024 RAM. Mac
  • 5. 5 o Can be installed on a 64 bit system with MAC OS X Snow Leopard with an Intel Core 2 Processor or later versions are needed, as well as 3 to 5 GB disk space and 1024 RAM. Linux o Can be installed on 32 or 64 bit systems with Ubuntu 10.04 LTS and 10.10 Red Hat Enterprise, Linux 5.x and 6.x, SUSE Linux Enterprise Desktop 11.x, Debian 5.x, an Intel or AMD x86 Processors are needed, as well as 3 to 5 GB of disk space and 1024 RAM. Of these systems, we installed the MATLAB 7.5.0 software package onto a 64 bit Windows 7 operating system with an AMD processor. The text files containing the inputs were imported through MATLAB’s import wizard and separated so the numerical data could be used explicitly. A simple code was created to process the data inputs—lengths of the upper arm, forearm, thigh, and calf--- through algebraic algorithms derived by (Kendricks et. al.,2010), then display the numerical outputs-- the joint angles that determine the position and orientation of the wrist and ankle during the gait cycle. The values were processed through a time delayed loop, and plotted onto a graph. The graph was then traced by a red marker simulating live motion. 4. Results The MOTION program operates by importing a Microsoft Excel file containing anatomical data provided by the VICON Motion Analysis System. This data is located on the operating system’s hard drive and synced with MATLAB. The data in the file is then processed through the algebraic algorithms and exports joint angles describing the position of the wrist and ankle in
  • 6. 6 space. This export file is processed through a for loop in which the loop plots each coordinate of the wrist and ankle onto a graph. Once each point is plotted along the x- and y- axis respectively a marker traces the path of wrist, simulating arm swing. MOTION Code for Plotting the Position and Orientation of the Wrist or Ankle %Program Name: MOTION %Author: Anthony A. Taylor %Date: 6/20/2011 %Description: Inverse Kinematics of human motion. This program will take %the known positions of the wrist, elbow, and shoulder from a .txt file and %apply the variables to algebraic formulas to find the unknown variables: %cos1, cos2, sin1, & sin2. Once all the variables are known, further %algebraic calculations are done to find the degrees of the elbow and %shoulder angles. %Allows users to select .xls file. [z, pathname] = uigetfile('*.xls','Select Excel File'); if isequal(z,0) disp('User selected Cancel') else disp(['User selected', fullfile(pathname, z)]) end %Reads in columns of data, These are the "Known" Variables L1, L2, a, & b. L1 = xlsread(z, 'J:J'); L2 = xlsread(z, 'K:K'); a = xlsread(z,'A:A'); b = xlsread(z,'B:B'); OERplot = xlsread(z,'Kin. Model _Fwd & Inv_Cycle 1','Z:Z'); OSRplot = xlsread(z,'Kin. Model _Fwd & Inv_Cycle 1','AA:AA'); %Apply the "Known" variables to the equation solution sets. SinTheta2Sqr= -((0.25).*L1.^4 - (0.5).*L1.^2.*L2.^2 -(0.5).*(L1.^2.*b.^2)- (0.5).*(L1.^2.* a.^2) + (0.25).*L2.^4 - (0.5).*(L2.^2.*b.^2) - (0.5).*(L2.^2.*a.^2) + (0.25).*b.^4 +0.5.*(b.^2.* a.^2)+0.25.*a.^4)./(L1.^2.*L2.^2); SinTheta2P = sqrt(SinTheta2Sqr); SinTheta2M = SinTheta2P*-1; CosTheta1P = (L2.*a)./(a.^2+b.^2).*SinTheta2P-(-1.*L1.^2.*b+L2.^2.*b-b.^3- b.*a.^2)./(2.*L1.*(a.^2+b.^2)); CosTheta1M = (L2.*a)./(a.^2+b.^2).*SinTheta2M-(-1.*L1.^2.*b+L2.^2.*b-b.^3- b.*a.^2)./(2.*L1.*(a.^2+b.^2)); CosTheta2P = -1.*((L1.^2+L2.^2)-(b.^2-a.^2))./(2.*L1.*L2);
  • 7. 7 SinTheta1P = -1.*(L2.*(b)).*(SinTheta2P)./ ((b).^2 +a.^2) - (-1.*L1.^2.* a + L2.^2.*a - (b).^2.* a-a.^3)./(2.*L1.*((b).^2 +a.^2)); SinTheta1M = -1.*(L2.*(b)).*(SinTheta2M)./ ((b).^2 +a.^2) - (-1.*L1.^2.* a + L2.^2.*a - (b).^2.* a-a.^3)./(2.*L1.*((b).^2 +a.^2)); %Take the inverse to find the Shoulder and Elbow angles Theta 1 & Theta 2 SAThetaOne1 = atan(SinTheta1P./CosTheta1P); EAThetaTwo1 = atan(SinTheta2P./CosTheta2P); ShoulderThetaOne2 = atan(SinTheta1M./CosTheta1M); ElbowThetaTwo2 = atan(SinTheta2M./CosTheta2P); %Actual angle in degrees ElbowAngleDegrees =EAThetaTwo1.*(180./pi); ShoulderAngleDegrees = SAThetaOne1.*(180./pi); ElbowRadian = ElbowAngleDegrees.*(pi./180); ShoulderRadian = ShoulderAngleDegrees.*(pi./180); E = ElbowRadian; S = ShoulderRadian; %Outputs data in an excel file with the following headings and plots the projected shoulder and elbow angles headers = {'Cosine of Theta 1_value 1 Plus','Cosine of theta 1_value 2 Minus','Sine of theta 1 _value1 Plus','Sine of theta 1_value 2 Minus','Shoulder Angles (Theta 1_1)','Elbow Angles (Theta 2_1)','Shoulder (Theta 1_2)','Elbow (Theta 2_2)','Cosine of theta 2','Sine of theta 2 (Squared)','Sine of theta 2_1 Plus','Sine of theta 2_2 Minus','Elbow Angles in Degrees','Shoulder Angles in Degrees','Elbow Angles in Radians','Shoulder Angles in Radians'}; data = [CosTheta1P,CosTheta1M,SinTheta1P,SinTheta1M,SAThetaOne1,EAThetaTwo1,Shoulder ThetaOne2,ElbowThetaTwo2,CosTheta2P,SinTheta2Sqr,SinTheta2P,SinTheta2M,ElbowA ngleDegrees,ShoulderAngleDegrees,ElbowRadian,ShoulderRadian]; xlswrite('DataOutput.xls',headers); xlswrite('DataOutput.xls',data,1,'A2'); %Start plot from position 1 to 100. %Track plot from 1 to 100. x=1:100; DELAY = 0.05; for i = 1:numel(x) clf; plot(x,S,'--r'); hold on; plot(x(i),S(i),'b*'); hold on; plot(x,OSRplot,'.b'); hold on; plot(x(i),OSRplot(i),'r*'); grid on ylabel('Angle in radians')
  • 8. 8 xlabel('% of the gait cycle') title('Shoulder positions') legend('Predicted Shoulder','Marker','Measured Shoulder','Marker') pause(DELAY); end (Figure 2. Shoulder Angles: Measured vs. Predicted) (Figure 3. A two dimensional view of the predicted position of the wrist moving in space.) The code for plotting the joint angles of the shoulder and elbow can also be used to plot the joint angles of the hip and knee. The lower extremity angles can be found by adjusting the input values of L1, L2, which is hip to knee, and knee to ankle, to determine the position of the ankle denoted (a,b). Look for future versions of MOTION to include these modifications so that the positions of the wrist and ankle can be predicted simultaneously. 5. Discussion Through further research with additional human subjects (of various height, weight, race, gender) the MOTION program will simultaneously generate multiple coordinates of the wrist and ankle in space. Advanced functionality of the program will be an asset for generating and synchronizing gait patterns to accurately distinguish abnormalities in real time, and in the future identify a human subject’s height, weight, race, etc. Such modifications can influence clinical studies that can accurately and effectively distinguish abnormal walking patterns caused by stooped posture, muscular disorders, or fractures. Motion analysis can also benefit with an enhanced system for studying video captured data. By accurately measuring video captured data
  • 9. 9 without physical measuring instruments, an identification system can be created to assist with distinguishing criminal terrorist or missing persons, as well as in the field of professional sports to enhance an athlete’s performance. 6. Conclusion This paper provides an overview of gait analysis and the methods used to measure gait. Using the computer applied technique, a MATLAB program called MOTION was created to simplify the analysis of human gait patterns by using algebraic techniques for solving inverse problems. The program imported the lengths and exported the joint angles that determine wrist or ankle position. The program also plotted the position and orientation of the wrist and ankle on a graph. Though MOTION is among many computer applied techniques, future applications will be seen in various branches of law enforcement, medical treatment and research, and professional sports. The need for an accurate and efficient system of measuring walking patterns will be in high demand for many government agencies and software developers, by combining the various methods of obtaining gait data and enhancing the performance of measuring techniques, MOTION will increase the efficiency of gait analysis and computational procedures. 7. References
  • 10. 10 Baker, R. (2007). The history of gait analysis before the advent of modern computers. Gait and Posture, 26(3), 331-342. Benabdelkader, C. Cutler, R. Davism, L. (2004). Gait Recognition Using Image Self-Similarity. Eurasip Journal on Applied Signal Processing, 4, 572-585. Bowden, R. (2000). Learning statistical models of human motion. In IEEE Workshop on Human Modeling, Analysis, and Synthesis, CVPR 2000, IEEE Computer Society. Dugdale, D. Hoch, D. Zieve, D. (2009). Walking Abnormalities. The A.D.A.M. Medical Encyclopedia, Bethesda, MD. Eberhart, H. D. & Inman, V. T. (1951). An evaluation of experimental procedures used in a fundamental study of human locomotion. Ann. N. Y. Acad. Sci. 51, 1213-1228 Figueroa, P. Leite, N.L. Barros, M.L. R. (2002). A flexible software for tracking of markers used in human motion analysis. Computer Methods and Programs in Biomedicine 72 (2003) 155-165. Inman, V. T., Ralston, Henry J. (1981). In Human Walking. Williams & Wilkins, Baltimore.
  • 11. 11 Kendricks, D.K. Fullenkamp, M.A. McGrellis, R. Juhl, J. and Tuttle, F.R. (2010). An Inverse Kinematic Mathematical Model Using Groebner Basis Theory for Arm Swing Movement in the Gait Cycle. Battlespace Acoustics and Magnetic Sensors. Koopman, B. Helm, F. Horsman, K.M. Laboratory Biomechanical Engineering. (2010, September 7). Analysis and Modeling of Gait Disorders. Retrieved May 25, 2011 from http://www.bw.ctw.utwente.nl/research/projects/Analysis.doc/index.html Pallejà, T. Teixidó, M. Tresanchez, M. and Palacín, J. (2009). Measuring Gait Using a Ground Laser Range Sensor. Sensors. 9 (11), 9133-9146. Pollo, F. (2007, April 30). Gait Analysis: Techniques and Recognition of Abnormal Gait. Baylor University Medical Center. Retrieved May 20, 2011 from http://www.scribd.com/doc/46943381/Gait-Analysis-Techniques-and-Abnormal-Patterns-AAA Sutherland, H. D, Olshen, R., Cooper, L. and Wo, SL. (1980) The Development of Mature Gait. The Journal of Bone and Joint Surgery, 62:336-353 Taylor, G.W. Hinton, G.E. and Roweis, S.T. (2006). Modeling human motion using binary latent variables. Advances in Neural Information Processing. MIT Press.
  • 12. 12 Teplitsk, S. (2009). Cluster 3. COSMOS 2009, University of California. Retrieved May 25, 2011 from http://cosmos.ucdavis.edu/archives/2009/cluster3/teplitsky_sarah.pdf