Automatic detection and localization of underwater objects in sonar images is of great importance in applications of Autonomous Underwater Vehicle navigation. This paper presents a new framework capable of analyzing multi-beam sonar images for underwater object detection and localization. Real-time sonar data flow is collected by a multi-beam sonar, and denoising techniques are mandatory before applying subsequent procedures. An improved adaptive thresholding method is proposed to separate the objects from background. A contour detection algorithm is used to find objects' contour for calculating the position of the objects. Experiments show that the proposed framework can detect objects and figure out their position accurately.