This is a graph theory problem (connected components in graph theory (Wikipedia)) and I'd like to apply it on the image processing problem.
Suppose we have a binary image which contains a set of (e.g., 100) regions (i.e., vertex). The target is to find out a set of clusters (subgraphs) of regions, where any pair of regions in the same cluster has the distance (counted by number of pixels ) less than a pre-defined value (e.g., 10 pixels).
Can you guys please have any idea on this?