# LiDAR-Based Dense Pedestrian Detection and Tracking
## 2 Methodology
### Dense Pedestrian Detection  
After the processing of clustering and segmentation, some geometric features, such as the width and height of a target, can be used to remove high walls and large buildings. As we all know, pedestrians are non-rigid, and their postures are time-varying. However, pedestrians are generally upright, and the geometric features, such as height and width, will maintain a certain proportion. By extracting these features, pedestrians can be distinguished from obstacles such as trees, traffic lights, and fire hydrants. During the fine segmentation, a large target, such as a vehicle, may be divided into several false pedestrians, in which case the geometric features will play a role in improving the detection performance. Suppose \(P=\{d_{1},d_{2},\ldots,d_{n}\}\) is a point cloud after fine segmentation, where \(d_{i}\) is the 3D position of a single point. The covariance matrix of the point cloud coordinates contains the positional relationship among the points. After eigendecomposition, the eigenvalues and eigenvectors of the covariance matrix can be used to characterize pedestrians. The process of eigendecomposition is given below:  
1. Centralizing all point clouds, \(d_{i}^{\prime}\gets d_{i}-\frac{1}{n}\sum_{i=1}^{n}d_{i}\);
2. Calculate the covariance matrix \(X=\frac{1}{n-1}DD^{T}\), where \(D=[d_{1}^{\prime},d_{2}^{\prime},\ldots,d_{n}^{\prime}]\);
3. Based on eigen-decomposition of the covariance matrix, we can find three eigenvalues \(\lambda_{1},\geq\lambda_{2}\), and \(\geq\lambda_{3}\) and the corresponding eigenvectors \(w_{1},w_{2}\), and \(w_{3}\). The eigenvector \(w_{1}\) corresponds to the maximum eigenvalue, the point cloud has the greatest variance along the vector \(w_{1}\) than other directions, and the variance is \(\lambda_{1}\). The eigenvector \(w_{2}\) corresponds to the second eigenvalue, which is orthogonal to \(w_{1}\) and the variance along the vector \(w_{2}\) is \(\lambda_{2}\). Similarly, \(w_{3}\) is orthogonal to \(w_{1}\) and \(w_{2}\), and the corresponding variance is \(\lambda_{3}\). Based on the eigenvalues and eigenvectors, we can define three features to describe pedestrians. When the pedestrian is upright, then the maximum variance direction of the point cloud should be perpendicular to the ground, which means the eigenvector \(w_{1}\) should be perpendicular to the ground. The ground normal vector \(e\) can be obtained in the ground elimination process using RANSAC. We can take the angle between eigenvector \(w_{1}\) and the vector \(e\) as the first feature. The calculation of the angle \(\theta\) is shown in (4). The distribution of angle \(\theta\) can be modeled by Rayleigh distribution, as shown in (5). The distribution described in (5) can be fitted using real data so as to obtain the parameter \(\sigma_{\theta}\). \[\theta{=}\ \text{acos}(\frac{w_{1}\cdot e}{\|w_{1}\|\|e\|})\quad 0{<}\theta <\frac{\pi}{2} \tag{4}\]  
\[p(\theta,\sigma_{\theta})=\frac{\theta}{\sigma_{\theta}^{2}}\exp(-\frac{ \theta^{2}}{2\sigma_{\theta}^{2}}) \tag{5}\]  
Based on the report [35], which presents the results of a comprehensive anthropometric survey of U.S. Marines, \(\lambda_{1}\) is the variance of the point cloud projected in the direction \(w_{1}\), which is positively correlated with the height of pedestrians. Similarly, \(\lambda_{2}\) and \(\lambda_{3}\) can reflect the width of the human body. However, \(\lambda_{1}\), \(\lambda_{2}\), and \(\lambda_{3}\) vary as the number of points changes. The two ratios shown in (6) and (7) are useful to describe human outline. \[r_{1}=\lambda_{1}/\lambda_{2} \tag{6}\]  
\[r_{2}=\lambda_{2}/\lambda_{3} \tag{7}\]  
When LiDAR rays are uniformly distributed in space, assuming that the pedestrian's height is \(H\), shoulder width is \(W\), and chest depth is \(D\), we use (8)-(10) to estimate \(\lambda_{1}\), \(\lambda_{2}\), and \(\lambda_{3}\), respectively.