Return to Computer Vision Notebooks


Methods which provides image binarization.

0. Input image

1. Global Thresholding

Given the value of threshold T: $$ \large g(x,y) = \begin{cases} 1 &, \text{if } f(x,y) \gt T \\ 0 &, \text{if } f(x,y) \leq T \end{cases} $$

2. Adaptive Threshold

The threshold value for each pixel is the mean of its neighbourhood area minus the constant C. The neighbourhood is defined based on the value of radius r.

$$ \large T(x,y)=\frac{\sum_{s=-r}^{r}\sum_{t=-r}^{r}f(x+s,y+t)}{(2r+1)^2} - C $$