5.2 Extracting the Motion Features
5.2.5 Vicinity
Vicinity features were used by Liwicki et al. (2006) for handwriting recognition, and re- cently by Beyan and Fisher (2013b) for classifying abnormal fish trajectories. In both cases, the feature set was made up of vicinity aspect, curliness, slope and linearity. They were selected to represent part of the motion features, since they consist of features ex- tracted from each point and takes into consideration their neighbouring points and are very robust to noisy data.
In this thesis a three point vicinity, which is defined as the point pkand its preceding (pk−1) and succeeding (pk+1) points enclosed by a bounding box was used (see Figure
5.4). In this case k = 1 . . . Q and Q = 64, which is the length of the short trajectory. Four vicinity features were extracted, which include curliness, aspect, slope and linearity.
Vicinity curliness (Ck) is the total length of the trajectory in the vicinity (Lk = |pk−1pk|+|pkpk+1|) divided by max{δ xk, δ yk} as in Equation 5.17. Where max{δ xk, δ yk}
= max{(xk−xk−1), (xk+1−xk), (yk−yk−1) and (yk+1−yk)}, |pk−1pk| is the distance from
the point pk−1to pkand |pkpk+1| the distance from pk to pk+1.
Ck= Lk
max{δ xk, δ yk}
(5.17)
The ten statistical features as in Equation 5.9 were computed from the vicinity curli- ness features to form the curliness features set (see Equation 5.18). Where curlinessk, j is
the curliness feature set index over k frames and j videos, and SCk, j is the ten statistical features derived from the computed vicinity curliness.
5.2. EXTRACTING THE MOTIONFEATURES 127
Vicinity aspect (Ak) at the point pkgiven by Equation 5.19, is the ratio of the height
hk to the width wk of the bounding box enclosing the vicinity points {pk−1, pk, pk−2} as
shown in Figure 5.4.
Ak= hk
wk (5.19)
The ten statistical features as in Equation 5.9 were computed from the vicinity aspect features to form the aspect features set (see Equation 5.20). Where aspectk, j is the aspect
feature set index over k frames and j videos, and SAk, j is the ten statistical features derived from the computed vicinity aspect.
aspectk, j = {SAk, j} (5.20)
Vicinity slope (SLk) as in Equation 5.21 is computed as the cosine of the angle αkof
the straight line from the first to last vicinity point (see Figure 5.4).
SLk= arccos(p (xk+1− xk−1)
(xk+1− xk−1)2+ (yk+1− yk−1)2
) (5.21)
The ten statistical features as in Equation 5.9 were computed from the vicinity slope features to form this features set (see Equation 5.22). Where slopek, j is the vicinity slope
feature set index over k frames and j videos, and SSLk, j is the ten statistical features derived from the computed vicinity slope.
slopek, j = {SSLk, j} (5.22)
Vicinity linearity (LNk) is the average square distance between all the points within the vicinity and the line joining the first and the last point in the vicinity. For the three point vicinity, there is only one such distance dk(see Figure 5.4). Therefore, in this case,
linearity can be defined as LNk= dk2. Where dk is the perpendicular distance from the
point pkand to the line |pk−1pk+ 1|. Again, the ten statistical features as in Equation 5.9
Figure 5.4: Three points vicinity, with a bounding box enclosed. The height (hk) and
width (wk) of the bounding box are measured for the computation of vicinity aspect.
The vicinity slope is measured as the cosine of the angle between the first (pk−1) and
last (pk+1) point in the vicinity. Vicinity curliness is measured as total length of the
trajectory within the vicinity (that is the length from pk−1 through pk and to pk+1)
divided by the maximum of the changes in x and y within the vicinity. Vicinity linearity is the average square distance (dk) from point pk to the line joining points pk−1 and
pk+1.
(see Equation 5.23). Where linearityk, j is the vicinity linearity feature set index over k
frames and j videos, and SSLk, j is the ten statistical features derived from the computed vicinity linearity.
linearityk, j= {SLNk, j} (5.23)
The feature sets from vicinity curliness, aspect, slope and linearity were then con- catenated to form a 40-feature set for vicinity (see Equation 5.24), which have been used to classify species.
vicinityk, j = {curlinessk, j, aspectk, j, slopek, j, linearityk, j} (5.24)
Where vicinity is the sequence of vicinity features used as part of the motion feature set, index over k frames and j videos.
5.2. EXTRACTING THE MOTIONFEATURES 129
Figure 5.5: The figure shows how the curvature θk is measured given three points, the
predecessor Pk−1and successor Pk+1points of the point Pk.