The Analysis of Basketball Free Throw Trajectory using PSO Algorithm
Pawel Lenik
1
, Tomasz Krzeszowski
2
, Krzysztof Przednowek
1
and Justyna Lenik
1
1
Faculty of Physical Education, University of Rzeszow, Rzeszow, Poland
2
Faculty of Electrical and Computer Engineering, Rzeszow University of Technology, Rzeszow, Poland
Keywords:
Ball Trajectory, Object Tracking, Particle Swarm Optimization, Basketball.
Abstract:
The following paper described the method for automatic measurement of selected parameters of a basketball
free throw trajectory. The research material was based on 10 sequences recorded by a monocular camera. For
tracking the ball the particle swarm optimization (PSO) algorithm was used. Additionally the method of ball
detection was developed. The study was conducted on a group of 10 basketball players who participated in the
Polish Second Division during the 2014/2015 season. The 10 parameters (four distances, three velocities, and
three angle parameters) were taken into account. The experimental results showed that the value of the initial
angle was equal to 47.27±4.42 degrees, and the height of ball trajectory was at the level of 3.84±0.34 m. The
correlation between body height and parameter of a free throw was also determined. The analysis conducted
showed a significant correlation between the height and shape of a free throw trajectory. The suggested method
can be used in the training process as a tool to improve performance of the free throw.
1 INTRODUCTION
A free throw is the special component of technical
preparation of every player, which is based on au-
tomation of movement. It is always performed in
the same way (correct rhythm and speed). If any-
one thinks about winning, effectiveness of free throws
should be at a high level. There are a lot of technical
aspects of a free throw, but it is generally said that
the most important thing is the effectiveness, which
equals 90% for the best players.
Free throws could have an important meaning for
the final score. Therefore, nobody can disregard this
element and its impact for the game. Research con-
ducted in this case concerns many of aspects, but the
main purpose is the correction of effectiveness of a
free throw. Hamilton and Reinschmidt (Hamilton and
Reinschmidt, 1997) analyzed the throw angle, speed
of the ball and impact of those components on accu-
racy. Whereas, Button et al. (Button et al., 2003)
have evaluated the posture of the player during a free
throw. In other studies (Englert et al., 2015) scientists
rated the level of concentration of the player, who is
throwing free throws. Gablonsky and Lang (Gablon-
sky and Lang, 2005) presented a different approach.
They elaborated mathematical model of a free throw,
which contains an ejection angle and velocity of the
ball. These studies have been extended by Murphy
(Murphy, 2012). The author focused on finding the
best parameters of a free throw. The player’s body
height, speed and angle of the ball’s throw were con-
sidered. The conclusion of this research is that the
taller players have smaller ejection angle and speed
of the ball. A similar problem was presented by Tran
and Silverberg (Tran and Silverberg, 2008), who ana-
lyzed an ejection angle, speed, rotation and height of
the ball’s flight. The performed studies show that the
effectiveness of the throw is equal to 70%, when the
ball leaves the player’s hands at an angle of 52
.
The quality of technical elements is based on ac-
curacy and precision of the move. It is really hard
to rate because it is only a visual observation. That
is why every year we have a lot of new studies con-
taining automatic and half-automatic analyzing play-
ers move at sport (Liu et al., 2010; Xu et al., 2001).
Technological progress facilitates observation and
evaluation of technical elements. In recent years sci-
entists using multimedia equipment, showed several
methods of game analysis in team sports. Notewor-
thy is the research by Per
ˇ
se et al. (Per
ˇ
se et al., 2009),
which provided a system to detect basic technical ele-
ments during a basketball game. This system showed
trajectory move of the players in defense and offense.
Video analysis was also used by Hua-Tsung Chean et
al. (Chen et al., 2012), who presented a method based
on observation typical moves of individual players.
250
Lenik, P., Krzeszowski, T., Przednowek, K. and Lenik, J..
The Analysis of Basketball Free Throw Trajectory using PSO Algorithm.
In Proceedings of the 3rd International Congress on Sport Sciences Research and Technology Support (icSPORTS 2015), pages 250-256
ISBN: 978-989-758-159-5
Copyright
c
2015 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
The system automatically detects if team play rather
defensively of offensively .
The main objective of this study was to develop
a method for automatic measurement of selected pa-
rameters of a basketball free throw trajectory. The
system was based on particle swarm optimization al-
gorithm and utilized video data captured by a monoc-
ular camera. The main contribution of this work was
to develop the methods of ball tracking and detection.
The PSO algorithm has been used to track the ball.
For automatic ball detect the circularity factor and the
size of segmented objects were taken into account.
2 MATERIAL AND METHODS
2.1 Data Collection
The study was conducted on a group of basketball
players who participated in the Polish Second Di-
vision during the 2014/2015 season. The analysis
included 10 males aged 19.4 ± 2.8. Players were
described by the parameters: body height 190.9 ±
4.9 cm, body mass 77 ± 8.7 kg, and BMI 21.2 ± 1.9.
Throughout the research, the sequence of a free throw
in the regulation conditions was captured. In the anal-
ysis one of correct shots for each player was used.
The sequences were captured by a monocular 100 Hz
Basler Ace acA645-100gc camera. The camera was
placed 4.6 m from the predicted trajectory of the ball
and perpendicularly to it. It should be noted that the
ideal perpendicular positioning is very difficult to im-
plement under the experimental conditions. Camera
calibration was done on the basis of the distances be-
tween the characteristic objects on the scene (the bas-
ketball court), such as lines, intersection of lines, bas-
ket, etc.
The analysis included 10 parameters in three
phases of throw (Figure 1). The measured parameters
were: velocities in three phases (v
1
, v
2
, v
3
), angles of
the moving ball (α
1
, α
2
, α
3
), height parameters (h
1
,
h
2
) and distance parameters (l
1
, l
2
). The description
of the specified parameters is shown in Table 1.
2.2 Basketball Detection
An important aspect of the proposed method for ob-
taining a trajectory of basketball free throw is detec-
tion of the ball. Ball detection method enables auto-
matic initialization of tracking and it can be used to
re-detection in case of a tracking failure. For the ex-
traction of moving objects the background subtraction
algorithm (Zivkovic and van der Heijden, 2006) was
used. After extraction, for each object, two conditions
Table 1: Description of parameters used in analysis.
Parameter Description
h
1
[m] height between ball and basket
h
2
[m] height of ball parabola
l
1
[m] distance between 1st and 2nd phase
l
2
[m] distance between 2nd and 3rd phase
v
1
[m/s] velocity of ball in 1st phase
v
2
[m/s] velocity of ball in 2nd phase
v
3
[m/s] velocity of ball in 3rd phase
α
1
[
] angle of ball in 1st phase
α
2
[
] angle of ball in 2nd phase
α
3
[
] angle of ball in 3rd phase
Figure 1: Analyzed parameters of a basket throw.
are checked; if both are true, the object is classified as
a ball. The first condition concerns the size of the
object and is determined by comparing the radius of
enclosing circle of the object with a ball radius. The
first condition has the form:
|
r
o
r
b
|
< m, (1)
where r
o
is radius of enclosing circle of the consid-
ered object, r
b
is radius of the ball and m is margin
factor, whose value was set at 22% of r
b
. The second
condition uses the circularity factor f
c
=
4πA
P
2
(Ritter
and Cooper, 2009), where A is the area of the object
and P is the perimeter of the object. Value of f
c
for a
perfectly round object is equal to 1. The second con-
dition has the form:
T
c
< f
c
, (2)
where T
c
is circle threshold equals to 0.78. Values
of m and T
c
have been determined experimentally. If
both conditions are true it means that the object un-
der consideration is a ball and tracking process can be
started. Additionally, in order to minimize the risk of
false alarms, all the objects before the free-throw line
and also below the height of 1.5 meter are removed.
The Analysis of Basketball Free Throw Trajectory using PSO Algorithm
251
2.3 Ball Tracking
In the ball tracking process, the particle swarm op-
timization algorithm (PSO) (Kennedy and Eberhart,
1995), was used. Its usefulness in solving problems
related to object tracking has been repeatedly con-
firmed (Kwolek, 2009; Kwolek et al., 2012). In PSO
algorithm, particle swarm is used in order to find the
best solution; each of the particles represents a hypo-
thetical solution of the problem. During the estima-
tion, particles explore the search space and exchange
information. Each i-th particle contains the current
position x
i
, velocity v
i
, and its best position pbest
i
.
Moreover, the particles have access to the best global
position gbest, which has been found by any particle
in the swarm. The d-th components of velocity and
position of each particle are updated based on the fol-
lowing equations:
v
k+1
i,d
= ω[v
k
i,d
+ c
1
r
1,d
(pbest
i,d
x
k
i,d
)
+ c
2
r
2,d
(gbest
d
x
k
i,d
)], (3)
x
k+1
i,d
= x
k
i,d
+ v
k+1
i,d
, (4)
where ω is a constriction factor, c
1
, c
2
are positive
constants and r
1,d
, r
2,d
are uniformly distributed ran-
dom numbers. Selection of the best position for i-th
particle (pbest
i
) and best global position (gbest) are
based on the fitness function value, which determines
whether a considered part of the image contains the
tracked object or not. In our application the position
of i-th particle represents the hypothetical position of
a ball.
3 RESULTS
The monocular ball tracking method was evaluated on
10 video sequences with a basketball free throw. The
quality of tracking was made by analyses carried out
through qualitative visual evaluations. In Figure 2 and
Figure 3 the ball tracking results for selected play-
ers were presented. As can be observed the proposed
method tracking of the ball has very good accuracy.
The analysis of the data in Table 2 indicates that
the maximum altitude of the ball (h
2
) is 4.03 m while
the minimum is equal to 3.67 m. In the case of the
parameter h
1
, measured from the beginning of a alti-
tude of the ball to the basket height, it can be observed
that most players reach the height of about 1 m. Only
in case of one player this parameter did not exceed
0.3 m.
The distance analysis of the first part of the ball
trajectory l
1
(measured from P
1
to P
2
- see Figure 1),
showed that the majority of throwing players could
achieve the length of approximately 2.4 m. Consider-
ing the length l
2
(measured from P
2
to P
3
), it can be
seen that half of the examined participants could score
the distance within the range from 1.7 m to 1.79 m.
The value of an initial angle (α
1
) for most players
reaches a size smaller than 50
. According to earlier
works (Hudson, 1982; Chen et al., 2009) an initial
angle of the ball should be about 52
, it can be as-
sumed that in such a case we will be dealing with a
correct throw. Analyzing the results it may be noted
that among the surveyed players only one player came
close to this value (α
1
= 52.82
). Among the ana-
lyzed players, the greatest initial angle of ball is at the
level of 53.59
.
According to Hamilton and Reinschmidt (Hamil-
ton and Reinschmidt, 1997) the optimum speed (v
1
),
which is achieved when the ball is thrown, is approx-
imately 7.3 m/s. Analyzing the data it can be seen
that the lowest speed is equal to 5.54 m/s and the
highest and therefore most similar to the standard is
6.62 m/s. The arithmetic average for this parameter is
6.18 m/s. Considering the initial velocity there may
be noticed a certain regularity. Players whose ampli-
tude of parabolic flight of the ball (h
2
) reaches the
greatest values (3.93 m and 4.03 m), throw the ball
at a slower speed (v
1
) 5.54 m/s and 6.13 m/s. It is
also noted that the speed v
2
is lower (3.67 m/s and
3.90 m/s) in athletes whose parabola height (h
2
) is
also relatively high.
Another analyzed parameter is the angle α
2
(the
ball angle at the highest point of the trajectory). The
study shows that the obtained results oscillate be-
tween 6.94
to 13.55
. The majority of the players
threw the ball at the speed above 4 m/s at the highest
point of the trajectory (v
2
). The lowest ball speed at
this point was 3.67 m/s. In addition, studies show that
the greatest angle of the ball falling into the basket
(α
3
) was 43.01
and the lowest 30.08
, whereas the
arithmetic average reached 36.64
. For more than half
of the monitored players the ball at this point reached
the speed (v
3
) of approximately 5 m/s.
While analyzing the ball trajectory charts, it can
be deduced that the majority of the players failed to
perform a clean throw. In four cases, the ball bounced
repeatedly off the rim or the backboard (Figure 4 (a,
b, d, f)) before falling into the basket. Two players
accomplished a throw, where the ball once bounced
off the basket (Figure 4 (c, g)). However, four players
performed a clean throw (the ball did not hit the board
nor the rim) (Figure 4 (e, h, i, j)).
The next element of the analysis is to examine
the relation between the player’s height and various
parameters of the ball’s trajectory (see Figure 5 and
Table 3). The conducted analysis shows that in two
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
252
Frame #85
Frame #106
Frame #143
Frame #177
Frame #200 Frame #259
Figure 2: Ball tracking in selected frames of sequence 4.
Figure 3: Ball tracking in selected frames of sequence 6.
cases the correlation coefficient presents the statis-
tical significance, i.e.: dependence with h
2
param-
eter (r
xy
= 0.78, p = 0.01) and with v
2
parameter
(r
xy
= 0.65, p = 0.04). Figure 5 shows that the rela-
tion between the body height and h
2
is characterized
by a positive direction. This implies that the higher
player the higher positioned point P
2
. However, it
should be noted that the taller players, the flatter their
throws will be. In the example of the second stated
dependence, it is noted that the taller the player, the
lower speed of the ball in the second phase of a ball’s
flight is (v
2
). Therefore it can be concluded that the
height of the body has the influence on the shape of
the parabola line.
The Analysis of Basketball Free Throw Trajectory using PSO Algorithm
253
0 1000 2000 3000 4000
1500 2000 2500 3000 3500
distance [mm]
height [mm]
a
0 1000 2000 3000 4000
1500 2000 2500 3000 3500
distance [mm]
height [mm]
b
0 1000 2000 3000 4000
0 1000 2000 3000 4000
distance [mm]
height [mm]
c
0 1000 2000 3000 4000
1000 2000 3000 4000
distance [mm]
height [mm]
d
0 1000 2000 3000 4000
500 1500 2500 3500
distance [mm]
height [mm]
e
1000 2000 3000 4000 5000
1000 2000 3000
distance [mm]
height [mm]
f
0 1000 2000 3000 4000
1000 1500 2000 2500 3000 3500
distance [mm]
height [mm]
g
1000 2000 3000 4000
1000 2000 3000
distance [mm]
height [mm]
h
0 1000 2000 3000 4000 5000
1000 2000 3000 4000
distance [mm]
height [mm]
i
1000 2000 3000 4000 5000
500 1500 2500 3500
distance [mm]
height [mm]
j
Figure 4: Ball trajectory for 10 sequences.
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
254
Table 2: Ball parameters of free throw trajectory.
Player h
1
[m] h
2
[m] l
1
[m] l
2
[m] v
1
[m/s] v
2
[m/s] v
3
[m/s] α
1
[
] α
2
[
] α
3
[
]
1 1.17 3.88 2.40 1.50 6.34 3.67 4.47 52.82 12.38 36.95
2 0.86 3.86 2.45 1.83 6.38 4.18 5.03 47.83 7.93 36.16
3 0.93 3.87 2.43 1.84 6.62 4.14 4.40 49.09 9.33 35.60
4 0.96 3.93 2.43 1.79 5.54 3.90 4.19 53.59 11.01 36.04
5 0.99 3.90 2.38 1.58 6.43 4.10 4.90 49.33 10.13 35.27
6 0.41 3.78 2.16 1.73 5.97 4.28 4.90 41.38 9.39 35.67
7 1.14 3.67 2.43 1.70 6.30 4.10 4.28 49.67 6.94 30.08
8 0.53 3.71 2.29 1.70 6.14 4.38 5.10 42.51 9.56 38.15
9 0.22 4.03 2.33 1.94 6.13 4.19 5.41 44.15 13.55 43.01
10 0.38 3.79 2.22 1.72 5.94 4.08 4.86 42.32 12.52 39.55
¯x 0.76 3.84 2.35 1.73 6.18 4.10 4.75 47.27 10.27 36.64
SD 0.11 0.34 0.10 0.13 0.31 0.20 0.40 4.42 2.10 3.31
Table 3: Correlation between body height and parameters of free throws; r
xy
– correlation coefficients, p – p-value.
h
1
h
2
l
1
l
2
v
1
v
2
v
3
α
1
α
2
α
3
r
xy
0.11 0.78 0.27 0.11 -0.24 -0.65 -0,08 0.49 0.56 0.35
p 0.77 0.01 0.44 0.77 0.50 0.04 0.83 0.15 0.09 0.33
175 180 185 190
3.70 3.75 3.80 3.85 3.90 3.95 4.00
175 180 185 190
3.7 3.8 3.9 4.0 4.1 4.2 4.3 4.4
body height [cm]
v
2
Figure 5: Relationships between body height and parameters h
2
and v
2
; red line shows regression line (directions of correla-
tion).
4 CONCLUSIONS
The paper presented the method for detection and
tracking the ball during a basketball free throw. The
experimental results were conducted on 10 sequences.
The values of 10 parameters were measured. Addi-
tionally the analysis of the relationship between body
height and parameters of trajectory was calculated.
The suggested method can be used in the train-
ing process as a tool to improve performance of free
throws. Coach using this application will be able
to monitor the trajectory of the ball which will help
to improve the correct motor habit. In consequence
player’s throws will be executed with the correct tim-
ing and with optimal trajectory.
The future work will focus on developing and im-
proving the system for obtaining a free throw tra-
jectory and developing an expert system that would
The Analysis of Basketball Free Throw Trajectory using PSO Algorithm
255
allow the automatic evaluation of performed free
throws.
REFERENCES
Button, C., Macleod, M., Sanders, R., and Coleman, S.
(2003). Examining movement variability in the bas-
ketball free-throw action at different skill levels. Re-
search Quarterly for Exercise and Sport, 74(3):257–
269. PMID: 14510290.
Chen, H.-T., Chou, C.-L., Fu, T.-S., Lee, S.-Y., and Lin,
B.-S. P. (2012). Recognizing tactic patterns in broad-
cast basketball video using player trajectory. Journal
of Visual Communication and Image Representation,
23(6):932 – 947.
Chen, H.-T., Tien, M.-C., Chen, Y.-W., Tsai, W.-J., and
Lee, S.-Y. (2009). Physics-based ball tracking and 3d
trajectory reconstruction with applications to shoot-
ing location estimation in basketball video. Journal
of Visual Communication and Image Representation,
20(3):204–216.
Englert, C., Bertrams, A., Furley, P., and Oudejans, R. R.
(2015). Is ego depletion associated with increased dis-
tractibility? Results from a basketball free throw task.
Psychology of Sport and Exercise, 18:26 – 31.
Gablonsky, J. M. and Lang, A. S. (2005). Modeling basket-
ball free throws. SIAM Review, 47(4):775–798.
Hamilton, G. R. and Reinschmidt, C. (1997). Optimal tra-
jectory for the basketball free throw. Journal of Sports
Sciences, 15(5):491–504. PMID: 9386207.
Hudson, J. L. (1982). A biomechanical analysis by skill
level of free throw shooting in basketball. Biomechan-
ics in sports, pages 95–102.
Kennedy, J. and Eberhart, R. (1995). Particle swarm opti-
mization. In Proc. of IEEE Int. Conf. on Neural Net-
works, volume 4, pages 1942–1948. IEEE Press, Pis-
cataway, NJ.
Kwolek, B. (2009). Object tracking via multi-region covari-
ance and particle swarm optimization. 11th IEEE Int.
Conf. on Advanced Video and Signal Based Surveil-
lance (AVSS), 0:418–423.
Kwolek, B., Krzeszowski, T., Gagalowicz, A., Woj-
ciechowski, K., and Josinski, H. (2012). Real-
time multi-view human motion tracking using particle
swarm optimization with resampling. In Perales, F.,
Fisher, R., and Moeslund, T., editors, Articulated Mo-
tion and Deformable Objects, volume 7378 of Lecture
Notes in Computer Science, pages 92–101. Springer
Berlin Heidelberg.
Liu, Y., Huang, C., and Liu, X. (2010). A new method to
classify shots in basketball video. In Proceedings of
the Second International Symposium on Networking
and Network Security (ISNNS 10), pages 153–156.
Murphy, L. (2012). Modeling baskestball free throws. In
17th Annual Statewide Undergraduate Research Con-
ference at UMass Amherst.
Per
ˇ
se, M., Kristan, M., Kova
ˇ
ci
ˇ
c, S., Vu
ˇ
ckovi
ˇ
c, G., and Per
ˇ
s,
J. (2009). A trajectory-based analysis of coordinated
team activity in a basketball game. Computer Vision
and Image Understanding, 113(5):612 621. Com-
puter Vision Based Analysis in Sport Environments.
Ritter, N. and Cooper, J. (2009). New resolution indepen-
dent measures of circularity. Journal of Mathematical
Imaging and Vision, 35(2):117–127.
Tran, C. M. and Silverberg, L. M. (2008). Optimal re-
lease conditions for the free throw in men’s basketball.
Journal of Sports Sciences, 26(11):1147–1155.
Xu, P., Xie, L., Chang, S.-F., Divakaran, A., Vetro, A.,
and Sun, H. (2001). Algorithms and system for seg-
mentation and structure analysis in soccer video. In
IEEE Int. Conf. on Multimedia and Expo 2001 (ICME
2001), pages 928 –931.
Zivkovic, Z. and van der Heijden, F. (2006). Efficient
adaptive density estimation per image pixel for the
task of background subtraction. Pattern Recogn. Lett.,
27(7):773–780.
icSPORTS 2015 - International Congress on Sport Sciences Research and Technology Support
256