Questions tagged [watershed]

Watersheds are a term commonly referred to in image processing. Gray level images are considered as topographic water reliefs, where each relief is flooded from its minima. When two lakes merge, a dam is built. The set of all dams that result are what is known as an image's watershed

A grey-level image may be seen as a topographic water relief, where the grey level of a pixel in the image is interpreted as the height within the relief. A drop of water falling on a topographic relief flows along a path to finally reach a local minimum. The watershed of a relief corresponds to the limits of the nearby catchment basins of the drops of water.

In image processing, different types of watershed lines may be computed. There are also many different algorithms to compute watersheds. Watershed algorithm is used in image processing primarily for image segmentation purposes.

Below is a visualization of the MRI of a heart visualized in a topographical way.

http://upload.wikimedia.org/wikipedia/commons/d/db/Relief_of_gradient_of_heart_MRI.png

Source: Wikipedia

These roughly correspond to the edge strength of the image, and the gradient of the image is shown below.

http://upload.wikimedia.org/wikipedia/commons/e/ea/Gradient_of_MRI_heart_image.png

Source: Wikipedia

Watersheds essentially calculate the final edges that are essentially the basins of where the water collects, and an example is shown below.

http://upload.wikimedia.org/wikipedia/commons/0/0d/Watershed_of_gradient_of_MRI_heart_image.png

Source: Wikipedia

Finally, the topographical visualization of the gradient (or the watershed) is shown below. The previous image is inevitably the result that is being sought, but the output of the watershed algorithm is what is shown below.

http://upload.wikimedia.org/wikipedia/commons/0/0f/Relief_view_of_the_watershed_of_the_gradient_of_an_MRI_heart_image.png

Source: Wikipedia


For more information about the different watershed algorithms that exist, check out the following links:

179 questions
0
votes
1 answer

How to get all the local "peaks" from a picture?

I would like to get all the small peaks from the picture below. I would also like to avoid getting the big peak (on the right), but I can exclude that based on the area. The image is a result of Sobel operator but this is not important. It will be…
ed22
  • 1,127
  • 2
  • 14
  • 30
0
votes
0 answers

Watershed algorithm uniquely identify overlapping objects in image, is it possible in a webcam stream?

I've read https://www.pyimagesearch.com/2015/11/02/watershed-opencv/ tutorial which has opened my eyes to this amazing possibility and I am now trying to implement it into my current object tracking program. I am struggling to implement this…
0
votes
0 answers

How to display output after applying the watershed algoithm?

I have applied watershed algorithm to segment characters of an ancient writing. Now How to get the segmented characters as output? I am working on segmenting characters from ancient inscriptions to build an OCR. I have tried MATLAB before but I am…
Venu
  • 3
  • 4
0
votes
1 answer

How do I get the segmented regions from watershed (OpenCV - C++) for further classification

I want to get all the segmented regions. I want to test if a particular segment is round (cell) or not. Can I use findingcontour in this kind of problem? ***Edit I've successfully get the segmented regions using contours. Any suggestion on how to…
0
votes
2 answers

How to identify particles in this complex image?

I have been trying Python+OpenCV for quite long time already and followed many tutorials in order to identify particles in the following image: My ultimate goal is to identify every particle, from there I will be able to e.g. count number of…
0
votes
0 answers

Segment dyed cells from digital pathology images using Matlab

I am trying to segment colored cells from original images like this: The blue colored cells are targets that I want to segment and counted. Here is the code I use: global ButtonDown img=imread('Zoom.png'); hsv=rgb2hsv(img); s=hsv(:,:,2); bw =…
0
votes
0 answers

skimage.morphology.watershed causes 32 Bit Kernel to die

When using Python 3.6.4 32-Bit with skimage version 0.13.1 the following code leads to a dieing kernel: from scipy.io import loadmat import skimage.morphology import skimage.feature import scipy import numpy as np import psutil import os process =…
B. Biehler
  • 101
  • 8
0
votes
0 answers

How does reconstruction function relate to watershed segmentation?

I'm trying to understand how watershed work by reading The Morphological Approach to Segmentation: The Watershed Transformation S. Beucher and F. Meyer This document mention reconstruction function. But I don't understand how reconstruction…
0
votes
0 answers

Watershed implementation in C++

I'm working in the watershed algortih in C++. I have implemented a source that i've found but i didn't get the expected results. I obtain: [ But the result should be this: [ I have charge the image .bmp into a matrix an then i obtain the Gradient of…
SantiSori
  • 381
  • 2
  • 15
0
votes
4 answers

Watershed algorithm – CT Lung segmentation

I am searching for source code to segment Lung in CT images using watershed algorithm. Please let me know if you find any website / source code.
user523582
  • 35
  • 1
  • 2
0
votes
0 answers

Image segmentation with watershed thresholding

I have implemented the marker-less (so not like OpenCV) watershed algorithm proposed in a 1991 paper by Vincent and Soille. I have also implemented a distance transform algorithm to apply it before watersheding. It works well in a good number of…
0
votes
1 answer

OpenCV only return contours that do not share boundary with other contours

My initial task was to perform segmentation of nuclei from a cropped area of a 40X magnification whole slide scan. Many of nuclei are touching, some are potentially overlapping. I started off by using the watershed algorithm with fair results. What…
octalMage
  • 23
  • 1
  • 6
0
votes
0 answers

Watershed segmentation in Python with skimage does not stop running

I'm having some trouble with the implementation of a watershed segmentation algorithm in Python using scikit-image. My sample code is below: from scipy import ndimage as ndi from skimage import feature import numpy as np cells =…
J B
  • 1
0
votes
1 answer

watershed segmentation implementation using scikit image

I have image with certain overlapping. I want to segment it with watershed algorithm using distance transform but are not able to achieve it. I am following the steps distance transform on binary image, then dilation and opening and…
image
  • 7
  • 4
0
votes
1 answer

Watershed algorithm with touch on image to add marker OpenCV android

I am trying to save the watershed segments as image to sdcard in android. Code tried in c++ and working fine for (int m = 0; m < images.size(); m++) { //wshed = wshed*0.5 + imgGray*0.5; cv::Mat input_bgra; …