Abstract:To address the problems of poor positioning accuracy and mapping error in the traditional simultaneous localization and mapping algorithms under the complex dynamic environments with dynamic objects, a semantic RGBD-SLAM algorithm in dynamic scenes is proposed, which is based on the optical flow. Firstly, the camera ego-motion is compensated by the optimized 2D perspective correction method based on adjacent frames. Secondly, by feeding the compensated perspective images into the RIFT-S network, the lowresolution dense optical flow field is obtained for extracting the current mask of the dynamic region. The dynamic regions in the current mask are tracked and optimized by using the position and velocity of the dynamic regions in previous mask. The accurate dynamic regions in each frame can be extracted. Finally, the static and dynamic features are separated, and the optimized camera pose is obtained by minimizing the reprojection error of the static feature points. The static semantic octree map without people is established by the depth data from camera and semantic information produced by the lightweight semantic segmentation network BiSeNetv2. Compared with ORBSLAM2, the test results on the public data set of TUM indicate that the absolute trajectory error of the proposed algorithm is reduced by more than 90% , and the accurate masks of dynamic regions and an accurate semantic map also can be obtained. Results show that the proposed algorithm has a good positioning accuracy and robustness under complex dynamic scenes.