How to binarize an image

How to binarize an image

         To transform an image to a black-and-white binary form you can use the binarization method with fixed threshold BinarizeFixed, so, in this case, you need to indicate a threshold in a range of 0 and 255. All pixels of the image that have an intensity greater than the selected threshold will be assigned to value 255 (black color), or 0 (white color) otherwise. The more precise method is a `Bradly` method BinarizeBradley is used to improve binarization quality. The method calculates the threshold adaptively based on the average intensity estimation of the surrounding area with size `s x s`. The resulting picture will have more smooth edges in this case. Also, you can use Otsu method (`BinarizeOtsu`) with an automatic threshold.