As the exploration of the seabed is extended ever further, automated recognition and classification of sonar images become increasingly important. However, most of the methods ignore the directional information and its effect on the image textures produced. To deal with this problem, we apply 2D Gabor filters to extract the features of sonar images. The filters are designed with constrained parameters to reduce the complexity and to improve the calculation efficiency. Meanwhile, at each orientation, the optimal Gabor filter parameters will be selected with the help of bandwidth parameters based on the Fisher criterion. This method can overcome some disadvantages of the traditional approaches of extracting texture features, and improve the recognition rate effectively.