Detecting and positioning method and system for aiming at underwater obstacles

The invention relates to a detecting and positioning method and a detecting and positioning system for aiming at underwater obstacles. The detecting and positioning system comprises a multi-beam image sonar and a computer. Firstly, an underwater sonar image in the forward direction is obtained through the multi-beam image sonar arranged on an autonomous underwater vehicle (AUV); then the image noise is reduced through a median filter so as to improve the image quality; after the obstacles and a background are segmented by utilizing an image segmenting algorithm, and according to a segmenting threshold value, each pixel point in a scene image is subjected to the binarization treatment; and finally an obstacle outline is obtained from a binary image, and according to the obtained outline, the size and the location of the obstacle are calculated. The detecting and positioning method can rapidly detect the obstacles of an unmanned surveying vessel or the underwater vehicle in the forward direction, can calculate the size and the location of the obstacle, and can be directly used for underwater navigation.