This finishes our discussions on binary images and image thresholding algorithms. I hope that by now, the distinction between grayscale and binary images should be quite clear to you. We saw a lot of different variants of thresholding algorithms that are a part of OpenCV's arsenal. It is interesting to note that the most commonly used variant is the simplest one: binary thresholding!
We also showed you a couple of representative algorithms belonging to the category of morphological operators: erosion and dilation. We saw how the two operators improve the quality of binary images generated by the thresholding operations by reducing the adverse effect of aberrations and other forms of image noise.
All the algorithms that we have seen so far in this book-image enhancement (negative, log and exponential transformations), image filtering (Box and Gaussian filters), thresholding (simple and adaptive) and morphological operators (erosion and dilation)-have one thing in common. They operate...