Abstract:In order to quickly and accurately segment the image, a new algorithm is proposed, which is based on the form of chain code to solve the excessive segmentation of the watershed algorithm. Firstly, according to the idea of traditional chain code, we put forward the outward chain code and the inward chain code. In the gray image, the rule of the chain code is defined, and it is used to segment the image. And then the rule of the chain code about merging of the small region that is arised after segmentation of the image is set. Finally, using the new algorithm and VS algorithm to segment image, and using the new algorithm and NGG algorithm to achieve the region merging, complete the analysis of result and speed of the implementation about the new algorithm. The results show that the new algorithm has the advantages of fast segmentation and merging, and it has a certain accuracy and feasibility.