BINARIZATION
GRAY LEVEL HISTOGRAM
histogram of the number of pixel for each light intensity defined as:
This histogram does not contain spatial information so a different arranged set of the same pixels produces the same histogram
BINARIZATION BY INTENSITY THRESHOLDING
Binarization can be computed by simply selected a threshold and splitting the points
THRESHOLD SELECTION
In real case scenarios the light stability of the image is not guaranteed so there is the need to select dynamically the threshold
DUMB APPROACH
This is the simplest threshold selection method, it works only if points are evenly distributed in the histogram
PEAKS METHOD
This method set T as the minimum of the function between the 2 main peaks
This method need the histogram smoothing to avoid been trapped in local minimums
OTSU’S ALGORITHM
The idea behind this method is to divide the histogram into 2 main regions with the aim of minimizing the within group variance
so given the following definitions:
- → gray levels
- → Number of pixels
- → entry of the histogram
- → probability of gray level
The mean and variance could be calculated as follows
Any given would split the histogram into 2 different regions with mean and variance defined as follows
The within group variance is defined as the weighted sum of the variance of the 2 regions
The algorithm aims to minimize this value with the assumption that the regions created from best will have all points concentrated in a relative small region (eg little variance)
ADAPTIVE THRESHOLDING
Any global thresholding method rely on the assumption of uniform lighting across the scene, if this assumption is violated it’s necessary to compute the threshold in function of the spatial variation
The idea is to compute the threshold at each point of the image based on a neighborhood of pixels (threshold become a function of space ), This introduce the problem of neighborhood dimension cause a too small one could lack of foreground pixels