Melanoma is a fatal cancer with a growing incident rate. However it could be cured if diagnosed in early stages. The
first step in detecting melanoma is the separation of skin lesion from healthy skin. There are particular features
associated with a malignant lesion whose successful detection relies upon accurately extracted borders. We propose a
two step approach. First, we apply K-means clustering method (to 3D RGB space) that extracts relatively accurate
borders. In the second step we perform an extra refining step for detecting the fading area around some lesions as
accurately as possible. Our method has a number of novelties. Firstly as the clustering method is directly applied to the
3D color space, we do not overlook the dependencies between different color channels. In addition, it is capable of
extracting fine lesion borders up to pixel level in spite of the difficulties associated with fading areas around the lesion.
Performing clustering in different color spaces reveals that 3D RGB color space is preferred. The application of the
proposed algorithm to an extensive data-base of skin lesions shows that its performance is superior to that of existing
methods both in terms of accuracy and computational complexity.