blockwise connected component labeling (for large datasets)