Sonar is one of the important means of underwater target detection. However, the existing sonar measurement method does not use a third-party object as a reference, which makes it difficult to measure underwater targets. In this paper, we propose an angle measurement method and 3D mapping algorithm based on sonar images and artificial landmark. By combining acoustic and visual methods, using the known size information of artificial landmarks as a reference, we can calculate the target information to realize the mapping between real space and sonar images. Before verifying the feasibility, we processed the sonar image, denoised with median filter, enhanced the landmark image with Sauvola algorithm, and finally introduced two data fitting methods to extract the edge information of artificial landmark, so as to help us find the key points more accurately. The experimental results show that the accuracy of our method can reach the millimeter level, and the error range is within 5%. The technology proposed in this paper realizes the shape correction and precise length measurement of underwater targets.