This is an implementation of the method described in:
Huang, D. Y., Lin, T. W., & Hu, W. C. (2011).
Automatic multilevel thresholding based on two-stage Otsu’s method with cluster determination by valley estimation.
International Journal of Innovative Computing, Information and Control, 7(10), 56315644.