get_patches function

Detect patches of cells