tags: image processing

Global Thresholding

Let’s say we want to threshold the following image: By some inspection of the histogram there is a big difference between the two peaks, one peak represent the white background and the other peak represents the dark foreground. Segmentation of black part is easy just apply thresholding for the pixel values less than middle between the two peaks.

Algorithm used to calculate an optimal T value

Adaptive thresholding

Some times the image is a bit noised or has illumination on it, that makes it nearly impossible to apply global thresholding. The above image is illuminated, that makes it impossible to apply global thresholding. So an algorithm is proposed to fix this issue, the algorithm is to subdivide the image into smaller images and try to look for a clear value to threshold by, let’s say the value was not found like for some parts in the above image, what should we do ? Just subdivide these parts only to smaller parts.

Optimal Global Adaptive Thresholding

It is the same as global thresholding but this time we find an adaptive value of T in according the the following minimization game to get a proper T value:

This algorithm is not practical because maybe in every picture the histograms change, or maybe because the optimal T value does not really give good results.