In this paper, we introduce a new unsupervised classifier for Hyperspectral images (HSI) using image segmentation and spectral unmixing. In the proposed method, first the number of classes is considered equal to the number of endmembers. Second, the endmember matrix is defined. Third, the abundance fraction maps are extracted. Fourth, an initial groundtruth is constructed by choosing the location of maximum absolute value of abundance fractions corresponding to each pixel. Fifth, each pixel which has the same eight neighboring (vertical, horizontal and diagonal) class is a good candidate for training data and after that some of good candidate pixels are randomly selected as final training data and remaining pixels are considered as testing data. Finally, support vector machine is applied to the HSI and initial groundtruth is iteratively repeated. In order to validate the efficiency of the proposed algorithm, two real HSI datasets are used. The obtained classification results are compared with some of state-of-the-art initial algorithms and the classification accuracy of the proposed method is close to the supervised algorithms.