Optimizing Two Pass Connected Component Labeling