Watershed is one of the most powerful tools used for image segmentation. Watershed by it own, applied to original grey-scale images is often useless due to intrinsic noisy nature of grey-scale images. A regulations process, called change of homotopy is used to sucessfully solve this instrinsic problem. This regularization process requires the selection of a marker image which in some cases can be a non-trivial task, but simpler than the original segmentation problem.
We will segment the same image used in the lesson Local Minimum where we used a local minima detection method to identify the horizontal thin lines.
In this case we will apply the watershed technique. The watershed is an algorithm that identifies the ridges in a gray-scale image, if we view the image as a surface terrain. These ridges are the divisory lines of the watersheds.
For this particular image, we want to detect the middle of the white lines, which is exactly what the watershed is designed for. Below we show the original image and the watershed application. As mentioned before, the image is ofter oversegmented due to the noisy nature of the original gray-level images.
|
|
|---|---|
| a) | b) |
In order to have a satisfactory result using the watershed, we regularize the image using the change of homotopy operator. We have to select a marker image that identifies each individual watersheds in the image. In the example we have to find a marker image which has a single connected component between each two white lines. We construct this marker image by getting the intersection of the local maxima image in the 1x3 vertical neighborhood with a central vertical line.
Below we show the vertical line and the local maxima image.
|
|
|---|---|
| a) | b) |
The marker is shown below and also the result of the regularization.
|
|
|---|---|
| a) | b) |
Now, the application of the watershed on the regularized image gives the desired results. The watershed image gives marks the pixels in the dividing lines as 0, and the other pixels to its unique watershed region value. Below we show the result of the watershed and the dividing lines.
|
|
|---|---|
| a) | b) |