Union-find - applications least common ancestor equivalence of finite state automata Matlab’s bwlabel() function in image processing