Identify and group clusters of like-coloured pieces