From the course: OpenCV for Python Developers

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Adaptive thresholding

Adaptive thresholding

- [Instructor] While simple thresholding is a powerful algorithm, it has its limits. Such as when there's uneven lighting in an image. This is where adaptive thresholding comes to the rescue. This is a technique that can increase the versatility of image thresholding operations. Instead of taking a simple global value as a threshold comparison, adaptive thresholding will look in its local neighborhood of the image to determine whether a relative threshold is met and this way it is possible to counteract issues such as uneven lighting. To try this out, we're going to open up the chapter three module three file and start off by importing our sudoku image, typing img = cv2.imread, we'll read in sudoku.png and then again, we're going to signify a 0 saying that we want a black and white image. You'll find this is very customary that we only work with black and white images when doing segmentation. Next, we can go ahead and see…

Contents