Thresholding :
Here, the matter is straight-forward. For every pixel, the same threshold value is applied. If the pixel value is smaller than the threshold, it is set to 0, otherwise it is set to a maximum value. The function cv2.threshold is used to apply the thresholding. The first argument is the source image, which should be a grayscale image. The second argument is the threshold value which is used to classify the pixel values. The third argument is the maximum value which is assigned to pixel values exceeding the threshold. OpenCV provides different types of thresholding which is given by the fourth
parameter of the function. Basic thresholding as described above is done by using the type cv2.THRESH BINARY. All simple thresholding types are:
- cv2:THRESH BINARY
- cv2:THRESH BINARYINV
- cv2:THRESH TRUNC
- cv2:THRESH TOZERO
- cv2:THRESH TOZEROINV
0 Comments