An efficient watershed algorithm based on connected components
Introduction to Algorithms