✨Histogram Thresholding
Histogram thresholding is a classical image segmentation algorithm. The idea is pretty straightforward. We set an intensity threshold in between the background and intersted tissues (foreground) to segement tissues from the image.
Decide a threshold (based on the histogram). Then for all pixels in the image, label as class 1 or class 0 if greater or less than the threshold
Ostu Thresholding
Basic global histogram thresholding algorithm. Ostu assumes that distribution characteristics for foreground and background are approximately equal, except for their means.
Assumptions:
Histogram(andtheimage)are bimodal.
No use of spatial coherence.
Assumes uniform illumination, so the bimodal brightness behavior arises from object appearance differences only.
Find the threshold that minimizes the weighted within-class variance == maximizes the between-class variance
The within-class variance is calculated as follows: σW2=Wbσb2+Wfσf2,
Wb is the weight, μb is the mean, σb2 is the variance for background;
Wf is the weight, μf is the mean, σf2 is the variance for foreground.

Given a histogram with n bins, for 1≤i≤n, we select the left i bins as background (it doesn't matter we call it background or foreground, the idea is we select these a group), and the remaining n−i bins as foreground, then to calculate within-class variance.


In this demo, Ostu thresholding performs well and segment the tissue from the background successfully.
However, Ostu thresholding has several disadvantages such as only consider the intensity and does not consider any relationships between pixels, choose one fix threshold for the whole image, etc. Therefore, there are serveral variation thresholding techniques trying to resolve some of these problems: Adaptive thresholding, HSV Segmentation.
Last updated