Find cluster with edge (1)

It is a point to apply mosaic filter before clustering.

source image :

A) applying mosaic filter :

B) finding cluster with edge :