Non-parametric clustering for segmentation and grouping