Camera pose estimation has a low accuracy and only generates a sparse map in the oriented FAST rotated BRIEF SLAM2 (ORB-SLAM2) system. To compute camera pose and generate a dense map, this study proposes a method that combines the dense direct method and sparse feature-based method adopted by the original ORB-SLAM2 system framework. This method mainly makes three improvements to the ORB-SLAM2 system. First, a new dense constraint unary edge is created in the third-party general graph optimization (g2o) library used in the original system; the photometric error constraint of the dense direct method is added to the g2o library. Second, the rotation transformation between two executive frames is calculated using the dense direct method; then, the improved g2o library is used to simultaneously minimize the re-projection error of the feature-based method and the photometric error of the direct method to compute the 6 degree-of-freedom (DOF) camera pose. Third, a dense reconstruction thread is added in the ORB-SLAM2 system framework and the reconstruction result of the surrounding scene is reported to the user in real time. Experiments conducted on TUM RGB-D and ICL-NUIM datasets reveal that the proposed method considerably improves the accuracy of the camera pose estimation in the ORB-SLAM2 system, produces sparse maps, and reconstructs high-precision dense maps.