In Otsu's method we exhaustively search for the threshold thatminimizes the intra-class variance, defined as a weighted sum ofvariances of the two classes:
Weights
Otsu shows that minimizing the intra-class variance is the same asmaximizing inter-class variance:[2]
which is expressed in terms of classprobabilities
NobuyukiOtsu (1979). "A threshold selection method from gray-levelhistograms".