pixels above the upper mean designated as the temporary foreground class and pixels below the lower mean designated as the temporary background class. Pixels fall between are denoted as a to-be-determined (TBD) region. This completes the first iteration of the algorithm. For the second iteration, the Otsu’s method is applied to the TBD region only to obtain a new threshold . The algorithm then calculates the mean of pixels in the TBD region that are above and the mean of pixels in the TBD region that are below . Pixels in the TBD region that are greater than the upper mean are added to the temporary foreground . And pixels in the TBD region that are less than the lower mean are added to the temporary background . Similarly, a new TBD region is obtained, which contains all the pixels falling between . This completes the second iteration. The algorithm then proceeds to the next iteration to process the new TBD region until it meets the stopping criterion. The criterion is that, when the difference between Otsu’s thresholds computed from two consecutive iterations is less than a small number, the iteration shall stop. For the last iteration, pixels above are assigned to the foreground class and pixels below the threshold are assigned to the background class. At the end, all the temporary foreground pixels are combined to constitute the final foreground. All the temporary background pixels are combined to become the final background. In implementation, the algorithm involves no parameter except for the stopping criterion in terminating the iterations. By iteratively applying the Otsu’s method and gradually shrinking the TBD region for segmentation, the algorithm can obtain a result that preserves weak objects better than the standard Otsu’s method does. References External links Implementation of Otsu's thresholding method as GIMP-plugin using Script-Fu (a Scheme-based language) Lecture notes on thresholding – covers the Otsu method A plugin for ImageJ using Otsu's method to do the threshold A full explanation of Otsu's method with a working example and Java implementation Implementation of Otsu's method in ITK Otsu Thresholding in C# – a straightforward C# implementation with explanation Otsu's method using MATLAB Otsu Thresholding with scikit-image in Python Image segmentation Statistical deviation and dispersion