To deal with low pose estimation accuracy and poor mapping performance of existing RGB-D SLAM (simultaneous localization and mapping) systems in indoor dynamic environments, an RGB-D SLAM algorithm with gridding segmentation and dual map coupling is proposed. Based on homography motion compensation and bidirectionally compensated optical flow method, gridding motion segmentation is achieved according to the geometrical connectivity and clustering result on depth images. Meanwhile, the speed of the algorithm in the segmentation process is ensured. Only features in the static region are used to estimate the camera position by minimizing the reprojection error. By combining camera poses, RGB-D images, and gridding motion segmentation images, the sparse point cloud map and the static octree map of the scene are constructed simultaneously and coupled. The static map points are filtered out with the gridding segmentation method and the octree map based ray traversal method on the keyframes, and thus the sparse point cloud map is updated to ensure the positioning accuracy. Experimental results on public datasets and in actual dynamic scenes show that the proposed method can effectively improve the accuracy of camera pose estimation in indoor dynamic scenes and achieve the real-time construction and update for static octree maps of scenes. Moreover, the proposed method can run in real-time on common CPU hardware platforms without additional computational resources, such as GPU.