Elsevier

Pattern Recognition Letters

Volume 30, Issue 3, 1 February 2009, Pages 275-284
Pattern Recognition Letters

Optimal multi-level thresholding using a two-stage Otsu optimization approach

https://doi.org/10.1016/j.patrec.2008.10.003Get rights and content

Abstract

Otsu’s method of image segmentation selects an optimum threshold by maximizing the between-class variance in a gray image. However, this method becomes very time-consuming when extended to a multi-level threshold problem due to the fact that a large number of iterations are required for computing the cumulative probability and the mean of a class. To greatly improve the efficiency of Otsu’s method, a new fast algorithm called the TSMO method (Two-Stage Multithreshold Otsu method) is presented. The TSMO method outperforms Otsu’s method by greatly reducing the iterations required for computing the between-class variance in an image. The experimental results show that the computational time increases exponentially for the conventional Otsu method with an average ratio of about 76. For TSMO-32, the maximum computational time is only 0.463 s when the class number M increases from two to six with relative errors of less than 1% when compared to Otsu’s method. The ratio of computational time of Otsu’s method to TSMO-32 is rather high, up to 109,708, when six classes (M = 6) in an image are used. This result indicates that the proposed method is far more efficient with an accuracy equivalent to Otsu’s method. It also has the advantage of having a small variance in runtimes for different test images.

Introduction

Single (bi-level) or multiple thresholding is a straightforward and effective technique for image segmentation and computer vision. However, it requires an adequate threshold value to extract objects of interest from their background, since the objects in an image have their own distinct gray-level distributions. Thresholding is widely used in many image processing applications such as (1) optical character recognition (OCR) (Abak et al., 1997, Yan et al., 2005), where the goal is to extract the character in a document image and then recognize it; (2) automatic visual inspection of defects (Aiteanu et al., 2005, Ng, 2006), where it is adopted to detect the defects of electronic components for industrial applications; (3) detection of video change (Jing et al., 2005, Ong et al., 2002, Su and Amer, 2006), where it utilizes an adaptive threshold to detect the changes between a current image and a pre-established background; (4) moving object segmentation (Amer, 2003, Chien et al., 2004, Sukmarg and Rao, 2000, Zhang and Lu, 2001), where an image is segmented into objects with homogeneous characteristics to achieve efficient compression by coding the contour and texture separately for real-time content-based applications; and (5) medical image applications (Atkins and Mackiewich, 1998, Saha and Udupa, 2001), where it is used to extract the brain region from a magnetic resonance image (MRI) for detecting tissue deformities such as cancers and injuries.

It is quite important to effectively determine a threshold value for a gray-level image when extracting objects of interest from their background. Otsu’s method (Otsu, 1979) is one of the better ways of image segmentation, which selects a global threshold value by maximizing the separability of the classes in gray levels. Demirkaya and Asyali (2004) adopted between-class variance as a criterion function to determine the image bimodality thresholds for various intensity distributions. In their study, the bimodality thresholds for uniform and normal distributions were theoretically determined, with the corresponding values of Bmax being 0.7506 and 0.637, respectively. The results on simulated bimodal images illustrate that the threshold value for bimodality is dependent on the underlying noise distribution.

Otsu’s method can be easily extended to a multi-level threshold problem, but it is inefficient in determining the optimal thresholds due to the fact that it involves a large number of repetitious computations of the zero- and first-order cumulative moments of the gray-level histogram, especially if there is a large class number M required in an image. To improve the efficiency of Otsu’s method, many methods have been proposed for solving the multi-level thresholding problems (Fan and Lin, 2007, Liao et al., 2001, Zahara et al., 2005). Liao et al. (2001) presented a modified version of Otsu’s method called “recursive Otsu method” to find the threshold values by accessing the pre-computed modified between-class variance through a look-up table (i.e., H-table). Recently, Fan and Lin (2007) proposed a hybrid optimal estimation algorithm to deal with the multi-level thresholding problem. In their method, the distribution of image intensity is approximated by using a mixture Gaussian model with parameters computed by a PSO (particle swarm optimization) + EM (expectation maximization) algorithm iteratively. They confirmed that the hybrid PSO + EM algorithm can solve the multi-level thresholding problem quickly, with quality thresholding outputs for complicated images. In their study, however, with seven-class thresholding using the PSO + EM method, the variation in runtime largely varied from 5.84 to 70.78 s. Quweider et al. (2007) presented a new algorithm based on dynamic programming and the optimal partitioning of the image data space on an interval of gray levels, which is commonly used in single and multi-level thresholding problems. This method can reduce the number of gray levels from a fine to coarse fashion, and is shown to offer very good results when compared to many existing methods.

Liao et al. (2001) showed that the recursive algorithm can greatly reduce the computational complexity of determining a multi-level threshold by accessing a look-up table when compared to the conventional Otsu method, but it still suffers from the problem of needing too much time when the class number M in an image grows larger. For example, it needs 107 s to complete a five-level threshold selection running on a 100 MHz Pentium II personal computer. To effectively improve the efficiency of determining the multi-level threshold in a real-time image processing system, this paper presents a new fast algorithm called the TSMO method (Two-Stage Multithreshold Otsu method), which is a modified version of the conventional Otsu method, but it determines the multi-level threshold in a two-stage fashion.

To evaluate the accuracy of the optimum threshold obtained for an image, Sezgin and Sankur (2004) adopted the following five methods to assess 40 existing thresholding algorithms: misclassification error (ME), edge mismatch (EMM), region non-uniformity (NU), relative foreground area error (RAE), and modified Hausdorff distance (MHD). However, note that these evaluation methods are only used on and limited to a bi-level thresholding problem. In this paper, the method of ME is utilized to evaluate the accuracy of the proposed TSMO method.

The rest of this paper is structured as follows: Section 2 briefly describes the conventional Otsu method. Section 3 reviews the recursive algorithm along with a look-up table proposed by Liao et al. (2001). Section 4 then gives a detailed description of the proposed TSMO method. The experimental results are discussed in Section 5, and Section 6 gives the concluding remarks of this work.

Section snippets

Conventional Otsu method

Assume that an image can be represented in L gray levels (1, 2,  , L). The number of pixels at level i is denoted by fi; then, the total number of pixels equals N = f1 + f2 +  + fL. For a given gray-level image, the occurrence probability of gray level i is given bypi=fiN,pi0,i=1Lpi=1.

If an image can be divided into two classes, C1 and C2, by a threshold at level t, where class C1 consists of gray levels from 0 to t, and class C2 contains the other gray levels with t + 1 to L, then the cumulative

Recursive Otsu method

A recursive algorithm based on Otsu’s method was proposed by Liao et al. (2001), who claim that it is computationally efficient for finding the multi-level threshold in an image by accessing a look-up table, i.e., the H-table. In their method, a modified between-class variance σB2 is pre-calculated and stored in a look-up table for reducing the computational complexity of the cumulative probability and the mean of a class. If an image is divided into M classes (C1, C2,  , CM), M  1 thresholds (t1, t

Two-stage multithreshold Otsu method (TSMO method)

Normally, Otsu’s method (Otsu, 1979) found the optimal threshold in an image by maximizing the between-class variance of pixel intensity with an exhaustive search. However, with an increase of the number of classes in an image, this method becomes rather inefficient because it requires a large number of iterations to compute the cumulative probability (zeroth-order moment) and the mean (first-order moment) of a class. To significantly improve the deficiencies in Otsu’s method with regard to

Experimental results and discussion

To evaluate the efficiency and accuracy of the proposed TSMO method, the results are compared with those of the conventional and recursive Otsu methods, as described earlier. The efficiency evaluations for the three methods are carried out on the same Pentium PC with a 3.4 GHz Core Duo processor and 4GB DDR II memory. For the accuracy evaluations, the misclassification error (ME) method (Sezgin and Sankur, 2004) is adopted, but it is only limited to the case of bi-level threshold (M = 2)

Concluding remarks

The proposed TSMO method outperforms Otsu’s method by greatly reducing the iterations required for computing the zeroth- and first-order moments of a class in an image. The runtime increases exponentially for the conventional Otsu method, with an average ratio of about 76. For TSMO-32, the maximum runtime is only 0.463 s when the class number M increases from two to six. The ratios of runtimes of the conventional and recursive Otsu methods to the TSMO method increase as the class number M

References (22)

  • Jing, G., Rajan, D., Siong, C.E., 2005. Motion detection with adaptive background and dynamic thresholds. In: IEEE...
  • Cited by (0)

    View full text