The way thresholding works is very simple. We define a threshold value. For a pixel
in a grayscale image, if the value of grayscale intensity is greater than the threshold,
we assign a value to the pixel (for example, white), else we assign a black value to the
pixel. This is the simplest form of thresholding and there are many other variations
of this method, which we will see now