Extraction of rivers from remote sensing images is crucial for understanding the utilization of water resources. Because rivers have similar and consistent widths in a consistent range of remote sensing images, the stroke width transform (SWT) algorithm has a good effect on river extraction. However, the algorithm is susceptible to the influence of features around the river. A river extraction method combining relative total variation (RTV) and SWT was proposed to obtain river area information with high accuracy. First, the near-infrared channel of the image was selected as the input and the RTV model was used for texture smoothing and edge enhancement. Thereafter, the image edge map calculateds by the Canny operator was used as the input of the SWT to obtain the stroke width map. Subsequently, the connectivity components were labeled, and a specific filter was constructed according to the geometric characteristics of the river to filter out nonriver noise. The retained connected components were filled with holes, and a highly accurate river basin map was generated. In this study, six images of rivers flowing through four different landforms, including woodland, urban, mountainous, and cultivated land, were captured by the Gaofen-1 satellite for validation and comparison analysis. The experimental results demonstrated that the method’s completeness, accuracy, and extraction quality in this study could be maintained above 95%. Compared with the mainstream methods of the Otsu method, normalized difference water index, U-Net, and direct use of the SWT algorithm, the method in this study is significantly better in terms of extraction effect and algorithm stability. This can effectively improve the accuracy of river segmentation.