O'Reilly logo

Computer Vision with Python 3 by Saurabh Kapur

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Watershed algorithm

This is an interesting algorithm in the sense that it draws analogy from the physical world. The most common way in which this algorithm is explained in research papers and other texts is in comparison to geographical reliefs. Imagine an area which has a lot of craters (the surface of the moon, for example) and we want to fill each of these craters with water of different colors. We initially start with marking the center of each crater and then keep filling the crater with colored water until the water level reaches to a point where it just touches the boundary of an adjacent crater (assume all craters are close by). After we have filled all craters with colored water, we have successfully segmented out each crater ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required