1. Introduction
Image segmentation means dividing values of brightness, color, texture, and motion into similar areas. To separate an image, especially to parts that have a strong correlation with an actual object or area. Results obtained through image segmentation are essential for image recognition and are used mainly for image analysis such as object recognition and self-driving equipment. Image segmentation algorithms are generally classified as threshold-based, boundary-based, area-based, mixed, and interactive image segmentation [1].
Threshold-based image segmentation is a method of determining the appropriate threshold based on the pixel of the image segmentation target and then classifying the pixels of the image, and boundary-based image segmentation is a method of extracting the area according to the boundary line extraction algorithm. This may result in different results depending on the value and number of thresholds.
The area-based image segmentation method has splitting/merging algorithm and region growing method, and the mixed image segmentation combines boundary-based image segmentation and area-based image segmentation techniques, thus bringing together the characteristics of the two algorithms to predict more accurate results [2, 3]. Interactive image segmentation method is to proceed with image segmentation with the interaction of the computer and the user by entering information [4].
Among image segmentation methods, the watershed algorithm is an algorithm that considers the gradient value of the image to be high and merges the area gradually from the minimum region, eventually determining the portion enclosed by one border as a uniform region. The algorithm was introduced by Lantuejoul, and Soille published an algorithm that uses sequential and parallel calculations for fast performance [5, 6].
These methods result in over-segmention due to the myriad regional minimum points in the image, resulting in undifferentiated results between regions. To suppress this over-segmention, a method of merging the region s over-segmented by post-processing was proposed. The disadvantage of this method is that it requires a large amount of time to perform and thus increases the processing time
In this paper, a watershed algorithm applied with adaptive threshold, at the regional minimum point determination step and at the step where the area is extended based on the determined minimum point, is proposed in order to segment images so that accurate boundaries are achieved without separate pre-processing and post-processing.
2. Image Segmentation by Watershed Algorithm
The watershed algorithm looks at two dimensional image in a topographic surface, and assumes that water is falling on this three-dimensional surface and extends the catchment basin to the concept of water rising in the seed area which is the local minima. When water rises from one freshwater area and floods another, dam is built on the site to prevent its combination with other freshwater areas. This dam becomes the boundary of the region and each freshwater region becomes a segmented region of the image [7]. Figure 1 shows a general watershed algorithm, which has an independent region at every local minimum and the boundary between regions is determined by the watershed.
Figure 1. Watershed Algorithm
Figure 2. Flowchart of Watershed Algorithm
The method of image segmentation by watershed algorithm is shown in Figure 2. First, simplify the input images to suit area and boundary information extraction and obtain the gradient images. Second, to segment an region in the gradient image, it proceeds to search for a local minimum and assign a label, and to expand the region based on the assigned minimum point. In the step of searching for the minimum point and assigning the label, the minimum resions within the gradient image are located and assign the labels. The pixels associated with the labeled center minimum point are assigned the same label, and the minimum regions that fall are assigned different labels. In the step of expanding the region based on the minimum point to which the label is assigned, expand the label by the labeled points. When you meet other labels as you expand, you stop extending and the boundaries that you meet become the boundary that separates freshwater areas. At the end of this expansion by freshwater, it is determined to be one region.
The method of watershed algorithm segmentation has the disadvantage of creating numerous region, resulting in over-segmentation and inaccurate boundaries of regions. Over-segmentation is not that all local minimums have the same importance, but that some are created by noise or by meaningless portions of the image. A method of merging these over-segmented regions has been proposed, but boundary regions are formed differently from the original image and require a lot of time to perform.
Therefore, if the local minimum value is obtained and only local minimums determined by analyzing the surrounding gradient value are merged, over-segmentation will be inhibited. In addition, when extending an area based on a selected minimum point, fresh water, except for regions with large differences in gradient values, shows the boundary of the region exactly. In order to reduce over-segmentation and to correct the boundary of the dividing region, a watershed algorithm using adaptive thresholds is proposed, taking into account the surrounding gradient values in the search for local minimum points and expanding the region.
3. Search for Minimum Points with Adaptive Thresholds
Gradient images are used as input for watershed algorithms. When local minimum points are obtained from gradient images, adaptive thresholds are used. Adaptive thresholds play an important role in determining local minimum points. If the threshold value is large, more minimum points can be determined and over-segmented or the minimum point assigned to the edge region. In addition, small values of thresholds can result in poor segmentation results because regions other than edge regions are treated as edge regions and parts that should be assigned to minimum points are not allocated. Thus, determining the threshold globally does not reflect the edge characteristics between adjacent pixels, so a method of adaptive threshold determination is required to take account of regional characteristics in the selection of local minimum points. An adaptive threshold considering local characteristics is obtained to search for minimum points.
If the difference between the gradient value and the gradient value of the surrounding 8-pixel gradient is less than or equal to the adaptive threshold , the center gradient value is determined as the minimum point. Otherwise, the center gradient value will not be determined as the minimum point. If the gradient value difference of adjacent pixels is large, it may be an edge region or a region with noise, so it is not allocated as a minimum point
Using the average difference between the center gradient and the gradient value of the surrounding 8 pixels, an adaptive threshold aT1 is obtained.
\(a T_{1}=D_{1} \times \alpha\) (1)
\(D_{1}=\frac{1}{9} \sum_{m=-1}^{1} \sum_{n=-1}^{1}|\nabla x(i, j)-\nabla x(i+m, j+n)|\) (2)
▽x(i, j) is the gradient value of the position (i, j), and α is a constant number that reflects the difference in gradient value, and is determined by experiment as 2.
Figure 3(a) shows an example of a local minimum-point search process with applied thresholds. If ▽x(i, j-1) is the center gradient, and the difference from the gradient value at point P is greater than aT1, ▽x(i, j-1) is not determined as the minimum point, but moves to the next ▽x(i, j) position. In addition, if the difference between ▽x(i, j) and the slope of the surrounding 8 pixels is smaller than or equal to aT1, ▽x(i, j) is determined as the minimum point.
If all of the local minimum points obtained by applying adaptive thresholds have been determined, the minimum points are sorted in ascending order and labels are assigned. The determined minimum points’ positions, slope values, and labels are stored.
Figure 3(a). Search for Local Minimum Points with Adaptive Thresholds Figure 3(b). Area Extension with Adaptive Thresholds
4. Adaptive Region Extension for Preservation of Boundary
Area expansion by merging is assigned a label that is assigned to the center minimum point for only the gradient value satisfied by the adaptive threshold aT2 around the center gradient within the 3*3 block. In other words, no labels are assigned for gradient values above aT2, compared the gradient of the central pixel and the gradient of the surrounding 8 pixels with aT2. After label assignment processing for the center gradient is completed, the same operation is repeated at the other center gradient after the extension at that location.
The adaptive threshold aT2 is obtained using the mean of difference between the center gradient and the surrounding gradient.
\(a T_{2}=D_{2} \times \beta\) (3)
\(D_{2}=\frac{1}{s} \sum_{m=-1}^{1} \sum_{n=-1}^{1}|\nabla x(i, j)-\nabla x(i+m, j+n)|\) (4)
▽x(i, j) is the gradient value of the position (i, j), and β is a constant number that reflects the difference in gradient value, and is determined by experiment as 3. In addition, β can vary in number due to the close region to which the label is assigned.
Figure 3(b) shows an example of how aT2 was used for area expansion, i.e. for label assignment. Unlike the processing method in the least-point search, if the center gradient ▽x(i, j), ▽x(i+1, j+1) of the gradient value of the surrounding 8 pixels, is greater than or equal to aT2, only the remaining parts are assigned labels, except for that value. Expression (5) shows the comparison between the center gradient and the surrounding gradient value when assigning labels.
\(\mathrm{L}(\mathrm{i}+\mathrm{k}, \mathrm{j}+\mathrm{l})=\left(\begin{array}{c} L(i, j), \text { if }|\nabla x(i, j)|<~a T_{2},-1 \leqq k, l \leqq 1 \\ \text { Unassigned, }~~~~~~~~~~~~~~~\text{otherwise} \end{array}\right)\) (5)
Where L(i+k, j+l) is the location where the label is assigned by comparing the difference between the center gradient and the surrounding gradient. If the difference in gradient values is smaller than aT2, assign a label, otherwise do not assign a label. For gradient images, the portion where the gradient value is greater than the surrounding gradient value belongs to the boundary section of the image. If a large slope belonging to the boundary area is assigned the same label as another small gradient, the boundary will be inaccurate due to blocking effect of the image. The proposed method can result in segmented images with exact boundaries by eliminating the blocking effect caused by assigning labels even those with large variations in gradient values.
5. Experiments
In general, median filters are applied to eliminate overall noise before applying geadient images to be used as inputs to the watershed algorithm. However, in the proposed method, gradient images are obtained without pre-processing. This gradient image has been applied to the proposed watershed algorithm. Gradient images were used by the Sobel method.
Figure 4 shows the segmentation result of each image. A is the result images of Lantuejoul's method [5, 6], B is applied with T1=T2=30 [8], C is applied with adaptive T1 and fixed T2=30 [9] and D is split by the proposed method. The results segmented by A method show that the overall was over-segmented and not segmented by the exact boundary of the object. The proposed method can be seen to be segmented into exact boundaries due to over-segmentation suppression of the boundaries of objects.
Figure 4. Segmented Image by Each Algorithm
Table 1 shows the final number of labels for the segmentation result. Images with the proposed watershed algorithm can be found to have significantly fewer labels compared to images segmented by other algorithms.
Table 1. Number of Label by Each Algorithm
6. Conclusion
In this paper, a watershed algorithm applied with region-specific thresholds was proposed, taking into account the surrounding regions in the step of determining local minimum points and expanding the region based on determined minimum points. To verify the effectiveness of the proposed method, the results were presented using experimental images with several characteristics.
In addition to over-segmentation, which was a problem in the watershed algorithm, the ambiguity of the contour of the boundary caused by the blocking effect in the boundary of the region was solved due to over-segmentation, so that the region matching the boundary surface of the original image was carried out.
In the future, studies will be required that are not aimed at reducing the number of regions for the segmentation of regions with more accurate boundaries, but are image segments that are consistent with the user's purpose. A study of real-time segmentation algorithms that can properly control over-segmentation on the boundary is needed.
Acknowledgement
The present research has been conducted by the Research Grant of Seoil University in 2018
References
- Jianping Fan, David. K. Y. Yau, Ahmed. K. Elmagarmid, and Walid G. Aref, "Automatic Image Segmentation by Integrating Color-Edge Extraction and Seeded Region Growing," IEEE Transaction On Image Processing, Vol. 10, No. 10, pp. 1454-1466, Oct 2001. DOI: 10.1109/83.951532
- R. Adams, L. Bischof, "Seeded region growing," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 16, No. 6, pp. 641-647, June 1994. https://doi.org/10.1109/34.295913
- E. N. Mortensen and W. A. Barrett, "Toboggan-based Intelligent Scissors with a four-parametter edge model," in CVPR, Vol. 2, pp. 452-458, June 1999. DOI: 10.1109/CVPR.1999.784720
- E. N. Mortensen and W. A. Barrett, "Interactive Image Segmentation with Intelligent Scissors," Graphical Models and Image Processing, Vol. 60, No. 5, pp.349-384, Sep 1998. DOI: https://doi.org/10.1006/gmip.1998.0480
- S. Beucher and C. Lantuejoul, "Use of Watersheds in Contour Detection," Proceedings of the International workshop on Image Processing, CCETT/IRISA, pp. 17-22, Sep 1979.
- L. Vicent and P. Soille, "Watershed in Digital Space : An Efficient Algorithm Based on Immersion Simulation," IEEE Trans. on Pattern Analysis and Machin Intelligence, Vol.13, No.6, pp. 583-598, 1991. DOI: 10.1109/34.87344
- R.C. Gonzalez and R.E. Woods, Digital Image Processing, Prentice Hall Publishing Company, 2001.
- S. H. Lee, "The Improved Watershed algorithm for Boundary Preservation," in Proc. KMMS, pp. 224-227, May.21-22, 2004.
- D. J. Kwon, “The Image Segmentation Method using 2-step Thresholds Watershed Algorithm for Boundary Preservation,” The Journal of Information Technology, Vol. 13, No. 2, pp. 43-50, June 2010.