Daniel Stanley Tan edited section_Otsu_s_Method_The__.tex  over 8 years ago

Commit id: f973fc32e78ab029e7acad63d5bb58b1b6df57f2

deletions | additions      

       

A simple way to find a suitable threshold is to find each of the modes (local maxima) and then find the valley (minimum) between them. One way to think of it is to consider the values in the two regions as two clusters. Our goal is to make each cluster as tight as possible, thus minimizing the overlap.   We can't change the distribution but we can adjust where we separate them (the threshold). As we adjust the threshold one way, we increase the spread of one and decrease the spread of the other. The goal then is to select the threshold that minimizes the combined spread.  We can define the within-class variance as the weighted sum of the variances of each cluster:  $$\sigma^2_{\text{Within}}(2) = n_B(T)\sigma^2_B(T)+n_O(T)\sigma^2_O(T)$$  where  $$n_B(T) = \sum_{i=0}^{T-1}p(i)$$  $$n_O(T) = \sum_{i=T}^{N-1}p(i)$$  $$\sigma^2_B(T) = \text{the variance of the pixels in the background (below the threshold)}$$  $$\sigma^2_O(T) = \text{the variance of the pixels in the foreground (above the threshold)}$$