Most current visual SLAM systems rely on static environment assumptions. However, in dynamic environments, the presence of dynamic objects can severely impair the performance of visual SLAM systems. To address this issue, we propose an algorithm that combines semantic segmentation and geometric constraints to eliminate the impact of dynamic objects on visual SLAM trajectory accuracy in dynamic indoor environments. First, a missed detection compensation algorithm based on the constant velocity model and region growing algorithm is proposed, which improves the accuracy of semantic or instance segmentation network and realizes accurate segmentation of dynamic objects at the semantic level in the new thread. Second, for the dynamic objects that cannot be recognized by the semantic segmentation network, a geometric constraint model based on the position correlation between feature points is presented to further eliminate the dynamic feature points that do not meet the motion consistency. Thereafter, the proposed method is integrated into the front-end of the ORB-SLAM2 system and evaluated using the RGB-D dataset. Experimental results demonstrate that the proposed method can improve the absolute trajectory accuracy of the ORB-SLAM2 system by an average of 96.90% in high dynamic scenes.