Abstract:An algorithm of edge detection of gray scale image based on the center of gravity is introduced in this paper. The gray scale value of each pixel is seemed as the “quality” or the z coordinates of three-dimensional space in the gray scale image. Whether a pixel is a boundary point or not, is depending on the size of the offset of center of gravity in the center of the rectangular area. The algorithm has some noise immunity. It is compared to the canny operator of edge detection, the algorithm is tested better actually on the B-ultrasound image.