We'll start with simple thresholding in this section and move on to adaptive thresholding in the next. OpenCV has a threshold()
function in its imgproc
module which implements different variants of simple thresholding. Where do these variants come from?
If you remember the working of thresholding operations, we map output intensity values to each of the two outcomes of the threshold comparison. The type of mapping that we perform gives rise to several different variants of simple thresholding. Before going into the details of these variants one by one, we will learn how to implement image thresholding in OpenCV. As in the case of image averaging, the implementation essentially boils down to a single line of code. However, a close inspection of the different parameters of the function call is imperative to enjoy a thorough understanding of image thresholding using OpenCV:
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2...