## 2 Materials and Methods
### Crop Row Recognition and Navigation Line Extraction  
#### 2.2.1 Point Cloud Filtering and Coordinate Transformation  
Due to the influence of environmental factors, LiDAR hardware, and the physical characteristics of scanned objects, the acquired point cloud data inevitably contain noise. These noisy points not only increase the data volume but also reduce the accuracy of object recognition and feature extraction. Therefore, this study employs the Kalman filtering algorithm to process the raw point cloud data. The Kalman filter is computed using the following formulation:  
\[\hat{x}_{k|k-1}=A\hat{x}_{k-1|k-1}+Bu_{k} \tag{1}\]  
\[P_{k|k-1}=AP_{k-1|k-1}A^{T}+Q \tag{2}\]  
\[\hat{x}_{k|k}=\hat{x}_{k|k-1}+K_{k}(z_{k}-H\hat{x}_{k|k-1}) \tag{3}\]  
\[K_{k}=P_{k|k-1}H^{T}(HP_{k|k-1}H^{T}+R)^{-1} \tag{4}\]  
In the equation, \(P\) represents the error covariance matrix; \(A\), \(B\), and \(H\) denote the state transition matrix, control matrix, and observation matrix, respectively; \(Q\) and \(R\) correspond to the process noise and observation noise covariance matrices; and \(K_{k}\) is the Kalman gain.  
In this study, the 3D spatial coordinates of each point in the LiDAR point cloud are modeled and updated as the state variables in the Kalman filter, enabling dynamic optimization of position fluctuations. After filtering, high-frequency noise is effectively suppressed, and the continuity between adjacent points is significantly enhanced. As shown in Figure 3, the filtered point cloud provides a reliable and structured data foundation for subsequent crop row recognition and modeling.  
Figure 2: LiDAR angle adjustment device.  
To ensure coordinate consistency, a coordinate transformation was performed on the crop point cloud data, converting the LiDAR-based coordinates into the global (world) coordinate system, as illustrated in Figure 4. The original \(XYZ\) coordinate system is defined by the LiDAR sensor, which changes dynamically with the movement and tilt of the mobile platform. After transformation, the point cloud data are aligned with the fixed global coordinate axes (\(X_{w}\), \(Y_{w}\), \(Z_{w}\)), ensuring spatial consistency and accuracy throughout the analysis.  
To transform the point cloud data from the LiDAR coordinate system to the world coordinate system, the overall rotation matrix of the LiDAR frame, denoted as \(R\), is defined. The calculation of \(R\) is given by the following equation:  
\[R=R_{x}(\alpha)\cdot R_{y}(\beta)\cdot R_{z}(\gamma) \tag{5}\]  
In the equation, \(\alpha\), \(\beta\), and \(\gamma\) represent the rotation angles of the LiDAR point cloud around the X, Y, and \(Z\) axes, respectively.  
The simplified rotation matrix is then expressed as follows:  
\[R_{Y}(\theta)=\begin{bmatrix}\cos\theta&0&\sin\theta\\ 0&1&0\\ -\sin\theta&0&\cos\theta\end{bmatrix} \tag{6}\]  
Figure 4: Schematic diagram of coordinate transformation.  
Figure 3: Kalman filtering effect on point cloud data.  
Furthermore, the coordinate transformation matrix was applied to convert the point cloud data from the LiDAR coordinate system to the world coordinate system. The transformation is performed according to the following equation:  
\[\begin{bmatrix}x\\ y\\ z\end{bmatrix}=R_{y}(\theta) \tag{7}\]  
In the equation, \(\theta\) denotes the LiDAR tilt angle (in degrees); \(x^{\prime},y^{\prime}\), and \(z^{\prime}\) represent the coordinates of the point cloud in the LiDAR coordinate system; and \(x,y,\) and \(z\) correspond to the transformed coordinates in the world coordinate system.