OpenCV  4.5.4-dev
Open Source Computer Vision
Image Segmentation with Distance Transform and Watershed Algorithm

Prev Tutorial: Point Polygon Test

Next Tutorial: Out-of-focus Deblur Filter

Original author Theodore Tsesmelis
Compatibility OpenCV >= 3.0

Goal

In this tutorial you will learn how to:

Theory

Code

Explanation / Result

source.jpeg
black_bg.jpeg
laplace.jpeg
sharp.jpeg
bin.jpeg
dist_transf.jpeg
peaks.jpeg
markers.jpeg
final.jpeg