I’ve implemented the meanshift algorithm from
http://courses.csail.mit.edu/6.869/handouts/PAMIMeanshift.pdf
with fixed bandwidth for now. When I run my MATLAB on the cameraman image with h=[8 4 10] as they suggest I get around 4000 clusters (I do a raster scan of the pixels, for each one compute the mode to which it maps and merge regions if they are within h). This algorithm also takes around 5 minutes for 256×256 case.
I have tried reading/using their code but I would need some explanations…
Are my results to be expected or can I get this to fewer clusters without some post processing?
If I look at the number of pixels per cluster i see that most of the 4000 have fewer than 20 points (the third number in the h vector defined in the paper) so by merging those regions with larger ones there is a more manageable number of clusters