RGB Image Segmentation using Clustering
You will want to implement this yourself.

Encoding the data as 5 dimensional vectors per pixel crates a substantial memory overhead. But if you can try that first, to see if the results are as good as you believe then to be...
Pay attention to scaling!