Simultaneous localization and mapping (SLAM) has been treated as the key technology of the autonomous robots. This paper takes the application of visual SLAM in autonomous underwater vehicle (AUV) positioning as background. Unlike atmospheric imaging, underwater medium has issues with low contrast and color distortion. Here an underwater image enhancement method is brought forward to settle this problem. In this method, the image was converted from red-green-blue (RGB) color space into hue-saturation-value (HSV) color space, and the irradiation image was achieved after the guided filer was conducted on value component. The reflection image was obtained according to Retinex theory, and the image was converted back to RGB space. Finally, a gamma correction was applied to strength the image contrast. In the experiment, the images were exploited to perform SLAM. The results indicated that the enhanced images perform better than the original images in feature points extraction and visual SLAM.