To find how many clusters in a sample set is an old yet unsolved problem in unsupervised clustering. Many segmentation methods require the user to specify the number of regions in the image or some delicate thresholds to get a sensible segmentation. In this paper, we propose a segmentation method that is able to automatically determine the number of regions in an image. The method effectively discerns distinct regions by analyzing the properties of the joint boundary between neighboring regions. By requiring that every region should be distinct from each other, it is able to choose a natural partition from the partition set which contains all possible partitions. Results are given at the end of this paper to demonstrate the effectiveness of this approach.