# 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.2 Trajectory-Based Motion Frame Generation  
In dynamic feature extraction, the optical flow algorithm describes the motion features by calculating video trajectories, which provide pixel-level motion information reflecting the dynamic features of the object, such as direction, velocity, and acceleration, and accurately capturing the spatial position and motion changes of the object. Based on these trajectories, it is possible to describe the motion patterns of objects in detail. In order to extract effective dynamic information, this section uses the density-based DBSCA algorithm to cluster the trajectories and identify significant motion regions. (The DBSCA algorithm  
Figure 1: Related process. Figure 2: Structure of CNN for extracting static extraction. is a density-based trajectory-clustering method that automatically identifies core points and clusters by evaluating the density around the data points and is able to handle clusters with complex shapes and effectively identify noise. It does not require a preset number of clusters and is widely used in trajectory analysis, traffic monitoring, and object tracking.) This approach not only reveals the motion patterns in the video but also provides accurate feature inputs for subsequent target tracking and behavioural analysis. The specific algorithm is shown below (Algorithm 1) [5]:  
```
Input: D: region of significant motion in the frame \(\epsilon\): radius parameter of the cluster MinPoints: field density thresholds Output: set of density-based clusters
1: c < 0
2: for each P \(\in\) D do
3: if P is visited then
4: continue
5: end if
6: NeighborPts = getAllPoints(P,\(\epsilon\))
7: if size (NeighborPts) < MinPoints then
8: mark p as noise
9: else
10: c = next cluster
11: addToCluster(P,NeighborPts,c,e,MinPoints)
12: end if
13: mark P as visited
14: end for
15: function addToCluster(P,NeighborPts,c,e,MinPoints)
16: add P to cluster c
17: for each point np \(\in\) NeighborPts do
18: if P is not visited then
19: mark np as visited
20: NeighborPts = getAllPoints(np,\(\epsilon\))
21: if size (NeighborPts) \(\geq\) MinPoints then
22: NeighborPts < NeighborPts joined with NeighborPts
23: end if
24: end if
25: if np is not yet member of any cluster then
26: add np to cluster c
27: end if
28: end for
29: end function
```  
**Algorithm 1** DBSCAN-Based Trajectory-Clustering Algorithm  
After clustering the trajectories, multiple clusters are formed for key motion regions in the video frames. To reduce the influence of noise and unimportant regions, some clusters can be culled. According to the culling rule, if the number of trajectory points of a cluster is less than 50% of the maximum cluster trajectory points of the current frame, the cluster will be culled, and the remaining clusters are used as motion candidate frames. Since each motion candidate frame is centred on the cluster centre and \(\epsilon\) is the radius,circular clusters need to be converted to rectangles in order to achieve scale uniformity. By calculating the Chebyshev distance from each clustered point to the centre, the 20% with the furthest distance are eliminated, thus performing motion frame noise reduction based on the Chebyshev distance. The Chebyshev distance is a distance metric commonly used in mathematics and computer science, especially in the fields of image processing and pattern recognition [6]. It is inspired by the 'king's move' on a chessboard and is therefore also known as the 'chessboard distance' or 'king's distance'. The Chebyshev distance is a measure of the distance between two points and is particularly useful for considering the distance of the largest difference between all axes in a standard coordinate system (e.g., a 2D or 3D coordinate system).