Abstract:Aiming at the problem that the environment inside the greenhouse is complicated and ORB-SLAM2 cannot build dense maps, the research on the greenhouse robot localization and dense map building method was carried out based on the improved ORB-SLAM2. Firstly, a feature point extraction threshold method was proposed in the tracking thread to adaptively adjust the feature point extraction threshold according to the overall pixels of the image to improve the quality and quantity of feature point extraction. Secondly, on the basis of ORB-SLAM2, combined with the relative position calculation between frames, the amount of rotation and translation was added as the key frame selection condition, which reduced the number of key frames and the average tracking time, and improved the positioning accuracy. Finally, a dense map building thread was introduced to generate fine 3D dense maps by fusing multi-frame point cloud data through point cloud recovery, statistical filtering, point cloud stitching and voxel filtering algorithms. In order to verify the effectiveness and practicality of the method, simulation analysis of public datasets and real scenario tests were conducted, respectively, and the improved algorithm was closer to the real trajectory than the ORB-SLAM2 running trajectory on the Freiburg1_room, Freiburg1_xyz, and Freiburg1_desk sequences, and the average absolute trajectory error was reduced by 46.00%, 29.01%, 39.85%, respectively. Within the greenhouse environments with three different branch and leaf shading, the improved algorithm improved the number of feature point matched by an average of 7.20%, 12.37%, and 12.81% each compared with ORB-SLAM2;meanwhile, the average number of keyframes was reduced from 400, 525, and 1,132 frames to 371, 411, and 708 frames, respectively, and the average tracking time was reduced from 0.0390s, 0.0357s, 0.0318s to 0.0373, 0.0343, and 0.0290s, respectively. The experimental results showed that the estimated trajectory of the improved algorithm basically fit with the actual trajectory of the greenhouse robot, which had good loopback detection performance, and a three-dimensional dense point cloud map of the greenhouse scene was successfully constructed, which accurately restored the real distribution of the crops and aisles in the three-dimensional space. This method can provide technical support for the localization and navigation of greenhouse mobile robots.