Underwater sonar image recognition based on gray-spatial histograms