# Improved Video Action Recognition Based on Pyramid Pooling and Dual-Stream C3D Networks
## 2 Methodology
### Static and Dynamic Feature Extraction for Character Movement
#### 2.1.3 Dynamic Feature Extraction Based on Motion Tubes  
Motion pipelines are motion trajectories extracted in video frames that are linked together by consecutive time frames to form a spatio-temporal structure connecting multiple time steps [8]. In the previous section, after generating motion candidate frames by clustering the trajectories in the video frames with the DBSCAN algorithm, these motion frames need to be further processed to construct a standardised dynamic feature representation. Since each video frame has a different number and size of motion frames, the number and size of motion frames in each frame must be standardised for subsequent dynamic feature analysis. Assuming that the input video is Vi, it can be expressed as follows after firstly splitting it into n video segments: since there are several important motion regions in each video frame, thus forming different motion frames, the video segment v,t can be described by the motion frames in each frame as shown in Equation (1), Vi = [vi, 1, vi,2,...]  
\[\text{g}(v_{i,t})=\big{\{}\big{[}b_{t,1,1},b_{t,1,2}\ldots b_{t,1,p}\big{]}, \big{[}b_{t,2,1},b_{t,2,2},\ldots b_{t,2,p}\big{]}\ldots\big{[}b_{t,n,1},b_{t, n,2},\ldots b_{t,n,p}\big{]}\big{\}} \tag{1}\]  
where b,n,r denote the rth motion frame. It is worth mentioning that in the nth frame of the tth video clip, each frame has a different number of motion frames. When the number of motion frames in a video frame is different, some motion frames may not be able to form a motion pipeline, and some motion frames that are not part of the motion pipeline may end up in the motion pipeline, which will change the way the motion is described. Therefore, in order to ensure that each motion frame is connected between nearby frames, it is necessary to unify the number of motion frames in each frame if one wishes to use motion frames to create a motion pipeline between subsequent frames [9]. We first determine the average number of motion frames for each frame in a video clip, assuming that each frame of a video clip with w consecutive frames has an average of N motion frames. This allows us to unify the number of motion frames for each video frame in the video clip. If the number of motion frames in the current frame is more than N, all subsequent motion frames after N are deleted in order to ensure that the video frames contain the same number of motion frames; if the number of motion frames in the current frame is less than N, motion frames are generated manually using linear regression for each x, y, and r in the vector b = (x, y, r, f). By following the above steps, we obtain the video clips with a consistent number of motion frames as shown in Equation (2):  
\[\mathrm{h}(\mathrm{g}(v_{i,t}))=\{[b_{t,1,1},b_{t,1,2}\ldots b_{t,1,k}],[b_{t,2,1},b_{t,2,2},\ldots b_{t,2,k}]\ldots[b_{t,n,1},b_{t,n,2},\ldots b_{t,n,k}]\} \tag{2}\]  
Now all that needs to be carried out is to use Equation (2) to construct the motion pipe describing the dynamic features; it is known that 1, 1, bt, m + 1, 1, bt, m + 1, 2, \(\ldots\), bt, m + 1, bt, m, k, and k are all motion frames in frame m and frame m + 1, respectively, and all motion frames in these two frames are now computed to form the Euclidean distance matrix between motion tubes in Equation (3) [10]:  
\[D= \begin{bmatrix}D_{11}&D_{12}&\ldots&D_{1k}\\ D_{21}&D_{22}&\ldots&D_{2k}\\ \vdots&\vdots&\vdots&\vdots\\ D_{k1}&D_{k2}&\ldots&D_{kk}\end{bmatrix}  \tag{3}\]  
where Dij is the Euclidean distance between the ith motion frame in m frames and the jth motion frame in m + 1 frames, and D is the Euclidean distance between all motion frames in m frames and m + 1 frames. After determining the Euclidean distance between each motion frame and each neighbouring frame, the connection of all motion frames in the neighbouring frames can be performed. A specific connection is made by assuming that Dij is the smallest value in row i. The ith motion frame is connected to the jth motion frame in frame m [11].