Abstract:To meet the demand for unmanned operations in rice and wheat harvesting, an algorithm using LiDAR to detect the rice and wheat harvest boundary was proposed, and the automatic alignment of the harvest boundary was realized by connecting the unmanned control system. Firstly, the algorithm delimited the angle range of interest for the collected harvesting outline point cloud, converted the measured data from polar coordinates to three-dimensional rectangular coordinates according to the installation height and position of the LiDAR, and corrected the measured point cloud by fusing the LiDAR attitude measured by the gyroscope. The noise and non-crop contour points in the point cloud were filtered by median filtering and Z-direction threshold filtering. The accuracy of K-means clustering and Z-direction central difference method for detecting harvest boundary was compared, and the error analysis was carried out. The sensing system was developed and the CAN communication protocol of sensing and control was established. Point tracking strategy was adopted to automatically control the boundary points detected in real time. The automatic alignment accuracy detection method of rice and wheat harvest boundary was analyzed and studied. In June 2022, the experiment of harvesting boundary detection and automatic alignment control system was carried out at Xiaotangshan National Precision Agriculture Demonstration Base in Beijing. The data were collected and analyzed by using data annotation and GPS pointing respectively. The experiment showed that the average horizontal error of harvesting boundary detection based on K-means clustering was 22.24cm, the average horizontal error of the Z-direction central difference method was 1.48cm, and the Z-direction central difference method was superior to the K-means clustering method. Therefore, the Z-direction central difference method was used for automatic alignment control experiment. The average value of lateral deviation of automatic alignment control system was 9.18cm, and the standard deviation was 2.48cm. The system can be used for unmanned rice and wheat harvesting.