Suppose that an image has m gray-levels, the probability for each gray-level is pi (i = 1, 2, . . ., m), the
mean value m = ai=1mipi, and we can divide the image
into two parts (i.e. the background and the objects).
Then one just has gray-levels from 1 to k, with probability o0=ai=1kpi=o(k), mean gray value
m0=ai=1kipi=m(k)/o(k) and the other from k + 1 to
m; with probability o1=ai=k+1mpi=1 ÿ o(k), mean gray value m1=ai=k+1mipi=(m ÿ m(k))/(1 ÿ o(k)) and
o0m0+o1m1=m.