1 | initial version |
As far as I understood, you'd like to apply some form of agglomerative clustering approach. Unfortunately this is not implemented and you need to implement it yourself.
If you know the number of clusters beforehand you could use kmeans-clustering on the x,y-coordinates of the white pixels...