The whole procedures of underwater digital terrain model (DTM) were presented by building with the global positioning system (GPS) aided high-resolution profile-scan sonar images. The algorithm regards the digital image scanned in a cycle as the raw data. First the label rings are detected with the improved Hough transform (HT) method and followed by curve-fitting for accurate location; then the most probable window for each ping is detected with weighted neighborhood gray-level co-occurrence matrix; and finally the DTM is built by integrating the GPS data with sonar data for 3D visualization. The case of an underwater trench for immersed tube road tunnel is illustrated.