Aiming at the problems of large trajectory error and low efficiency of visual simultaneous localization and mapping (SLAM) algorithms in low light environments, a visual SLAM algorithm based on oriented fast and rotated brief (ORB)-SLAM2 is proposed by fusing an image brightness enhancement module and inertial measurement unit (IMU) information. Aiming to improve the number of key frames generated by the algorithm in low- light environments, a Gamma correction factor that can adaptively change according to image brightness is designed to extract the feature points after adaptively adjusting the brightness of the low-light image selected by the brightness threshold. The extracted feature points are tracked using Lucas-Kanade (LK) optical flow, to estimate the initial pose, which is further optimized by using vision and IMU information to improve the operation efficiency and robustness of the algorithm. Experiments are conducted on public datasets and Bingda robot operating system (ROS). The results show that compared with ORB-SLAM2, the average absolute trajectory error, average relative pose error, and average tracking time per frame of the improved algorithm are reduced by 35 %, 25 %, and 24 %, respectively, which proves that the accuracy and efficiency of the algorithm presented in this paper are higher, and the algorithm has good practical value for applications in low light environments.