1

I used PIL library to write in python a prototype of the kmeans algorithm applied on an image. As initial centroids I used the first k colors that

convert('P', palette=Image.ADAPTIVE, colors=N_CLUSTERS) 

extracts . I've already read convert's source code (in image.py) but I haven't understood how it works when I choose the ADAPTIVE choice, which seems to be very effective

My aim is to implement kmeans in C++ so I can't rely on what convert() method does to find the first k centroids, I have to deeply understand its behavior, in order to replicate it in C++.

Thank you

rocker
  • 77
  • 9

0 Answers0