In this paper, we propose a stereo simultaneous localization and mapping (SLAM) method based on line segments. For the front-end module of SLAM, we designed a novel method based on the coplanar junction detection, description, and matching. Then the junctions along with their multi-scale rotated BRIEF descriptors are used in other SLAM modules, including line tracking, mapping, and loop closure. The line extraction and matching thread runs at 20 ∼ 40Hz for stereo image sequences on a laptop, making it a practical front-end for line-based SLAM system. For the back-end module, a cost function is designed to minimize both of the reprojection error of line segments and alignment error of the vanishing points. The experimental results demonstrate that the proposed method exhibits more accurate localization and reconstruction than state-of-the-art line-based SLAM systems in line-rich environments. INDEX TERMS Simultaneous localization and mapping (SLAM), line detection, vanishing point, visual odometry, loop closure.