Added the union-find for all pixels.